/** * Sets the range of valid values for this field. * * @param min the minimum allowed value (inclusive) * @param max the maximum allowed value (inclusive) */ public void setValidRange(int min, int max) { minValidValue = min; maxValidValue = max; setErrorMessage(JFaceResources.format("IntegerFieldEditor.errorMessageRange", //$NON-NLS-1$ Integer.valueOf(min), Integer.valueOf(max))); }
/** * Sets the range of valid values for this field. * * @param min the minimum allowed value (inclusive) * @param max the maximum allowed value (inclusive) */ public void setValidRange(int min, int max) { minValidValue = min; maxValidValue = max; setErrorMessage(JFaceResources.format("IntegerFieldEditor.errorMessageRange", //$NON-NLS-1$ Integer.valueOf(min), Integer.valueOf(max))); }
/** * Sets the range of valid values for this field. * * @param min the minimum allowed value (inclusive) * @param max the maximum allowed value (inclusive) */ public void setValidRange(int min, int max) { minValidValue = min; maxValidValue = max; setErrorMessage(JFaceResources.format( "IntegerFieldEditor.errorMessageRange", //$NON-NLS-1$ new Object[] { new Integer(min), new Integer(max) })); }
.length()); recentFilesEditor .setErrorMessage(NLS.bind(WorkbenchMessages.WorkbenchPreference_recentFilesError, Integer.valueOf(EditorHistory.MAX_SIZE))); recentFilesEditor
saveInterval.setPage(this); saveInterval.setTextLimit(Integer.toString(MAX_SAVE_INTERVAL).length()); saveInterval.setErrorMessage(NLS.bind( WorkbenchMessages.WorkbenchPreference_workbenchSaveIntervalError, Integer.valueOf(MAX_SAVE_INTERVAL))); saveInterval.setValidateStrategy(StringFieldEditor.VALIDATE_ON_KEY_STROKE);
saveInterval.setTextLimit(Integer.toString( IDEInternalPreferences.MAX_SAVE_INTERVAL).length()); saveInterval.setErrorMessage(NLS.bind(IDEWorkbenchMessages.WorkbenchPreference_saveIntervalError, Integer.valueOf(IDEInternalPreferences.MAX_SAVE_INTERVAL))); saveInterval
private void createReadBufferField(Composite composite) { bufferEditor = new IntegerFieldEditor(ILogViewerConstants.PREF_BUFFER,LogViewerPlugin.getResourceString("preferences.buffer.label.text"),composite); //$NON-NLS-1$ bufferEditor.setPreferenceStore(doGetPreferenceStore()); bufferEditor.setPage(this); bufferEditor.setTextLimit(Integer.toString(ILogViewerConstants.MAX_TAIL_BUFFER_SIZE).length()); bufferEditor.setErrorMessage(LogViewerPlugin.getResourceString("preferences.buffer.label.errortext",new Object[]{new Integer(ILogViewerConstants.MAX_TAIL_BUFFER_SIZE)})); //$NON-NLS-1$ bufferEditor.setValidateStrategy(StringFieldEditor.VALIDATE_ON_KEY_STROKE); bufferEditor.setValidRange(0,ILogViewerConstants.MAX_TAIL_BUFFER_SIZE); bufferEditor.load(); bufferEditor.setPropertyChangeListener(validityChangeListener); }
private void createReadWaitField(Composite composite) { readWaitEditor = new IntegerFieldEditor(ILogViewerConstants.PREF_READWAIT,LogViewerPlugin.getResourceString("preferences.readwait.label.text"),composite); //$NON-NLS-1$ readWaitEditor.setPreferenceStore(doGetPreferenceStore()); readWaitEditor.setPage(this); readWaitEditor.setTextLimit(Integer.toString(ILogViewerConstants.MAX_READWAIT_SIZE).length()); readWaitEditor.setErrorMessage(LogViewerPlugin.getResourceString("preferences.readwait.label.errortext",new Object[]{new Integer(ILogViewerConstants.MAX_READWAIT_SIZE)})); //$NON-NLS-1$ readWaitEditor.setValidateStrategy(StringFieldEditor.VALIDATE_ON_KEY_STROKE); readWaitEditor.setValidRange(0,ILogViewerConstants.MAX_READWAIT_SIZE); readWaitEditor.load(); readWaitEditor.setPropertyChangeListener(validityChangeListener); }
reuseEditorsThreshold.setPage(this); reuseEditorsThreshold.setTextLimit(2); reuseEditorsThreshold.setErrorMessage(WorkbenchMessages.WorkbenchPreference_reuseEditorsThresholdError); reuseEditorsThreshold .setValidateStrategy(StringFieldEditor.VALIDATE_ON_KEY_STROKE);
private void createBacklogField(Composite composite) { backlogEditor = new IntegerFieldEditor(ILogViewerConstants.PREF_BACKLOG,LogViewerPlugin.getResourceString("preferences.backlog.label.text"),composite); //$NON-NLS-1$ backlogEditor.setPreferenceStore(doGetPreferenceStore()); backlogEditor.setPage(this); backlogEditor.setTextLimit(Integer.toString(ILogViewerConstants.MAX_BACKLOG).length()); backlogEditor.setErrorMessage(LogViewerPlugin.getResourceString("preferences.backlog.label.errortext",new Object[]{new Integer(ILogViewerConstants.MAX_BACKLOG)})); //$NON-NLS-1$ backlogEditor.setValidateStrategy(StringFieldEditor.VALIDATE_ON_KEY_STROKE); backlogEditor.setValidRange(0,ILogViewerConstants.MAX_BACKLOG); backlogEditor.load(); backlogEditor.setPropertyChangeListener(validityChangeListener); }
/** * Creates an integer field editor. * * @param name the name of the preference this field editor works on * @param labelText the label text of the field editor * @param parent the parent of the field editor's control * @param textLimit the maximum number of characters in the text. */ public IntegerFieldEditor(String name, String labelText, Composite parent, int textLimit) { init(name, labelText); setTextLimit(textLimit); setEmptyStringAllowed(false); setErrorMessage(JFaceResources .getString("IntegerFieldEditor.errorMessage"));//$NON-NLS-1$ createControl(parent); }
/** * Creates an integer field editor. * * @param name the name of the preference this field editor works on * @param labelText the label text of the field editor * @param parent the parent of the field editor's control * @param textLimit the maximum number of characters in the text. */ public IntegerFieldEditor(String name, String labelText, Composite parent, int textLimit) { init(name, labelText); setTextLimit(textLimit); setEmptyStringAllowed(false); setErrorMessage(JFaceResources .getString("IntegerFieldEditor.errorMessage"));//$NON-NLS-1$ createControl(parent); }
/** * Creates an integer field editor. * * @param name the name of the preference this field editor works on * @param labelText the label text of the field editor * @param parent the parent of the field editor's control * @param textLimit the maximum number of characters in the text. */ public IntegerFieldEditor(String name, String labelText, Composite parent, int textLimit) { init(name, labelText); setTextLimit(textLimit); setEmptyStringAllowed(false); setErrorMessage(JFaceResources .getString("IntegerFieldEditor.errorMessage"));//$NON-NLS-1$ createControl(parent); }
maxNumberOfElementPassed.setErrorMessage( Messages.getFormattedString( "designer.preview.preference.numberOfElementPassedToGetSchema.errormessage", new Object[]{new Integer( MAX_INTEGER ) } ) );
/** * Creates a widget with a text, a text field (to handle the interval) and a * text. */ private void createIntervalPart() { intervalComposite = new Composite(autoSaveGroup, SWT.NONE); final GridLayout intervalCompositeLayout = new GridLayout(); intervalCompositeLayout.numColumns = 2; intervalCompositeLayout.marginWidth = 0; intervalCompositeLayout.marginHeight = 10; intervalComposite.setLayout(intervalCompositeLayout); final GridData intervalCompositeLayoutData = new GridData(SWT.FILL, SWT.FILL, true, false); intervalComposite.setLayoutData(intervalCompositeLayoutData); intervalComposite.setEnabled(autoSaveButton.getSelection()); intervalField = new IntegerFieldEditor(IPreferenceConstants.SAVE_AUTOMATICALLY_INTERVAL, "", //$NON-NLS-1$ intervalComposite); intervalField.setLabelText(IDEWorkbenchMessages.AutoSavePreferencPage_intervalMessage); intervalField.setPreferenceStore(WorkbenchPlugin.getDefault().getPreferenceStore()); intervalField.setPage(this); intervalField.setTextLimit(10); intervalField.setErrorMessage(IDEWorkbenchMessages.AutoSavePreferencPage_errorMessage); intervalField.setValidateStrategy(StringFieldEditor.VALIDATE_ON_KEY_STROKE); intervalField.setValidRange(1, Integer.MAX_VALUE); intervalField.load(); intervalField.getLabelControl(intervalComposite).setEnabled(autoSaveButton.getSelection()); intervalField.getTextControl(intervalComposite).setEnabled(autoSaveButton.getSelection()); intervalField.setPropertyChangeListener(validityChangeListener); }
timeout.setValidRange(minValue, maxValue); timeout.setValidateStrategy(StringFieldEditor.VALIDATE_ON_KEY_STROKE); timeout.setErrorMessage(MessageFormat.format(AntPreferencesMessages.AntPreferencePage_14, new Object[] { Integer.valueOf(minValue), Integer.valueOf(maxValue) })); addField(timeout);
int historyMax = IDebugPreferenceConstants.MAX_LAUNCH_HISTORY_SIZE; editor.setTextLimit(Integer.toString(historyMax).length()); editor.setErrorMessage(MessageFormat.format(DebugPreferencesMessages.DebugPreferencePage_11, new Object[] { Integer.valueOf(1), Integer.valueOf(historyMax)})); editor.setValidateStrategy(StringFieldEditor.VALIDATE_ON_KEY_STROKE); editor.setValidRange(1, historyMax);