Search in sources :

Example 61 with Control

use of org.eclipse.swt.widgets.Control 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);
    outputTablesZoneView.initInsertionIndicator();
    previousControl = null;
    List<OutputTable> tables = mapperModel.getOutputDataMapTables();
    Boolean minimizeStateOfTables = getMinimizedButtonState(tables);
    if (minimizeStateOfTables != null) {
        outputsZone.getToolbar().setMinimizeButtonState(minimizeStateOfTables.booleanValue());
    }
    sc3MSListener = new MouseScrolledListener(mapperManager.getUiManager(), sc3);
    for (OutputTable outputTable : tables) {
        OutputDataMapTableView dataMapTableView = uiManager.createNewOutputTableView(previousControl, outputTable, outputTablesZoneView);
        previousControl = dataMapTableView;
    }
    outputTablesZoneView.setSize(outputTablesZoneView.computeSize(SWT.DEFAULT, SWT.DEFAULT));
}
Also used : Control(org.eclipse.swt.widgets.Control) GridData(org.eclipse.swt.layout.GridData) ScrolledComposite(org.eclipse.swt.custom.ScrolledComposite) ControlListener(org.eclipse.swt.events.ControlListener) OutputsZone(org.talend.designer.mapper.ui.visualmap.zone.OutputsZone) OutputTablesZoneView(org.talend.designer.mapper.ui.visualmap.zone.scrollable.OutputTablesZoneView) ControlEvent(org.eclipse.swt.events.ControlEvent) MouseScrolledListener(org.talend.designer.abstractmap.ui.listener.MouseScrolledListener) OutputTable(org.talend.designer.mapper.model.table.OutputTable) OutputDataMapTableView(org.talend.designer.mapper.ui.visualmap.table.OutputDataMapTableView)

Example 62 with Control

use of org.eclipse.swt.widgets.Control in project tdi-studio-se by Talend.

the class MapperUI method createInputZoneWithTables.

private void createInputZoneWithTables(MapperModel mapperModel, final Display display) {
    inputsZone = new InputsZone(datasFlowViewSashForm, SWT.NONE, mapperManager);
    inputsZone.createHeaderZoneComponents();
    sc1 = new ScrolledComposite(inputsZone, getBorder() | SWT.H_SCROLL | SWT.V_SCROLL);
    // this.dropTargetOperationListener.addControl(sc1);
    GridData sc1GridData = new GridData(GridData.FILL_BOTH);
    sc1.setLayoutData(sc1GridData);
    sc1.setBackgroundMode(SWT.INHERIT_DEFAULT);
    sc1.addControlListener(new ControlListener() {

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

        public void controlResized(ControlEvent e) {
            // System.out.println("sc1 controlResized");
            onSashResized(display);
        }
    });
    // add for auto scroll
    new DragNDrop(mapperManager, sc1, true, true);
    inputTablesZoneView = new InputTablesZoneView(sc1, getBorder(), mapperManager);
    // this.dropTargetOperationListener.addControl(inputTablesZoneView);
    inputTablesZoneView.setBackgroundMode(SWT.INHERIT_DEFAULT);
    sc1.setExpandHorizontal(true);
    sc1.setContent(inputTablesZoneView);
    sc1MSListener = new MouseScrolledListener(mapperManager.getUiManager(), sc1);
    inputTablesZoneView.initInsertionIndicator();
    Control previousControl = null;
    List<InputTable> tables = mapperModel.getInputDataMapTables();
    Boolean minimizeStateOfTables = getMinimizedButtonState(tables);
    if (minimizeStateOfTables != null) {
        inputsZone.getToolbar().setMinimizeButtonState(minimizeStateOfTables.booleanValue());
    }
    for (InputTable inputTable : tables) {
        InputDataMapTableView dataMapTableView = new InputDataMapTableView(inputTablesZoneView, SWT.BORDER, inputTable, mapperManager);
        FormData formData = new FormData();
        formData.left = new FormAttachment(0, 0);
        formData.right = new FormAttachment(100, 0);
        formData.top = new FormAttachment(previousControl);
        dataMapTableView.setLayoutData(formData);
        previousControl = dataMapTableView;
        boolean tableIsMinimized = inputTable.isMinimized();
        dataMapTableView.minimizeTable(tableIsMinimized);
        dataMapTableView.registerStyledExpressionEditor(getTabFolderEditors().getStyledTextHandler());
        dataMapTableView.loaded();
    // dataMapTableView.fillMinimumSize(false);
    }
    inputTablesZoneView.setSize(inputTablesZoneView.computeSize(SWT.DEFAULT, SWT.DEFAULT));
    sc1MSListener.addMouseWheelListener(sc1);
}
Also used : FormData(org.eclipse.swt.layout.FormData) InputDataMapTableView(org.talend.designer.mapper.ui.visualmap.table.InputDataMapTableView) MouseScrolledListener(org.talend.designer.abstractmap.ui.listener.MouseScrolledListener) InputTable(org.talend.designer.mapper.model.table.InputTable) Control(org.eclipse.swt.widgets.Control) InputsZone(org.talend.designer.mapper.ui.visualmap.zone.InputsZone) DragNDrop(org.talend.designer.mapper.ui.dnd.DragNDrop) InputTablesZoneView(org.talend.designer.mapper.ui.visualmap.zone.scrollable.InputTablesZoneView) GridData(org.eclipse.swt.layout.GridData) ScrolledComposite(org.eclipse.swt.custom.ScrolledComposite) ControlListener(org.eclipse.swt.events.ControlListener) ControlEvent(org.eclipse.swt.events.ControlEvent) FormAttachment(org.eclipse.swt.layout.FormAttachment)

