Search in sources :

Example 36 with ModifyEvent

use of org.eclipse.swt.events.ModifyEvent in project tdi-studio-se by Talend.

the class XmlMapNodeDirectEditManager method initCellEditor.

/*
     * (non-Javadoc)
     * 
     * @see org.eclipse.gef.tools.DirectEditManager#initCellEditor()
     */
@Override
protected void initCellEditor() {
    DirectEditType directEditType = cellAndType.get(getCellEditor());
    if (model instanceof AbstractNode) {
        final AbstractNode abstractNode = (AbstractNode) model;
        if (directEditType != null) {
            switch(directEditType) {
                case EXPRESSION:
                    String expression = abstractNode.getExpression() == null ? "" : abstractNode.getExpression();
                    getCellEditor().setValue(expression);
                    Text text = ((ExtendedTextCellEditor) getCellEditor()).getTextControl();
                    text.selectAll();
                    break;
                case NODE_NAME:
                    String variable = abstractNode.getName();
                    if (variable == null) {
                        variable = "";
                    }
                    getCellEditor().setValue(variable);
                    final Text nametext = (Text) ((TextCellEditor) getCellEditor()).getControl();
                    nametext.selectAll();
                    if (model instanceof VarNode) {
                        nametext.addModifyListener(new ModifyListener() {

                            @Override
                            public void modifyText(ModifyEvent e) {
                                List<VarNode> children = new ArrayList<VarNode>();
                                children.addAll(((VarTable) abstractNode.eContainer()).getNodes());
                                children.remove(model);
                                String message = XmlMapUtil.isValidColumnName(children, ((Text) e.widget).getText());
                                if (message != null) {
                                    nametext.setBackground(ColorConstants.red);
                                } else {
                                    nametext.setBackground(ColorConstants.white);
                                }
                            }
                        });
                    }
                    break;
                case VAR_NODE_TYPE:
                    if (getCellEditor() instanceof ComboBoxCellEditor) {
                        CCombo combo = (CCombo) getCellEditor().getControl();
                        combo.setText(getTypeDisplayValue((VarNode) abstractNode));
                    }
                    break;
            }
        }
    } else if (model instanceof InputXmlTree) {
        InputXmlTree inputxmlTree = (InputXmlTree) model;
        if (directEditType != null) {
            switch(directEditType) {
                case EXPRESSION_FILTER:
                    String expressionFilter = inputxmlTree.getExpressionFilter();
                    if (expressionFilter == null) {
                        expressionFilter = "";
                    }
                    getCellEditor().setValue(expressionFilter);
                    Text textarea = ((ExtendedTextCellEditor) getCellEditor()).getTextControl();
                    textarea.selectAll();
                    break;
                case LOOKUP_MODEL:
                    if (getCellEditor() instanceof ComboBoxCellEditor) {
                        CCombo combo = (CCombo) getCellEditor().getControl();
                        combo.setText(getLookupDisplayName(inputxmlTree.getLookupMode()));
                    }
                    break;
                case MATCH_MODEL:
                    if (getCellEditor() instanceof ComboBoxCellEditor) {
                        CCombo combo = (CCombo) getCellEditor().getControl();
                        combo.setText(getMatchModelDisplayName(inputxmlTree.getMatchingMode()));
                    }
                    break;
                case JOIN_MODEL:
                    if (getCellEditor() instanceof ComboBoxCellEditor) {
                        CCombo combo = (CCombo) getCellEditor().getControl();
                        String join = "";
                        if (inputxmlTree.isInnerJoin()) {
                            join = joinModel[0];
                        } else {
                            join = joinModel[1];
                        }
                        combo.setText(join);
                    }
                    break;
                case PERSISTENT_MODEL:
                    if (getCellEditor() instanceof ComboBoxCellEditor) {
                        CCombo combo = (CCombo) getCellEditor().getControl();
                        combo.setText(String.valueOf(inputxmlTree.isPersistent()));
                    }
                    break;
            }
        }
    } else if (model instanceof OutputXmlTree) {
        OutputXmlTree outputTree = (OutputXmlTree) model;
        if (directEditType != null) {
            switch(directEditType) {
                case EXPRESSION_FILTER:
                    String expressionFilter = outputTree.getExpressionFilter();
                    if (expressionFilter == null) {
                        expressionFilter = "";
                    }
                    getCellEditor().setValue(expressionFilter);
                    Text textarea = ((ExtendedTextCellEditor) getCellEditor()).getTextControl();
                    textarea.selectAll();
                    break;
                case OUTPUT_REJECT:
                    if (getCellEditor() instanceof ComboBoxCellEditor) {
                        CCombo combo = (CCombo) getCellEditor().getControl();
                        combo.setText(String.valueOf(outputTree.isReject()));
                    }
                    break;
                case LOOK_UP_INNER_JOIN_REJECT:
                    if (getCellEditor() instanceof ComboBoxCellEditor) {
                        CCombo combo = (CCombo) getCellEditor().getControl();
                        combo.setText(String.valueOf(outputTree.isRejectInnerJoin()));
                    }
                    break;
                case ALL_IN_ONE:
                    if (getCellEditor() instanceof ComboBoxCellEditor) {
                        CCombo combo = (CCombo) getCellEditor().getControl();
                        combo.setText(String.valueOf(outputTree.isAllInOne()));
                    }
                    break;
                case ENABLE_EMPTY_ELEMENT:
                    if (getCellEditor() instanceof ComboBoxCellEditor) {
                        CCombo combo = (CCombo) getCellEditor().getControl();
                        combo.setText(String.valueOf(outputTree.isEnableEmptyElement()));
                    }
            }
        }
    } else if (model instanceof XmlMapData) {
        XmlMapData xmlMapData = (XmlMapData) model;
        if (directEditType != null) {
            switch(directEditType) {
                case SERACH:
                    Text text = (Text) getCellEditor().getControl();
                    text.selectAll();
                    break;
            }
        }
    }
}
Also used : VarNode(org.talend.designer.xmlmap.model.emf.xmlmap.VarNode) ModifyListener(org.eclipse.swt.events.ModifyListener) AbstractNode(org.talend.designer.xmlmap.model.emf.xmlmap.AbstractNode) ComboBoxCellEditor(org.eclipse.jface.viewers.ComboBoxCellEditor) Text(org.eclipse.swt.widgets.Text) ExtendedTextCellEditor(org.talend.commons.ui.runtime.swt.tableviewer.celleditor.ExtendedTextCellEditor) VarTable(org.talend.designer.xmlmap.model.emf.xmlmap.VarTable) InputXmlTree(org.talend.designer.xmlmap.model.emf.xmlmap.InputXmlTree) ModifyEvent(org.eclipse.swt.events.ModifyEvent) DirectEditType(org.talend.designer.gefabstractmap.part.directedit.DirectEditType) CCombo(org.eclipse.swt.custom.CCombo) List(java.util.List) ArrayList(java.util.ArrayList) OutputXmlTree(org.talend.designer.xmlmap.model.emf.xmlmap.OutputXmlTree) XmlMapData(org.talend.designer.xmlmap.model.emf.xmlmap.XmlMapData)

