Search in sources :

Example 16 with FillLayout

use of org.eclipse.swt.layout.FillLayout in project tdi-studio-se by Talend.

the class RepositoryWebService method ctrate.

public void ctrate() {
    wsdlComposite = new Composite(uiParent, SWT.NONE);
    GridLayout layout = new GridLayout();
    layout.marginWidth = 20;
    layout.marginHeight = 20;
    wsdlComposite.setLayout(layout);
    wsdlComposite.setLayoutData(new GridData(GridData.FILL_BOTH));
    // WSDL URL
    Composite wsdlUrlcomposite = new Composite(wsdlComposite, SWT.NONE);
    GridData layoutData = new GridData(GridData.FILL_HORIZONTAL);
    layoutData.verticalIndent = 2;
    layoutData.verticalSpan = 1;
    wsdlUrlcomposite.setLayoutData(layoutData);
    layout = new GridLayout(4, false);
    wsdlUrlcomposite.setLayout(layout);
    wsdlField = new LabelledFileField(wsdlUrlcomposite, ExternalWebServiceUIProperties.FILE_LABEL, ExternalWebServiceUIProperties.FILE_EXTENSIONS, 1, SWT.BORDER) {

        @Override
        protected void setFileFieldValue(String result) {
            if (result != null) {
                getTextControl().setText(TalendTextUtils.addQuotes(PathUtils.getPortablePath(result)));
                getDataFromNet();
                isFirst = false;
            }
        }
    };
    wsdlField.addModifyListener(new ModifyListener() {

        public void modifyText(ModifyEvent e) {
            // TODO Auto-generated method stub
            URLValue = wsdlField.getText();
            connection.setWSDL(URLValue);
        }
    });
    // add a listener for ctrl+space.
    TalendProposalUtils.installOn(wsdlField.getTextControl(), connector.getProcess(), connector);
    //$NON-NLS-1$
    String wsdlUrl = (String) connector.getElementParameter("ENDPOINT").getValue();
    if (wsdlUrl != null) {
        wsdlField.setText(wsdlUrl);
    }
    refreshbut = new Button(wsdlUrlcomposite, SWT.PUSH | SWT.CENTER);
    refreshbut.setImage(ImageProvider.getImage(EImage.REFRESH_ICON));
    GridData butData = new GridData();
    butData.verticalSpan = 1;
    refreshbut.setLayoutData(butData);
    // add port name UI
    Composite wsdlPortcomposite = new Composite(wsdlComposite, SWT.NONE);
    GridData portlayoutData = new GridData(GridData.FILL_HORIZONTAL);
    portlayoutData.verticalIndent = 2;
    portlayoutData.verticalSpan = 3;
    wsdlPortcomposite.setLayoutData(portlayoutData);
    layout = new GridLayout(2, false);
    layout.verticalSpacing = 1;
    wsdlPortcomposite.setLayout(layout);
    portNameLabel = new Label(wsdlPortcomposite, SWT.NONE);
    //$NON-NLS-1$
    portNameLabel.setText(Messages.getString("WebServiceUI.Port"));
    GridData portLabelGridData = new GridData();
    portLabelGridData.verticalAlignment = SWT.TOP;
    portNameLabel.setLayoutData(portLabelGridData);
    Composite portTabComposite = new Composite(wsdlPortcomposite, SWT.BORDER);
    portTabComposite.setLayoutData(new GridData(GridData.FILL_BOTH));
    portTabComposite.setLayout(new FillLayout());
    //$NON-NLS-1$
    ExtendedTableModel<PortNames> portModel = new ExtendedTableModel<PortNames>("PORTNAMELIST", allPortNames);
    portListTableView = new AbstractDataTableEditorView<PortNames>(portTabComposite, SWT.NONE, portModel, false, true, false) {

        @Override
        protected void setTableViewerCreatorOptions(TableViewerCreator<PortNames> newTableViewerCreator) {
            super.setTableViewerCreatorOptions(newTableViewerCreator);
            newTableViewerCreator.setHeaderVisible(false);
            newTableViewerCreator.setVerticalScroll(true);
            newTableViewerCreator.setReadOnly(true);
        }

        @Override
        protected void createColumns(TableViewerCreator<PortNames> tableViewerCreator, Table table) {
            TableViewerCreatorColumn rowColumn = new TableViewerCreatorColumn(tableViewerCreator);
            //$NON-NLS-1$
            rowColumn.setTitle(Messages.getString("WebServiceUI.COLUMN"));
            rowColumn.setBeanPropertyAccessors(new IBeanPropertyAccessors<PortNames, String>() {

                public String get(PortNames bean) {
                    return bean.getPortName();
                }

                public void set(PortNames bean, String value) {
                    bean.setPortName(value);
                }
            });
            rowColumn.setWeight(60);
            rowColumn.setModifiable(true);
            rowColumn.setMinimumWidth(60);
            rowColumn.setCellEditor(new TextCellEditor(tableViewerCreator.getTable()));
        }
    };
    // WSDL Operation
    Composite wsdlOperationcomposite = new Composite(wsdlComposite, SWT.NONE);
    GridData operationlayoutData = new GridData(GridData.FILL_BOTH);
    operationlayoutData.verticalIndent = 2;
    operationlayoutData.verticalSpan = 5;
    wsdlOperationcomposite.setLayoutData(operationlayoutData);
    layout = new GridLayout(2, false);
    layout.verticalSpacing = 3;
    wsdlOperationcomposite.setLayout(layout);
    // wsdlOperationcomposite.setLayoutData(new GridData(GridData.FILL_BOTH));
    operationLabel = new Label(wsdlOperationcomposite, SWT.NONE);
    //$NON-NLS-1$
    operationLabel.setText(Messages.getString("WebServiceUI.Operation"));
    GridData opertionLabelGridData = new GridData();
    opertionLabelGridData.verticalAlignment = SWT.TOP;
    operationLabel.setLayoutData(opertionLabelGridData);
    Composite tabComposite = new Composite(wsdlOperationcomposite, SWT.BORDER);
    GridData tabGridData = new GridData(GridData.FILL_BOTH);
    // tabGridData.verticalSpan = 3;
    tabComposite.setLayoutData(tabGridData);
    tabComposite.setLayout(new FillLayout());
    //$NON-NLS-1$
    ExtendedTableModel<Function> funModel = new ExtendedTableModel<Function>("FUNCTIONLIST", allfunList);
    listTableView = new AbstractDataTableEditorView<Function>(tabComposite, SWT.NONE, funModel, false, true, false) {

        @Override
        protected void setTableViewerCreatorOptions(TableViewerCreator<Function> newTableViewerCreator) {
            super.setTableViewerCreatorOptions(newTableViewerCreator);
            newTableViewerCreator.setHeaderVisible(false);
            newTableViewerCreator.setVerticalScroll(true);
            newTableViewerCreator.setReadOnly(true);
        }

        @Override
        protected void createColumns(TableViewerCreator<Function> tableViewerCreator, Table table) {
            TableViewerCreatorColumn rowColumn = new TableViewerCreatorColumn(tableViewerCreator);
            //$NON-NLS-1$
            rowColumn.setTitle(Messages.getString("WebServiceUI.COLUMN"));
            rowColumn.setBeanPropertyAccessors(new IBeanPropertyAccessors<Function, String>() {

                public String get(Function bean) {
                    return bean.getName();
                }

                public void set(Function bean, String value) {
                    bean.setName(value);
                }
            });
            rowColumn.setWeight(60);
            rowColumn.setModifiable(true);
            rowColumn.setMinimumWidth(60);
            rowColumn.setCellEditor(new TextCellEditor(tableViewerCreator.getTable()));
        }
    };
    addListenerForWSDLCom();
}
Also used : Table(org.eclipse.swt.widgets.Table) Composite(org.eclipse.swt.widgets.Composite) ModifyListener(org.eclipse.swt.events.ModifyListener) Label(org.eclipse.swt.widgets.Label) LabelledFileField(org.talend.commons.ui.swt.formtools.LabelledFileField) FillLayout(org.eclipse.swt.layout.FillLayout) PortNames(org.talend.designer.webservice.ws.wsdlinfo.PortNames) Function(org.talend.designer.webservice.ws.wsdlinfo.Function) GridLayout(org.eclipse.swt.layout.GridLayout) ModifyEvent(org.eclipse.swt.events.ModifyEvent) Button(org.eclipse.swt.widgets.Button) GridData(org.eclipse.swt.layout.GridData) IBeanPropertyAccessors(org.talend.commons.utils.data.bean.IBeanPropertyAccessors) TextCellEditor(org.eclipse.jface.viewers.TextCellEditor) ExtendedTableModel(org.talend.commons.ui.swt.extended.table.ExtendedTableModel) TableViewerCreatorColumn(org.talend.commons.ui.swt.tableviewer.TableViewerCreatorColumn)