Example 63 with Control

use of org.eclipse.swt.widgets.Control in project tdi-studio-se by Talend.

the class InvokeDialog method validate.

/**
     * Validates the specified text.
     */
void validate() {
    boolean enableButton = true;
    for (Entry<MBeanParameterInfo, Control> entry : controls.entrySet()) {
        Control control = entry.getValue();
        if (!(control instanceof Text)) {
            continue;
        }
        String type = entry.getKey().getType();
        String text = ((Text) control).getText();
        if (!validateNumber(type, text)) {
            enableButton = false;
            break;
        }
    }
    Button invokeButton = getButton(IDialogConstants.CLIENT_ID);
    if (invokeButton != null) {
        invokeButton.setEnabled(enableButton);
    }
}
Also used : Control(org.eclipse.swt.widgets.Control) Button(org.eclipse.swt.widgets.Button) Text(org.eclipse.swt.widgets.Text) MBeanParameterInfo(javax.management.MBeanParameterInfo)

Example 64 with Control

use of org.eclipse.swt.widgets.Control in project tdi-studio-se by Talend.

the class LoginProjectPage method refreshNecessaryVisible.

protected void refreshNecessaryVisible(boolean isRemote) {
    boolean isSVNPluginLoaded = PluginChecker.isSVNProviderPluginLoaded();
    refreshCreateSandboxProjectVisible(isNeedSandboxProject());
    refreshImportLocalProjectVisible(!isRemote);
    refreshImportDemoProjectVisible(!isRemote);
    refreshCreateNewProjectVisible(!isRemote);
    refreshBranchAreaVisible(isSVNPluginLoaded && isRemote);
    Control projectListAreaBottomControl = null;
    if (isSVNPluginLoaded) {
        if (isRemote) {
            if (isNeedSandboxProject()) {
                projectListAreaBottomControl = createSandBoxProject;
            } else {
                projectListAreaBottomControl = navigateArea;
            }
        }
    }
    if (projectListAreaBottomControl == null) {
        projectListAreaBottomControl = createNewProject;
    }
    FormData formData = (FormData) projectListArea.getLayoutData();
    if (projectListAreaBottomControl == navigateArea) {
        formData.bottom = new FormAttachment(100, -1 * TAB_VERTICAL_PADDING_LEVEL_1);
    } else {
        formData.bottom = new FormAttachment(projectListAreaBottomControl, -1 * TAB_VERTICAL_PADDING_LEVEL_1, SWT.TOP);
    }
    projectOperationArea.layout();
    projectOperationArea.update();
}
Also used : FormData(org.eclipse.swt.layout.FormData) Control(org.eclipse.swt.widgets.Control) FormAttachment(org.eclipse.swt.layout.FormAttachment)

Example 65 with Control

