List of usage examples for org.eclipse.jface.preference FieldEditor VALUE
String VALUE
To view the source code for org.eclipse.jface.preference FieldEditor VALUE.
Click Source Link
"field_editor_value"
) to signal a change in the value of this field editor. From source file:org.eclipse.umlgen.gen.c.ui.UML2CPropertyPage.java
License:Open Source License
/** * Creates the second group on which access paths to models must be specified. * * @param parent// w ww. j a va 2 s. c om * The composite parent */ private void createModelsGroup(Composite parent) { final Group mainGroup = new Group(parent, SWT.NONE); mainGroup.setText(Messages.getString("UML2CPropertyPage.0")); //$NON-NLS-1$ mainGroup.setLayout(new GridLayout()); mainGroup.setLayoutData(new GridData(SWT.FILL, SWT.NONE, true, false)); // FIXME MIGRATION // Composite for the diagram path // final Composite diagramComposite = new Composite(mainGroup, SWT.NONE); // diagramComposite.setLayout(new GridLayout()); // diagramComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, // true, 0, 0)); // FIXME MIGRATION reference to facilities // Access to UMLDI Model path // diagramPath = new ResourceFieldEditor(BundleConstants.UMLDI_MODEL_PATH, Messages.getString("UML2CPropertyPage.1"), diagramComposite); //$NON-NLS-1$ // diagramPath.setPreferenceStore(getPreferenceStore()); // diagramPath.setPage(this); // diagramPath.setEmptyStringAllowed(false); // diagramPath.setPropertyChangeListener(new IPropertyChangeListener() // { // /** // * @see // org.eclipse.jface.util.IPropertyChangeListener#propertyChange(org.eclipse.jface.util.PropertyChangeEvent) // */ // public void propertyChange(PropertyChangeEvent event) // { // if (FieldEditor.VALUE.equals(event.getProperty())) // { // // deduce and set a default value into the next field. // URI uri = URI.createURI(diagramPath.getStringValue(), false); // try // { // Resource rsc = rscSet.getResource(uri, true); // EObject root = rsc.getContents().get(0); // // FIXME MIGRATION reference to modeler // // if (root instanceof Diagrams) // // { // // EObject model = ((Diagrams) root).getModel(); // // URI modelURI = EcoreUtil.getURI(model); // // // modelPath.setStringValue(URI.decode(modelURI.trimFragment().toString())); // // } // } // catch (Exception e) // { // modelPath.setStringValue(""); //$NON-NLS-1$ // } // } // } // }); // Composite for the model path final Composite modelComposite = new Composite(mainGroup, SWT.NONE); modelComposite.setLayout(new GridLayout()); modelComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 0, 0)); // Access to UML Model path // CHECKSTYLE:OFF modelPath = new StringButtonFieldEditor() { // CHECKSTYLE:ON { init(BundleConstants.UML_MODEL_PATH, Messages.getString("C2UMLPropertyPage.3")); //$NON-NLS-1$ createControl(modelComposite); } ElementTreeSelectionDialog dialog = new ElementTreeSelectionDialog(getShell(), new WorkbenchLabelProvider(), new BaseWorkbenchContentProvider()); @Override protected String changePressed() { IFile d = null; dialog.setInput(getElement()); if (dialog.open() == Window.OK) { Object[] result = dialog.getResult(); // sanity check if (result.length == 1) { if (result[0] instanceof IFile) { d = (IFile) result[0]; } } } if (d == null) { return null; } URI uri = URI.createPlatformResourceURI(d.getFullPath().toString(), false); return URI.decode(uri.toString()); } }; modelPath.setPreferenceName(BundleConstants.UML_MODEL_PATH); modelPath.setLabelText(Messages.getString("UML2CPropertyPage.3")); //$NON-NLS-1$ modelPath.setEnabled(true, modelComposite); // FIXME MIGRATION // modelPath = new ResourceFieldEditor(BundleConstants.UML_MODEL_PATH, // Messages.getString("UML2CPropertyPage.3"), modelComposite); //$NON-NLS-1$ // modelPath.setEnabled(false, modelComposite); // modelPath.getLabelControl(modelComposite).setEnabled(true); modelPath.setPreferenceStore(getPreferenceStore()); modelPath.setPage(this); modelPath.setEmptyStringAllowed(false); modelPath.setPropertyChangeListener(new IPropertyChangeListener() { public void propertyChange(PropertyChangeEvent event) { if (FieldEditor.VALUE.equals(event.getProperty())) { resetPathFields(); extractPackagesFromModel(); } } }); }
From source file:org.jboss.jca.eclipse.preferences.IronJacamarPreferencePage.java
License:Open Source License
/** propertyChange * @param event PropertyChangeEvent /*from w w w . ja va2 s.c om*/ * @see org.eclipse.jface.preference.FieldEditorPreferencePage# * propertyChange(org.eclipse.jface.util.PropertyChangeEvent) */ @Override public void propertyChange(PropertyChangeEvent event) { super.propertyChange(event); if (event.getProperty().equals(FieldEditor.VALUE)) { checkState(); } }
From source file:org.jboss.tools.common.model.ui.attribute.editor.DirectoryFieldEditorEx.java
License:Open Source License
public void propertyChange(org.eclipse.jface.util.PropertyChangeEvent event) { if (valueChangeListener != null) { if (FieldEditor.VALUE.equals(event.getProperty())) { setPropertyChangeListener(null); java.beans.PropertyChangeEvent e = new java.beans.PropertyChangeEvent(this, IPropertyEditor.VALUE, event.getOldValue(), event.getNewValue()); valueChangeListener.valueChange(e); setPropertyChangeListener(this); }//from w w w . j ava 2 s .co m } }
From source file:org.mwc.debrief.core.wizards.FlatFilenameWizardPage.java
License:Open Source License
/** * @see IDialogPage#createControl(Composite) */// ww w . j a va 2s.c o m public void createControl(final Composite parent) { final Composite container = new Composite(parent, SWT.NULL); final GridLayout layout = new GridLayout(); container.setLayout(layout); layout.numColumns = 3; layout.verticalSpacing = 9; final String filenameKey = "3Debrief.FlatFileOutput"; final String sensor1Key = "3Debrief.FlatFileSensorType1"; final String sensor2Key = "3Debrief.FlatFileSensorType2"; final String protMarkKey = "3Debrief.FlatFileProtMarking"; final String serialKey = "3Debrief.FlatFileSerialName"; final String sensor1fwdKey = "3Debrief.FlatFileSensor1fwd"; final String sensor1aftKey = "3Debrief.FlatFileSensor1aft"; final String sensor2fwdKey = "3Debrief.FlatFileSensor2fwd"; final String sensor2aftKey = "3Debrief.FlatFileSensor2aft"; final String speedOfSoundKey = "3Debrief.speedOfSoundKey"; final String title = "Output directory:"; _fileFieldEditor = new DirectoryFieldEditor(filenameKey, title, container) { @Override protected void doLoad() { super.doLoad(); fireValueChanged(FieldEditor.VALUE, null, this.getStringValue()); } protected void fireValueChanged(final String property, final Object oldValue, final Object newValue) { super.fireValueChanged(property, oldValue, newValue); // is this the value property? if (!property.equals(FieldEditor.VALUE)) return; // tell the ui to update itself _filePath = (String) newValue; dialogChanged(); this.store(); } @Override protected boolean doCheckState() { return _filePath != null; } }; _fileFieldEditor.fillIntoGrid(container, 3); _fileFieldEditor.setPreferenceStore(getPreferenceStore()); _fileFieldEditor.setPage(this); _fileFieldEditor.setEmptyStringAllowed(false); _fileFieldEditor.load(); // store the current editor value _filePath = _fileFieldEditor.getStringValue(); // ok, we also need the sensor depth attribute if (_fileVersion.equals(FlatFileExporter.UPDATED_VERSION)) { // ok, get the sensor1 depth final StringFieldEditor speedOfSoundEditor = new StringFieldEditor(speedOfSoundKey, "Speed of Sound (m/sec):", container) { @Override protected void doLoad() { super.doLoad(); fireValueChanged(FieldEditor.VALUE, null, this.getStringValue()); } protected void fireValueChanged(final String property, final Object oldValue, final Object newValue) { super.fireValueChanged(property, oldValue, newValue); // is this the value property? if (!property.equals(FieldEditor.VALUE)) return; // is this the value property? try { _speedOfSound = MWCXMLReader.readThisDouble(newValue.toString()); } catch (final ParseException e) { // ignore } dialogChanged(); // and remember the new value store(); } @Override protected boolean doCheckState() { return _speedOfSound != null; } }; speedOfSoundEditor.setEmptyStringAllowed(false); speedOfSoundEditor.setPreferenceStore(getPreferenceStore()); speedOfSoundEditor.setPage(this); speedOfSoundEditor.setErrorMessage("A value for speed of sound must be supplied"); speedOfSoundEditor.setStringValue(""); speedOfSoundEditor.load(); if (speedOfSoundEditor.getStringValue() != null) { try { _speedOfSound = MWCXMLReader.readThisDouble(speedOfSoundEditor.getStringValue()); } catch (final ParseException pe) { // ignore } } @SuppressWarnings("unused") final Label lbl3 = new Label(container, SWT.None); } // sort out the correct selection lists String[][] sensorTypes; if (_fileVersion.equals(FlatFileExporter.INITIAL_VERSION)) { sensorTypes = sensor1Types; } else { sensorTypes = sensor2Types; } // sort out the first sensor _sensor1TypeEditor = new RadioGroupFieldEditor(sensor1Key, "Sensor 1 type:", 2, sensorTypes, container) { protected void fireValueChanged(final String property, final Object oldValue, final Object newValue) { super.fireValueChanged(property, oldValue, newValue); // is this the value property? if (!property.equals(FieldEditor.VALUE)) return; _sensorType1 = (String) newValue; enableAftEditor(container, _sensor1AftEditor, _sensorType1); dialogChanged(); // remember the value this.store(); } }; _sensor1TypeEditor.setPreferenceStore(getPreferenceStore()); _sensor1TypeEditor.setPage(this); _sensor1TypeEditor.load(); _sensorType1 = getPreferenceStore().getString(sensor1Key); @SuppressWarnings("unused") final Label lbl = new Label(container, SWT.None); // ok, we also need the sensor depth attribute if (_fileVersion.equals(FlatFileExporter.UPDATED_VERSION)) { // ok, get the sensor1 depth final StringFieldEditor sensor1FwdEditor = new StringFieldEditor(sensor1fwdKey, "Sensor 1 fwd depth (m):", container) { @Override protected void doLoad() { super.doLoad(); fireValueChanged(FieldEditor.VALUE, null, this.getStringValue()); } protected void fireValueChanged(final String property, final Object oldValue, final Object newValue) { super.fireValueChanged(property, oldValue, newValue); // is this the value property? if (!property.equals(FieldEditor.VALUE)) return; try { _sensor1Fwd = MWCXMLReader.readThisDouble(newValue.toString()); } catch (final ParseException pe) { _sensor1Fwd = null; } if (_sensor1AftEditor != null) _sensor1AftEditor.setEnabled(!_sensorType1.startsWith("H"), container); // we may not have a second editor = get checking // if (_sensor2AftEditor != null) // _sensor2AftEditor.setEnabled(!_sensorType2.startsWith("H"), // container); dialogChanged(); // remember the value this.store(); } @Override protected boolean doCheckState() { return _sensor1Fwd != null; } }; sensor1FwdEditor.setEmptyStringAllowed(false); sensor1FwdEditor.setPreferenceStore(getPreferenceStore()); sensor1FwdEditor.setPage(this); sensor1FwdEditor.setErrorMessage("A value for Sensor 1 fwd depth must be supplied"); sensor1FwdEditor.setStringValue(""); sensor1FwdEditor.load(); if (sensor1FwdEditor.getStringValue() != null) { try { _sensor1Fwd = MWCXMLReader.readThisDouble(sensor1FwdEditor.getStringValue()); } catch (final ParseException pe) { // ignore } } @SuppressWarnings("unused") final Label lbl2 = new Label(container, SWT.None); // ok, get the sensor1 depth _sensor1AftEditor = new StringFieldEditor(sensor1aftKey, "Sensor 1 aft depth (m):", container) { @Override protected void doLoad() { super.doLoad(); fireValueChanged(FieldEditor.VALUE, null, this.getStringValue()); } protected void fireValueChanged(final String property, final Object oldValue, final Object newValue) { super.fireValueChanged(property, oldValue, newValue); // is this the value property? if (!property.equals(FieldEditor.VALUE)) return; // is this the value property? try { _sensor1Aft = MWCXMLReader.readThisDouble(newValue.toString()); } catch (final ParseException pe) { _sensor1Aft = null; } dialogChanged(); // remember this value this.store(); } @Override protected boolean doCheckState() { return _sensor1Aft != null; } }; _sensor1AftEditor.setEmptyStringAllowed(false); _sensor1AftEditor.setPreferenceStore(getPreferenceStore()); _sensor1AftEditor.setPage(this); _sensor1AftEditor.setErrorMessage("A value for Sensor 1 aft depth must be supplied"); _sensor1AftEditor.setStringValue(""); _sensor1AftEditor.load(); enableAftEditor(container, _sensor1AftEditor, _sensorType1); if (_sensor1AftEditor.getStringValue() != null) { try { _sensor1Aft = MWCXMLReader.readThisDouble(_sensor1AftEditor.getStringValue()); } catch (final ParseException pe) { // ignore } } @SuppressWarnings("unused") final Label lbl3b = new Label(container, SWT.None); } // and now the second sensor if (_numSensors > 1) { _sensor2TypeEditor = new RadioGroupFieldEditor(sensor2Key, "Sensor 2 type:", 2, sensorTypes, container) { protected void fireValueChanged(final String property, final Object oldValue, final Object newValue) { super.fireValueChanged(property, oldValue, newValue); // is this the value property? if (!property.equals(FieldEditor.VALUE)) return; _sensorType2 = (String) newValue; enableAftEditor(container, _sensor2AftEditor, _sensorType2); dialogChanged(); // remember this value this.store(); } }; _sensor2TypeEditor.setPreferenceStore(getPreferenceStore()); _sensor2TypeEditor.setPage(this); _sensor2TypeEditor.load(); _sensorType2 = getPreferenceStore().getString(sensor2Key); @SuppressWarnings("unused") final Label lbl2 = new Label(container, SWT.None); // ok, we also need the sensor depth attribute if (_fileVersion.equals(FlatFileExporter.UPDATED_VERSION)) { // ok, get the sensor1 depth final StringFieldEditor sensor2FwdEditor = new StringFieldEditor(sensor2fwdKey, "Sensor 2 fwd depth (m):", container) { @Override protected void doLoad() { super.doLoad(); fireValueChanged(FieldEditor.VALUE, null, this.getStringValue()); } protected void fireValueChanged(final String property, final Object oldValue, final Object newValue) { super.fireValueChanged(property, oldValue, newValue); // is this the value property? if (!property.equals(FieldEditor.VALUE)) return; // is this the value property? try { _sensor2Fwd = MWCXMLReader.readThisDouble(newValue.toString()); dialogChanged(); // remember this value this.store(); } catch (final ParseException pe) { _sensor2Fwd = null; } } @Override protected boolean doCheckState() { return _sensor2Fwd != null; } }; sensor2FwdEditor.setEmptyStringAllowed(false); sensor2FwdEditor.setPreferenceStore(getPreferenceStore()); sensor2FwdEditor.setPage(this); sensor2FwdEditor.setErrorMessage("A value for Sensor 2 fwd depth must be supplied"); sensor2FwdEditor.load(); if (sensor2FwdEditor.getStringValue() != null) { try { _sensor2Fwd = MWCXMLReader.readThisDouble(sensor2FwdEditor.getStringValue()); } catch (final ParseException pe) { // ignore } } @SuppressWarnings("unused") final Label lbl3 = new Label(container, SWT.None); // ok, get the sensor1 depth _sensor2AftEditor = new StringFieldEditor(sensor2aftKey, "Sensor 2 aft depth (m):", container) { @Override protected void doLoad() { super.doLoad(); fireValueChanged(FieldEditor.VALUE, null, this.getStringValue()); } protected void fireValueChanged(final String property, final Object oldValue, final Object newValue) { super.fireValueChanged(property, oldValue, newValue); // is this the value property? if (!property.equals(FieldEditor.VALUE)) return; // is this the value property? try { _sensor2Aft = MWCXMLReader.readThisDouble(newValue.toString()); } catch (final ParseException pe) { _sensor2Aft = null; } // remember this value this.store(); dialogChanged(); } @Override protected boolean doCheckState() { return _sensor2Aft != null; } }; _sensor2AftEditor.setEmptyStringAllowed(false); _sensor2AftEditor.setPreferenceStore(getPreferenceStore()); _sensor2AftEditor.setPage(this); _sensor2AftEditor.setErrorMessage("A value for Sensor 2 aft depth must be supplied"); _sensor2AftEditor.load(); enableAftEditor(container, _sensor2AftEditor, _sensorType2); if (_sensor2AftEditor.getStringValue() != null) { try { _sensor2Aft = MWCXMLReader.readThisDouble(_sensor2AftEditor.getStringValue()); } catch (final ParseException pe) { // ignore } } @SuppressWarnings("unused") final Label lbl4 = new Label(container, SWT.None); } } if (_fileVersion.equals(FlatFileExporter.UPDATED_VERSION)) { // we also want to specify the prot marking editor _protMarkingEditor = new StringFieldEditor(protMarkKey, "Protective Marking:", container) { protected void fireValueChanged(final String property, final Object oldValue, final Object newValue) { super.fireValueChanged(property, oldValue, newValue); // is this the value property? if (!property.equals(FieldEditor.VALUE)) return; _protMarking = (String) newValue; dialogChanged(); // remember this value this.store(); } @Override protected boolean doCheckState() { return _protMarking != null; } }; _protMarkingEditor.setEmptyStringAllowed(false); _protMarkingEditor.setPreferenceStore(getPreferenceStore()); _protMarkingEditor.setPage(this); _protMarkingEditor.setErrorMessage("A value for protective marking must be supplied"); _protMarkingEditor.setStringValue(""); _protMarkingEditor.load(); _protMarking = _protMarkingEditor.getStringValue(); @SuppressWarnings("unused") final Label lbl3 = new Label(container, SWT.None); } // we also want to specify the serial nane (for single or double sensors) _serialNameEditor = new StringFieldEditor(serialKey, "Serial name:", container) { protected void fireValueChanged(final String property, final Object oldValue, final Object newValue) { super.fireValueChanged(property, oldValue, newValue); // is this the value property? if (!property.equals(FieldEditor.VALUE)) return; _serialName = (String) newValue; dialogChanged(); // remember this value this.store(); } @Override protected boolean doCheckState() { return _serialName != null; } }; _serialNameEditor.setPreferenceStore(getPreferenceStore()); _serialNameEditor.setPage(this); _serialNameEditor.setEmptyStringAllowed(false); _serialNameEditor.setErrorMessage("The serial name must be supplied"); _serialNameEditor.load(); _serialName = _serialNameEditor.getStringValue(); final GridLayout urlLayout = (GridLayout) container.getLayout(); urlLayout.numColumns = 3; container.layout(); setControl(container); }
From source file:org.occiware.clouddesigner.occi.docker.preference.preferences.DockerPreference.java
License:Open Source License
public void propertyChange(PropertyChangeEvent event) { super.propertyChange(event); if (event.getProperty().equals(FieldEditor.VALUE)) { checkState();/* w ww .j a v a2 s .c om*/ } }
From source file:org.rdkit.knime.extensions.aggregration.RDKitMcsAggregationPreferencePage.java
License:Open Source License
/** * {@inheritDoc}/*from www.j av a 2 s . co m*/ * @see org.eclipse.jface.preference.FieldEditorPreferencePage#propertyChange(org.eclipse.jface.util.PropertyChangeEvent) */ @Override public void propertyChange(final PropertyChangeEvent event) { super.propertyChange(event); if (event.getProperty().equals(FieldEditor.VALUE)) { checkState(); } }
From source file:org.wesnoth.preferences.WesnothPreferencesPage.java
License:Open Source License
@Override public void propertyChange(PropertyChangeEvent event) { super.propertyChange(event); if (event.getProperty().equals(FieldEditor.VALUE)) checkState();/*from w w w . j av a 2s . c om*/ }
From source file:org.xmind.cathy.internal.GeneralPrefPage.java
License:Open Source License
public void propertyChange(PropertyChangeEvent event) { super.propertyChange(event); if (event.getSource() instanceof FieldEditor) { FieldEditor fe = (FieldEditor) event.getSource(); if (event.getProperty().equals(FieldEditor.VALUE)) { String prefName = fe.getPreferenceName(); if (CathyPlugin.AUTO_SAVE_ENABLED.equals(prefName)) { autoSaveIntervalsInput.setEnabled(((Boolean) event.getNewValue()).booleanValue()); // autoSaveIntervalsField.setEnabled( // (Boolean) event.getNewValue(), // autoSaveIntervalsParent); } else if (PrefConstants.AUTO_BACKUP_ENABLE.equals(prefName)) { autoBackup = ((Boolean) event.getNewValue()).booleanValue(); }/*w ww . j a va2s .c om*/ } } }
From source file:sernet.gs.ui.rcp.main.preferences.ClientServerPreferencePage.java
License:Open Source License
@Override public void propertyChange(PropertyChangeEvent event) { super.propertyChange(event); if (event.getProperty().equals(FieldEditor.VALUE) && event.getSource() == operationMode) { newServerMode = (String) event.getNewValue(); boolean servermode = newServerMode.equals(PreferenceConstants.OPERATION_MODE_REMOTE_SERVER); serverURI.setEnabled(servermode, getFieldEditorParent()); }//from w ww . j a v a 2 s . c o m if (event.getProperty().equals(FieldEditor.VALUE) && event.getSource() == serverURI) { newUrl = (String) event.getNewValue(); } }
From source file:sernet.gs.ui.rcp.main.preferences.DatenbankPreferencePage.java
License:Open Source License
@Override public void propertyChange(PropertyChangeEvent event) { super.propertyChange(event); if (event.getProperty().equals(FieldEditor.VALUE)) { if (event.getSource() == dbDriver) { setDefaults((String) event.getNewValue()); }/*from w w w.j a v a2s .c o m*/ checkState(); } modified = true; }