Example 17 with FillLayout

use of org.eclipse.swt.layout.FillLayout in project tdi-studio-se by Talend.

the class AddArrayIndexForParentsDialog method createDialogArea.

protected Control createDialogArea(Composite parent) {
    Composite createDialogArea = (Composite) super.createDialogArea(parent);
    FillLayout layout = new FillLayout();
    // layout.horizontalSpacing = 1;
    // layout.numColumns = 1;
    GridData data = new GridData(GridData.FILL_BOTH);
    createDialogArea.setLayout(layout);
    createDialogArea.setLayoutData(data);
    table = new TableViewer(createDialogArea, SWT.FULL_SELECTION | SWT.BORDER);
    new TableColumn(table.getTable(), SWT.LEFT).setText(COLUMN_NAME[0]);
    table.getTable().getColumn(0).pack();
    new TableColumn(table.getTable(), SWT.LEFT).setText(COLUMN_NAME[1]);
    table.getTable().getColumn(1).pack();
    table.getTable().setHeaderVisible(true);
    table.getTable().setLinesVisible(true);
    table.setContentProvider(new IndexContentProvider());
    table.setLabelProvider(new IndexLabelProvider());
    table.setInput(arrayIndexList);
    table.setColumnProperties(COLUMN_NAME);
    CellEditor[] editors = new CellEditor[2];
    editors[0] = null;
    editors[1] = new TextCellEditor(table.getTable());
    table.setCellEditors(editors);
    table.setCellModifier(new ICellModifier() {

        public boolean canModify(Object element, String property) {
            if (property.equals(COLUMN_NAME[0]))
                return false;
            return true;
        }

        public Object getValue(Object element, String property) {
            ArrayIndexList index = (ArrayIndexList) element;
            if (property.equals(COLUMN_NAME[1])) {
                if (index.getIndexNum() != null) {
                    return index.getIndexNum();
                } else {
                    return "";
                }
            }
            return null;
        }

        public void modify(Object element, String property, Object value) {
            if (element instanceof Item)
                element = ((Item) element).getData();
            ArrayIndexList index = (ArrayIndexList) element;
            if (property.equals(COLUMN_NAME[1]))
                index.setIndexNum((String) value);
            table.refresh();
        }
    });
    return createDialogArea;
}
Also used : Composite(org.eclipse.swt.widgets.Composite) TextCellEditor(org.eclipse.jface.viewers.TextCellEditor) CellEditor(org.eclipse.jface.viewers.CellEditor) FillLayout(org.eclipse.swt.layout.FillLayout) TableColumn(org.eclipse.swt.widgets.TableColumn) Item(org.eclipse.swt.widgets.Item) GridData(org.eclipse.swt.layout.GridData) ICellModifier(org.eclipse.jface.viewers.ICellModifier) ArrayIndexList(org.talend.designer.webservice.data.ArrayIndexList) TextCellEditor(org.eclipse.jface.viewers.TextCellEditor) TableViewer(org.eclipse.jface.viewers.TableViewer)

