use of org.eclipse.swt.widgets.Button in project tdi-studio-se by Talend.
the class JSONFileOutputStep2Form method addSchemaViewer.
private void addSchemaViewer(final Composite mainComposite, final int width, final int height) {
final Group group = Form.createGroup(mainComposite, 1, "Linker Source", height);
// group.setBackgroundMode(SWT.INHERIT_FORCE);
schemaButton = new Button(group, SWT.PUSH);
schemaButton.setText("Schema Management");
schemaButton.setToolTipText("You can add or edit schema and save in 'Schema List' viewer");
schemaViewer = new TableViewer(group);
JSONFileTableViewerProvider provider = new JSONFileTableViewerProvider();
schemaViewer.setContentProvider(provider);
schemaViewer.setLabelProvider(provider);
GridData gridData = new GridData(GridData.FILL_BOTH);
Table table = schemaViewer.getTable();
if (isReadOnly()) {
table.setEnabled(false);
}
table.setHeaderVisible(true);
org.eclipse.swt.widgets.TableColumn column = new org.eclipse.swt.widgets.TableColumn(table, SWT.LEFT);
column.setText("Schema List");
column.setWidth(100);
table.setLayoutData(gridData);
}
use of org.eclipse.swt.widgets.Button in project tdi-studio-se by Talend.
the class JSONFileOutputStep1Form method createOutputSettingArea.
private void createOutputSettingArea() {
Group group = Form.createGroup(this, 1, "Output Setting", 80);
GridData data = new GridData(GridData.FILL_HORIZONTAL);
data.heightHint = 150;
group.setLayoutData(data);
Composite compositeButton = Form.startNewDimensionnedGridLayout(group, 1, WIDTH_GRIDDATA_PIXEL, 20);
noFileButton = new Button(compositeButton, SWT.RADIO);
noFileButton.setText("Create manually");
useFileButton = new Button(compositeButton, SWT.RADIO);
useFileButton.setText("Create from a file");
Composite compositeOutput = Form.startNewDimensionnedGridLayout(group, 3, WIDTH_GRIDDATA_PIXEL, 20);
String[] extensions = new String[] { "*.JSON", "*.*", "*" };
jsonFilePath = new LabelledFileField(compositeOutput, "JSON File", extensions);
jsonFilePath.setText("");
EMetadataEncoding[] values = EMetadataEncoding.values();
String[] encodingData = new String[values.length];
for (int j = 0; j < values.length; j++) {
encodingData[j] = values[j].getName();
}
encodingCombo = new LabelledCombo(compositeOutput, "Encording", "Encording", encodingData, 1, true, SWT.NONE);
encodingCombo.setText("");
Composite limitation = new Composite(compositeOutput, SWT.NONE);
limitation.setLayout(new GridLayout(2, false));
labelLimitation = new Label(limitation, SWT.LEFT);
labelLimitation.setText("Limit");
commonNodesLimitation = new Text(limitation, SWT.BORDER);
GridData gd = new GridData(18, 12);
commonNodesLimitation.setLayoutData(gd);
commonNodesLimitation.setText(String.valueOf(TreePopulator.getLimit()));
labelLimitation.setToolTipText(MessageFormat.format(Messages.JSONLimitToolTip, commonNodesLimitation.getText()));
if (!noFileButton.getSelection() && !useFileButton.getSelection()) {
noFileButton.setSelection(true);
}
}
use of org.eclipse.swt.widgets.Button in project tdi-studio-se by Talend.
the class AbstractLoginActionPage method instantiateNavigatorArea.
protected void instantiateNavigatorArea(Composite container) {
// Navigate Area
navigateArea = new Composite(container, SWT.NONE);
navigatorSeperatorLine = new Label(navigateArea, SWT.SEPARATOR | SWT.HORIZONTAL);
alwaysAsk = new Button(navigateArea, SWT.CHECK);
alwaysAsk.setFont(LoginDialogV2.fixedFont);
alwaysAsk.setBackground(backgroundColor);
//$NON-NLS-1$
alwaysAsk.setText(Messages.getString("LoginProjectPage.alwaysAskMe"));
//$NON-NLS-1$
alwaysAsk.setToolTipText(Messages.getString("LoginProjectPage.alwaysAskMe.toolTip"));
previousButton = new Button(navigateArea, SWT.NONE);
previousButton.setFont(LoginDialogV2.fixedFont);
previousButton.setBackground(backgroundColor);
//$NON-NLS-1$
previousButton.setText(Messages.getString("LoginProjectPage.previous"));
finishButton = new Button(navigateArea, SWT.NONE);
finishButton.setFont(LoginDialogV2.fixedFont);
finishButton.setBackground(backgroundColor);
//$NON-NLS-1$
finishButton.setText(Messages.getString("LoginProjectPage.finish"));
}
use of org.eclipse.swt.widgets.Button in project tdi-studio-se by Talend.
the class LoginAgreementPage method createControl.
@Override
public void createControl(Composite parentCtrl) {
Composite container = new Composite(parentCtrl, SWT.NONE);
container.setLayout(new FormLayout());
Label titleLabel = new Label(container, SWT.WRAP);
titleLabel.setFont(LoginDialogV2.fixedFont);
//$NON-NLS-1$
titleLabel.setText(Messages.getString("LoginAgreementPage.title"));
FormData titleLabelFormData = new FormData();
titleLabelFormData.left = new FormAttachment(0, 0);
titleLabelFormData.top = new FormAttachment(0, 0);
titleLabel.setLayoutData(titleLabelFormData);
acceptButton = new Button(container, SWT.CENTER);
acceptButton.setBackground(backgroundColor);
acceptButton.setFont(LoginDialogV2.fixedFont);
//$NON-NLS-1$
acceptButton.setText(Messages.getString("LoginAgreementPage.accept"));
FormData acceptButtonFormLayoutData = new FormData();
acceptButtonFormLayoutData.bottom = new FormAttachment(100, 0);
acceptButtonFormLayoutData.right = new FormAttachment(100, 0);
acceptButtonFormLayoutData.left = new FormAttachment(100, -1 * LoginDialogV2.getNewButtonSize(acceptButton).x);
acceptButton.setLayoutData(acceptButtonFormLayoutData);
boolean haveHtmlDesc = false;
FileInputStream licenseInputStream = null;
String licenseFileBasePath = Platform.getInstallLocation().getURL().getPath();
if (Boolean.parseBoolean(System.getProperty("USE_BROWSER"))) {
//$NON-NLS-1$
File htmlFile = new File(licenseFileBasePath + LICENSE_FILE_PATH_HTML);
if (htmlFile.exists()) {
try {
licenseInputStream = new FileInputStream(htmlFile);
if (licenseInputStream != null) {
haveHtmlDesc = true;
}
} catch (FileNotFoundException e) {
CommonExceptionHandler.process(e);
}
}
}
if (licenseInputStream == null) {
try {
licenseInputStream = new FileInputStream(licenseFileBasePath + LICENSE_FILE_PATH);
} catch (FileNotFoundException e) {
CommonExceptionHandler.process(e);
}
}
FormData clufLayoutData = new FormData();
clufLayoutData.top = new FormAttachment(titleLabel, LoginDialogV2.TAB_VERTICAL_PADDING_LEVEL_1, SWT.BOTTOM);
clufLayoutData.left = new FormAttachment(0, 0);
clufLayoutData.right = new FormAttachment(100, 0);
clufLayoutData.bottom = new FormAttachment(acceptButton, -1 * LoginDialogV2.TAB_VERTICAL_PADDING_LEVEL_1, SWT.TOP);
if (haveHtmlDesc) {
clufBrowser = new Browser(container, SWT.BORDER);
clufBrowser.setText(getLicense(licenseInputStream));
clufBrowser.setLayoutData(clufLayoutData);
} else {
clufText = new Text(container, SWT.MULTI | SWT.WRAP | SWT.V_SCROLL | SWT.H_SCROLL | SWT.LEFT | SWT.BORDER);
clufText.setBackground(new Color(null, 255, 255, 255));
//$NON-NLS-1$
Font font = new Font(DisplayUtils.getDisplay(), "courier", 10, SWT.NONE);
clufText.setFont(font);
clufText.setEditable(false);
clufText.setText(getLicense(licenseInputStream));
clufText.setLayoutData(clufLayoutData);
}
}
use of org.eclipse.swt.widgets.Button in project tdi-studio-se by Talend.
the class UseDynamicJobSelectionDialog method createSelectionButton.
/**
* DOC hcw Comment method "createSelectionButton".
*
* @param itemComposite
*/
private void createSelectionButton(Composite itemComposite) {
Composite buttonComposite = new Composite(itemComposite, SWT.NONE);
GridLayoutFactory.swtDefaults().margins(0, 25).applyTo(buttonComposite);
GridDataFactory.swtDefaults().align(SWT.FILL, SWT.BEGINNING).applyTo(buttonComposite);
Button selectAll = new Button(buttonComposite, SWT.PUSH);
// selectAll.setText(DataTransferMessages.DataTransfer_selectAll);
//$NON-NLS-1$
selectAll.setText(Messages.getString("DataTransferMessages.DataTransfer_selectAll"));
selectAll.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
CheckboxTreeViewer exportItemsTreeViewer = getItemsTreeViewer();
exportItemsTreeViewer.setAllChecked(true);
}
});
setButtonLayoutData(selectAll);
Button deselectAll = new Button(buttonComposite, SWT.PUSH);
// deselectAll.setText(DataTransferMessages.DataTransfer_deselectAll);
//$NON-NLS-1$
deselectAll.setText(Messages.getString("DataTransferMessages.DataTransfer_deselectAll"));
deselectAll.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
CheckboxTreeViewer exportItemsTreeViewer = getItemsTreeViewer();
exportItemsTreeViewer.setAllChecked(false);
}
});
setButtonLayoutData(deselectAll);
Button expandBtn = new Button(buttonComposite, SWT.PUSH);
//$NON-NLS-1$
expandBtn.setText(Messages.getString("UseDynamicJobSelectionDialog.expandBtnText"));
expandBtn.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
CheckboxTreeViewer exportItemsTreeViewer = getItemsTreeViewer();
exportItemsTreeViewer.expandAll();
}
});
setButtonLayoutData(expandBtn);
Button collapseBtn = new Button(buttonComposite, SWT.PUSH);
//$NON-NLS-1$
collapseBtn.setText(Messages.getString("UseDynamicJobSelectionDialog.collapseBtnText"));
collapseBtn.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
CheckboxTreeViewer exportItemsTreeViewer = getItemsTreeViewer();
exportItemsTreeViewer.collapseAll();
}
});
setButtonLayoutData(collapseBtn);
}
Aggregations