List of usage examples for org.eclipse.jface.preference FieldEditor IS_VALID
String IS_VALID
To view the source code for org.eclipse.jface.preference FieldEditor IS_VALID.
Click Source Link
"field_editor_is_valid"
) to signal a change in the validity of the value of this field editor. From source file:org.eclipse.datatools.engagement.marklogic.ui.preference.DataSetPreferencePage.java
License:Open Source License
protected Control createContents(Composite parent) { Composite mainComposite = new Composite(parent, SWT.NONE); GridLayout layout = new GridLayout(); layout.marginWidth = 0;/* w w w . java 2s . c o m*/ mainComposite.setLayout(layout); Group columnMappingPageGroup = new Group(mainComposite, SWT.NONE); columnMappingPageGroup.setLayout(layout); columnMappingPageGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); columnMappingPageGroup .setText(Messages.getString("designer.preview.preference.columnMappingPage.group.title")); //$NON-NLS-1$ //Set up the maximum number of schemas to be fetched in SQLDataSetPage. maxNumberOfElementPassed = new IntegerFieldEditor(USER_MAX_NUM_OF_ELEMENT_PASSED, Messages.getString("designer.preview.preference.numberOfElementPassedToGetSchema"), //$NON-NLS-1$ columnMappingPageGroup); // adjust the parent layout margin set by the field editor GridLayout groupLayout = (GridLayout) columnMappingPageGroup.getLayout(); groupLayout.marginWidth = 5; groupLayout.marginHeight = 5; maxNumberOfElementPassed.setPage(this); maxNumberOfElementPassed.setTextLimit(Integer.toString(MAX_INTEGER).length()); maxNumberOfElementPassed.setValidateStrategy(StringFieldEditor.VALIDATE_ON_KEY_STROKE); maxNumberOfElementPassed.setValidRange(0, MAX_INTEGER); maxNumberOfElementPassed.setPropertyChangeListener(new IPropertyChangeListener() { public void propertyChange(PropertyChangeEvent event) { if (event.getProperty().equals(FieldEditor.IS_VALID)) setValid(maxNumberOfElementPassed.isValid()); } }); maxNumberOfElementPassed.setErrorMessage(Messages.getFormattedString( "designer.preview.preference.numberOfElementPassedToGetSchema.errormessage", //$NON-NLS-1$ new Object[] { new Integer(MAX_INTEGER) })); String defaultMaxSchema = UiPlugin.getDefault().getPluginPreferences() .getString(USER_MAX_NUM_OF_ELEMENT_PASSED); if (defaultMaxSchema == null || defaultMaxSchema.trim().length() <= 0) { defaultMaxSchema = String.valueOf(DEFAULT_MAX_NUM_OF_ELEMENT_PARSED); } maxNumberOfElementPassed.setStringValue(defaultMaxSchema); XMLRelationInfoUtil.setSystemHelp(getControl(), IHelpConstants.CONEXT_ID_PREFERENCE_DATASET_XML); return mainComposite; }
From source file:org.eclipse.debug.internal.ui.preferences.ConsolePreferencePage.java
License:Open Source License
/** * @see org.eclipse.jface.util.IPropertyChangeListener#propertyChange(org.eclipse.jface.util.PropertyChangeEvent) *//*from ww w .j av a 2 s .co m*/ public void propertyChange(PropertyChangeEvent event) { if (event.getProperty().equals(FieldEditor.IS_VALID)) { boolean newValue = ((Boolean) event.getNewValue()).booleanValue(); // If the new value is true then we must check all field editors. // If it is false, then the page is invalid in any case. if (newValue) { if (fWidthEditor != null && event.getSource() != fWidthEditor) { fWidthEditor.refreshValidState(); } if (fBufferSizeEditor != null && event.getSource() != fBufferSizeEditor) { fBufferSizeEditor.refreshValidState(); } checkState(); } else { super.propertyChange(event); } } else { super.propertyChange(event); } }
From source file:org.eclipse.jdt.internal.debug.ui.JavaDebugPreferencePage.java
License:Open Source License
public void propertyChange(PropertyChangeEvent event) { if (event.getProperty().equals(FieldEditor.IS_VALID)) { boolean newValue = ((Boolean) event.getNewValue()).booleanValue(); // If the new value is true then we must check all field editors. // If it is false, then the page is invalid in any case. if (newValue) { if (fTimeoutText != null && event.getSource() != fTimeoutText) { fTimeoutText.refreshValidState(); }/* ww w. j av a 2 s.co m*/ if (fConnectionTimeoutText != null && event.getSource() != fConnectionTimeoutText) { fConnectionTimeoutText.refreshValidState(); } } setValid(fTimeoutText.isValid() && fConnectionTimeoutText.isValid()); getContainer().updateButtons(); updateApplyButton(); } }
From source file:org.eclipse.ocl.common.ui.internal.preferences.AbstractProjectPreferencePage.java
License:Open Source License
/** * The field editor preference page implementation of this <code>IPreferencePage</code> * (and <code>IPropertyChangeListener</code>) method intercepts <code>IS_VALID</code> * events but passes other events on to its superclass. *//*from w w w .j av a 2 s . c om*/ public void propertyChange(PropertyChangeEvent event) { if (event.getProperty().equals(FieldEditor.IS_VALID)) { boolean newValue = ((Boolean) event.getNewValue()).booleanValue(); // If the new value is true then we must check all field editors. // If it is false, then the page is invalid in any case. if (newValue) { checkState(); } else { invalidFieldEditor = (IFieldEditor) event.getSource(); setValid(newValue); } } }
From source file:org.eclipse.team.internal.ccvs.ui.repo.RepositoryEncodingPropertyPage.java
License:Open Source License
public void propertyChange(PropertyChangeEvent event) { if (event.getProperty() == FieldEditor.IS_VALID) { setValid(((Boolean) event.getNewValue()).booleanValue()); return;//from w ww. j a v a2 s. c om } else if (event.getProperty() == FieldEditor.VALUE) { valueChanged = true; return; } }
From source file:org.eclipse.titan.designer.properties.pages.FieldEditorPropertyPage.java
License:Open Source License
/** * The field editor preference page implementation of this * <code>IPreferencePage</code> (and * <code>IPropertyChangeListener</code>) method intercepts * <code>IS_VALID</code> events but passes other events on to its * superclass.//from w w w . j a v a 2 s .c o m */ @Override public void propertyChange(final PropertyChangeEvent event) { if (event.getProperty().equals(FieldEditor.IS_VALID)) { boolean newValue = ((Boolean) event.getNewValue()).booleanValue(); if (newValue) { checkState(); } else { setValid(newValue); } } }
From source file:org.eclipse.titan.executor.properties.FieldEditorPropertyPage.java
License:Open Source License
/** * The field editor preference page implementation of this * <code>IPreferencePage</code> (and <code>IPropertyChangeListener</code>) * method intercepts <code>IS_VALID</code> events but passes other events on * to its superclass./*from www . ja v a2s . c om*/ */ @Override public void propertyChange(final PropertyChangeEvent event) { if (event.getProperty().equals(FieldEditor.IS_VALID)) { boolean newValue = (Boolean) event.getNewValue(); if (newValue) { checkState(); } else { setValid(newValue); } } }
From source file:org.eclipse.ui.internal.dialogs.WorkbenchPreferencePage.java
License:Open Source License
/** * Create a composite that contains entry fields specifying save interval * preference./* w ww .j av a 2s .com*/ * * @param composite * the Composite the group is created in. */ private void createSaveIntervalGroup(Composite composite) { Composite groupComposite = new Composite(composite, SWT.LEFT); GridLayout layout = new GridLayout(); layout.numColumns = 2; groupComposite.setLayout(layout); GridData gd = new GridData(); gd.horizontalAlignment = GridData.FILL; gd.grabExcessHorizontalSpace = true; groupComposite.setLayoutData(gd); saveInterval = new IntegerFieldEditor(IPreferenceConstants.WORKBENCH_SAVE_INTERVAL, WorkbenchMessages.WorkbenchPreference_workbenchSaveInterval, groupComposite); // @issue we should drop our preference constant and let clients use // core's pref. ours is not up-to-date anyway if someone changes this // interval directly thru core api. saveInterval.setPreferenceStore(getPreferenceStore()); saveInterval.setPage(this); saveInterval.setTextLimit(Integer.toString(MAX_SAVE_INTERVAL).length()); saveInterval.setErrorMessage(NLS.bind(WorkbenchMessages.WorkbenchPreference_workbenchSaveIntervalError, new Integer(MAX_SAVE_INTERVAL))); saveInterval.setValidateStrategy(StringFieldEditor.VALIDATE_ON_KEY_STROKE); saveInterval.setValidRange(0, MAX_SAVE_INTERVAL); saveInterval.load(); saveInterval.setPropertyChangeListener(new IPropertyChangeListener() { public void propertyChange(PropertyChangeEvent event) { if (event.getProperty().equals(FieldEditor.IS_VALID)) { setValid(saveInterval.isValid()); } } }); }
From source file:org.eclipse.ui.internal.ide.dialogs.IDEWorkspacePreferencePage.java
License:Open Source License
/** * Create a composite that contains entry fields specifying save interval * preference.//from w w w.j a v a 2s . c o m * * @param composite the Composite the group is created in. */ private void createSaveIntervalGroup(Composite composite) { Composite groupComposite = new Composite(composite, SWT.LEFT); GridLayout layout = new GridLayout(); layout.numColumns = 2; groupComposite.setLayout(layout); GridData gd = new GridData(); gd.horizontalAlignment = GridData.FILL; gd.grabExcessHorizontalSpace = true; groupComposite.setLayoutData(gd); saveInterval = new IntegerFieldEditor(IDEInternalPreferences.SAVE_INTERVAL, IDEWorkbenchMessages.WorkbenchPreference_saveInterval, groupComposite); // @issue we should drop our preference constant and let clients use // core's pref. ours is not up-to-date anyway if someone changes this // interval directly thru core api. saveInterval.setPreferenceStore(getIDEPreferenceStore()); saveInterval.setPage(this); saveInterval.setTextLimit(Integer.toString(IDEInternalPreferences.MAX_SAVE_INTERVAL).length()); saveInterval.setErrorMessage(NLS.bind(IDEWorkbenchMessages.WorkbenchPreference_saveIntervalError, new Integer(IDEInternalPreferences.MAX_SAVE_INTERVAL))); saveInterval.setValidateStrategy(StringFieldEditor.VALIDATE_ON_KEY_STROKE); saveInterval.setValidRange(1, IDEInternalPreferences.MAX_SAVE_INTERVAL); IWorkspaceDescription description = ResourcesPlugin.getWorkspace().getDescription(); long interval = description.getSnapshotInterval() / 60000; saveInterval.setStringValue(Long.toString(interval)); saveInterval.setPropertyChangeListener(new IPropertyChangeListener() { public void propertyChange(PropertyChangeEvent event) { if (event.getProperty().equals(FieldEditor.IS_VALID)) { setValid(saveInterval.isValid()); } } }); }
From source file:org.eclipse.ui.internal.ide.dialogs.IDEWorkspacePreferencePage.java
License:Open Source License
/** * Create a composite that contains the encoding controls * //from ww w . ja v a 2 s . co m * @param parent */ private void createEncodingEditorControls(Composite parent) { Composite encodingComposite = new Composite(parent, SWT.NONE); encodingComposite.setLayout(new GridLayout()); encodingComposite.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.GRAB_HORIZONTAL)); encodingEditor = new ResourceEncodingFieldEditor(IDEWorkbenchMessages.WorkbenchPreference_encoding, encodingComposite, ResourcesPlugin.getWorkspace().getRoot()); encodingEditor.setPage(this); encodingEditor.load(); encodingEditor.setPropertyChangeListener(new IPropertyChangeListener() { /* (non-Javadoc) * @see org.eclipse.jface.util.IPropertyChangeListener#propertyChange(org.eclipse.jface.util.PropertyChangeEvent) */ public void propertyChange(PropertyChangeEvent event) { if (event.getProperty().equals(FieldEditor.IS_VALID)) { setValid(encodingEditor.isValid()); } } }); }