Example 37 with ModifyEvent

use of org.eclipse.swt.events.ModifyEvent in project tdi-studio-se by Talend.

the class MavenVersionManagementProjectSettingPage method addItemElements.

@Override
protected void addItemElements(List<ItemVersionObject> elements) {
    if (elements == null || elements.isEmpty()) {
        return;
    }
    itemTable.setRedraw(false);
    for (final ItemVersionObject object : elements) {
        final TableItem tableItem = new TableItem(itemTable, SWT.CENTER);
        tableItem.setData(object);
        Item item = object.getItem();
        IBaseLabelProvider labelProvider = treeViewer.getLabelProvider();
        Image itemsImage = null;
        if (labelProvider instanceof NavigatorDecoratingLabelProvider) {
            NavigatorDecoratingLabelProvider navigatorProvider = (NavigatorDecoratingLabelProvider) labelProvider;
            itemsImage = navigatorProvider.getImage(object.getRepositoryNode());
        } else {
            ERepositoryObjectType itemType = ERepositoryObjectType.getItemType(item);
            itemsImage = getItemsImage(CoreImageProvider.getIcon(itemType));
        }
        tableItem.setImage(itemsImage);
        tableItem.setText(item.getProperty().getLabel());
        // old version
        tableItem.setText(1, MavenVersionUtils.getItemMavenVersion(item.getProperty()));
        TableEditor versionEditor = null;
        if (fixedVersionButton.getSelection()) {
            tableItem.setText(2, appliedFixedVersion);
        } else if (useJobVersionButton.getSelection()) {
            String jobDefaultVersion = MavenVersionUtils.getDefaultVersion(item.getProperty().getVersion());
            tableItem.setText(2, jobDefaultVersion);
            object.setNewVersion(jobDefaultVersion);
        } else {
            // new version
            versionEditor = new TableEditor(itemTable);
            Composite versionComposite = new Composite(itemTable, SWT.NONE);
            GridLayout layout = new GridLayout(1, false);
            layout.marginHeight = 0;
            layout.marginWidth = 0;
            layout.marginLeft = 0;
            layout.marginRight = 1;
            versionComposite.setLayout(layout);
            final Text text = new Text(versionComposite, SWT.CENTER | SWT.BORDER);
            GridData data = new GridData(GridData.FILL_BOTH);
            text.setLayoutData(data);
            String newVersion = object.getNewVersion();
            if (newVersion == null || "".equals(newVersion.trim())) {
                //$NON-NLS-1$
                newVersion = appliedFixedVersion;
                object.setNewVersion(newVersion);
            }
            text.setText(newVersion);
            checkVersionPattern(text, newVersion);
            text.addModifyListener(new ModifyListener() {

                @Override
                public void modifyText(ModifyEvent e) {
                    String version = text.getText();
                    checkVersionPattern(text, version);
                    object.setNewVersion(version);
                    checkValid();
                }
            });
            versionEditor.minimumWidth = itemTable.getColumn(2).getWidth();
            versionEditor.setEditor(versionComposite, tableItem, 2);
        }
        TableEditor delEditor = new TableEditor(itemTable);
        Label delLabel = new Label(itemTable, SWT.CENTER);
        delLabel.setBackground(Display.getDefault().getSystemColor(SWT.COLOR_WHITE));
        delLabel.setImage(ImageProvider.getImage(EImage.DELETE_ICON));
        //$NON-NLS-1$
        delLabel.setToolTipText(Messages.getString("VersionManagementDialog.DeletedTip"));
        delLabel.pack();
        delLabel.addMouseListener(new MouseAdapter() {

            @Override
            public void mouseDown(MouseEvent e) {
                checkedObjects.remove(object);
                removeTableItem(tableItem);
                refreshCheckedTreeView();
                checkButtonsState();
                checkButtonsState(false);
            }
        });
        delEditor.minimumWidth = 25;
        delEditor.horizontalAlignment = SWT.CENTER;
        delEditor.setEditor(delLabel, tableItem, 3);
        if (fixedVersionButton.getSelection() || useJobVersionButton.getSelection()) {
            tableItem.setData(ITEM_EDITOR_KEY, new TableEditor[] { delEditor });
        } else if (versionEditor != null) {
            tableItem.setData(ITEM_EDITOR_KEY, new TableEditor[] { versionEditor, delEditor });
        }
        itemTable.setRedraw(true);
    }
}
Also used : MouseEvent(org.eclipse.swt.events.MouseEvent) Composite(org.eclipse.swt.widgets.Composite) ModifyListener(org.eclipse.swt.events.ModifyListener) NavigatorDecoratingLabelProvider(org.eclipse.ui.internal.navigator.NavigatorDecoratingLabelProvider) TableItem(org.eclipse.swt.widgets.TableItem) Label(org.eclipse.swt.widgets.Label) MouseAdapter(org.eclipse.swt.events.MouseAdapter) Text(org.eclipse.swt.widgets.Text) Image(org.eclipse.swt.graphics.Image) EImage(org.talend.commons.ui.runtime.image.EImage) TableEditor(org.eclipse.swt.custom.TableEditor) Item(org.talend.core.model.properties.Item) TableItem(org.eclipse.swt.widgets.TableItem) GridLayout(org.eclipse.swt.layout.GridLayout) ModifyEvent(org.eclipse.swt.events.ModifyEvent) IBaseLabelProvider(org.eclipse.jface.viewers.IBaseLabelProvider) GridData(org.eclipse.swt.layout.GridData) ItemVersionObject(org.talend.repository.model.ItemVersionObject) ERepositoryObjectType(org.talend.core.model.repository.ERepositoryObjectType)

