private FieldEditor createSlowTestWarningCutoffEditor() { IntegerFieldEditor editor = new IntegerFieldEditor(SLOW_TEST_WARNING, "Slow Test Warning (milliseconds)", getFieldEditorParent()); editor.setEmptyStringAllowed(false); editor.setValidRange(1, MAX_VALUE); return editor; }
private FieldEditor createParallelizationEditor() { IntegerFieldEditor editor = new IntegerFieldEditor(PARALLEL_CORES, "Projects Tested Concurrently", getFieldEditorParent()); editor.setEmptyStringAllowed(false); editor.setValidRange(1, MultiCoreConcurrencyController.DEFAULT_MAX_CORES); return editor; }
recentFilesEditor .setValidateStrategy(StringFieldEditor.VALIDATE_ON_KEY_STROKE); recentFilesEditor.setValidRange(0, EditorHistory.MAX_SIZE); recentFilesEditor.load(); recentFilesEditor.setPropertyChangeListener(validityChangeListener);
WorkbenchMessages.WorkbenchPreference_workbenchSaveIntervalError, Integer.valueOf(MAX_SAVE_INTERVAL))); saveInterval.setValidateStrategy(StringFieldEditor.VALIDATE_ON_KEY_STROKE); saveInterval.setValidRange(0, MAX_SAVE_INTERVAL);
reuseEditorsThreshold .setValidateStrategy(StringFieldEditor.VALIDATE_ON_KEY_STROKE); reuseEditorsThreshold.setValidRange(1, 99); reuseEditorsThreshold.load(); reuseEditorsThreshold.getLabelControl(editorReuseThresholdGroup)
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 .setValidateStrategy(StringFieldEditor.VALIDATE_ON_KEY_STROKE); saveInterval.setValidRange(1, IDEInternalPreferences.MAX_SAVE_INTERVAL);
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.setValidRange(1, Integer.MAX_VALUE); maxItersField.setPage(this); maxItersField.setPreferenceStore(getPreferenceStore());
/** * 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); }
maxNumberOfElementPassed.setValidRange(0, MAX_INTEGER);
private Group createPanelSettings(final Composite parent) { final Group group = new Group(parent, SWT.NONE); group.setText("Panel"); group.setLayout(new GridLayout(1, false)); group.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); final Composite composite = new Composite(group, SWT.NONE); composite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); createCurrentWindowOption(composite); addField(new BooleanFieldEditor(PANEL_STARTUP, "Show at startup", composite)); addField(new BooleanFieldEditor(PANEL_STATUS_LINE, "Show panel in status line when possible", composite)); addField(new BooleanFieldEditor(PANEL_DIRECTIONS, "Show direction buttons", composite)); addField(new BooleanFieldEditor(PANEL_CLOSE, "Show close button", composite)); addField(new BooleanFieldEditor(PANEL_AUTO_INDEXING, "Enable auto indexing", composite)); addField(new BooleanFieldEditor(SEARCH_INCREMENTAL, "Enable incremental search", composite)); final IntegerFieldEditor maxIndexingDepthEditor = new IntegerFieldEditor(PANEL_MAX_INDEXING_DEPTH, "Max indexing depth for trees:", composite); maxIndexingDepthEditor.setValidRange(1, Integer.MAX_VALUE); addField(maxIndexingDepthEditor); addField(new IntegerFieldEditor(PANEL_TEXT_SIZE, "Default box width in chars:", composite)); return group; }
protected void createFieldEditors() { addField(new IntegerFieldEditor("launchCount", "Number of times it has been launched", getFieldEditorParent())); IntegerFieldEditor offset = new IntegerFieldEditor("offset", "Current offset from GMT", getFieldEditorParent()); offset.setValidRange(-14, +12); addField(offset); String[][] data = ZoneId.getAvailableZoneIds()// .stream().sorted().map(s -> new String[] { s, s }) // .collect(Collectors.toList()).toArray(new String[][] {}); addField(new ComboFieldEditor("favorite", "Favorite time zone", data, getFieldEditorParent())); addField(new BooleanFieldEditor("tick", "Boolean value", getFieldEditorParent())); addField(new ColorFieldEditor("colour", "Favourite colour", getFieldEditorParent())); addField(new ScaleFieldEditor("scale", "Scale", getFieldEditorParent(), 0, 360, 10, 90)); addField(new FileFieldEditor("file", "Pick a file", getFieldEditorParent())); addField(new DirectoryFieldEditor("dir", "Pick a directory", getFieldEditorParent())); addField(new PathEditor("path", "Path", "Directory", getFieldEditorParent())); addField(new RadioGroupFieldEditor("group", "Radio choices", 3, data, getFieldEditorParent(), true)); }
int minValue = DefaultScope.INSTANCE.getNode(AntLaunching.getUniqueIdentifier()).getInt(IAntLaunchingPreferenceConstants.ANT_COMMUNICATION_TIMEOUT, 20000); int maxValue = 1200000; timeout.setValidRange(minValue, maxValue); timeout.setValidateStrategy(StringFieldEditor.VALIDATE_ON_KEY_STROKE); timeout.setErrorMessage(MessageFormat.format(AntPreferencesMessages.AntPreferencePage_14, new Object[] { Integer.valueOf(minValue),
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); editor.setEmptyStringAllowed(false);
periodicReindexInterval = new IntegerFieldEditor(PreferenceConstants.P_INDEX_UPDATE_INTERVAL, "Automatic Reindex interval (ms)", getFieldEditorParent()); periodicReindexInterval.setValidRange(0, Integer.MAX_VALUE); addField(periodicReindexInterval);