Java Code Examples for org.eclipse.jface.preference.FieldEditor#setPropertyChangeListener()

The following examples show how to use org.eclipse.jface.preference.FieldEditor#setPropertyChangeListener() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ProfileView.java    From Pydev with Eclipse Public License 1.0 6 votes vote down vote up
protected void addField(final FieldEditor editor, Composite parent, IPreferenceStore preferenceStore) {
    fields.add(editor);

    editor.setPreferenceStore(preferenceStore);
    editor.load();
    editor.setPropertyChangeListener(new IPropertyChangeListener() {

        @Override
        public void propertyChange(PropertyChangeEvent event) {
            // Apply on any change!
            editor.store();
        }
    });
    if (editor instanceof BooleanFieldEditorCustom) {
        editor.fillIntoGrid(parent, 2);
    } else {
        editor.fillIntoGrid(parent, 1);
    }
}
 
Example 2
Source File: TypeScriptMainPreferencePage.java    From typescript.java with MIT License 5 votes vote down vote up
/**
 * Initializes and sets up the given editor
 * 
 * @param editor
 * @param store
 */
void initEditor(FieldEditor editor, IPreferenceStore store) {
	addField(editor);
	editor.setPage(this);
	editor.setPropertyChangeListener(this);
	editor.setPreferenceStore(store);
	editor.load();
}
 
Example 3
Source File: FieldLayoutPreferencePage.java    From tesb-studio-se with Apache License 2.0 5 votes vote down vote up
/**
 * The field editor preference page implementation of an <code>IDialogPage</code> method disposes of this page's
 * controls and images. Subclasses may override to release their own allocated SWT resources, but must call
 * <code>super.dispose</code>.
 */
@Override
public void dispose() {
    super.dispose();
    if (m_fields != null) {
        Iterator<FieldEditor> I = m_fields.iterator();
        while (I.hasNext()) {
            FieldEditor editor = I.next();
            editor.setPage(null);
            editor.setPropertyChangeListener(null);
            editor.setPreferenceStore(null);
        }
    }
}
 
Example 4
Source File: FieldLayoutPreferencePage.java    From tesb-studio-se with Apache License 2.0 5 votes vote down vote up
/**
 * Initializes all field editors.
 */
protected void initialize() {
    if (m_fields != null) {
        Iterator<FieldEditor> I = m_fields.iterator();
        while (I.hasNext()) {
            FieldEditor editor = I.next();
            editor.setPage(null);
            editor.setPropertyChangeListener(this);
            editor.setPreferenceStore(getPreferenceStore());
            editor.load();
        }
    }
}