Example 38 with ModifyEvent

use of org.eclipse.swt.events.ModifyEvent in project tdi-studio-se by Talend.

the class MavenVersionManagementProjectSettingPage method addItemsOption.

@Override
protected void addItemsOption(Composite parent) {
    Group option = new Group(parent, SWT.NONE);
    option.setLayout(new GridLayout());
    //$NON-NLS-1$
    option.setText(Messages.getString("VersionManagementDialog.Options"));
    GridDataFactory.swtDefaults().align(SWT.FILL, SWT.CENTER).applyTo(option);
    fixedVersionButton = new Button(option, SWT.RADIO);
    //$NON-NLS-1$
    fixedVersionButton.setText(Messages.getString("VersionManagementDialog.FixedVersion"));
    // default
    fixedVersionButton.setSelection(true);
    Composite versionComposit = new Composite(option, SWT.NONE);
    GridLayout layout = new GridLayout(8, false);
    layout.horizontalSpacing = 1;
    layout.verticalSpacing = 0;
    layout.marginHeight = 0;
    layout.marginWidth = 0;
    versionComposit.setLayout(layout);
    GridDataFactory.swtDefaults().align(SWT.FILL, SWT.BEGINNING).applyTo(versionComposit);
    fixedVersionText = new Text(versionComposit, SWT.BORDER);
    GridData data = new GridData();
    data.widthHint = 120;
    data.minimumWidth = 80;
    data.horizontalIndent = 20;
    fixedVersionText.setLayoutData(data);
    fixedVersionText.setText(MavenVersionUtils.DEFAULT_MAVEN_VERSION);
    applyVersionButton = new Button(versionComposit, SWT.NONE);
    //$NON-NLS-1$
    applyVersionButton.setText(Messages.getString("VersionManagementDialog.applyVersion"));
    subjobs = new Button(versionComposit, SWT.NONE);
    //$NON-NLS-1$
    subjobs.setText(Messages.getString("VersionManagementDialog.subjob"));
    subjobs.setEnabled(false);
    eachVersionButton = new Button(option, SWT.RADIO);
    //$NON-NLS-1$
    eachVersionButton.setText(Messages.getString("VersionManagementDialog.EachVersion"));
    useJobVersionButton = new Button(option, SWT.RADIO);
    //$NON-NLS-1$
    useJobVersionButton.setText(Messages.getString("VersionManagementDialog.useJobVersion"));
    // event
    fixedVersionButton.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent e) {
            fixedVersionText.setEnabled(fixedVersionButton.getSelection());
            applyVersionButton.setEnabled(fixedVersionButton.getSelection());
            refreshTableItems();
        }
    });
    fixedVersionText.addModifyListener(new ModifyListener() {

        @Override
        public void modifyText(ModifyEvent e) {
            String version = fixedVersionText.getText();
            if (MavenVersionUtils.isValidMavenVersion(version)) {
                applyVersionButton.setEnabled(true);
                fixedVersionText.setBackground(COLOR_WHITE);
                //$NON-NLS-1$
                fixedVersionText.setToolTipText("");
            } else {
                applyVersionButton.setEnabled(false);
                fixedVersionText.setBackground(COLOR_RED);
                //$NON-NLS-1$
                fixedVersionText.setToolTipText(Messages.getString("VersionManagementDialog.valueWarning"));
            }
        }
    });
    applyVersionButton.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent e) {
            String version = fixedVersionText.getText();
            if (version != null && !"".equals(version.trim())) {
                //$NON-NLS-1$
                appliedFixedVersion = version;
                refreshTableItems();
            }
        }
    });
    subjobs.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent e) {
            selectSubjob();
        }
    });
    eachVersionButton.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent e) {
            refreshTableItems();
        }
    });
    useJobVersionButton.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent e) {
            refreshTableItems();
        }
    });
}
Also used : Group(org.eclipse.swt.widgets.Group) GridLayout(org.eclipse.swt.layout.GridLayout) ModifyEvent(org.eclipse.swt.events.ModifyEvent) Composite(org.eclipse.swt.widgets.Composite) ModifyListener(org.eclipse.swt.events.ModifyListener) Button(org.eclipse.swt.widgets.Button) SelectionAdapter(org.eclipse.swt.events.SelectionAdapter) GridData(org.eclipse.swt.layout.GridData) SelectionEvent(org.eclipse.swt.events.SelectionEvent) Text(org.eclipse.swt.widgets.Text)

