List of usage examples for org.eclipse.jface.preference StringFieldEditor StringFieldEditor
public StringFieldEditor(String name, String labelText, Composite parent)
From source file:fr.obeo.dsl.arduino.preferences.ArduinoPreferencesPage.java
License:Open Source License
private void createArduinoSdk(Composite parent) { DirectoryFieldEditor sdk = new DirectoryFieldEditor(ArduinoPreferences.ARDUINO_SDK_ID, "Arduino SDK :", getFieldEditorParent());//w w w . j av a 2 s .c o m addField(sdk); StringFieldEditor port = new StringFieldEditor(ArduinoPreferences.ARDUINO_SERIAL_PORT, "Arduino Serial Port :", getFieldEditorParent()); addField(port); }
From source file:gda.rcp.views.dashboard.DashboardPreferencePage.java
License:Open Source License
@Override protected void createFieldEditors() { formatFieldEditor = new StringFieldEditor(PreferenceConstants.DASHBOARD_FORMAT, "Dashboard number format", getFieldEditorParent());//from w w w . j a v a 2 s . co m addField(formatFieldEditor); final BooleanFieldEditor showBounds = new BooleanFieldEditor(PreferenceConstants.DASHBOARD_BOUNDS, "Show bounds", getFieldEditorParent()); addField(showBounds); final BooleanFieldEditor showDes = new BooleanFieldEditor(PreferenceConstants.DASHBOARD_DESCRIPTION, "Show description", getFieldEditorParent()); addField(showDes); }
From source file:gov.nasa.arc.spife.europa.preferences.EuropaPreferencePage.java
License:Open Source License
@Override protected void createFieldEditors() { Composite parent = getFieldEditorParent(); connectionGroup = createGroup(parent); connectionGroup.setText("Connection And Server Type"); connectionTypeEditor = new RadioGroupFieldEditor(P_CONNECTION_TYPE, "Connection &Type:", 2, new String[][] { { "JNI", "JNI" }, { "xml-rpc", "xml-rpc" } }, connectionGroup); addField(connectionTypeEditor);/*from w w w. j a v a 2 s. co m*/ serverTypeEditor = new RadioGroupFieldEditor(P_SERVER_TYPE, "&Server Type:", 2, new String[][] { { "Embedded", "embedded" }, { "Out-of-process", "remote" } }, connectionGroup); addField(serverTypeEditor); hostEditor = new StringFieldEditor(P_HOST, "Fully Qualified &Host Name:", connectionGroup); addField(hostEditor); portEditor = new IntegerFieldEditor(P_PORT, "Default &Port Number:", connectionGroup); addField(portEditor); engineTypeEditor = new StringFieldEditor(P_ENGINE_TYPE, "Engine Type:", connectionGroup); addField(engineTypeEditor); findingGroup = createGroup(parent); findingGroup.setText("Finding violations"); addField(useEuropaViolationsEditor = new BooleanFieldEditor(P_USE_EUROPA_VIOLATIONS, "Use &Europa violation checking and fixing", findingGroup)); addField(temporalEditor = new BooleanFieldEditor(P_FIND_TEMPORAL_VIOLATIONS, "Report temporal violations (re-open plans to take effect)", findingGroup)); indent(temporalEditor, findingGroup); addField(flightRuleEditor = new BooleanFieldEditor(P_FIND_FLIGHT_RULE_VIOLATIONS, "Find and fix state violations (re-open plans to take effect)", findingGroup)); indent(flightRuleEditor, findingGroup); addField(sharableEditor = new BooleanFieldEditor(P_FIND_SHARABLE_VIOLATIONS, "Find and fix sharable violations (re-open plans to take effect)", findingGroup)); indent(sharableEditor, findingGroup); addField(claimableEditor = new BooleanFieldEditor(P_FIND_CLAIMABLE_VIOLATIONS, "Find and fix claimable violations (re-open plans to take effect)", findingGroup)); indent(claimableEditor, findingGroup); addField(numericEditor = new BooleanFieldEditor(P_FIND_NUMERIC_VIOLATIONS, "Find and fix numeric violations (re-open plans to take effect)", findingGroup)); indent(numericEditor, findingGroup); Group fixingGroup = createGroup(parent); fixingGroup.setText("Fixing violations"); addField(new BooleanFieldEditor(P_FIX_VIOLATIONS_PROGRESSIVELY, "Fix violations &progressively:", BooleanFieldEditor.SEPARATE_LABEL, fixingGroup)); addField(new IntegerFieldEditor(P_MAX_STEPS, "Maximum number of steps to fix &violations:", fixingGroup)); Group adGroup = createGroup(parent); adGroup.setText("Activity Dictionary validation / Model Generation"); addField(new StringFieldEditor(P_MODEL_NAME, "&Activity Dictionary Target Version:", adGroup)); addField(new BooleanFieldEditor(P_STRICT_TYPES, "Use strict activity &type checking", BooleanFieldEditor.SEPARATE_LABEL, adGroup)); addField(new BooleanFieldEditor(P_DO_MODEL_AUTOEXPORT, "Do &Model Auto-export if needed", BooleanFieldEditor.SEPARATE_LABEL, adGroup)); addField(new BooleanFieldEditor(P_USE_RESOURCE_SOLVING, "Use Resource Solving for State Constraints", BooleanFieldEditor.SEPARATE_LABEL, adGroup)); addField(new BooleanFieldEditor(P_TRANSLATE_NUMERIC_RESOURCES, "Translate Numeric Resources", BooleanFieldEditor.SEPARATE_LABEL, adGroup)); }
From source file:gov.nasa.arc.spife.ui.timeline.preference.TimelinePreferencePage.java
License:Open Source License
@Override protected void createFieldEditors() { colorGroup = createGroup(getFieldEditorParent()); colorGroup.setText("Color"); {//from w ww.j a va 2s . c o m addField(new ColorFieldEditor(P_ALTERNATING_COLOR, "Alternating Rows:", colorGroup)); } addField(hideHorizontalLinesBooleanFieldEditor = new BooleanFieldEditor(P_HORIZONTAL_LINES_HIDE, "Hide horizontal lines", colorGroup)); { addField(horizontalColorFieldEditor = new ColorFieldEditor(P_HORIZONTAL_LINES_COLOR, "Horizontal Lines:", colorGroup)); } { addField(new ColorFieldEditor(P_VERTICAL_LINES_COLOR, "Vertical Lines:", colorGroup)); } { addField(new ColorFieldEditor(P_SCALE_TICKMARK_COLOR, "Scale Tickmarks:", colorGroup)); } { IntegerFieldEditor editor = new IntegerFieldEditor(P_SCALE_FONT_SIZE, "Scale area font size:", getFieldEditorParent()); editor.setValidRange(3, 72); addField(editor); } { IntegerFieldEditor editor = new IntegerFieldEditor(P_CONTENT_FONT_SIZE, "Timeline area font size:", getFieldEditorParent()); editor.setValidRange(3, 72); addField(editor); } { addField(new BooleanFieldEditor(P_CURSOR_TIME_ENABLED, "Show timeline cursor", getFieldEditorParent())); } Group nodeGroup = createGroup(getFieldEditorParent()); nodeGroup.setText("Row"); { IntegerFieldEditor editor = new IntegerFieldEditor(P_ROW_ELEMENT_HEIGHT, "Height (pixels):", nodeGroup); editor.setValidRange(3, 100); addField(editor); } { addField(new StringFieldEditor(P_ROW_ELEMENT_OVERLAP, "Activity Vertical Overlap:", nodeGroup) { @Override protected boolean doCheckState() { try { float f = Float.parseFloat(getStringValue()); return (f >= 0 && f <= 1); } catch (NumberFormatException e) { return false; } } }); } addField(new BooleanFieldEditor(P_ROW_ELEMENT_ROUNDED, "Round corners", nodeGroup)); addField(new BooleanFieldEditor(P_ROW_ELEMENT_ACTIVITY_GROUP_NOGAPS, "Show Activity Group figures with no duration gaps between its activities", nodeGroup)); addTooltipSpeedEditor(nodeGroup); addTooltipTimeEditor(nodeGroup); addNodeDecoratorFields(getFieldEditorParent()); }
From source file:gov.nasa.ensemble.core.plan.editor.preferences.PlanEditorPreferencePage.java
License:Open Source License
/** * 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./* www. j a v a 2 s . com*/ */ @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); }
From source file:gov.redhawk.sca.ui.preferences.RedhawkScaPreferencePage.java
License:Open Source License
@Override protected void createFieldEditors() { final StringFieldEditor field = new StringFieldEditor(ScaPreferenceConstants.SCA_DEFAULT_NAMING_SERVICE, "Default Naming Service:", getFieldEditorParent()); addField(field);/*from ww w. j ava 2s . c om*/ this.registry = ScaPlugin.getDefault().getDomainManagerRegistry(getFieldEditorParent().getDisplay()); this.domList = new DomainListEditor(this.registry, "Domains:", getFieldEditorParent()); addField(this.domList); /** We bind this field editor to a fake preference because we just use it to set the auto-connect preference on all domains when selected */ final RadioGroupFieldEditor autoConnect = new RadioGroupFieldEditor("FAKE", "All Domains: Reconnect on startup", 2, new String[][] { { "Auto", "true" }, { "Manual", "false" } }, getFieldEditorParent(), false); autoConnect.setPropertyChangeListener(new IPropertyChangeListener() { @Override public void propertyChange(PropertyChangeEvent event) { Boolean auto = Boolean.valueOf((String) event.getNewValue()); RedhawkScaPreferencePage.this.domList.setAllAutoConnect(auto); } }); final StringListFieldEditor listField = new StringListFieldEditor( ScaPreferenceConstants.SCA_DOMAIN_WAVEFORMS_SEARCH_PATH, "Waveforms Search Path:", getFieldEditorParent()); addField(listField); listField.getUpButton().setVisible(false); listField.getDownButton().setVisible(false); PlatformUI.getWorkbench().getHelpSystem().setHelp(getControl(), HelpConstants.reference_preferences_domainConnections); }
From source file:gov.va.isaac.mdht.otf.ui.preferences.IsaacPreferencePage.java
License:Apache License
/** * 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.// w w w. ja v a 2 s. c o m */ public void createFieldEditors() { addField(new DirectoryFieldEditor(PreferenceConstants.DATABASE_PATH, "&Database location:", getFieldEditorParent())); List<ConceptVersionBI> modules = PreferenceUtil.getAllModules(); String[][] moduleArray = new String[modules.size()][2]; for (int i = 0; i < modules.size(); i++) { try { moduleArray[i][0] = modules.get(i).getPreferredDescription().getText(); moduleArray[i][1] = modules.get(i).getPrimordialUuid().toString(); } catch (IOException | ContradictionException e) { StatusManager.getManager().handle( new Status(IStatus.ERROR, Activator.PLUGIN_ID, "Cannot get module description", e), StatusManager.SHOW | StatusManager.LOG); } } addField(new ComboFieldEditor(PreferenceConstants.MODULE_UUID, "Current &module", moduleArray, getFieldEditorParent())); addField(new StringFieldEditor(PreferenceConstants.USER_UUID, "Current &user", getFieldEditorParent())); addField(new StringFieldEditor(PreferenceConstants.PATH_UUID, "Current &path", getFieldEditorParent())); // addField(new BooleanFieldEditor(PreferenceConstants.P_BOOLEAN, // "&An example of a boolean preference", getFieldEditorParent())); }
From source file:hu.bme.mit.massif.simulink.importer.ui.dialogs.ImportSettingsDialog.java
License:Open Source License
@Override protected List<FieldEditor> additionalFields(Composite fieldEditorParent) { Label filters = new Label(fieldEditorParent, SWT.NONE); filters.setText("Import filters to use:"); List<FieldEditor> fes = new LinkedList<FieldEditor>(); Map<String, ISimulinkImportFilter> filtersById = ImportFilterRegistry.INSTANCE.getFiltersById(); for (String filterId : filtersById.keySet()) { ISimulinkImportFilter filter = filtersById.get(filterId); BooleanFieldEditor filterCheckbox = new BooleanFieldEditor(filterId, filter.getName(), fieldEditorParent);//from w w w. j a v a 2 s .c om filterCheckbox.setPreferenceStore(store); filterCheckbox.setPreferenceName(filterId); filterCheckbox.load(); filterCheckbox.getDescriptionControl(fieldEditorParent).setToolTipText(filter.getDescription()); fes.add(filterCheckbox); filterSelectors.put(filterId, filterCheckbox); } importedModelNameEditor = new StringFieldEditor("", "Result Model Name:", fieldEditorParent); importedModelNameEditor.setEmptyStringAllowed(false); importedModelNameEditor.setStringValue(importedModelName); fes.add(importedModelNameEditor); return fes; }
From source file:hu.bme.mit.massif.simulink.importer.ui.preferences.ExporterPreferencePage.java
License:Open Source License
/** * Creates the field editors./*from w w w.j ava 2 s.co m*/ */ public void createFieldEditors() { Label modelPathInformation = new Label(getFieldEditorParent(), SWT.NONE); modelPathInformation.setBounds(new Rectangle(0, 0, 400, 30)); modelPathInformation.setText("You can provide a default path for the exported models." + "\nIf empty, you will be prompted for the required information at export time."); // Result model path ContainerFieldEditor resultModelPathEditor = new ContainerFieldEditor( PreferenceConstants.EXPORT_RESULT_MODEL_PATH, "Default result model location:", getFieldEditorParent()); addField(resultModelPathEditor); // Result model extension //@formatter:off RadioGroupFieldEditor modelExtensionSelector = new RadioGroupFieldEditor( PreferenceConstants.EXPORT_RESULT_MODEL_EXTENSION, "Simulink model file extension: ", 1, new String[][] { { "MDL", "mdl" }, { "SLX", "slx" } }, getFieldEditorParent()); //@formatter:on addField(modelExtensionSelector); // A horizontal separator on the page SeparatorFieldEditor separator = new SeparatorFieldEditor(getFieldEditorParent()); addField(separator); Label additionalMatlabPathInformation = new Label(getFieldEditorParent(), SWT.NONE); additionalMatlabPathInformation.setBounds(new Rectangle(0, 0, 400, 30)); additionalMatlabPathInformation .setText("You can provide additional path that are to be added to the Matlab Path." + "\nIf you provide multiple paths, separate them with '|'."); // Additional MATLAB path addField(new StringFieldEditor(PreferenceConstants.EXPORT_ADDITIONAL_MATLAB_PATH, "Additional Matlab path:", getFieldEditorParent())); Label startupScriptInformation = new Label(getFieldEditorParent(), SWT.NONE); startupScriptInformation.setBounds(new Rectangle(0, 0, 400, 30)); startupScriptInformation .setText("You can provide additional startup scripts that are to be executed in Matlab." + "\nIf you provide multiple script names, separate them with '|'."); // Additional MATLAB script names addField(new StringFieldEditor(PreferenceConstants.EXPORT_SCRIPT_NAMES, "Startup script names:", getFieldEditorParent())); }
From source file:hu.bme.mit.massif.simulink.importer.ui.preferences.ImporterPreferencePage.java
License:Open Source License
/** * Creates the field editors.//w w w.jav a2 s . co m */ public void createFieldEditors() { Label traverseModeInformation = new Label(getFieldEditorParent(), SWT.NONE); traverseModeInformation.setBounds(new Rectangle(0, 0, 300, 30)); traverseModeInformation.setText( "Set the traversal strategy of the importer." + "\nCases differ in handling model references."); // Traverse mode RadioGroupFieldEditor importModePickerEditor = new RadioGroupFieldEditor( PreferenceConstants.IMPORT_TRAVERSE_MODE, "Traverse mode:", 1, new String[][] { { "&Shallow (only the model reference block is imported)", ImportMode.SHALLOW.toString() }, { "&Deep (the models referred by the imported model are also imported as an individual model)", ImportMode.DEEP.toString() }, { "&Flattening (the model references are resolved and are imported as though they were part of the same model)", ImportMode.FLATTENING.toString() }, { "&Referencing (all linked subsystem blocks' library is imported as an individual model)", ImportMode.REFERENCING.toString() } }, getFieldEditorParent()); addField(importModePickerEditor); Label modelPathInformationPlaceholder = new Label(getFieldEditorParent(), SWT.NONE); modelPathInformationPlaceholder.setBounds(new Rectangle(0, 0, 300, 15)); modelPathInformationPlaceholder.setText(""); Label modelPathInformation = new Label(getFieldEditorParent(), SWT.NONE); modelPathInformation.setBounds(new Rectangle(0, 0, 400, 30)); modelPathInformation.setText("You can provide a default path for the imported models." + "\nIf empty, you will be prompted for the required information at import time."); // Result model path ContainerFieldEditor resultModelPathEditor = new ContainerFieldEditor( PreferenceConstants.IMPORT_RESULT_MODEL_PATH, "Default result model location:", getFieldEditorParent()); // A horizontal separator on the page SeparatorFieldEditor separator = new SeparatorFieldEditor(getFieldEditorParent()); addField(separator); // Import filter // TODO magic string elimination Label filterInformation = new Label(getFieldEditorParent(), SWT.NONE); filterInformation.setBounds(new Rectangle(0, 0, 300, 15)); filterInformation.setText("Import filters to use by default:"); Map<String, ISimulinkImportFilter> filtersById = ImportFilterRegistry.INSTANCE.getFiltersById(); for (String filterId : filtersById.keySet()) { ISimulinkImportFilter filter = filtersById.get(filterId); Composite filterCheckboxParent = getFieldEditorParent(); BooleanFieldEditor filterCheckbox = new BooleanFieldEditor(filterId, filter.getName(), filterCheckboxParent); filterCheckbox.getDescriptionControl(filterCheckboxParent).setToolTipText(filter.getDescription()); addField(filterCheckbox); } // TODO set this, makes the setting more user friendly // resultModelPathEditor.setFilterPath(path); addField(resultModelPathEditor); Label additionalMatlabPathInformation = new Label(getFieldEditorParent(), SWT.NONE); additionalMatlabPathInformation.setBounds(new Rectangle(0, 0, 400, 30)); additionalMatlabPathInformation .setText("You can provide additional path that are to be added to the Matlab Path." + "\nIf you provide multiple paths, separate them with '|'."); // Additional MATLAB path addField(new StringFieldEditor(PreferenceConstants.IMPORT_ADDITIONAL_MATLAB_PATH, "Additional Matlab path:", getFieldEditorParent())); Label startupScriptInformation = new Label(getFieldEditorParent(), SWT.NONE); startupScriptInformation.setBounds(new Rectangle(0, 0, 400, 30)); startupScriptInformation .setText("You can provide additional startup scripts that are to be executed in Matlab." + "\nIf you provide multiple script names, separate them with '|'."); // Additional MATLAB script names addField(new StringFieldEditor(PreferenceConstants.IMPORT_STARTUP_SCRIPTS, "Startup script names:", getFieldEditorParent())); }