Search in sources :

Example 71 with ScrolledComposite

use of org.eclipse.swt.custom.ScrolledComposite in project tdi-studio-se by Talend.

the class MapperUI method createOutputZoneWithTables.

private void createOutputZoneWithTables(MapperModel mapperModel, final UIManager uiManager, final Display display) {
    Control previousControl;
    outputsZone = new OutputsZone(datasFlowViewSashForm, SWT.NONE, mapperManager);
    outputsZone.createHeaderZoneComponents();
    // this.dropTargetOperationListener.addControl(outputsZone);
    sc3 = new ScrolledComposite(outputsZone, getBorder() | SWT.H_SCROLL | SWT.V_SCROLL);
    // this.dropTargetOperationListener.addControl(sc3);
    GridData sc3GridData = new GridData(GridData.FILL_BOTH);
    sc3.setLayoutData(sc3GridData);
    sc3.setBackgroundMode(SWT.INHERIT_DEFAULT);
    sc3.addControlListener(new ControlListener() {

        public void controlMoved(ControlEvent e) {
        // System.out.println("sc3 controlMoved");
        }

        public void controlResized(ControlEvent e) {
            // System.out.println("sc3 controlResized");
            onSashResized(display);
        }
    });
    outputTablesZoneView = new OutputTablesZoneView(sc3, getBorder(), mapperManager);
    // this.dropTargetOperationListener.addControl(outputTablesZoneView);
    outputTablesZoneView.setBackgroundMode(SWT.INHERIT_DEFAULT);
    sc3.setExpandHorizontal(true);
    sc3.setContent(outputTablesZoneView);
    sc3MSListener = new MouseScrolledListener(mapperManager.getUiManager(), sc3);
    outputTablesZoneView.initInsertionIndicator();
    previousControl = null;
    List<OutputTable> tables = mapperModel.getOutputDataMapTables();
    Boolean minimizeStateOfTables = getMinimizedButtonState(tables);
    if (minimizeStateOfTables != null) {
        outputsZone.getToolbar().setMinimizeButtonState(minimizeStateOfTables.booleanValue());
    }
    for (IDataMapTable abstractDataMapTable : tables) {
        OutputDataMapTableView dataMapTableView = uiManager.createNewOutputTableView(previousControl, abstractDataMapTable, outputTablesZoneView);
        previousControl = dataMapTableView;
    }
    outputTablesZoneView.setSize(outputTablesZoneView.computeSize(SWT.DEFAULT, SWT.DEFAULT));
}
Also used : IDataMapTable(org.talend.designer.abstractmap.model.table.IDataMapTable) OutputsZone(org.talend.designer.dbmap.ui.visualmap.zone.OutputsZone) OutputTablesZoneView(org.talend.designer.dbmap.ui.visualmap.zone.scrollable.OutputTablesZoneView) MouseScrolledListener(org.talend.designer.abstractmap.ui.listener.MouseScrolledListener) OutputTable(org.talend.designer.dbmap.model.table.OutputTable) Control(org.eclipse.swt.widgets.Control) GridData(org.eclipse.swt.layout.GridData) ScrolledComposite(org.eclipse.swt.custom.ScrolledComposite) ControlListener(org.eclipse.swt.events.ControlListener) ControlEvent(org.eclipse.swt.events.ControlEvent) OutputDataMapTableView(org.talend.designer.dbmap.ui.visualmap.table.OutputDataMapTableView)

Example 72 with ScrolledComposite

use of org.eclipse.swt.custom.ScrolledComposite in project tdi-studio-se by Talend.

the class UIManager method moveOutputScrollBarZoneAtSelectedTable.

private void moveOutputScrollBarZoneAtSelectedTable() {
    Rectangle bounds = currentSelectedOutputTableView.getBounds();
    int selection = bounds.y - 30;
    ScrolledComposite scrolledCompositeViewOutputs = getScrolledCompositeViewOutputs();
    setPositionOfVerticalScrollBarZone(scrolledCompositeViewOutputs, selection);
}
Also used : Rectangle(org.eclipse.swt.graphics.Rectangle) ScrolledComposite(org.eclipse.swt.custom.ScrolledComposite) Point(org.eclipse.swt.graphics.Point)