use of org.eclipse.swt.widgets.Control in project tdi-studio-se by Talend.

the class LoginProjectPage method layoutProjectListArea.

protected void layoutProjectListArea() {
    projectListArea.setLayout(new FormLayout());
    FormData formData = null;
    /**
         * BranchArea layout
         */
    formData = new FormData();
    formData.left = new FormAttachment(0, TAB_HORIZONTAL_PADDING_LEVEL_3);
    formData.right = new FormAttachment(100, 0);
    formData.bottom = new FormAttachment(100, 0);
    branchArea.setLayoutData(formData);
    branchArea.setLayout(new FormLayout());
    int svnBranchLabelWidth = branchLabel.computeSize(SWT.DEFAULT, SWT.DEFAULT).x;
    int refreshButtonWidth = refreshProjectButton.computeSize(SWT.DEFAULT, SWT.DEFAULT).x;
    formData = new FormData();
    formData.bottom = new FormAttachment(100, 0);
    formData.right = new FormAttachment(100, -1 * refreshButtonWidth - TAB_HORIZONTAL_PADDING_LEVEL_2);
    formData.left = new FormAttachment(0, svnBranchLabelWidth + TAB_HORIZONTAL_PADDING_LEVEL_2);
    Control svnBranchComboControl = branchesViewer.getControl();
    svnBranchComboControl.setLayoutData(formData);
    formData = new FormData();
    formData.top = new FormAttachment(svnBranchComboControl, 0, SWT.CENTER);
    formData.bottom = new FormAttachment(svnBranchComboControl, 0, SWT.CENTER);
    formData.left = new FormAttachment(0, 0);
    branchLabel.setLayoutData(formData);
    formData = new FormData();
    formData.right = new FormAttachment(100, 0);
    if (EnvironmentUtils.isWindowsSystem()) {
        formData.top = new FormAttachment(svnBranchComboControl, -1, SWT.TOP);
        formData.bottom = new FormAttachment(svnBranchComboControl, 1, SWT.BOTTOM);
    } else {
        formData.top = new FormAttachment(svnBranchComboControl, 0, SWT.CENTER);
        formData.bottom = new FormAttachment(svnBranchComboControl, 0, SWT.CENTER);
    }
    refreshProjectButton.setLayoutData(formData);
    formData = new FormData();
    formData.top = new FormAttachment(0, 0);
    formData.left = new FormAttachment(0, 0);
    formData.right = new FormAttachment(100, 0);
    formData.bottom = new FormAttachment(branchArea, -1 * TAB_VERTICAL_PADDING_LEVEL_2, SWT.TOP);
    projectViewer.getControl().setLayoutData(formData);
}
Also used : FormLayout(org.eclipse.swt.layout.FormLayout) FormData(org.eclipse.swt.layout.FormData) Control(org.eclipse.swt.widgets.Control) FormAttachment(org.eclipse.swt.layout.FormAttachment) Point(org.eclipse.swt.graphics.Point)

Aggregations

Control (org.eclipse.swt.widgets.Control)475 Point (org.eclipse.swt.graphics.Point)149 Composite (org.eclipse.swt.widgets.Composite)141 GridData (org.eclipse.swt.layout.GridData)102 Button (org.eclipse.swt.widgets.Button)93 Label (org.eclipse.swt.widgets.Label)73 GridLayout (org.eclipse.swt.layout.GridLayout)71 Text (org.eclipse.swt.widgets.Text)70 FormData (org.eclipse.swt.layout.FormData)62 FormAttachment (org.eclipse.swt.layout.FormAttachment)61 Node (org.talend.designer.core.ui.editor.nodes.Node)46 DecoratedField (org.eclipse.jface.fieldassist.DecoratedField)45 SelectionEvent (org.eclipse.swt.events.SelectionEvent)44 StyledText (org.eclipse.swt.custom.StyledText)42 GC (org.eclipse.swt.graphics.GC)41 CLabel (org.eclipse.swt.custom.CLabel)38 ArrayList (java.util.ArrayList)36 Shell (org.eclipse.swt.widgets.Shell)35 FieldDecoration (org.eclipse.jface.fieldassist.FieldDecoration)33 CCombo (org.eclipse.swt.custom.CCombo)32