List of usage examples for org.eclipse.jface.preference FieldEditor setPreferenceStore
public void setPreferenceStore(IPreferenceStore store)
From source file:org.eclipse.papyrus.infra.gmfdiag.preferences.ui.AbstractGroup.java
License:Open Source License
/** * Set the preference store of all registered fieldEditors. * // w ww . j av a2 s . c o m * @see org.eclipse.papyrus.infra.gmfdiag.preferences.ui.AbstractGroup#addFieldEditor(FieldEditor) */ public final void setPreferenceStore(IPreferenceStore store) { for (FieldEditor fe : fieldsEditor) { fe.setPreferenceStore(store); } }
From source file:org.eclipse.photran.internal.ui.preferences.AbstractFortranPreferencePage.java
License:Open Source License
protected void addField(FieldEditor editor) { super.addField(editor); editor.setPreferenceStore(this.getPreferenceStore()); }
From source file:org.eclipse.wb.core.controls.jface.preference.FieldLayoutPreferencePage.java
License:Open Source License
/** * 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>. */// w w w. ja v a2s.c o m @Override public void dispose() { super.dispose(); for (FieldEditor fieldEditor : fields) { fieldEditor.setPage(null); fieldEditor.setPropertyChangeListener(null); fieldEditor.setPreferenceStore(null); } }
From source file:org.eclipse.wb.core.controls.jface.preference.FieldLayoutPreferencePage.java
License:Open Source License
/** * Initializes all field editors./*from w w w .java 2 s. co m*/ */ 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
/** * 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>. *//* w ww . ja va2s . c o m*/ 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); } } }
From source file:org.eclipse.wb.swt.FieldLayoutPreferencePage.java
License:Open Source License
/** * Initializes all field editors./* ww w . j a v a 2 s . c o 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 * // w ww . j a v a 2s. c o 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
/** * Handles creating the UI for the connector selected *//*from w w w . j av a2 s . c o m*/ void handleConnectorSelected() { Connector connect = getSelectedConnector(); if (connect == null || connect.equals(this.selectedconnector)) { //nothing changed return; } this.selectedconnector = connect; String desc = this.selectedconnector.description(); if (desc != null) { this.description.setText(desc); } else { this.description.setText(Messages.no_description_provided); } this.editormap.clear(); //get rid of the old controls Control[] children = this.argumentsgroup.getChildren(); for (int i = 0; i < children.length; i++) { children[i].dispose(); } PreferenceStore store = new PreferenceStore(); Entry entry = null; Argument argument = null; FieldEditor editor = null; String key = null; for (Iterator iter = this.selectedconnector.defaultArguments().entrySet().iterator(); iter.hasNext();) { entry = (Entry) iter.next(); key = (String) entry.getKey(); argument = (Argument) entry.getValue(); if (argument instanceof IntegerArgument) { //create an int editor store.setDefault(argument.name(), ((IntegerArgument) argument).intValue()); editor = new IntegerFieldEditor(argument.name(), argument.label(), this.argumentsgroup); } else if (argument instanceof BooleanArgument) { //create boolean editor store.setDefault(argument.name(), ((BooleanArgument) argument).booleanValue()); editor = new BooleanFieldEditor(argument.name(), argument.label(), this.argumentsgroup); editor.fillIntoGrid(argumentsgroup, 2); } else if (argument instanceof StringArgument) { //create String editor store.setDefault(argument.name(), argument.value()); editor = new StringFieldEditor(argument.name(), argument.label(), this.argumentsgroup); } else if (argument instanceof SelectedArgument) { //create list selection editor List choices = ((SelectedArgument) argument).choices(); String[][] namesAndValues = new String[choices.size()][2]; int count = 0; for (Iterator iter2 = choices.iterator(); iter2.hasNext();) { String choice = (String) iter2.next(); namesAndValues[count][0] = choice; namesAndValues[count][1] = choice; count++; } store.setDefault(argument.name(), argument.value()); editor = new ComboFieldEditor(argument.name(), argument.label(), namesAndValues, this.argumentsgroup); } if (editor != null) { editor.setPreferenceStore(store); editor.loadDefault(); editor.setPropertyChangeListener(this); this.editormap.put(key, editor); editor = null; } } //reset margins to undo FieldEditor bogosity GridLayout gd = (GridLayout) this.argumentsgroup.getLayout(); gd.marginHeight = 5; gd.marginWidth = 5; this.argumentsgroup.getParent().layout(true); this.argumentsgroup.setVisible(true); this.argumentsgroup.layout(true); updateLaunchConfigurationDialog(); }
From source file:org.limy.eclipse.common.jface.AbstractLimyPreferencePage.java
License:Open Source License
/** * tB?[h??B//from w w w. ja va 2 s .co 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 w ww . j av a 2 s. co m*/ * @param field tB?[h */ protected void initField(FieldEditor field) { field.setPreferenceStore(getPreferenceStore()); field.setPage(this); field.load(); fields.add(field); }