Example 73 with ScrolledComposite

use of org.eclipse.swt.custom.ScrolledComposite in project tdi-studio-se by Talend.

the class ImportCompatibleEcoComponentsComposite method createControls.

public void createControls(Composite parent) {
    setLayout(new GridLayout());
    setLayoutData(new GridData(GridData.FILL_BOTH));
    creatOptions(parent);
    Composite tableComposite = new Composite(parent, SWT.NONE);
    tableComposite.setLayout(new GridLayout());
    GridData layoutData = new GridData(GridData.FILL_BOTH);
    layoutData.heightHint = HEIGHT;
    layoutData.minimumHeight = HEIGHT;
    tableComposite.setLayoutData(layoutData);
    scrolledCompositeFileViewer = new ScrolledComposite(tableComposite, SWT.H_SCROLL | SWT.V_SCROLL | SWT.NONE);
    scrolledCompositeFileViewer.setExpandHorizontal(true);
    scrolledCompositeFileViewer.setExpandVertical(true);
    GridData gridData1 = new GridData(GridData.FILL_BOTH);
    gridData1.widthHint = 300;
    gridData1.heightHint = 325;
    gridData1.horizontalSpan = 2;
    scrolledCompositeFileViewer.setLayoutData(gridData1);
    createTable();
}
Also used : GridLayout(org.eclipse.swt.layout.GridLayout) Composite(org.eclipse.swt.widgets.Composite) ScrolledComposite(org.eclipse.swt.custom.ScrolledComposite) GridData(org.eclipse.swt.layout.GridData) ScrolledComposite(org.eclipse.swt.custom.ScrolledComposite)

Example 74 with ScrolledComposite

use of org.eclipse.swt.custom.ScrolledComposite in project bndtools by bndtools.

the class PluginPropertiesPage method createControl.

public void createControl(Composite parent) {
    setTitle("Plug-in Configuration");
    setDescription("Set configuration properties for the plug-in.");
    // Create controls
    mainComposite = new Composite(parent, SWT.NONE);
    Group group = new Group(mainComposite, SWT.NONE);
    group.setText("Properties");
    group.setLayout(new FillLayout());
    ScrolledComposite scroller = new ScrolledComposite(group, SWT.V_SCROLL);
    fieldContainer = new Composite(scroller, SWT.NONE);
    scroller.setMinSize(200, 200);
    scroller.setExpandVertical(true);
    scroller.setExpandHorizontal(true);
    scroller.setContent(fieldContainer);
    Label separator = new Label(mainComposite, SWT.SEPARATOR | SWT.HORIZONTAL);
    Composite classpathComposite = new Composite(mainComposite, SWT.NONE);
    new Label(classpathComposite, SWT.NONE).setText("Classpath:");
    txtPath = new Text(classpathComposite, SWT.BORDER);
    resetPropertyFields();
    String path = properties.get(Constants.PATH_DIRECTIVE);
    if (path != null)
        txtPath.setText(path);
    txtPath.addModifyListener(new ModifyListener() {

        public void modifyText(ModifyEvent e) {
            String path = txtPath.getText();
            if (path == null || path.length() == 0)
                properties.remove(Constants.PATH_DIRECTIVE);
            else
                properties.put(Constants.PATH_DIRECTIVE, path);
            changed = true;
        }
    });
    // Layout
    GridLayout layout;
    GridData gd;
    layout = new GridLayout(1, false);
    mainComposite.setLayout(layout);
    gd = new GridData(SWT.FILL, SWT.FILL, true, true);
    group.setLayoutData(gd);
    gd = new GridData(SWT.FILL, SWT.CENTER, true, false);
    separator.setLayoutData(gd);
    gd = new GridData(SWT.FILL, SWT.FILL, true, false);
    classpathComposite.setLayoutData(gd);
    layout = new GridLayout(2, false);
    layout.verticalSpacing = 10;
    layout.horizontalSpacing = 10;
    fieldContainer.setLayout(layout);
    layout = new GridLayout(2, false);
    classpathComposite.setLayout(layout);
    gd = new GridData(SWT.FILL, SWT.CENTER, true, false);
    txtPath.setLayoutData(gd);
    setControl(mainComposite);
}
Also used : Group(org.eclipse.swt.widgets.Group) ModifyEvent(org.eclipse.swt.events.ModifyEvent) GridLayout(org.eclipse.swt.layout.GridLayout) Composite(org.eclipse.swt.widgets.Composite) ScrolledComposite(org.eclipse.swt.custom.ScrolledComposite) ModifyListener(org.eclipse.swt.events.ModifyListener) Label(org.eclipse.swt.widgets.Label) GridData(org.eclipse.swt.layout.GridData) ScrolledComposite(org.eclipse.swt.custom.ScrolledComposite) Text(org.eclipse.swt.widgets.Text) FillLayout(org.eclipse.swt.layout.FillLayout)