Example 18 with FillLayout

use of org.eclipse.swt.layout.FillLayout in project tdi-studio-se by Talend.

the class ErrorMessageDialog method createDialogArea.

@Override
protected Control createDialogArea(Composite parent) {
    Composite createDialogArea = (Composite) super.createDialogArea(parent);
    createDialogArea.setLayout(new FillLayout());
    sashForm = new SashForm(createDialogArea, SWT.VERTICAL);
    GridLayout sashGrid = new GridLayout();
    sashGrid.numColumns = 5;
    sashForm.setLayout(sashGrid);
    sashForm.setSize(400, 200);
    sashForm.pack();
    // Composite comSimple = new Composite(sashForm, SWT.NONE);
    // comSimple.pack();
    // GridLayout simGrid = new GridLayout();
    // simGrid.numColumns = 10;
    // comSimple.setLayout(simGrid);
    // imageLable = new Label(comSimple, SWT.WRAP);
    // imageLable.setImage(ImageProvider.getImage(EImage.ERRORSIMPLEMESS_ICON));
    // GridData imaData = new GridData(GridData.FILL_VERTICAL);
    // imaData.horizontalSpan = 5;
    // imageLable.setLayoutData(imaData);
    // imageLable.pack();
    // titleLable = new Label(comSimple, SWT.WRAP);
    // GridData titleData = new GridData(GridData.FILL_BOTH);
    // titleData.horizontalSpan = 5;
    // titleLable.setLayoutData(titleData);
    // titleLable.pack();
    //        String str[] = content.split("\n");//$NON-NLS-1$
    // String simpleMess;
    // if (LanguageManager.getCurrentLanguage().equals(ECodeLanguage.PERL)) {
    // if (mergeNode.isCheckProperty()) {
    //                simpleMess = Messages.getString("ErrorMessageDialog.property_error") + mergeNode.getUniqueName(); //$NON-NLS-1$
    // } else {
    // if (str.length >= 1) {
    //                    simpleMess = content.split("\n")[0];//$NON-NLS-1$
    // } else {
    //                    simpleMess = Messages.getString("ErrorMessageDialog.EXCEP_IN_COM") + mergeNode.getUniqueName();//$NON-NLS-1$
    // }
    // }
    // titleLable.setText(simpleMess);
    //
    // } else if (LanguageManager.getCurrentLanguage().equals(ECodeLanguage.JAVA)) {
    // if (mergeNode.isCheckProperty()) {
    //                simpleMess = Messages.getString("ErrorMessageDialog.property_error") + mergeNode.getUniqueName(); //$NON-NLS-1$
    // } else {
    // if (str.length >= 2) {
    //                    simpleMess = content.split("\n")[0] + "\n" + content.split("\n")[1];//$NON-NLS-1$//$NON-NLS-1$//$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
    // } else {
    //                    simpleMess = Messages.getString("ErrorMessageDialog.EXCEP_IN_COM") + mergeNode.getUniqueName();//$NON-NLS-1$
    // }
    // }
    // titleLable.setText(simpleMess);
    // }
    //
    // Composite comDetail = new Composite(sashForm, SWT.NONE);
    // GridLayout detailGrid = new GridLayout();
    // detailGrid.numColumns = 15;
    // comDetail.setLayout(detailGrid);
    // GridData dataBut = new GridData();
    // dataBut.horizontalSpan = 15;
    // button = new CLabel(comDetail, SWT.FLAT);
    // button.pack();
    //        button.setText(Messages.getString("ErrorMessageDialog.DETAIL")); //$NON-NLS-1$
    // button.setImage(ImageProvider.getImage(EImage.RIGHTPRESS_ICON));
    textArea = new StyledText(sashForm, SWT.BORDER | SWT.WRAP | SWT.H_SCROLL | SWT.V_SCROLL | SWT.READ_ONLY);
    textArea.pack();
    if (content != null) {
        textArea.setText(content);
    } else {
        textArea.setText("Error in the component's properties!");
    }
    textArea.setBackground(new Color(Display.getDefault(), new RGB(255, 255, 255)));
    textArea.setForeground(new Color(Display.getDefault(), new RGB(255, 102, 102)));
    // addButtonListener();
    return createDialogArea;
}
Also used : SashForm(org.eclipse.swt.custom.SashForm) GridLayout(org.eclipse.swt.layout.GridLayout) StyledText(org.eclipse.swt.custom.StyledText) Composite(org.eclipse.swt.widgets.Composite) Color(org.eclipse.swt.graphics.Color) FillLayout(org.eclipse.swt.layout.FillLayout) RGB(org.eclipse.swt.graphics.RGB)