Example 39 with ModifyEvent

use of org.eclipse.swt.events.ModifyEvent in project tdi-studio-se by Talend.

the class StatusDialog method createDialogArea.

/*
     * (non-Javadoc) Method declared on Dialog.
     */
@Override
protected Control createDialogArea(Composite parent) {
    // create composite
    Composite composite = (Composite) super.createDialogArea(parent);
    // create message
    // if (message != null) {
    // Label label = new Label(composite, SWT.WRAP);
    // label.setText(message);
    // GridData data = new GridData(GridData.GRAB_HORIZONTAL
    // | GridData.GRAB_VERTICAL | GridData.HORIZONTAL_ALIGN_FILL
    // | GridData.VERTICAL_ALIGN_CENTER);
    // data.widthHint = convertHorizontalDLUsToPixels(IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH);
    // label.setLayoutData(data);
    // label.setFont(parent.getFont());
    // }
    GridLayout layout = new GridLayout();
    layout.numColumns = 3;
    composite.setLayout(layout);
    Label label1 = new Label(composite, SWT.None);
    //$NON-NLS-1$
    label1.setText(Messages.getString("StatusDialog.labelText.code"));
    // label.setLayoutData(new GridData(GridData.VERTICAL_ALIGN_BEGINNING));
    GridData data = new GridData(GridData.GRAB_VERTICAL | GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_CENTER);
    label1.setLayoutData(data);
    label1.setFont(parent.getFont());
    codeText = new Text(composite, SWT.SINGLE | SWT.BORDER);
    data = new GridData();
    data.widthHint = convertHorizontalDLUsToPixels(30);
    codeText.setLayoutData(data);
    codeText.addModifyListener(new ModifyListener() {

        public void modifyText(ModifyEvent e) {
            validateInput();
        }
    });
    label1 = new Label(composite, SWT.WRAP);
    data = new GridData(GridData.FILL_HORIZONTAL);
    label1.setLayoutData(data);
    label1 = new Label(composite, SWT.WRAP);
    //$NON-NLS-1$
    label1.setText(Messages.getString("StatusDialog.labelText.label"));
    label1.setFont(parent.getFont());
    labelText = new Text(composite, SWT.SINGLE | SWT.BORDER);
    data = new GridData(GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL);
    data.horizontalSpan = 2;
    labelText.setLayoutData(data);
    labelText.addModifyListener(new ModifyListener() {

        public void modifyText(ModifyEvent e) {
            validateInput();
        }
    });
    errorMessageText = new Label(composite, SWT.NONE);
    errorMessageText.setLayoutData(data);
    errorMessageText.setBackground(errorMessageText.getDisplay().getSystemColor(SWT.COLOR_WIDGET_BACKGROUND));
    applyDialogFont(composite);
    return composite;
}
Also used : GridLayout(org.eclipse.swt.layout.GridLayout) ModifyEvent(org.eclipse.swt.events.ModifyEvent) Composite(org.eclipse.swt.widgets.Composite) ModifyListener(org.eclipse.swt.events.ModifyListener) Label(org.eclipse.swt.widgets.Label) GridData(org.eclipse.swt.layout.GridData) Text(org.eclipse.swt.widgets.Text)

