Search in sources :

Example 71 with SashForm

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

the class JSONFileStep2Form method addFields.

@Override
protected void addFields() {
    // compositeFile Main Fields
    // Composite mainComposite = Form.startNewGridLayout(this, 1);
    SashForm mainComposite = new SashForm(this, SWT.VERTICAL | SWT.SMOOTH);
    mainComposite.setLayoutData(new GridData(GridData.FILL_BOTH));
    if (firstTimeWizardOpened == null) {
        firstTimeWizardOpened = Boolean.TRUE;
    } else if (firstTimeWizardOpened.equals(Boolean.TRUE)) {
        firstTimeWizardOpened = Boolean.FALSE;
    }
    // Splitter
    this.jsonToSchemaSash = new SashForm(mainComposite, SWT.HORIZONTAL | SWT.SMOOTH);
    jsonToSchemaSash.setLayoutData(new GridData(GridData.FILL_BOTH));
    jsonToSchemaSash.setBackgroundMode(SWT.INHERIT_FORCE);
    addGroupJSONFileSettings(jsonToSchemaSash, 400, 110);
    addGroupSchemaTarget(jsonToSchemaSash, 300, 110);
    jsonToSchemaSash.setWeights(new int[] { 40, 60 });
    SashForm sash2 = new SashForm(mainComposite, SWT.HORIZONTAL | SWT.SMOOTH);
    sash2.setLayoutData(new GridData(GridData.FILL_BOTH));
    addGroupFileViewer(sash2, 400, 210);
    if (!isInWizard()) {
        // Bottom Button
        Composite compositeBottomButton = Form.startNewGridLayout(this, 2, false, SWT.CENTER, SWT.CENTER);
        // Button Cancel
        cancelButton = new UtilsButton(compositeBottomButton, "Cancel", WIDTH_BUTTON_PIXEL, HEIGHT_BUTTON_PIXEL);
    }
    addUtilsButtonListeners();
    mainComposite.setWeights(new int[] { 60, 40 });
}
Also used : SashForm(org.eclipse.swt.custom.SashForm) Composite(org.eclipse.swt.widgets.Composite) CommandStackForComposite(org.talend.commons.ui.command.CommandStackForComposite) GridData(org.eclipse.swt.layout.GridData) UtilsButton(org.talend.commons.ui.swt.formtools.UtilsButton)

Example 72 with SashForm

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

the class AddListDialog method createDialogArea.