Example 19 with FillLayout

use of org.eclipse.swt.layout.FillLayout in project tdi-studio-se by Talend.

the class JSONFileOutputStep3Form method addFields.

@Override
protected void addFields() {
    Composite mainComposite = Form.startNewDimensionnedGridLayout(this, 2, WIDTH_GRIDDATA_PIXEL, 60);
    metadataNameText = new LabelledText(mainComposite, "Name");
    metadataCommentText = new LabelledText(mainComposite, "Comment");
    Group groupMetaData = Form.createGroup(this, 1, "Schema", 280);
    Composite compositeMetaData = Form.startNewGridLayout(groupMetaData, 1);
    Composite compositeTable = Form.startNewDimensionnedGridLayout(compositeMetaData, 1, WIDTH_GRIDDATA_PIXEL, 200);
    compositeTable.setLayout(new FillLayout());
    metadataEditor = new MetadataEmfTableEditor("Description of the Schema");
    tableEditorView = new MetadataEmfTableEditorView(compositeTable, SWT.NONE);
}
Also used : LabelledText(org.talend.commons.ui.swt.formtools.LabelledText) MetadataEmfTableEditorView(org.talend.core.ui.metadata.editor.MetadataEmfTableEditorView) Group(org.eclipse.swt.widgets.Group) Composite(org.eclipse.swt.widgets.Composite) MetadataEmfTableEditor(org.talend.core.ui.metadata.editor.MetadataEmfTableEditor) FillLayout(org.eclipse.swt.layout.FillLayout)