Example 40 with ModifyEvent

use of org.eclipse.swt.events.ModifyEvent in project tdi-studio-se by Talend.

the class TextController method createControl.

/*
     * (non-Javadoc)
     * 
     * @see
     * org.talend.designer.core.ui.editor.properties2.editors.AbstractElementPropertySectionController#createControl()
     */
@Override
public Control createControl(final Composite subComposite, final IElementParameter param, final int numInRow, final int nbInRow, final int top, final Control lastControl) {
    this.curParameter = param;
    this.paramFieldType = param.getFieldType();
    FormData data;
    final DecoratedField dField = new DecoratedField(subComposite, SWT.BORDER, new SelectAllTextControlCreator());
    if (param.isRequired()) {
        FieldDecoration decoration = FieldDecorationRegistry.getDefault().getFieldDecoration(FieldDecorationRegistry.DEC_REQUIRED);
        dField.addFieldDecoration(decoration, SWT.RIGHT | SWT.TOP, false);
    }
    if (canAddRepositoryDecoration(param)) {
        FieldDecoration decoration = FieldDecorationRegistry.getDefault().getFieldDecoration(FieldDecorationRegistry.DEC_CONTENT_PROPOSAL);
        //$NON-NLS-1$
        decoration.setDescription(Messages.getString("TextController.decoration.description"));
        dField.addFieldDecoration(decoration, SWT.RIGHT | SWT.BOTTOM, false);
    }
    Control cLayout = dField.getLayoutControl();
    Text labelText = (Text) dField.getControl();
    labelText.setData(PARAMETER_NAME, param.getName());
    editionControlHelper.register(param.getName(), labelText);
    cLayout.setBackground(subComposite.getBackground());
    if (elem instanceof Node) {
        labelText.setToolTipText(VARIABLE_TOOLTIP + param.getVariableName());
    }
    if (!isReadOnly()) {
        if (param.isRepositoryValueUsed() && !(elem instanceof org.talend.designer.core.ui.editor.process.Process || elem instanceof StatsAndLogsElement || elem instanceof ImplicitContextLoadElement)) {
            addRepositoryPropertyListener(labelText);
        }
        if (param.isRequired()) {
            labelText.addModifyListener(new ModifyListener() {

                @Override
                public void modifyText(ModifyEvent e) {
                    checkTextError(param, labelText, labelText.getText());
                }
            });
        }
        boolean editable = !param.isReadOnly() && (elem instanceof FakeElement || !param.isRepositoryValueUsed());
        labelText.setEditable(editable);
    } else {
        labelText.setEditable(false);
    }
    addDragAndDropTarget(labelText);
    CLabel labelLabel = getWidgetFactory().createCLabel(subComposite, param.getDisplayName());
    data = new FormData();
    if (lastControl != null) {
        data.left = new FormAttachment(lastControl, 0);
    } else {
        data.left = new FormAttachment((((numInRow - 1) * MAX_PERCENT) / nbInRow), 0);
    }
    data.top = new FormAttachment(0, top);
    labelLabel.setLayoutData(data);
    // *********************
    data = new FormData();
    int currentLabelWidth = STANDARD_LABEL_WIDTH;
    GC gc = new GC(labelLabel);
    Point labelSize = gc.stringExtent(param.getDisplayName());
    gc.dispose();
    if ((labelSize.x + (ITabbedPropertyConstants.HSPACE * 2)) > currentLabelWidth) {
        currentLabelWidth = labelSize.x + (ITabbedPropertyConstants.HSPACE * 2);
    }
    if (numInRow == 1) {
        if (lastControl != null) {
            data.left = new FormAttachment(lastControl, currentLabelWidth);
        } else {
            data.left = new FormAttachment(0, currentLabelWidth);
        }
    } else {
        data.left = new FormAttachment(labelLabel, 0, SWT.RIGHT);
    }
    data.right = new FormAttachment((numInRow * MAX_PERCENT) / nbInRow, 0);
    data.top = new FormAttachment(0, top);
    cLayout.setLayoutData(data);
    // **********************
    hashCurControls.put(param.getName(), labelText);
    Point initialSize = cLayout.computeSize(SWT.DEFAULT, SWT.DEFAULT);
    // curRowSize = initialSize.y + ITabbedPropertyConstants.VSPACE;
    dynamicProperty.setCurRowSize(initialSize.y + ITabbedPropertyConstants.VSPACE);
    if (isInWizard()) {
        labelLabel.setAlignment(SWT.RIGHT);
        if (lastControl != null) {
            data.right = new FormAttachment(lastControl, 0);
        } else {
            data.right = new FormAttachment(100, -ITabbedPropertyConstants.HSPACE);
        }
        data.left = new FormAttachment((((nbInRow - numInRow) * MAX_PERCENT) / nbInRow), currentLabelWidth + ITabbedPropertyConstants.HSPACE);
        data = (FormData) labelLabel.getLayoutData();
        data.right = new FormAttachment(cLayout, 0);
        data.left = new FormAttachment((((nbInRow - numInRow) * MAX_PERCENT) / nbInRow), 0);
        return labelLabel;
    }
    return cLayout;
}
Also used : FormData(org.eclipse.swt.layout.FormData) CLabel(org.eclipse.swt.custom.CLabel) ModifyListener(org.eclipse.swt.events.ModifyListener) FieldDecoration(org.eclipse.jface.fieldassist.FieldDecoration) Node(org.talend.designer.core.ui.editor.nodes.Node) Text(org.eclipse.swt.widgets.Text) DecoratedField(org.eclipse.jface.fieldassist.DecoratedField) Point(org.eclipse.swt.graphics.Point) FakeElement(org.talend.designer.core.model.FakeElement) Point(org.eclipse.swt.graphics.Point) SelectAllTextControlCreator(org.talend.designer.core.ui.editor.properties.controllers.creator.SelectAllTextControlCreator) Control(org.eclipse.swt.widgets.Control) ModifyEvent(org.eclipse.swt.events.ModifyEvent) ImplicitContextLoadElement(org.talend.designer.core.ui.projectsetting.ImplicitContextLoadElement) GC(org.eclipse.swt.graphics.GC) StatsAndLogsElement(org.talend.designer.core.ui.projectsetting.StatsAndLogsElement) FormAttachment(org.eclipse.swt.layout.FormAttachment)

