@Override protected void createFieldEditors() { Composite parent = getFieldEditorParent(); RadioGroupFieldEditor autoFoldCommentChoice = new RadioGroupFieldEditor( SolidityPreferences.FOLDING_COMMENT_AUTOFOLD , "Auto-fold comments" , 1 , new String[][] { {"None", SolidityPreferences.FOLDING_COMMENT_AUTOFOLD_NONE} ,{"Only header comment", SolidityPreferences.FOLDING_COMMENT_AUTOFOLD_HEADER} ,{"All", SolidityPreferences.FOLDING_COMMENT_AUTOFOLD_ALL} } , parent); addField(autoFoldCommentChoice); IntegerFieldEditor longCommentLineCount = new IntegerFieldEditor( SolidityPreferences.FOLDING_COMMENT_LINECOUNT , "Enable folding for comments exceeding line count" , parent); addField(longCommentLineCount); }
/** * Creates the page components. */ protected void createFieldEditors() { TexlipsePreferencePage.addSpacer(getFieldEditorParent()); addField(new BooleanFieldEditor(TexlipseProperties.INDENTATION, TexlipsePlugin.getResourceString("preferenceIndentEnabledLabel"), getFieldEditorParent())); String message = TexlipsePlugin.getResourceString("preferenceIndentLevelLabel").replaceFirst("%1", "" + MIN_INDENTATION).replaceFirst("%2", "" + MAX_INDENTATION); final IntegerFieldEditor indentationWidth = new IntegerFieldEditor(TexlipseProperties.INDENTATION_LEVEL, message, getFieldEditorParent()); indentationWidth.setValidateStrategy(IntegerFieldEditor.VALIDATE_ON_KEY_STROKE); indentationWidth.setValidRange(MIN_INDENTATION, MAX_INDENTATION); if (TexlipsePlugin.getDefault().getPreferenceStore().getBoolean(TexlipseProperties.INDENTATION_TABS)) { indentationWidth.setEnabled(false, getFieldEditorParent()); } addField(indentationWidth); BooleanFieldEditor indentationTabs = new BooleanFieldEditor(TexlipseProperties.INDENTATION_TABS, TexlipsePlugin.getResourceString("preferenceIndentTabsLabel"), getFieldEditorParent()){ @Override protected void valueChanged(boolean oldValue, boolean newValue) { super.valueChanged(oldValue, newValue); if (newValue == true) indentationWidth.setEnabled(false, getFieldEditorParent()); else indentationWidth.setEnabled(true, getFieldEditorParent()); } }; addField(indentationTabs); TexlipsePreferencePage.addSpacer(getFieldEditorParent()); addField(new StringListFieldEditor(TexlipseProperties.INDENTATION_ENVS, TexlipsePlugin.getResourceString("preferenceIndentEnvsLabel"), getFieldEditorParent())); }
/** * {@inheritDoc} */ @Override protected void createFieldEditors() { hostname = new StringFieldEditor(HACPreferenceConstants.P_HOSTNAME_URL, PreferencePage.Label.HOSTNAME_URL_INPUT_TEXT, getFieldEditorParent()); username = new StringFieldEditor(HACPreferenceConstants.P_USERNAME, PreferencePage.Label.USERNAME_INPUT_TEXT, getFieldEditorParent()); password = new StringFieldEditor(HACPreferenceConstants.P_PASSWORD, PreferencePage.Label.PASSWORD_INPUT_TEXT, getFieldEditorParent()) { @Override protected void doFillIntoGrid(final Composite parent, final int numColumns) { super.doFillIntoGrid(parent, numColumns); getTextControl().setEchoChar('*'); } }; timeout = new IntegerFieldEditor(HACPreferenceConstants.P_TIMEOUT, PreferencePage.Label.TIMEOUT_INPUT_TEXT, getFieldEditorParent()); addField(hostname); addField(username); addField(password); addField(timeout); }
private void createPollChangesIntervalGroup(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); pollChangesInterval = new IntegerFieldEditor(POLL_CHANGES_INTERVAL_PREF, "Poll changes interval (seconds)", groupComposite); pollChangesInterval.setTextLimit(Integer.toString(MAX_POLL_CHANGES_INTERVAL).length()); pollChangesInterval.setErrorMessage("The workspace save interval should be between 30 and 9999."); pollChangesInterval.setValidateStrategy(StringFieldEditor.VALIDATE_ON_KEY_STROKE); pollChangesInterval.setValidRange(MIN_POLL_CHANGES_INTERVAL, MAX_POLL_CHANGES_INTERVAL); pollChangesInterval.setPropertyChangeListener(event -> { if (event.getProperty().equals(FieldEditor.IS_VALID)) { setValid(pollChangesInterval.isValid()); } }); addField(pollChangesInterval); }
/** * Creates the field editors. Field editors are abstractions of * the common GUI blocks needed to manipulate various types * of preferences. Each field editor knows how to save and * restore itself. */ public void createFieldEditors() { /* addField(new DirectoryFieldEditor(PreferenceConstants.P_PATH, "&Directory preference:", getFieldEditorParent())); addField(new BooleanFieldEditor(PreferenceConstants.P_BOOLEAN, "&An example of a boolean preference", getFieldEditorParent())); addField(new RadioGroupFieldEditor(PreferenceConstants.P_CHOICE, "An example of a multiple-choice preference", 1, new String[][] { { "&Choice 1", "choice1" }, { "C&hoice 2", "choice2" } }, getFieldEditorParent())); addField(new StringFieldEditor(PreferenceConstants.P_STRING, "A &text preference:", getFieldEditorParent())); */ addField(new BooleanFieldEditor(IPreferenceConstants.I_RESTORE_LAST_SPEC, "&Continue Previous Session on Restart", getFieldEditorParent())); IntegerFieldEditor minStorageSizeEditor = new IntegerFieldEditor(IPreferenceConstants.I_MIN_DISPLAYED_SIZE, "&Minimum spec storage displayed (in kilobytes)", getFieldEditorParent()); addField(minStorageSizeEditor); minStorageSizeEditor.setValidRange(0, 2000000); }
/** Create fields controlling editing assist behavior */ @Override public void createFieldEditors() { baseComp = SwtUtil.makeGroupComposite(getFieldEditorParent(), 1, 1, ""); SwtUtil.addLabel(baseComp, "Enable folding of:", 2); addField(new BooleanFieldEditor(FOLDING_FRONTMATTER_ENABLED, "Front matter block", baseComp)); addField(new BooleanFieldEditor(FOLDING_HIDDEN_COMMENTS_ENABLED, "Hidden comments", baseComp)); addField(new BooleanFieldEditor(FOLDING_CODEBLOCKS_ENABLED, "Code blocks", baseComp)); SwtUtil.addSpacer(baseComp, 2); SwtUtil.addLabel(baseComp, "Initially fold:", 2); addField(new BooleanFieldEditor(FOLDING_INITIAL_FRONT_MATTER, "Front matter block", baseComp)); addField(new BooleanFieldEditor(FOLDING_INITIAL_HIDDEN_COMMENTS, "Hidden comments", baseComp)); addField(new BooleanFieldEditor(FOLDING_INITIAL_CODEBLOCKS, "Code blocks", baseComp)); SwtUtil.addSpacer(baseComp, 2); addField(new IntegerFieldEditor(FOLDING_LINES_LIMIT, "Minimum number of lines to fold: ", baseComp, 6)); }
@Override protected void createFieldEditors() { nbMessageLineToDisplay = new IntegerFieldEditor( "events.nbMessageLineToDisplay", "Number of lines per event message (0: unlimited)", getFieldEditorParent()); addField(nbMessageLineToDisplay); Label label = new Label(getFieldEditorParent(), SWT.NONE); label.setText("Columns to be displayed:"); showColumSeqNum = new BooleanFieldEditor("events.showColumSeqNum", "Sequence Number", getFieldEditorParent()); showColumReception = new BooleanFieldEditor( "events.showColumReception", "Reception Time", getFieldEditorParent()); showColumnGeneration = new BooleanFieldEditor( "events.showColumnGeneration", "Generation Time", getFieldEditorParent()); addField(showColumSeqNum); addField(showColumReception); addField(showColumnGeneration); }
protected IntegerFieldEditor createIntegerFieldEditor(final String name, final String label, final Composite parent, final FieldEditorDetails details) { final IntegerFieldEditor fieldEditor = new IntegerFieldEditor(name, label, parent); if (details != null) { if (details.getEmptyStringAllowed() != null) { fieldEditor.setEmptyStringAllowed(details.getEmptyStringAllowed()); } if (details.getNumberMinimum() != null && details.getNumberMaximum() != null) { fieldEditor.setValidRange(details.getNumberMinimum().intValue(), details.getNumberMaximum().intValue()); fieldEditor.setTextLimit(Math.max(Integer.toString(details.getNumberMaximum().intValue()).length(), Integer.toString(details.getNumberMinimum().intValue()).length())); } if (details.getTextLimit() != null) { fieldEditor.setTextLimit(details.getTextLimit()); } } return fieldEditor; }
private void createUI(final Composite parent) { final Group group = new Group(parent, SWT.NONE); GridDataFactory.fillDefaults().grab(true, false).applyTo(group); // text: description height final IntegerFieldEditor fieldEditor = new IntegerFieldEditor(ITourbookPreferences.TOUR_EDITOR_DESCRIPTION_HEIGHT, Messages.pref_tour_editor_description_height, group); fieldEditor.setValidRange(2, 100); fieldEditor.getLabelControl(group).setToolTipText(Messages.pref_tour_editor_description_height_tooltip); UI.setFieldWidth(group, fieldEditor, UI.DEFAULT_FIELD_WIDTH); addField(fieldEditor); // set margins after the field editors are added final GridLayout groupLayout = (GridLayout) group.getLayout(); groupLayout.marginWidth = 5; groupLayout.marginHeight = 5; }
@Override protected void createFieldEditors() { IntegerFieldEditor highThreshold = new IntegerFieldEditor( CoveragePlugin.HIGH_THRESHOLD_PREFERENCE, "&High coverage threshold:", getFieldEditorParent()); highThreshold.setValidRange(0, 100); addField(highThreshold); IntegerFieldEditor lowThreshold = new IntegerFieldEditor( CoveragePlugin.LOW_THRESHOLD_PREFERENCE, "&Low coverage threshold:", getFieldEditorParent()); lowThreshold.setValidRange(0, 100); addField(lowThreshold); }
/** * Creates the field editors. Field editors are abstractions of * the common GUI blocks needed to manipulate various types * of preferences. Each field editor knows how to save and * restore itself. */ @Override public void createFieldEditors() { Composite parent = getFieldEditorParent(); String valueString = EnsembleProperties.getProperty(P_TEMPLATE_PLAN_URI_EDITABLE); if (valueString == null || Boolean.FALSE != Boolean.parseBoolean(valueString)) { addField(new StringFieldEditor(P_TEMPLATE_PLAN_URI, "Template plan URI", parent)); } addField(new BooleanFieldEditor(P_CHECK_CUSTODIAN, "Check custodian when saving", parent)); addField(new BooleanFieldEditor(P_CROSS_EDITOR_SELECTIONS, "Share selections across editors", parent)); Label reorderByTimeLabel=new Label(parent, SWT.None); reorderByTimeLabel.setText("Reorder by time usually uses the start time of an activity \nor activity group unless the duration in hours is longer than large plan item duration."); GridData reorderByTimeLayout = new GridData(); reorderByTimeLayout.horizontalSpan=2; reorderByTimeLabel.setLayoutData(reorderByTimeLayout); IntegerFieldEditor reorderByTimeField=new IntegerFieldEditor(P_WATERFALL_LARGE_ELEMENT_DURATION_IN_HOURS, "", parent); reorderByTimeField.setLabelText("Large Plan Item Duration"); reorderByTimeField.setEmptyStringAllowed(false); reorderByTimeField.setValidRange(0, 10000); addField(reorderByTimeField); }
/** * Create contents of the preference page. */ @Override protected void createFieldEditors() { serverAddress = new StringListEditor(MONDO_ADDRESSES_PROPERTY, "Server Addresses", getFieldEditorParent()); extensions = new StringListEditor(MONDO_EXTENSIONS_PROPERTY, "Extensions", getFieldEditorParent()); tempFolder = new DirectoryFieldEditor(MONDO_TEMP_PROPERTY, "Temp folder", getFieldEditorParent()); enableLock = new BooleanFieldEditor(MONDO_ENABLE_PROPERTY, "Enable live-lock", getFieldEditorParent()); lockUpdateDelay = new IntegerFieldEditor(MONDO_DELAY_PROPERTY, "Lock update delay [ms] (0 = manually)", getFieldEditorParent()); lockUpdateDelay.setValidRange(0, 100000); addField(serverAddress); addField(extensions); addField(tempFolder); addField(enableLock); addField(lockUpdateDelay); }
@Override protected void createFieldEditors() { Composite p = getFieldEditorParent(); showVerticalindentGuideFieldEditor = new BooleanFieldEditor(PydevEditorPrefs.USE_VERTICAL_INDENT_GUIDE, "Show vertical indent guide?", p); addField(showVerticalindentGuideFieldEditor); useEditorForegroundAsColorFieldEditor = new BooleanFieldEditor( PydevEditorPrefs.USE_VERTICAL_INDENT_COLOR_EDITOR_FOREGROUND, "Use the editor foreground as the color?", p); addField(useEditorForegroundAsColorFieldEditor); selectionColorFieldEditor = new ColorFieldEditor(PydevEditorPrefs.VERTICAL_INDENT_COLOR, "Vertical indent guide color.", p); addField(selectionColorFieldEditor); transparencyFieldEditor = new IntegerFieldEditor(PydevEditorPrefs.VERTICAL_INDENT_TRANSPARENCY, "Vertical indent guide transparency\n(0 = transparent, 255 = opaque).", p); transparencyFieldEditor.setValidRange(0, 255); addField(transparencyFieldEditor); updateInitialState(); }
@Override public void createFieldEditors(DebugPrefsPage page, Composite parent) { page.addField(new IntegerFieldEditor(DebugPluginPrefsInitializer.PYDEV_REMOTE_DEBUGGER_PORT, "Port for remote debugger:", parent, 10)); ComboFieldEditor editor = new ComboFieldEditor(DebugPluginPrefsInitializer.DEBUG_SERVER_STARTUP, "Remote debugger server activation: ", ENTRIES_AND_VALUES_DEBUGGER_STARTUP, parent); page.addField(editor); editor.getLabelControl(parent) .setToolTipText( "This option marks if the remote debugger should be auto-activated in some situation."); ComboFieldEditor comboEditor = new ComboFieldEditor(DebugPluginPrefsInitializer.FORCE_SHOW_SHELL_ON_BREAKPOINT, "On breakpoint hit: ", ENTRIES_AND_VALUES, parent); page.addField(comboEditor); comboEditor.getLabelControl(parent) .setToolTipText( "Checking this option will force Eclipse to have focus when a PyDev breakpoint is hit."); }
protected void createFieldEditors() { // Initialize all field editors. IntegerFieldEditor hitcount = new IntegerFieldEditor(ScenarioTraversalPreferences.PREF_MAXHITCOUNT, Messages .getString("ScenarioTraversalPreferencePage.MaximumHitCount"), getFieldEditorParent()); //$NON-NLS-1$ addField(hitcount); BooleanFieldEditor strategyVariables = new BooleanFieldEditor(ScenarioTraversalPreferences.PREF_INTEGRATESTRATEGYVARIABLES, Messages .getString("ScenarioTraversalPreferencePage.IntegrateStrategyVariables"), getFieldEditorParent()); //$NON-NLS-1$ addField(strategyVariables); BooleanFieldEditor patient = new BooleanFieldEditor(ScenarioTraversalPreferences.PREF_ISPATIENTONPRECONDITIONS, Messages .getString("ScenarioTraversalPreferencePage.IsPatient"), getFieldEditorParent()); //$NON-NLS-1$ addField(patient); BooleanFieldEditor deterministic = new BooleanFieldEditor(ScenarioTraversalPreferences.PREF_ISDETERMINISTIC, Messages .getString("ScenarioTraversalPreferencePage.IsDeterministic"), getFieldEditorParent()); //$NON-NLS-1$ addField(deterministic); }
/** * Creates the field editors. Field editors are abstractions of the common * GUI blocks needed to manipulate various types of preferences. Each field * editor knows how to save and restore itself. */ @Override public void createFieldEditors() { addField(new FontFieldEditor( EventPreferences.CMDLINE_FONT, "Schrift:", getFieldEditorParent()) ); addField(new IntegerFieldEditor( EventPreferences.CMDLINE_INDENT_WIDTH, "Einrückungstiefe", getFieldEditorParent()) ); addField(new ColorListEditor(new String[][] { {EventPreferences.CMDLINE_BACKGROUND_COLOR, "Hintergrund Farbe"}, {EventPreferences.CMDLINE_COLOR_DEFAULT, "Default Farbe"}, {EventPreferences.CMDLINE_COLOR_COMMENT, "Kommentare"}, {EventPreferences.CMDLINE_COLOR_CONTROL, "Kontrollstrukturen"}, {EventPreferences.CMDLINE_COLOR_ASSIGNMENT, "Zuweisungen"}, {EventPreferences.CMDLINE_COLOR_FUNCTION, "Funktionen"}, }, "Farb-Schema:", getFieldEditorParent()) ); }
@Override protected void createFieldEditors(){ addField(new RadioGroupFieldEditor(Preferences.ABL_LANGUAGE, Messages.Ablauf_preferredLang, 1, new String[][] { { Messages.Ablauf_german, "d" //$NON-NLS-1$ }, { Messages.Ablauf_french, "f" //$NON-NLS-1$ }, { Messages.Ablauf_italian, Messages.Ablauf_24 } }, getFieldEditorParent())); addField(new IntegerFieldEditor(Preferences.ABL_CACHELIFETIME, Messages.Ablauf_cachelifetime, getFieldEditorParent())); addField(new IntegerFieldEditor(Preferences.ABL_HEARTRATE, Messages.Ablauf_heartrate, getFieldEditorParent())); }
@Override protected void createFieldEditors(){ addField(new MultilineFieldEditor(CFG_EVLISTE, "Einnahmevorschriften", 5, SWT.V_SCROLL, true, getFieldEditorParent())); addField(new BooleanFieldEditor(CFG_FLORDZ, "Ordnungszahl in FML anzeigen", getFieldEditorParent())); addField(new BooleanFieldEditor(CFG_MK_INCSTOP, "In Medikarte bis&mit Stoppdatum anzeigen?", getFieldEditorParent())); addField(new IntegerFieldEditor(CFG_AKG_HEARTBEAT, "Archiv KG Heartbeat", getFieldEditorParent())); addField(new IntegerFieldEditor(CFG_AKG_SCROLLPERIOD, "Archiv KG Scroll Periode [ms]", getFieldEditorParent())); addField(new IntegerFieldEditor(CFG_AKG_SCROLLDIST_UP, "Archiv KG Scroll Distanz hoch [px]", getFieldEditorParent())); addField(new IntegerFieldEditor(CFG_AKG_SCROLLDIST_DOWN, "Archiv KG Scroll Distanz runter [px]", getFieldEditorParent())); }
/** * Creates the field editors. Field editors are abstractions of the common GUI blocks needed to manipulate various types of preferences. Each field editor knows how to save and restore itself. */ @Override public void createFieldEditors () { final IntegerFieldEditor fieldEditor = new IntegerFieldEditor ( PreferenceConstants.P_DEFAULT_CHUNK_SIZE, "&Default chunk size:", getFieldEditorParent () ); fieldEditor.setEmptyStringAllowed ( false ); fieldEditor.setValidRange ( 1, Integer.MAX_VALUE ); fieldEditor.setValidateStrategy ( StringFieldEditor.VALIDATE_ON_KEY_STROKE ); addField ( fieldEditor ); }
/** * Creates the field editors. Field editors are abstractions of * the common GUI blocks needed to manipulate various types * of preferences. Each field editor knows how to save and * restore itself. */ @Override public void createFieldEditors () { this.bellActivatedEditor = new BooleanFieldEditor ( PreferenceConstants.BELL_ACTIVATED_KEY, Messages.PreferencePage_activateBell, getFieldEditorParent () ); this.numOfEventsEditor = new IntegerFieldEditor ( PreferenceConstants.NUMBER_OF_EVENTS_KEY, Messages.PreferencePage_numberOfEvents, getFieldEditorParent () ); this.cutListAllSecondsEditor = new IntegerFieldEditor ( PreferenceConstants.CUT_LIST_ALL_SECONDS_KEY, Messages.PreferencePage_cutListEveryXSeconds, getFieldEditorParent () ); addField ( this.bellActivatedEditor ); addField ( this.numOfEventsEditor ); addField ( this.cutListAllSecondsEditor ); }
/** * @param value * @param editor * @param message * Validates port values */ private void validatePortField(String value, IntegerFieldEditor editor, String message){ if(StringUtils.isBlank(value) || !value.matches(Constants.PORT_VALIDATION_REGEX)){ showErrorMessage(editor, message,false); }else{ showErrorMessage(editor, null,true); checkState(); } }
/** * @param editor * @param message * @param validState * Display error message */ private void showErrorMessage(IntegerFieldEditor editor, String message,boolean validState) { setErrorMessage(message); editor.setErrorMessage(message); setValid(validState); }
private void validationForIntegerField(String value, IntegerFieldEditor editor, String message){ if(StringUtils.isBlank(value) || !value.matches("\\d+") || value.equalsIgnoreCase("0")){ setErrorMessage(message); editor.setErrorMessage(message); setValid(false); }else{ setErrorMessage(null); editor.setErrorMessage(""); setValid(true); checkState(); } }
private void validatePortField(String value, IntegerFieldEditor editor, String message){ if(StringUtils.isBlank(value) || !value.matches(Constants.PORT_VALIDATION_REGEX)){ showErrorMessage(editor, message,false); }else{ showErrorMessage(editor, null,true); checkState(); } }
private IntegerFieldEditor newMinimumRangeFieldEditor(String name, String labelText, int minimumValue, String errorMessagePrefix, Composite parent) { IntegerFieldEditor editor = new IntegerFieldEditor(name, labelText, parent); editor.setValidRange(minimumValue, Integer.MAX_VALUE); // Overriding the error message defined by "setValidRange, ". editor.setErrorMessage(errorMessagePrefix + " must be no less than " + minimumValue); return editor; }
/** * Creates the field editors. Field editors are abstractions of * the common GUI blocks needed to manipulate various types * of preferences. Each field editor knows how to save and * restore itself. */ public void createFieldEditors() { TexlipsePreferencePage.addSpacer(3, getFieldEditorParent()); addField(new BooleanFieldEditor(TexlipseProperties.BIB_COMPLETION, TexlipsePlugin.getResourceString("preferenceBibCompletion"), getFieldEditorParent())); String message = TexlipsePlugin.getResourceString("preferenceBibCompletionDelay").replaceFirst("%1", "" + MIN_DELAY).replaceFirst("%2", "" + MAX_DELAY); IntegerFieldEditor delay = new IntegerFieldEditor(TexlipseProperties.BIB_COMPLETION_DELAY, message, getFieldEditorParent()); delay.setValidateStrategy(IntegerFieldEditor.VALIDATE_ON_KEY_STROKE); delay.setValidRange(MIN_DELAY, MAX_DELAY); addField(delay); addField(new BooleanFieldEditor(TexlipseProperties.BIB_CODE_FOLDING, TexlipsePlugin.getResourceString("preferenceBibCodeFolding"), getFieldEditorParent())); addField(new BooleanFieldEditor(TexlipseProperties.BIB_FOLD_INITIAL, TexlipsePlugin.getResourceString("preferenceBibFoldInitial"), getFieldEditorParent())); //addField(new BooleanFieldEditor(TexlipseProperties.BIB_STRING, TexlipsePlugin.getResourceString("preferenceBibString"), getFieldEditorParent())); //addField(new BooleanFieldEditor(TexlipseProperties.BIB_FREQSORT, TexlipsePlugin.getResourceString("preferenceBibFreqSort"), getFieldEditorParent())); }
/** * Creates the page components. */ protected void createFieldEditors() { TexlipsePreferencePage.addSpacer(2, getFieldEditorParent()); ViewerListFieldEditor vfe = new ViewerListFieldEditor(TexlipsePlugin.getResourceString("preferenceViewerConfigsLabel"), getFieldEditorParent()); addField(vfe); WorkbenchHelp.setHelp(vfe.getListControl(getFieldEditorParent()), TexlipseHelpIds.VIEWER_LIST); // Depricated. Eclipse has it's own mechanism for auto rebuild. //TexlipsePreferencePage.addSpacer(2, getFieldEditorParent()); //TexlipsePreferencePage.addSeparator(2, getFieldEditorParent()); //addField(new BooleanFieldEditor(TexlipseProperties.BUILD_BEFORE_VIEW, TexlipsePlugin.getResourceString("preferenceViewerBuildLabel"), getFieldEditorParent())); TexlipsePreferencePage.addSpacer(2, getFieldEditorParent()); TexlipsePreferencePage.addSeparator(2, getFieldEditorParent()); TexlipsePreferencePage.addSpacer(2, getFieldEditorParent()); TexlipsePreferencePage.addLabelField(2, TexlipsePlugin.getResourceString("preferenceViewerPortLabel"), getFieldEditorParent()); String message = TexlipsePlugin.getResourceString("preferenceViewerConfigsPort").replaceFirst("%1", "" + MIN_PORT).replaceFirst("%2", "" + MAX_PORT); IntegerFieldEditor port = new IntegerFieldEditor(TexlipseProperties.FILE_LOCATION_PORT, message, getFieldEditorParent()); port.setValidateStrategy(IntegerFieldEditor.VALIDATE_ON_KEY_STROKE); port.setValidRange(MIN_PORT, MAX_PORT); addField(port); addField(new BooleanFieldEditor(TexlipseProperties.BUILDER_FORCE_RETURN_FOCUS, TexlipsePlugin.getResourceString("forceReturnFocusOnInverseSearch"), getFieldEditorParent())); addField(new BooleanFieldEditor(TexlipseProperties.BUILDER_RETURN_FOCUS, TexlipsePlugin.getResourceString("preferenceViewerReturnFocusLabel"), getFieldEditorParent())); WorkbenchHelp.setHelp(port.getTextControl(getFieldEditorParent()), TexlipseHelpIds.VIEWER_PORT); }
/** * Creates the field editors. Field editors are abstractions of * the common GUI blocks needed to manipulate various types * of preferences. Each field editor knows how to save and * restore itself. */ public void createFieldEditors() { teamNumberEditor = new IntegerFieldEditor(PreferenceConstants.TEAM_NUMBER, "&Team Number:", getFieldEditorParent()); addField(teamNumberEditor); autoManageLibraries = new BooleanFieldEditor(PreferenceConstants.MANAGE_LIBRARIES, "&Auto Manage User Libraries", getFieldEditorParent()); addField(autoManageLibraries); }
@Override protected void createFieldEditors() { Composite composite = getFieldEditorParent(); // set the maximum number of threads IntegerFieldEditor maxThreads = new IntegerFieldEditor(CONFIG_MAX_THREADS.longName(), "Maximum number of threads", composite); maxThreads.setValidRange(1, 10 * Runtime.getRuntime().availableProcessors()); addField(maxThreads); IntegerFieldEditor maxStreamBufferSize = new IntegerFieldEditor(CONFIG_STREAM_BUFFERS_SIZE.longName(), "Input/output stream buffer size", composite); maxStreamBufferSize.setValidRange(100, Integer.MAX_VALUE); addField(maxStreamBufferSize); IntegerFieldEditor maxQueueSize = new IntegerFieldEditor(CONFIG_QUEUES_SIZE.longName(), "The queue size used by parallel threads or processes", composite); maxQueueSize.setValidRange(100, Integer.MAX_VALUE); addField(maxQueueSize); addField(new BooleanFieldEditor(CONFIG_MINIMIZE_MEMORY_USAGE.longName(), "Minimize the memory usage required by the analysies (some analysies could be slower)", composite)); addField(new BooleanFieldEditor(CONFIG_REMOVE_TEMP_TRACE_FILES.longName(), "Remove all the temporary trace file before loading again the same trace", composite)); addField(new BooleanFieldEditor(CONFIG_VERBOSE.longName(), "Debug mode", composite)); }
protected void createFieldEditors() { IntegerFieldEditor rightMarginEditor = new IntegerFieldEditor(EDITOR_RIGHT_MARGIN, "&Module editor right margin", getFieldEditorParent()); addField(rightMarginEditor); rightMarginEditor.setValidRange(20, 200); addField(new BooleanFieldEditor(CLEAR_DECLARATION_USE_MARKERS_ON_PARSE, "&Clear declaration use markers when parsing", getFieldEditorParent())); // Preferences for renumbering. Added 25 July 2013 by LL Label lbl = new Label(getFieldEditorParent(), SWT.NONE); GridData gd = new GridData(); gd.horizontalSpan = 2; lbl.setLayoutData(gd); lbl = new Label(getFieldEditorParent(), SWT.NONE); lbl.setText("Renumber Proof Command preferences") ; lbl.setLayoutData(gd); addField(new RadioGroupFieldEditor(EditorPreferencePage.RENUMBER_KEY, "Which step names to renumber", 1, new String[][] { {"All step names", ALL_NAMES}, {"Names containing a digit", SOME_DIGIT}, {"Names beginning with a digit", FIRST_DIGIT}, {"Names that are all digits", ALL_DIGITS} }, getFieldEditorParent())) ; addField(new BooleanFieldEditor(SAVE_MODULE, "&Save module", getFieldEditorParent())) ; }
/** Create fields controlling editing assist behavior */ @Override public void createFieldEditors() { baseComp = SwtUtil.makeGroupComposite(getFieldEditorParent(), 1, 1, "Editor"); // Lines addField(new BooleanFieldEditor(EDITOR_SMART_BACKSPACE, "Smart backspace", baseComp)); addField(new BooleanFieldEditor(EDITOR_WORD_WRAP, "Soft word wrapping", baseComp)); addField(new BooleanFieldEditor(EDITOR_HTML_OPEN, "Open HTML file after creation", baseComp)); addField(new BooleanFieldEditor(EDITOR_PDF_OPEN, "Open PDF file after creation", baseComp)); addField(new IntegerFieldEditor(EDITOR_TAB_WIDTH, "Tab size: ", baseComp, 6)); addField(new BooleanFieldEditor(EDITOR_FORMATTING_ENABLED, "Formatting enabled", baseComp)); addField(new IntegerFieldEditor(EDITOR_FORMATTING_COLUMN, "Formatted line width: ", baseComp, 6)); // ------ taskComp = SwtUtil.makeGroupComposite(getFieldEditorParent(), 1, 1, "Tasks"); // Tasks addField(new BooleanFieldEditor(EDITOR_TASK_TAGS, "Use task tags ", taskComp)); addField(new StringFieldEditor(EDITOR_TASK_TAGS_DEFINED, "Task tags defined:", taskComp)); viewComp = SwtUtil.makeGroupComposite(getFieldEditorParent(), 1, 1, "Preview"); addField(new IntegerFieldEditor(VIEW_UPDATE_DELAY, "Update rate limiter period (ms): ", viewComp, 6)); ((GridData) viewComp.getLayoutData()).grabExcessHorizontalSpace = false; }
@Override protected void createFieldEditors() { portField = new IntegerFieldEditor(PORT, "Port number: ", getFieldEditorParent(), 5); portField.setValidRange(1, 65536); portField.setValidateStrategy(IntegerFieldEditor.VALIDATE_ON_FOCUS_LOST); portField.setErrorMessage(String.format("Port number is not valid valid (1-65536).", portField.getStringValue())); addField(portField); final String[][] entries = new String[][] { // new String[] { "On", Boolean.TRUE.toString() }, // new String[] { "Off", Boolean.FALSE.toString() } }; enabledField = new ComboFieldEditor(ENABLED, "Switch ON/OFF", entries, getFieldEditorParent()); addField(enabledField); }
/** * Create contents of the preference page. */ @Override protected void createFieldEditors() { // Create the field editors addField(new BooleanFieldEditor(BTSEGYUIConstants.SIGN_TEXT_SHOW_HIEROGLYPHS, "Show Hieroglyphs", BooleanFieldEditor.DEFAULT, getFieldEditorParent())); addField(new BooleanFieldEditor(BTSEGYUIConstants.SIGN_TEXT_SHOW_LEMMAID, "Show Lemma ID", BooleanFieldEditor.DEFAULT, getFieldEditorParent())); addField(new BooleanFieldEditor(BTSEGYUIConstants.SIGN_TEXT_SHOW_FLEXION, "Show Flexion", BooleanFieldEditor.DEFAULT, getFieldEditorParent())); for (String lang : BTSCoreConstants.LANGS) { String prefNode = BTSEGYUIConstants.SIGN_TEXT_SHOW_TRANSLATION_PREF_PREFIX + lang; addField(new BooleanFieldEditor(prefNode, "Show Translation: "+lang.toUpperCase(), BooleanFieldEditor.DEFAULT, getFieldEditorParent())); } addField(new IntegerFieldEditor(BTSEGYUIConstants.SIGN_TEXT_SHOW_LINE_WIDTH, "Line Width in Pixel", getFieldEditorParent())); }
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); }
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); }
/** * Add the ZAP preferences to the preferences page. */ @Override protected void createFieldEditors() { FileFieldEditor zapJarLocation = new FileFieldEditor(ZAP_JAR_LOCATION, "ZAP JAR Location:", getFieldEditorParent()); zapJarLocation.setEmptyStringAllowed(false); addField(zapJarLocation); DirectoryFieldEditor zapSessionDirectory = new DirectoryFieldEditor(ZAP_SESSION_DIRECTORY, "ZAP Session Directory", getFieldEditorParent()); zapSessionDirectory.setEmptyStringAllowed(false); addField(zapSessionDirectory); StringFieldEditor zapSessionName = new StringFieldEditor(ZAP_SESSION_NAME, "ZAP Session Name", getFieldEditorParent()); zapSessionName.setEmptyStringAllowed(false); addField(zapSessionName); IntegerFieldEditor zapProxyPort = new IntegerFieldEditor(ZAP_PROXY_PORT, "ZAP Proxy Port:", getFieldEditorParent()); zapProxyPort.setValidRange(0, 99999); zapProxyPort.setEmptyStringAllowed(false); addField(zapProxyPort); StringFieldEditor zapApiKey = new StringFieldEditor(ZAP_API_KEY, "ZAP API Key", getFieldEditorParent()); zapApiKey.setEmptyStringAllowed(false); addField(zapApiKey); }
/** * Creates the field editors. Field editors are abstractions of the common * GUI blocks needed to manipulate various types of preferences. Each field * editor knows how to save and restore itself. */ public void createFieldEditors() { addField(new BooleanFieldEditor(JTIDY_INDENT, JTIDY_INDENT, getFieldEditorParent())); for (int i = 0; i < JTIDY_NUMER.length; i++) { addField(new IntegerFieldEditor(JTIDY_NUMER[i], JTIDY_NUMER[i], getFieldEditorParent())); } for (int i = 0; i < JTIDY_PREF.length; i++) { addField(new BooleanFieldEditor(JTIDY_PREF[i], JTIDY_PREF[i], getFieldEditorParent())); } }
/** * Creates the field editors. Field editors are abstractions of the common * GUI blocks needed to manipulate various types of preferences. Each field * editor knows how to save and restore itself. */ public void createFieldEditors() { addField(new ColorFieldEditor(ColorManager.COLOR_FOREACH_DIRECTIVE, UIUtil.getResourceLabel("ForeachDirective"), getFieldEditorParent())); addField(new ColorFieldEditor(ColorManager.COLOR_IF_DIRECTIVE, UIUtil.getResourceLabel("IfDirective"), getFieldEditorParent())); addField(new ColorFieldEditor(ColorManager.COLOR_MACRO_DIRECTIVE, UIUtil.getResourceLabel("MacroDirective"), getFieldEditorParent())); addField(new ColorFieldEditor(ColorManager.COLOR_SET_DIRECTIVE, UIUtil.getResourceLabel("SetDirective"), getFieldEditorParent())); addField(new ColorFieldEditor(ColorManager.COLOR_VARIABLE, UIUtil.getResourceLabel("VelocityVariable"), getFieldEditorParent())); addField(new ColorFieldEditor(ColorManager.COLOR_COMMENT, UIUtil.getResourceLabel("VelocityComment"), getFieldEditorParent())); addField(new ColorFieldEditor(ColorManager.COLOR_PROC_INSTR, UIUtil.getResourceLabel("XMLInstruction"), getFieldEditorParent())); addField(new ColorFieldEditor(ColorManager.COLOR_STRING, UIUtil.getResourceLabel("XMLString"), getFieldEditorParent())); addField(new ColorFieldEditor(ColorManager.COLOR_TAG, UIUtil.getResourceLabel("XMLTag"), getFieldEditorParent())); addField(new ColorFieldEditor(ColorManager.COLOR_XML_COMMENT, UIUtil.getResourceLabel("XMLComment"), getFieldEditorParent())); { IntegerFieldEditor integerFieldEditor = new IntegerFieldEditor(AUTO_COMPLETE_DEPLAY, "Auto Completion Delay(ms):", getFieldEditorParent()); integerFieldEditor.setStringValue("80"); integerFieldEditor.setValidRange(0, 9999); addField(integerFieldEditor); } { StringFieldEditor stringFieldEditor = new StringFieldEditor(MACRO_TEMPLATE_PATH, "Macro Template Path:", 40, StringFieldEditor.VALIDATE_ON_KEY_STROKE, getFieldEditorParent()); stringFieldEditor.setEmptyStringAllowed(false); stringFieldEditor.setStringValue("/src/main/webapp/home/templates/"); addField(stringFieldEditor); } }
protected Control createContents( Composite parent ) { Composite top = EclipseUtil.createGrid( parent, 1, 1, true, false ); Composite quietComposite = EclipseUtil.createGrid( top ); quiet = new BooleanFieldEditor( QUIET, "Quiet", quietComposite ); Composite verbosityComposite = EclipseUtil.createGrid( top ); verbosity = new IntegerFieldEditor( VERBOSITY, "Verbosity", verbosityComposite ); addFieldEditor( quiet ); addFieldEditor( verbosity ); return top; }