@Override
protected Control createDialogArea(Composite parent) {
    // Composite baseCom = (Composite) super.createDialogArea(parent);
    Composite createDialogArea = (Composite) super.createDialogArea(parent);
    createDialogArea.setLayout(new FillLayout());
    SashForm baseCom = new SashForm(createDialogArea, SWT.VERTICAL | SWT.BORDER);
    treeViewer = new TreeViewer(baseCom, SWT.FULL_SELECTION | SWT.H_SCROLL | SWT.V_SCROLL | SWT.MULTI);
    tree = treeViewer.getTree();
    tree.setHeaderVisible(true);
    tree.setLinesVisible(true);
    tree.setLayoutData(new GridData(GridData.FILL_BOTH));
    // Paramater Name Column
    TreeColumn column1 = new TreeColumn(tree, SWT.LEFT);
    column1.setText("Parameter Name");
    column1.setWidth(200);
    // Array Index Column
    TreeColumn column2 = new TreeColumn(tree, SWT.CENTER);
    column2.setText("Array Index");
    column2.setWidth(100);
    treeViewer.setColumnProperties(new String[] { NAME, INDEX });
    CellEditor editor = new TextCellEditor(treeViewer.getTree());
    // CellEditor nameEditor = new ComboBoxCellEditor(treeViewer.getTree());
    treeViewer.setCellEditors(new CellEditor[] { null, editor });
    treeViewer.setCellModifier(new ICellModifier() {

        public boolean canModify(Object element, String property) {
            if (element instanceof ParameterInfo) {
                ParameterInfo para = (ParameterInfo) element;
                if (INDEX.equals(property) && para.getArraySize() != 0) {
                    // if item is array it can edit.
                    return true;
                }
            }
            return false;
        }

        public Object getValue(Object element, String property) {
            if (element instanceof ParameterInfo) {
                ParameterInfo para = (ParameterInfo) element;
                if (INDEX.equals(property)) {
                    return para.getIndex() == null ? "" : para.getIndex();
                } else if (NAME.equals(property)) {
                    return para.getName();
                }
            }
            return null;
        }

        public void modify(Object element, String property, Object value) {
            if (element instanceof TreeItem) {
                ParameterInfo para = (ParameterInfo) ((TreeItem) element).getData();
                if (INDEX.equals(property)) {
                    para.setIndex(value.toString());
                }
            }
            treeViewer.refresh();
        }
    });
    // DrillDownAdapter adapter = new DrillDownAdapter(treeView);
    treeViewer.setContentProvider(new WebServiceTreeContentProvider());
    treeViewer.setLabelProvider(new WebServiceTreeLabelProvider());
    treeViewer.setInput(para);
    treeViewer.addSelectionChangedListener(selectAction);
    // tree.addSelectionListener(new SelectionAdapter() {
    //
    // @Override
    // public void widgetSelected(SelectionEvent e) {
    // TreeItem[] selects = tree.getSelection();
    // ISelection select = (ISelection) treeViewer.getSelection();
    // Object obj = ((IStructuredSelection) select).getFirstElement();
    // if (obj instanceof ParameterInfo) {
    // // if (((ParameterInfo) obj).getParameterInfos().size() > 0) {
    // // // ErrorDialog dialog = new ErrorDialog(parentShell, "", "", null, 0);
    // // // dialog.open();
    // // selectedParaInfo = null;
    // // } else {
    // selectedParaInfo = (ParameterInfo) obj;
    // // }
    // }
    // }
    //
    // });
    treeViewer.getTree().addSelectionListener(new SelectionAdapter() {

        public void widgetSelected(SelectionEvent e) {
            createAllTypeDialog();
        }
    });
    return baseCom;
}
Also used : Composite(org.eclipse.swt.widgets.Composite) TreeItem(org.eclipse.swt.widgets.TreeItem) TreeViewer(org.eclipse.jface.viewers.TreeViewer) CellEditor(org.eclipse.jface.viewers.CellEditor) TextCellEditor(org.eclipse.jface.viewers.TextCellEditor) ComboBoxCellEditor(org.eclipse.jface.viewers.ComboBoxCellEditor) SelectionAdapter(org.eclipse.swt.events.SelectionAdapter) FillLayout(org.eclipse.swt.layout.FillLayout) ParameterInfo(org.talend.designer.webservice.ws.wsdlinfo.ParameterInfo) SashForm(org.eclipse.swt.custom.SashForm) WebServiceTreeLabelProvider(org.talend.designer.webservice.ui.tree.WebServiceTreeLabelProvider) TreeColumn(org.eclipse.swt.widgets.TreeColumn) GridData(org.eclipse.swt.layout.GridData) ICellModifier(org.eclipse.jface.viewers.ICellModifier) SelectionEvent(org.eclipse.swt.events.SelectionEvent) TextCellEditor(org.eclipse.jface.viewers.TextCellEditor) WebServiceTreeContentProvider(org.talend.designer.webservice.ui.tree.WebServiceTreeContentProvider)

Example 73 with SashForm

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

the class JSONFileOutputStep2Form method addFields.