Aggregations

ModifyEvent (org.eclipse.swt.events.ModifyEvent)297 ModifyListener (org.eclipse.swt.events.ModifyListener)296 GridData (org.eclipse.swt.layout.GridData)200 Text (org.eclipse.swt.widgets.Text)177 GridLayout (org.eclipse.swt.layout.GridLayout)175 Composite (org.eclipse.swt.widgets.Composite)162 Label (org.eclipse.swt.widgets.Label)156 SelectionEvent (org.eclipse.swt.events.SelectionEvent)155 SelectionAdapter (org.eclipse.swt.events.SelectionAdapter)126 Button (org.eclipse.swt.widgets.Button)93 Combo (org.eclipse.swt.widgets.Combo)61 Group (org.eclipse.swt.widgets.Group)47 SelectionListener (org.eclipse.swt.events.SelectionListener)37 File (java.io.File)27 KeyEvent (org.eclipse.swt.events.KeyEvent)27 StyledText (org.eclipse.swt.custom.StyledText)23 DirectoryDialog (org.eclipse.swt.widgets.DirectoryDialog)21 FocusEvent (org.eclipse.swt.events.FocusEvent)19 Point (org.eclipse.swt.graphics.Point)19 FileDialog (org.eclipse.swt.widgets.FileDialog)18