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

The following examples show how to use org.eclipse.jface.preference.FieldEditor#load() . 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: AbstractPreferencePage.java    From xtext-eclipse with Eclipse Public License 2.0 5 votes vote down vote up
/**
 * Loads values of all field editors using current search scopes in the preference store. Also updates fields
 * enabled status. (The effect is that fields show project specific values when enabled, and instance scoped/default
 * values when disabled).
 */
protected void updateFieldEditors(boolean enabled) {
	Composite parent = getFieldEditorParent();
	for (FieldEditor editor : editors) {
		editor.load();
		editor.setEnabled(enabled, parent);
	}
	Button defaultsButton = getDefaultsButton();
	if (defaultsButton != null && !defaultsButton.isDisposed()) {
		defaultsButton.setEnabled(enabled);
	}
}
 
Example 3
Source File: AbstractProjectPreferencesPage.java    From uml2solidity with Eclipse Public License 1.0 5 votes vote down vote up
protected void updateFieldEditors(boolean enabled) {
	Composite parent = getFieldEditorParent();
	for (FieldEditor editor : editors) {
		editor.load();
		editor.setEnabled(enabled, parent);
	}
	getDefaultsButton().setEnabled(enabled);
}
 
Example 4
Source File: GenericFieldEditorPropertyPage.java    From tlaplus with MIT License 5 votes vote down vote up
protected void initialize()
{
    if (fields != null)
    {
        Iterator e = fields.iterator();
        while (e.hasNext())
        {
            FieldEditor fieldEditor = (FieldEditor) e.next();
            fieldEditor.setPage(this);
            fieldEditor.setPreferenceStore(getPreferenceStore());
            fieldEditor.load();
        }
    }
}
 
Example 5
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 6
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();
        }
    }
}
 
Example 7
Source File: ScopedFieldEditorPreferencePage.java    From Pydev with Eclipse Public License 1.0 5 votes vote down vote up
public void loadFromWorkspace() {
    if (fields != null) {
        Iterator<FieldEditor> e = fields.iterator();
        while (e.hasNext()) {
            FieldEditor pe = e.next();
            pe.load();
        }
    }
}
 
Example 8
Source File: IoPreferencePage.java    From olca-app with Mozilla Public License 2.0 5 votes vote down vote up
@Override
protected void performDefaults() {
	super.performDefaults();
	IoPreference.reset();
	for (FieldEditor editor : editors)
		editor.load();
}
 
Example 9
Source File: IoPreferencePage.java    From olca-app with Mozilla Public License 2.0 4 votes vote down vote up
private void addField(FieldEditor editor) {
	editors.add(editor);
	editor.setPage(this);
	editor.setPreferenceStore(getPreferenceStore());
	editor.load();
}