@Override
protected void addFields() {
    mainSashFormComposite = new SashForm(this, SWT.HORIZONTAL | SWT.SMOOTH);
    mainSashFormComposite.setLayoutData(new GridData(GridData.FILL_BOTH));
    mainSashFormComposite.setBackgroundMode(SWT.INHERIT_FORCE);
    addSchemaViewer(mainSashFormComposite, 300, 100);
    addJSONFileViewer(mainSashFormComposite, 400, 100);
    mainSashFormComposite.setWeights(new int[] { 40, 60 });
    linker = new JSONFileSchema2TreeLinker(mainSashFormComposite);
    linker.setForm(this);
    linker.init(schemaViewer.getTable(), JSONViewer);
    JSONTree2SchemaLinker oppositeLinker = new JSONTree2SchemaLinker(mainSashFormComposite);
    oppositeLinker.setConnection(getConnection());
    oppositeLinker.setDelegateLinker(linker);
    oppositeLinker.init(JSONViewer, schemaViewer);
}
Also used : SashForm(org.eclipse.swt.custom.SashForm) JSONFileSchema2TreeLinker(org.talend.repository.json.ui.wizards.view.JSONFileSchema2TreeLinker) GridData(org.eclipse.swt.layout.GridData) JSONTree2SchemaLinker(org.talend.repository.json.ui.wizards.view.JSONTree2SchemaLinker)

Example 74 with SashForm

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

the class JobScriptsExportWizardPage method createControl.

/**
     * (non-Javadoc) Method declared on IDialogPage.
     */
/**
     * (non-Javadoc) Method declared on IDialogPage.
     */
@Override
public void createControl(Composite parent) {
    initializeDialogUnits(parent);
    SashForm sash = createExportTree(parent);
    GridLayout layout = new GridLayout();
    layout.verticalSpacing = 0;
    layout.marginHeight = 0;
    layout.marginBottom = 0;
    Composite composite = new Composite(sash, SWT.NONE);
    composite.setLayout(layout);
    composite.setLayoutData(new GridData(GridData.FILL_BOTH));
    composite.setFont(parent.getFont());
    createDestinationGroup(composite);
    if (!isMultiNodes()) {
        createJobVersionGroup(composite);
    }
    createUnzipOptionGroup(composite);
    createOptionsGroup(composite);
    // ie.- local
    restoreResourceSpecificationWidgetValues();
    // ie.- subclass hook
    restoreWidgetValues();
    updateWidgetEnablements();
    setPageComplete(determinePageCompletion());
    // should not initially have error message
    setErrorMessage(null);
    setControl(sash);
    sash.setWeights(new int[] { 0, 2, 23 });
    giveFocusToDestination();
}
Also used : SashForm(org.eclipse.swt.custom.SashForm) GridLayout(org.eclipse.swt.layout.GridLayout) Composite(org.eclipse.swt.widgets.Composite) GridData(org.eclipse.swt.layout.GridData)

Example 75 with SashForm

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

the class JobScriptsExportWizardPage method createExportTree.

protected SashForm createExportTree(Composite parent) {
    // Using a protected method to provide the tree. LiXiaopeng 2011-9-21
    treeViewer = getExportTree();
    SashForm sashForm = treeViewer.createContents(parent);
    treeViewer.addCheckStateListener(checkStateListener);
    return sashForm;
}
Also used : SashForm(org.eclipse.swt.custom.SashForm)

Aggregations

SashForm (org.eclipse.swt.custom.SashForm)96 GridData (org.eclipse.swt.layout.GridData)65 GridLayout (org.eclipse.swt.layout.GridLayout)57 Composite (org.eclipse.swt.widgets.Composite)56 SelectionEvent (org.eclipse.swt.events.SelectionEvent)31 FillLayout (org.eclipse.swt.layout.FillLayout)30 Label (org.eclipse.swt.widgets.Label)26 SelectionAdapter (org.eclipse.swt.events.SelectionAdapter)25 CTabItem (org.eclipse.swt.custom.CTabItem)14 Button (org.eclipse.swt.widgets.Button)13 StyledText (org.eclipse.swt.custom.StyledText)12 ToolBar (org.eclipse.swt.widgets.ToolBar)12 ArrayList (java.util.ArrayList)11 Point (org.eclipse.swt.graphics.Point)11 Table (org.eclipse.swt.widgets.Table)11 ToolItem (org.eclipse.swt.widgets.ToolItem)11 TableViewer (org.eclipse.jface.viewers.TableViewer)10 Event (org.eclipse.swt.widgets.Event)10 Listener (org.eclipse.swt.widgets.Listener)9 Tree (org.eclipse.swt.widgets.Tree)9