.getPreferenceStore()); recentFilesEditor.setPage(this); recentFilesEditor.setTextLimit(Integer.toString(EditorHistory.MAX_SIZE) .length()); recentFilesEditor
saveInterval.setTextLimit(Integer.toString(MAX_SAVE_INTERVAL).length()); saveInterval.setErrorMessage(NLS.bind( WorkbenchMessages.WorkbenchPreference_workbenchSaveIntervalError, Integer.valueOf(MAX_SAVE_INTERVAL)));
.getPreferenceStore()); reuseEditorsThreshold.setPage(this); reuseEditorsThreshold.setTextLimit(2); reuseEditorsThreshold.setErrorMessage(WorkbenchMessages.WorkbenchPreference_reuseEditorsThresholdError); reuseEditorsThreshold
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); }
saveInterval.setTextLimit(Integer.toString( IDEInternalPreferences.MAX_SAVE_INTERVAL).length()); saveInterval.setErrorMessage(NLS.bind(IDEWorkbenchMessages.WorkbenchPreference_saveIntervalError,
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); }
/** * 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 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); }
/** * 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.setTextLimit( Integer.toString( MAX_INTEGER ).length( ) );
addField(editor); 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);