Example 20 with FillLayout

use of org.eclipse.swt.layout.FillLayout in project tdi-studio-se by Talend.

the class AbstractActionPage method createControl.

protected void createControl() {
    isNeedRecreateControl = false;
    this.setLayout(new FillLayout());
    createControl(this);
}
Also used : FillLayout(org.eclipse.swt.layout.FillLayout)

Aggregations

FillLayout (org.eclipse.swt.layout.FillLayout)688 Composite (org.eclipse.swt.widgets.Composite)444 GridData (org.eclipse.swt.layout.GridData)267 GridLayout (org.eclipse.swt.layout.GridLayout)187 Shell (org.eclipse.swt.widgets.Shell)164 Label (org.eclipse.swt.widgets.Label)150 SelectionEvent (org.eclipse.swt.events.SelectionEvent)140 Button (org.eclipse.swt.widgets.Button)118 Display (org.eclipse.swt.widgets.Display)99 Group (org.eclipse.swt.widgets.Group)95 SelectionAdapter (org.eclipse.swt.events.SelectionAdapter)89 Point (org.eclipse.swt.graphics.Point)89 Text (org.eclipse.swt.widgets.Text)84 Table (org.eclipse.swt.widgets.Table)80 ScrolledComposite (org.eclipse.swt.custom.ScrolledComposite)77 Rectangle (org.eclipse.swt.graphics.Rectangle)77 TableColumn (org.eclipse.swt.widgets.TableColumn)65 SelectionListener (org.eclipse.swt.events.SelectionListener)61 Tree (org.eclipse.swt.widgets.Tree)60 IStructuredSelection (org.eclipse.jface.viewers.IStructuredSelection)54