Search in sources :

Example 1 with UtilsButton

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

the class ContextComposite method createControl.

private void createControl() {
    Composite exportComposite = Form.startNewGridLayout(this, 2, true, SWT.CENTER, SWT.CENTER);
    GC gc = new GC(exportComposite);
    //$NON-NLS-1$
    String displayStr = Messages.getString("ContextComposite.exportAsContext");
    Point buttonSize = gc.stringExtent(displayStr);
    exportContextBtn = new UtilsButton(exportComposite, displayStr, buttonSize.x + 12, HEIGHT_BUTTON_PIXEL);
    exportContextBtn.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent e) {
            exportAsContext();
        }
    });
    //$NON-NLS-1$
    displayStr = Messages.getString("ContextComposite.revertContext");
    buttonSize = gc.stringExtent(displayStr);
    revertContextBtn = new UtilsButton(exportComposite, displayStr, buttonSize.x + 12, HEIGHT_BUTTON_PIXEL);
    gc.dispose();
    revertContextBtn.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent e) {
            revertContext();
        }
    });
    RowLayout layout = (RowLayout) exportComposite.getLayout();
    layout.spacing = 20;
    exportComposite.setLayout(layout);
    refreshContextBtn();
}
Also used : Composite(org.eclipse.swt.widgets.Composite) SelectionAdapter(org.eclipse.swt.events.SelectionAdapter) RowLayout(org.eclipse.swt.layout.RowLayout) SelectionEvent(org.eclipse.swt.events.SelectionEvent) UtilsButton(org.talend.commons.ui.swt.formtools.UtilsButton) Point(org.eclipse.swt.graphics.Point) GC(org.eclipse.swt.graphics.GC)

Example 2 with UtilsButton

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

the class AbstractNoSQLSchemaForm method addTreeNavigator.

private void addTreeNavigator(Composite parent, int width, int height) {
    // Group
    // $NON-NLS-1$
    Group group = Form.createGroup(parent, 1, Messages.getString("AbstractNoSQLSchemaForm.treeSchema"), height);
    // ScrolledComposite
    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("AbstractNoSQLSchemaForm.table"));
    tableColumn.setWidth(width + 120);
    scrolledCompositeFileViewer.setContent(tableNavigator);
    scrolledCompositeFileViewer.setSize(width + 12, height);
    GC gc = new GC(group);
    // $NON-NLS-1$
    String displayStr = Messages.getString("AbstractNoSQLSchemaForm.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("AbstractNoSQLSchemaForm.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 3 with UtilsButton

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

the class AbstractNoSQLSchemaForm method createGuessSchemaField.

/**
 * DOC PLV Comment method "createGuessSchemaPart".
 */
protected void createGuessSchemaField() {
    Composite compositeGuessSchemaButton = Form.startNewGridLayout(container, 3, false, SWT.CENTER, SWT.TOP);
    GC gc = new GC(compositeGuessSchemaButton);
    // $NON-NLS-1$
    String displayStr = "Guess Schema";
    Point buttonSize = gc.stringExtent(displayStr);
    buttonSize = gc.stringExtent(displayStr);
    guessSchemaButton = new UtilsButton(compositeGuessSchemaButton, displayStr, buttonSize.x + 12, HEIGHT_BUTTON_PIXEL);
    // $NON-NLS-1$
    guessSchemaButton.setToolTipText(Messages.getString("AbstractNoSQLSchemaForm.GuessSchemaToolTip"));
    gc.dispose();
}
Also used : Composite(org.eclipse.swt.widgets.Composite) 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)

Example 4 with UtilsButton

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

the class HCatalogForm 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.marginTop = 0;
    checkButtonLayout.marginBottom = 0;
    checkButtonLayout.marginLeft = 0;
    checkButtonLayout.marginRight = 0;
    checkButtonLayout.marginWidth = 0;
    checkConnectionBtn = new UtilsButton(checkButtonComposite, Messages.getString("HCatalogForm.button.check"), WIDTH_BUTTON_PIXEL, // $NON-NLS-1$
    HEIGHT_BUTTON_PIXEL);
    checkConnectionBtn.setEnabled(false);
}
Also used : GridLayout(org.eclipse.swt.layout.GridLayout) Composite(org.eclipse.swt.widgets.Composite) ScrolledComposite(org.eclipse.swt.custom.ScrolledComposite) GridData(org.eclipse.swt.layout.GridData) UtilsButton(org.talend.commons.ui.swt.formtools.UtilsButton)

Example 5 with UtilsButton

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

the class HDFSForm 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.marginTop = 0;
    checkButtonLayout.marginBottom = 0;
    checkButtonLayout.marginLeft = 0;
    checkButtonLayout.marginRight = 0;
    checkButtonLayout.marginWidth = 0;
    // $NON-NLS-1$
    checkConnectionBtn = new UtilsButton(checkButtonComposite, "Check", WIDTH_BUTTON_PIXEL, HEIGHT_BUTTON_PIXEL);
    checkConnectionBtn.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