Example 75 with ScrolledComposite

use of org.eclipse.swt.custom.ScrolledComposite in project bndtools by bndtools.

the class ErrorDialog method createDialogArea.

@Override
protected Control createDialogArea(Composite parent) {
    Composite composite = (Composite) super.createDialogArea(parent);
    Composite c2 = new Composite(composite, SWT.NONE);
    GridLayout gridLayout = new GridLayout();
    gridLayout.numColumns = 2;
    gridLayout.horizontalSpacing = 0;
    gridLayout.verticalSpacing = 5;
    gridLayout.marginWidth = 0;
    gridLayout.marginHeight = 10;
    c2.setLayout(gridLayout);
    c2.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, true));
    Label label = new Label(c2, SWT.NONE);
    label.setText(Messages.project);
    Text projName = new Text(c2, SWT.BORDER);
    projName.setEditable(false);
    projName.setText(name);
    ScrolledComposite scrolled = new ScrolledComposite(composite, SWT.H_SCROLL | SWT.V_SCROLL);
    gridLayout = new GridLayout();
    gridLayout.numColumns = 1;
    gridLayout.horizontalSpacing = 0;
    gridLayout.verticalSpacing = 5;
    gridLayout.marginWidth = 10;
    gridLayout.marginHeight = 10;
    scrolled.setLayout(gridLayout);
    GridData gridData = new GridData(GridData.FILL, GridData.FILL, true, true);
    scrolled.setLayoutData(gridData);
    errorList.createControl(scrolled);
    scrolled.setExpandHorizontal(true);
    scrolled.setExpandVertical(true);
    scrolled.setContent(errorList.getControl());
    // scrolled.setMinSize(500, 500);
    scrolled.layout(true);
    return composite;
}
Also used : GridLayout(org.eclipse.swt.layout.GridLayout) Composite(org.eclipse.swt.widgets.Composite) ScrolledComposite(org.eclipse.swt.custom.ScrolledComposite) GridData(org.eclipse.swt.layout.GridData) Label(org.eclipse.swt.widgets.Label) ScrolledComposite(org.eclipse.swt.custom.ScrolledComposite) Text(org.eclipse.swt.widgets.Text)

Aggregations

ScrolledComposite (org.eclipse.swt.custom.ScrolledComposite)89 Composite (org.eclipse.swt.widgets.Composite)67 GridData (org.eclipse.swt.layout.GridData)55 GridLayout (org.eclipse.swt.layout.GridLayout)51 Label (org.eclipse.swt.widgets.Label)39 Point (org.eclipse.swt.graphics.Point)27 Button (org.eclipse.swt.widgets.Button)21 Text (org.eclipse.swt.widgets.Text)20 FillLayout (org.eclipse.swt.layout.FillLayout)19 SelectionEvent (org.eclipse.swt.events.SelectionEvent)18 SelectionAdapter (org.eclipse.swt.events.SelectionAdapter)14 Control (org.eclipse.swt.widgets.Control)13 Group (org.eclipse.swt.widgets.Group)13 ControlEvent (org.eclipse.swt.events.ControlEvent)10 Rectangle (org.eclipse.swt.graphics.Rectangle)9 HistoryComposite (com.cubrid.cubridmanager.ui.monitoring.editor.internal.HistoryComposite)8 ArrayList (java.util.ArrayList)7 Combo (org.eclipse.swt.widgets.Combo)7 Image (org.eclipse.swt.graphics.Image)6 FormAttachment (org.eclipse.swt.layout.FormAttachment)6