use of org.eclipse.jface.util.IPropertyChangeListener in project tdi-studio-se by Talend.
the class DragAndDrogDialog method createDialogArea.
/*
* (non-Javadoc) Method declared on Dialog.
*/
protected Control createDialogArea(Composite parent) {
// create composite
Composite composite = (Composite) super.createDialogArea(parent);
// composite.setLayout(new GridLayout());
// String[][] namevalues = new String[][] { { "Create as sub-element of target node", CREATE_AS_SUBELEMENT },
// { "Create as attribute of target node", CREATE_AS_ATTRIBUTE }, { "Add linker to target node", CREATE_AS_TEXT
// } };
String[][] namevalues = null;
if (hasChildren) {
namevalues = new String[][] { { "Create as sub-element of target node", CREATE_AS_SUBELEMENT }, { "Create as attribute of target node", CREATE_AS_ATTRIBUTE } };
} else {
namevalues = new String[][] { { "Create as sub-element of target node", CREATE_AS_SUBELEMENT }, { "Create as attribute of target node", CREATE_AS_ATTRIBUTE }, { "Add linker to target node", CREATE_AS_TEXT } };
}
RadioGroupFieldEditor rgfe = new RadioGroupFieldEditor("", "Select the operation:", 1, namevalues, composite, true);
GridLayout layout = new GridLayout();
layout.marginWidth = 12;
composite.setLayout(layout);
rgfe.setPropertyChangeListener(new IPropertyChangeListener() {
public void propertyChange(PropertyChangeEvent event) {
value = event.getNewValue().toString();
}
});
applyDialogFont(composite);
return composite;
}
use of org.eclipse.jface.util.IPropertyChangeListener in project translationstudio8 by heartsome.
the class PluginConfigManageDialog method createShortcutKeyGoup.
/**
* 创建快捷键面板
* @param tparent
* ;
*/
private void createShortcutKeyGoup(Composite tparent) {
Group group = new Group(tparent, SWT.None);
group.setText(Messages.getString("dialog.PluginConfigManageDialog.group"));
GridDataFactory.swtDefaults().align(SWT.FILL, SWT.CENTER).grab(true, false).applyTo(group);
GridLayoutFactory.swtDefaults().numColumns(2).applyTo(group);
Label keyLbl = new Label(group, SWT.NONE);
keyLbl.setText(Messages.getString("dialog.PluginConfigManageDialog.keyLbl"));
keyTxt = new Text(group, SWT.BORDER);
GridDataFactory.swtDefaults().align(SWT.FILL, SWT.CENTER).grab(true, false).applyTo(keyTxt);
fKeySequenceText = new KeySequenceText(keyTxt);
fKeySequenceText.setKeyStrokeLimit(4);
fKeySequenceText.addPropertyChangeListener(new IPropertyChangeListener() {
public final void propertyChange(final PropertyChangeEvent event) {
if (!event.getOldValue().equals(event.getNewValue())) {
final KeySequence keySequence = fKeySequenceText.getKeySequence();
if (!keySequence.isComplete()) {
return;
}
keyTxt.setSelection(keyTxt.getTextLimit());
}
}
});
}
use of org.eclipse.jface.util.IPropertyChangeListener in project cubrid-manager by CUBRID.
the class ChartCompositePart method createSeriesList.
/**
* Create the sub composite of Series selection combo and its related
* properties such as check and color
*
* @param composite the parent composite
*/
private void createSeriesList(Composite composite) {
Composite comp = new Composite(composite, SWT.NONE);
GridLayout layout = new GridLayout(3, false);
comp.setLayout(layout);
comp.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
combo = new Combo(comp, SWT.DROP_DOWN);
for (Map.Entry<String, String> entry : valueMap.entrySet()) {
combo.add(entry.getKey());
}
combo.setLayout(new GridLayout());
combo.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
combo.addSelectionListener(new SelectionAdapter() {
/**
* Sent when selection occurs in the control.
*
* @param event an event containing information about the selection
*/
public void widgetSelected(SelectionEvent event) {
widgetDefaultSelected(event);
}
/**
* Sent when default selection occurs in the control.
*
* @param event an event containing information about the default
* selection
*/
public void widgetDefaultSelected(SelectionEvent event) {
String selectedItem = combo.getItem(combo.getSelectionIndex());
boolean checked = settingMap.get(selectedItem).isChecked();
RGB rgb = settingMap.get(selectedItem).getSeriesRgb();
checkBtn.setSelection(checked);
colorField.getColorSelector().setColorValue(rgb);
}
});
checkBtn = new Button(comp, SWT.CHECK);
checkBtn.setText(Messages.seriesSelectCheckBtn);
checkBtn.addSelectionListener(new SelectionAdapter() {
/**
* Sent when selection occurs in the control.
*
* @param event an event containing information about the selection
*/
public void widgetSelected(SelectionEvent event) {
widgetDefaultSelected(event);
}
/**
* Sent when default selection occurs in the control.
*
* @param event an event containing information about the default
* selection
*/
public void widgetDefaultSelected(SelectionEvent event) {
handleUpdateSettingChange();
}
});
Composite selComp = new Composite(comp, SWT.NONE);
colorField = new ColorFieldEditor(Messages.seriesSelectColorBtnName, Messages.seriesSelectColorBtnLbl, selComp);
colorField.getColorSelector().addListener(new IPropertyChangeListener() {
/**
* Notification that a property has changed.
*
* @param event the property change event object describing which
* property changed and how
*/
public void propertyChange(PropertyChangeEvent event) {
handleUpdateSettingChange();
}
});
}
use of org.eclipse.jface.util.IPropertyChangeListener in project eclipse.platform.text by eclipse.
the class EditorsPlugin method start.
@Override
public void start(BundleContext context) throws Exception {
super.start(context);
if (PlatformUI.isWorkbenchRunning()) {
fThemeListener = new IPropertyChangeListener() {
@Override
public void propertyChange(PropertyChangeEvent event) {
if (IThemeManager.CHANGE_CURRENT_THEME.equals(event.getProperty()))
EditorsPluginPreferenceInitializer.setThemeBasedPreferences(getPreferenceStore(), true);
}
};
PlatformUI.getWorkbench().getThemeManager().addPropertyChangeListener(fThemeListener);
}
}
use of org.eclipse.jface.util.IPropertyChangeListener in project eclipse.platform.text by eclipse.
the class TemplateStore method startListeningForPreferenceChanges.
/**
* Starts listening for property changes on the preference store. If the configured preference
* key changes, the template store is {@link #load() reloaded}. Call
* {@link #stopListeningForPreferenceChanges()} to remove any listener and stop the
* auto-updating behavior.
*
* @since 3.2
*/
public final void startListeningForPreferenceChanges() {
if (fPropertyListener == null) {
fPropertyListener = new IPropertyChangeListener() {
@Override
public void propertyChange(PropertyChangeEvent event) {
/*
* Don't load if we are in the process of saving ourselves. We are in sync anyway after the
* save operation, and clients may trigger reloading by listening to preference store
* updates.
*/
if (!fIgnorePreferenceStoreChanges && fKey.equals(event.getProperty()))
try {
load();
} catch (IOException x) {
handleException(x);
}
}
};
fPreferenceStore.addPropertyChangeListener(fPropertyListener);
}
}
Aggregations