recentFilesEditor.setPage(this); recentFilesEditor.setTextLimit(Integer.toString(EditorHistory.MAX_SIZE) .length());
saveInterval.setPage(this); saveInterval.setTextLimit(Integer.toString(MAX_SAVE_INTERVAL).length()); saveInterval.setErrorMessage(NLS.bind(
reuseEditorsThreshold.setPage(this); reuseEditorsThreshold.setTextLimit(2); reuseEditorsThreshold.setErrorMessage(WorkbenchMessages.WorkbenchPreference_reuseEditorsThresholdError);
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.setPage(this); saveInterval.setTextLimit(Integer.toString( IDEInternalPreferences.MAX_SAVE_INTERVAL).length());
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); }
private IntegerFieldEditor createIntegerField(final Composite parent, final String name, final String text, final int min, final int max) { final IntegerFieldEditor editor = new IntegerFieldEditor(name, text, parent); editor.setPreferenceStore(getPreferenceStore()); editor.setPage(this); editor.setValidRange(min, max); editor.setPropertyChangeListener(this); editor.load(); return editor; }
maxItersField.setPage(this); maxItersField.setPreferenceStore(getPreferenceStore()); maxItersField.setPropertyChangeListener(validityChangeListener);
/** * 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); }
lab.setText(Messages.getString("designer.preview.preference.numberOfElementPassedToGetSchema" )); maxNumberOfElementPassed.setPage(this); maxNumberOfElementPassed.setTextLimit( Integer.toString( MAX_INTEGER ).length( ) );