Search in sources :

Example 11 with UtilsButton

use of org.talend.commons.ui.swt.formtools.UtilsButton 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 12 with UtilsButton

use of org.talend.commons.ui.swt.formtools.UtilsButton in project tbd-studio-se by Talend.

the class HCatalogSchemaForm method addTreeNavigator.

private void addTreeNavigator(Composite parent, int width, int height) {
    // $NON-NLS-1$
    Group group = Form.createGroup(parent, 1, Messages.getString("HCatalogSchemaForm.group.schema.title"), height);
    ScrolledComposite scrolledCompositeFileViewer = new ScrolledComposite(group, SWT.H_SCROLL | SWT.V_SCROLL | SWT.NONE);
    scrolledCompositeFileViewer.setExpandHorizontal(true);
    scrolledCompositeFileViewer.setExpandVertical(true);
    GridData gridData1 = new GridData(GridData.FILL_BOTH);
    gridData1.widthHint = width + 12;
    gridData1.heightHint = height;
    gridData1.horizontalSpan = 2;
    scrolledCompositeFileViewer.setLayoutData(gridData1);
    tableViewerCreator = new TableViewerCreator(scrolledCompositeFileViewer);
    tableViewerCreator.setHeaderVisible(false);
    tableViewerCreator.setColumnsResizableByDefault(false);
    tableViewerCreator.setBorderVisible(false);
    tableViewerCreator.setLinesVisible(false);
    tableViewerCreator.setLayoutMode(LAYOUT_MODE.NONE);
    tableViewerCreator.setCheckboxInFirstColumn(false);
    tableViewerCreator.setFirstColumnMasked(false);
    tableNavigator = tableViewerCreator.createTable();
    tableNavigator.setLayoutData(new GridData(GridData.FILL_BOTH));
    TableColumn tableColumn = new TableColumn(tableNavigator, SWT.NONE);
    // $NON-NLS-1$
    tableColumn.setText(Messages.getString("HCatalogSchemaForm.tableNavigator.tableColumn"));
    tableColumn.setWidth(width + 120);
    scrolledCompositeFileViewer.setContent(tableNavigator);
    scrolledCompositeFileViewer.setSize(width + 12, height);
    GC gc = new GC(group);
    // $NON-NLS-1$
    String displayStr = Messages.getString("HCatalogSchemaForm.button.addSchema");
    Point buttonSize = gc.stringExtent(displayStr);
    GridData girdData = new GridData(buttonSize.x + 12, HEIGHT_BUTTON_PIXEL);
    girdData.horizontalAlignment = SWT.CENTER;
    // Button Add metadata Table
    addTableBtn = new UtilsButton(group, displayStr, girdData);
    // $NON-NLS-1$
    displayStr = Messages.getString("HCatalogSchemaForm.button.removeSchema");
    buttonSize = gc.stringExtent(displayStr);
    if (buttonSize.x + 12 > girdData.widthHint) {
        girdData.widthHint = buttonSize.x + 12;
    }
    girdData = new GridData(buttonSize.x + 12, HEIGHT_BUTTON_PIXEL);
    girdData.horizontalAlignment = SWT.CENTER;
    removeTableBtn = new UtilsButton(group, displayStr, girdData);
    gc.dispose();
}
Also used : Group(org.eclipse.swt.widgets.Group) TableViewerCreator(org.talend.commons.ui.swt.tableviewer.TableViewerCreator) GridData(org.eclipse.swt.layout.GridData) ScrolledComposite(org.eclipse.swt.custom.ScrolledComposite) UtilsButton(org.talend.commons.ui.swt.formtools.UtilsButton) Point(org.eclipse.swt.graphics.Point) GC(org.eclipse.swt.graphics.GC) TableColumn(org.eclipse.swt.widgets.TableColumn)

Example 13 with UtilsButton

use of org.talend.commons.ui.swt.formtools.UtilsButton in project tbd-studio-se by Talend.

the class HCatalogTableSelectorForm method addButtonFields.

private void addButtonFields() {
    GC gc = new GC(buttonsGroup);
    // $NON-NLS-1$
    String displayStr = Messages.getString("HCatalogTableSelectorForm.button.selectAll");
    Point buttonSize = gc.stringExtent(displayStr);
    selectAllBtn = new UtilsButton(buttonsGroup, displayStr, buttonSize.x + 12, HEIGHT_BUTTON_PIXEL);
    // $NON-NLS-1$
    displayStr = Messages.getString("HCatalogTableSelectorForm.button.selectNone");
    buttonSize = gc.stringExtent(displayStr);
    selectNoneBtn = new UtilsButton(buttonsGroup, displayStr, buttonSize.x + 12, HEIGHT_BUTTON_PIXEL);
    // $NON-NLS-1$
    displayStr = Messages.getString("HCatalogTableSelectorForm.button.checkConnection");
    buttonSize = gc.stringExtent(displayStr);
    checkConnectionBtn = new UtilsButton(buttonsGroup, displayStr, buttonSize.x + 12, HEIGHT_BUTTON_PIXEL);
    gc.dispose();
}
Also used : UtilsButton(org.talend.commons.ui.swt.formtools.UtilsButton) Point(org.eclipse.swt.graphics.Point) GC(org.eclipse.swt.graphics.GC)

