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();
}
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();
}
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();
}
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);
}
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);
}
Aggregations