Example usage for org.eclipse.jface.preference FieldEditor load

List of usage examples for org.eclipse.jface.preference FieldEditor load

Introduction

In this page you can find the example usage for org.eclipse.jface.preference FieldEditor load.

Prototype

public void load() 

Source Link

Document

Initializes this field editor with the preference value from the preference store.

Usage

From source file:org.eclipse.debug.internal.ui.preferences.LaunchConfigurationsPreferencePage.java

License:Open Source License

/**
 * Initializes the field editors to their values
 * @since 3.2//w w  w  . j a v  a2s  .c o m
 */
private void initFieldEditors() {
    FieldEditor editor;
    for (int i = 0; i < fFieldEditors.size(); i++) {
        editor = (FieldEditor) fFieldEditors.get(i);
        editor.setPreferenceStore(getPreferenceStore());
        editor.load();
    }
    fDeleteConfigs.setSelection(Platform.getPreferencesService().getBoolean(DebugPlugin.getUniqueIdentifier(),
            DebugPlugin.PREF_DELETE_CONFIGS_ON_PROJECT_DELETE, true, null));
    //restore the tables' checked state
    String[] types = getPreferenceStore().getString(IInternalDebugUIConstants.PREF_FILTER_TYPE_LIST)
            .split("\\,"); //$NON-NLS-1$
    TableItem[] items = fTable.getItems();
    ILaunchConfigurationType type;
    for (int i = 0; i < types.length; i++) {
        for (int j = 0; j < items.length; j++) {
            type = (ILaunchConfigurationType) items[j].getData();
            if (type.getIdentifier().equals(types[i])) {
                items[j].setChecked(true);
            }
        }
    }
}

From source file:org.eclipse.epsilon.common.dt.preferences.EpsilonPreferencePage.java

License:Open Source License

@Override
protected Control createContents(Composite parent) {

    Composite composite = new Composite(parent, SWT.FILL);

    fieldEditors.add(/*  www .jav  a 2 s.c  o m*/
            new BooleanFieldEditor(ENABLE_STATIC_ANALYSIS, "Enable static analysis (experimental)", composite));

    for (FieldEditor fieldEditor : fieldEditors) {
        fieldEditor.setPreferenceStore(EpsilonCommonsPlugin.getDefault().getPreferenceStore());
        fieldEditor.load();
    }

    return composite;
}

From source file:org.eclipse.papyrus.infra.gmfdiag.preferences.ui.AbstractGroup.java

License:Open Source License

/**
 * Load preferences of all registered fieldEditors.
 * /*from  w w w .  ja va 2s . co  m*/
 * @see org.eclipse.papyrus.infra.gmfdiag.preferences.ui.AbstractGroup#addFieldEditor(FieldEditor)
 */
public void load() {
    for (FieldEditor fe : fieldsEditor) {
        fe.load();
    }
}

From source file:org.eclipse.wb.core.controls.jface.preference.FieldLayoutPreferencePage.java

License:Open Source License

/**
 * Initializes all field editors./*from   ww w .  j ava2  s  .  com*/
 */
protected void initialize() {
    for (FieldEditor fieldEditor : fields) {
        fieldEditor.setPage(null);
        fieldEditor.setPropertyChangeListener(this);
        fieldEditor.setPreferenceStore(getPreferenceStore());
        fieldEditor.load();
    }
}

From source file:org.eclipse.wb.swt.FieldLayoutPreferencePage.java

License:Open Source License

/**
 * Initializes all field editors./* ww  w  .  jav a 2s .co  m*/
 */
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();
        }
    }
}

From source file:org.eclipse.wst.jsdt.debug.internal.rhino.ui.preferences.RhinoDebugPreferencePage.java

License:Open Source License

/**
 * Initializes and sets up the given editor
 * /*from   w ww. ja v  a2 s  .co m*/
 * @param editor
 * @param store
 */
void initEditor(FieldEditor editor, IPreferenceStore store) {
    addField(editor);
    editor.setPage(this);
    editor.setPropertyChangeListener(this);
    editor.setPreferenceStore(store);
    editor.load();
}

From source file:org.eclipse.wst.jsdt.debug.internal.ui.launching.JavaScriptConnectTab.java

License:Open Source License

public void initializeFrom(ILaunchConfiguration configuration) {
    try {/*from   w  w  w.ja  v a 2  s.  c o m*/
        String connectorid = configuration.getAttribute(ILaunchConstants.CONNECTOR_ID, (String) null);
        if (connectorid != null) {
            Connector connector = JavaScriptDebugPlugin.getConnectionsManager().getConnector(connectorid);
            if (connector != null) {
                int idx = this.connectorcombo.indexOf(connector.name());
                if (idx > -1) {
                    this.connectorcombo.select(idx);
                    handleConnectorSelected();
                    Map argmap = configuration.getAttribute(ILaunchConstants.ARGUMENT_MAP, (Map) null);
                    if (argmap != null) {
                        Entry entry = null;
                        Argument argument = null;
                        String key = null;
                        FieldEditor editor = null;
                        for (Iterator iter = argmap.entrySet().iterator(); iter.hasNext();) {
                            entry = (Entry) iter.next();
                            key = (String) entry.getKey();
                            argument = (Argument) connector.defaultArguments().get(key);
                            editor = (FieldEditor) this.editormap.get(key);
                            if (argument != null && editor != null) {
                                String value = (String) argmap.get(key);
                                if (argument instanceof StringArgument
                                        || argument instanceof SelectedArgument) {
                                    editor.getPreferenceStore().setValue(key, value);
                                } else if (argument instanceof BooleanArgument) {
                                    editor.getPreferenceStore().setValue(key,
                                            Boolean.valueOf(value).booleanValue());
                                } else if (argument instanceof IntegerArgument) {
                                    editor.getPreferenceStore().setValue(key, new Integer(value).intValue());
                                }
                                editor.load();
                            }
                        }
                    }
                } else {
                    this.connectorcombo.select(0);
                    handleConnectorSelected();
                }
            }
        }
    } catch (CoreException ce) {
        //ignore
    }
}

From source file:org.limy.eclipse.common.jface.AbstractLimyPreferencePage.java

License:Open Source License

/**
 * tB?[h??B// w  ww  .j  a v  a2s . c  o  m
 * @param field tB?[h
 */
protected void initField(FieldEditor field) {
    field.setPreferenceStore(getPreferenceStore());
    setPreferencePage(this, field);
    field.load();
    fields.add(field);
}

From source file:org.limy.eclipse.common.jface.AbstractLimyPropertyPage.java

License:Open Source License

/**
 * tB?[h??B//from   www. j  av a 2 s .c  o  m
 * @param field tB?[h
 */
protected void initField(FieldEditor field) {
    field.setPreferenceStore(getPreferenceStore());
    field.setPage(this);
    field.load();

    fields.add(field);
}

From source file:org.mailster.gui.prefs.DefaultConfigurationPage.java

License:Open Source License

/**
 * Adds the editor to the current preference page. Links it with the 
 * page IPreferenceStore and then load stored value.
 * /*from ww w .  ja v a  2 s  .c o m*/
 * @param editor the field editor to setup 
 */
public void setupEditor(FieldEditor editor) {
    editor.setPage(this);
    editor.setPreferenceStore(getPreferenceStore());
    editor.load();
}