Example 14 with UtilsButton

use of org.talend.commons.ui.swt.formtools.UtilsButton in project tbd-studio-se by Talend.

the class HDFSFileSelectorForm method addButtonFields.

private void addButtonFields() {
    GC gc = new GC(buttonsGroup);
    // $NON-NLS-1$
    String displayStr = Messages.getString("HDFSFileSelectorForm.button.selectAll");
    Point buttonSize = gc.stringExtent(displayStr);
    selectAllBtn = new UtilsButton(buttonsGroup, displayStr, buttonSize.x + 12, HEIGHT_BUTTON_PIXEL);
    // $NON-NLS-1$
    displayStr = Messages.getString("HDFSFileSelectorForm.button.selectNone");
    buttonSize = gc.stringExtent(displayStr);
    selectNoneBtn = new UtilsButton(buttonsGroup, displayStr, buttonSize.x + 12, HEIGHT_BUTTON_PIXEL);
    // $NON-NLS-1$
    displayStr = Messages.getString("HDFSFileSelectorForm.button.checkConnection");
    buttonSize = gc.stringExtent(displayStr);
    checkConnectionBtn = new UtilsButton(buttonsGroup, displayStr, buttonSize.x + 12, HEIGHT_BUTTON_PIXEL);
    gc.dispose();
}
Also used : UtilsButton(org.talend.commons.ui.swt.formtools.UtilsButton) Point(org.eclipse.swt.graphics.Point) GC(org.eclipse.swt.graphics.GC)

Example 15 with UtilsButton

use of org.talend.commons.ui.swt.formtools.UtilsButton in project tbd-studio-se by Talend.

the class GoogleDataprocInfoForm method addCheckFields.

private void addCheckFields() {
    Composite checkGroup = new Composite(this, SWT.NONE);
    GridLayout checkGridLayout = new GridLayout(1, false);
    checkGroup.setLayout(checkGridLayout);
    GridData checkGridData = new GridData(GridData.FILL_HORIZONTAL);
    checkGridData.minimumHeight = 5;
    checkGroup.setLayoutData(checkGridData);
    Composite checkButtonComposite = Form.startNewGridLayout(checkGroup, 1, false, SWT.CENTER, SWT.BOTTOM);
    GridLayout checkButtonLayout = (GridLayout) checkButtonComposite.getLayout();
    checkButtonLayout.marginHeight = 0;
    checkButtonLayout.marginWidth = 0;
    // $NON-NLS-1$
    checkServicesBtn = new UtilsButton(checkButtonComposite, Messages.getString("HadoopClusterForm.button.check"), true);
    checkServicesBtn.setEnabled(false);
}
Also used : GridLayout(org.eclipse.swt.layout.GridLayout) Composite(org.eclipse.swt.widgets.Composite) GridData(org.eclipse.swt.layout.GridData) UtilsButton(org.talend.commons.ui.swt.formtools.UtilsButton)

Aggregations

UtilsButton (org.talend.commons.ui.swt.formtools.UtilsButton)17 GridData (org.eclipse.swt.layout.GridData)12 Composite (org.eclipse.swt.widgets.Composite)12 GC (org.eclipse.swt.graphics.GC)9 Point (org.eclipse.swt.graphics.Point)9 ScrolledComposite (org.eclipse.swt.custom.ScrolledComposite)8 GridLayout (org.eclipse.swt.layout.GridLayout)8 Group (org.eclipse.swt.widgets.Group)7 LabelledText (org.talend.commons.ui.swt.formtools.LabelledText)4 SashForm (org.eclipse.swt.custom.SashForm)3 FillLayout (org.eclipse.swt.layout.FillLayout)3 TableColumn (org.eclipse.swt.widgets.TableColumn)3 TableViewerCreator (org.talend.commons.ui.swt.tableviewer.TableViewerCreator)3 MetadataEmfTableEditor (org.talend.core.ui.metadata.editor.MetadataEmfTableEditor)3 Label (org.eclipse.swt.widgets.Label)2 MetadataEmfTableEditorView (org.talend.core.ui.metadata.editor.MetadataEmfTableEditorView)2 FocusEvent (org.eclipse.swt.events.FocusEvent)1 FocusListener (org.eclipse.swt.events.FocusListener)1 ModifyEvent (org.eclipse.swt.events.ModifyEvent)1 ModifyListener (org.eclipse.swt.events.ModifyListener)1