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

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

Introduction

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

Prototype

public void store() 

Source Link

Document

Stores this field editor's value back into the preference store.

Usage

From source file:com.dnw.plugin.preference.GroupFieldEditor.java

License:Open Source License

/**
 * Stores the preference value from this field editor into the preference store.
 * //from www.  ja  v a 2s  .  c  o  m
 * @author manbaum
 * @since Oct 22, 2014
 * @see org.eclipse.jface.preference.FieldEditor#doStore()
 */
@Override
protected void doStore() {
    if (fields != null) {
        for (FieldEditor f : fields) {
            f.store();
        }
    }
}

From source file:com.ge.research.sadl.ui.preferences.ReasonerConfigurationDialog.java

License:Open Source License

@Override
protected void buttonPressed(int buttonId) {
    if (buttonId == IDialogConstants.OK_ID) {
        // make each editor save its value
        for (FieldEditor editor : editors) {
            editor.store();
        }/*from  ww w.  jav a 2 s.co m*/
        // copy updated values into configuration map
        updateConfigurationOptions();
    }
    super.buttonPressed(buttonId);
}

From source file:com.ge.research.sadl.ui.preferences.TranslatorConfigurationDialog.java

License:Open Source License

@Override
protected void buttonPressed(int buttonId) {
    ConfigurationItem configItem = null;
    if (buttonId == IDialogConstants.OK_ID) {
        // make each editor save its value
        for (FieldEditor editor : editors) {
            editor.store();
        }//from  ww w. j a va2s  .  co  m
        // copy updated values into configuration map
        configItem = constructConfigurationOptions();
        Method validateMethod = null;
        try {
            validateMethod = translator.getClass().getMethod("ValidateConfigurationOptions", null);
            if (validateMethod != null) {
                logger.debug("Translator method ValidateConfigurationOptions found");
                translator.configure(configItem);
                String errorMessage = (String) validateMethod.invoke(translator, null);
                if (errorMessage.length() > 0) {
                    messageArea.updateText(errorMessage, IMessageProvider.ERROR);
                    return;
                }
            }
        } catch (SecurityException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
            return;
        } catch (NoSuchMethodException e) {
            logger.debug("No Translator method ValidateConfigurationOptions found");
        } catch (IllegalArgumentException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
            return;
        } catch (IllegalAccessException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
            return;
        } catch (InvocationTargetException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
            return;
        }
    }
    updateConfigurationOptions(configItem);
    super.buttonPressed(buttonId);
}

From source file:com.safi.workshop.sqlexplorer.preferences.OverlaidPreferencePage.java

License:Open Source License

@Override
protected void addField(final FieldEditor editor) {
    // Make sure that FieldEditors automatically write their changes straight to the store
    editor.setPropertyChangeListener(new IPropertyChangeListener() {
        public void propertyChange(PropertyChangeEvent event) {
            editor.store();
        }//from  w w  w .  jav a  2s. c o  m
    });
    super.addField(editor);
}

From source file:com.swtdesigner.FieldLayoutPreferencePage.java

License:Open Source License

/** 
 * The field editor preference page implementation of this 
 * <code>PreferencePage</code> method saves all field editors by
 * calling <code>FieldEditor.store</code>. Note that this method
 * does not save the preference store itself; it just stores the
 * values back into the preference store.
 *
 * @see FieldEditor#store()//from   w w  w. jav  a 2s .  c  o m
 */
public boolean performOk() {
    if (fields != null) {
        Iterator e = fields.iterator();
        while (e.hasNext()) {
            FieldEditor pe = (FieldEditor) e.next();
            pe.store();
        }
    }
    return true;
}

From source file:com.technophobia.substeps.editor.preferences.page.SubstepsPropertyPage.java

License:Open Source License

@Override
public boolean performOk() {
    final boolean result = super.performOk();

    doValidation();/*from w  w  w . j  a  v  a2s  .co  m*/

    if (isValid()) {
        hasNatureEditor.store();
        controlEditor.store();
        for (final FieldEditor fieldEditor : fieldEditorsByKey.values()) {
            oldSubstepsFolderLocation();
            fieldEditor.store();
        }
        savePreferenceStore();

        updateProject();
        return result;
    }
    return false;
}

From source file:com.threecrickets.creel.eclipse.internal.PreferencePageWithFields.java

License:LGPL

@Override
public boolean performOk() {
    for (FieldEditor fieldEditor : fieldEditors)
        fieldEditor.store();
    return super.performOk();
}

From source file:de.fraunhofer.esk.ernest.visualization.ganttchart.preferences.VisualizationPreferencePage.java

License:Open Source License

@Override
public boolean performOk() {
    for (FieldEditor editor : preferenceEditors) {
        editor.store();
    }/*from  w ww .  j a va 2 s .c  om*/

    // we get the ConstraintView of the current active page and reload it to
    // reflect the changes in the preferences
    ConstraintView view = (ConstraintView) PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage()
            .findView(ConstraintView.ID);
    if (view != null) {
        view.refresh();
    }
    return super.performOk();
}

From source file:de.hasait.eclipse.ccg.properties.CcgProjectPropertyPage.java

License:Apache License

public boolean performOk() {
    for (Iterator fieldEditorsI = _fieldEditors.iterator(); fieldEditorsI.hasNext();) {
        FieldEditor fieldEditor = (FieldEditor) fieldEditorsI.next();
        fieldEditor.store();
    }/*from w w w  . j  a  v  a2 s  .c o  m*/
    try {
        _configuration.save();
    } catch (IOException e) {
        return false;
    }
    return super.performOk();
}

From source file:gov.redhawk.internal.ui.preferences.PlotPreferencePage.java

License:Open Source License

@Override
public boolean performOk() {
    if (!super.performOk()) {
        return false;
    }/*ww w. j  av  a  2 s  .co  m*/
    if (blockPreferenceStore != null) {
        Iterator<FieldEditor> e = blockPreferences.iterator();
        while (e.hasNext()) {
            FieldEditor pe = e.next();
            pe.store();
            // TODO How do we we do this for block preferences, I don't have access to the method
            //            pe.setPresentsDefaultValue(false);
        }
    }
    return true;
}