use of org.eclipse.swt.events.SelectionAdapter in project tdi-studio-se by Talend.
the class NameAndLabelsDialog method createDialogArea.
@Override
protected Control createDialogArea(Composite parent) {
Composite composite = (Composite) super.createDialogArea(parent);
Composite comp = new Composite(composite, SWT.NONE);
comp.setLayoutData(new GridData(GridData.FILL_BOTH));
comp.setLayout(new GridLayout());
selectionComposite = new ElementsSelectionComposite<NamedThing>(comp) {
@Override
protected IBaseLabelProvider getLabelProvider() {
return new LabelProvider() {
@Override
public String getText(Object obj) {
NamedThing nal = (NamedThing) obj;
return nal.getDisplayName();
}
@Override
public Image getImage(Object obj) {
return null;
}
};
}
;
}.setMultipleSelection(false).create();
selectionComposite.setLayoutData(new GridData(GridData.FILL_BOTH));
selectionComposite.setViewerData(nameAndLabels);
Composite customComposite = new Composite(comp, SWT.NONE);
customComposite.setLayout(new GridLayout());
customComposite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
Button useCustomBtn = new Button(customComposite, SWT.CHECK);
//$NON-NLS-1$
useCustomBtn.setText(Messages.getString("NameAndLabelsDialog.custom.button"));
useCustomBtn.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
updateFieldsStatus(useCustomBtn.getSelection());
}
});
//$NON-NLS-1$
customObjNameText = new LabelledText(customComposite, Messages.getString("NameAndLabelsDialog.custom.text"));
updateFieldsStatus(useCustomBtn.getSelection());
if (!isInWizard) {
// set empty quotes to show the user he should fill the name between quotes
//$NON-NLS-1$
customObjNameText.setText("\"\"");
}
return composite;
}
use of org.eclipse.swt.events.SelectionAdapter in project tdi-studio-se by Talend.
the class ButtonController method createControl.
@Override
public Control createControl(Composite subComposite, IElementParameter param, int numInRow, int nbInRow, int top, Control lastControl) {
//$NON-NLS-1$
Button theBtn = getWidgetFactory().createButton(subComposite, "", SWT.PUSH);
theBtn.setBackground(subComposite.getBackground());
if (param.getDisplayName().equals("")) {
//$NON-NLS-1$
theBtn.setImage(ImageProvider.getImage(CoreUIPlugin.getImageDescriptor(DOTS_BUTTON)));
} else {
theBtn.setText(param.getDisplayName());
}
FormData data = new FormData();
if (isInWizard()) {
if (lastControl != null) {
data.right = new FormAttachment(lastControl, 0);
} else {
data.right = new FormAttachment(100, -ITabbedPropertyConstants.HSPACE);
}
} else {
if (lastControl != null) {
data.left = new FormAttachment(lastControl, 0);
} else {
data.left = new FormAttachment((((numInRow - 1) * MAX_PERCENT) / nbInRow), 0);
}
}
data.top = new FormAttachment(0, top);
theBtn.setLayoutData(data);
theBtn.setEnabled(!param.isReadOnly());
theBtn.setData(param);
hashCurControls.put(param.getName(), theBtn);
theBtn.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
Command cmd = createCommand((Button) e.getSource());
executeCommand(cmd);
}
});
Point initialSize = theBtn.computeSize(SWT.DEFAULT, SWT.DEFAULT);
dynamicProperty.setCurRowSize(initialSize.y + ITabbedPropertyConstants.VSPACE);
return theBtn;
}
use of org.eclipse.swt.events.SelectionAdapter in project tdi-studio-se by Talend.
the class PerformancePreferencePage method addSVNInforAutoCheckFiled.
private void addSVNInforAutoCheckFiled() {
if (PluginChecker.isSVNProviderPluginLoaded()) {
final CheckBoxFieldEditor autoCheckField = new CheckBoxFieldEditor(ITalendCorePrefConstants.SVN_UPDATE_INFO_AUTO_CHECK, Messages.getString("PerformancePreferencePage.autoCheckField"), //$NON-NLS-1$
getFieldEditorParent());
addField(autoCheckField);
final IntegerFieldEditor autoCheckTime = new IntegerFieldEditor(ITalendCorePrefConstants.SVN_UPDATE_INFO_AUTO_CHECK_TIME_INTERVAL, //$NON-NLS-1$
Messages.getString("PerformancePreferencePage.autoCheckTime"), getFieldEditorParent());
autoCheckTime.setValidRange(1, 30);
autoCheckTime.setEnabled(getPreferenceStore().getBoolean(ITalendCorePrefConstants.SVN_UPDATE_INFO_AUTO_CHECK), getFieldEditorParent());
addField(autoCheckTime);
autoCheckField.getButton().addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
if (autoCheckField.getButton().getSelection()) {
autoCheckTime.setEnabled(true, getFieldEditorParent());
} else {
autoCheckTime.setEnabled(false, getFieldEditorParent());
}
}
});
final CheckBoxFieldEditor autoRefreshLocksField = new CheckBoxFieldEditor(ITalendCorePrefConstants.AUTO_REFRESH_LOCKS, Messages.getString("PerformancePreferencePage.autoRefreshLocksField"), //$NON-NLS-1$
getFieldEditorParent());
addField(autoRefreshLocksField);
final IntegerFieldEditor tacConnectionTimeout = new IntegerFieldEditor(ITalendCorePrefConstants.PERFORMANCE_TAC_CONNECTION_TIMEOUT, //$NON-NLS-1$
Messages.getString("PerformancePreferencePage.tacTimeout"), getFieldEditorParent());
autoCheckTime.setValidRange(0, 3600);
addField(tacConnectionTimeout);
}
}
use of org.eclipse.swt.events.SelectionAdapter in project tdi-studio-se by Talend.
the class DownloadCheckUpdatesDialog method createDialogArea.
/**
* Create contents of the dialog.
*
* @param parent
*/
@Override
protected Control createDialogArea(Composite parent) {
Composite container = (Composite) super.createDialogArea(parent);
Composite composite = new Composite(container, SWT.NONE);
composite.setLayout(new GridLayout(2, false));
GridData gd_composite = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1);
gd_composite.heightHint = 188;
gd_composite.widthHint = 423;
composite.setLayoutData(gd_composite);
Label lblNewLabel = new Label(composite, SWT.NONE);
GridData gd_lblNewLabel = new GridData(SWT.LEFT, SWT.CENTER, false, false, 2, 1);
gd_lblNewLabel.heightHint = 92;
gd_lblNewLabel.widthHint = 406;
lblNewLabel.setLayoutData(gd_lblNewLabel);
lblNewLabel.setText("\nThere are newer versions of some items you have downloaded\nfrom the Talend Exchange.");
Label lblNewLabel_1 = new Label(composite, SWT.NONE);
lblNewLabel_1.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false, 2, 1));
lblNewLabel_1.setText("Total available updates : ");
new Label(composite, SWT.NONE);
new Label(composite, SWT.NONE);
new Label(composite, SWT.NONE);
new Label(composite, SWT.NONE);
Button btnCheckButton = new Button(composite, SWT.CHECK);
btnCheckButton.setText("Don't ask again ");
new Label(composite, SWT.NONE);
btnCheckButton.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent event) {
IPreferenceStore prefStore = PlatformUI.getPreferenceStore();
prefStore.setValue(ITalendCorePrefConstants.EXCHANGE_DOWNLOADED_CHECK_UPDATES, true);
cancelPressed();
}
});
return container;
}
use of org.eclipse.swt.events.SelectionAdapter in project tdi-studio-se by Talend.
the class ImportCompatibleEcoComponentsComposite method creatOptions.
/**
*
* There will create three radio button.
*/
private void creatOptions(Composite exchangeDialogCom) {
Group group = new Group(exchangeDialogCom, SWT.NONE);
GridLayout layout = new GridLayout();
layout.numColumns = 5;
layout.makeColumnsEqualWidth = false;
layout.marginWidth = 5;
group.setLayout(layout);
group.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
// Category
creatCategory(group);
category = categoryCombo.getText();
// Tos Version
creatTosVersionFilter(group, true);
version = versionCombo.getText();
// Refresh
Button refresh = new Button(group, SWT.PUSH);
refresh.setImage(ImageProvider.getImage(EImage.REFRESH_ICON));
//$NON-NLS-1$
refresh.setToolTipText(Messages.getString("ImportExchangeDialog.REFRESH_BUTTON"));
refresh.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
//$NON-NLS-1$
progressBarMessage = Messages.getString("ImportExchangeDialog.REFRESHING_PROGRESSBAR");
findChoiceExchange();
}
});
}
Aggregations