@Override protected void createFieldEditors () { final List<String> tzs = Arrays.asList ( TimeZone.getAvailableIDs () ); Collections.sort ( tzs ); final String[][] entries = new String[tzs.size ()][2]; int i = 0; for ( final String id : tzs ) { entries[i][0] = id; entries[i][1] = id; i += 1; } final FieldEditor field = new ComboFieldEditor ( "timeZone", Messages.TimeZonePreferencePage_TimeZone_Label, entries, getFieldEditorParent () ); //$NON-NLS-1$ addField ( field ); }
private void createComboBox(BashEditorValidationPreferenceConstants constant, Composite parent) { String name = constant.getId(); String labelText = constant.getLabelText(); /* @formatter:off */ String[][] entryNamesAndValues = new String[][] { getLabelAndValue(BashEditorValidationErrorLevel.ERROR), getLabelAndValue(BashEditorValidationErrorLevel.WARNING), getLabelAndValue(BashEditorValidationErrorLevel.INFO) }; /* @formatter:on */ Composite composite = new Composite(parent, SWT.NONE); ComboFieldEditor comboFieldEditor = new ComboFieldEditor(name, labelText, entryNamesAndValues, composite); addField(comboFieldEditor); }
@Override protected void createFieldEditors() { addField( new ComboFieldEditor(PG_EDIT_PREF.PERSPECTIVE_CHANGING_STATUS, Messages.generalPrefPage_perspective_changing_status, new String[][] { {Messages.prespective_change_status_always, MessageDialogWithToggle.ALWAYS}, {Messages.prespective_change_status_never, MessageDialogWithToggle.NEVER}, {Messages.prespective_change_status_ask, MessageDialogWithToggle.PROMPT}}, getFieldEditorParent())); addField( new ComboFieldEditor(PG_EDIT_PREF.EDITOR_UPDATE_ACTION, Messages.ProjectEditorPrefPage_action_type, new String[][] { {Messages.ProjectEditorPrefPage_action_update, PG_EDIT_PREF.UPDATE}, {Messages.ProjectEditorPrefPage_action_reset, PG_EDIT_PREF.RESET}, {Messages.ProjectEditorPrefPage_action_no_action, PG_EDIT_PREF.NO_ACTION}}, getFieldEditorParent())); }
/** Creates the field editors. */ @Override public void createFieldEditors() { Composite parent = getFieldEditorParent(); Group frame = new Group(parent, SWT.NONE); frame.setText("Stylesheets"); GridDataFactory.fillDefaults().indent(0, 6).grab(true, false).span(2, 1).applyTo(frame); GridLayoutFactory.fillDefaults().numColumns(3).margins(6, 6).applyTo(frame); Composite internal = new Composite(frame, SWT.NONE); GridDataFactory.fillDefaults().indent(0, 4).grab(true, false).applyTo(internal); GridLayoutFactory.fillDefaults().numColumns(3).applyTo(internal); // Github Syntax support addField(new BooleanFieldEditor(EDITOR_GITHUB_SYNTAX, "Support Github Syntax", internal)); // Multi-Markdown support addField(new BooleanFieldEditor(EDITOR_MULTIMARKDOWN_METADATA, "Support Multi-Markdown Metadata", internal)); // Browser CSS addField(new ComboFieldEditor(EDITOR_CSS_DEFAULT, "Default Stylesheet", builtins(), internal)); addField(new FileFieldEditor(EDITOR_CSS_CUSTOM, "Custom Stylesheet", internal)); }
@Override protected void createFieldEditors() { // separator Label label = new Label(getFieldEditorParent(), SWT.NONE); label.setLayoutData(new GridData(SWT.FILL, SWT.TOP, false, false, 3, 1)); // beep fields String[][] typeOfBeepTriggers = { { "Do Not Beep", "NONE" }, { "Parameter First Out-of-Limit Value", "FIRST" }, { "Parameter Each Out-of-Limit Value", "EACH" } }; triggerBeep = new ComboFieldEditor("trigerBeep", "Beep on event:", typeOfBeepTriggers, getFieldEditorParent()); addField(triggerBeep); beepWarning = new BooleanFieldEditor("beepWarning", "Beep on Warning", getFieldEditorParent()); addField(beepWarning); beepCritical = new BooleanFieldEditor("beepCritical", "Beep on Critical", getFieldEditorParent()); addField(beepCritical); }
@Override protected void updateFieldEditors() { super.updateFieldEditors(); // update editor states if needed if (this.isPageEnabled()) { Composite parent = this.getFieldEditorParent(); BooleanFieldEditor bundle = this.getField(Preferences.BUNDLE(DEFAULT_PROFILE_NAME)); StringFieldEditor bundlesDirectory = this.getField(Preferences.BUNDLES_DIRECTORY(DEFAULT_PROFILE_NAME)); ComboFieldEditor module = this.getField(Preferences.MODULE_KIND(DEFAULT_PROFILE_NAME)); if (bundle.getBooleanValue()) { getPreferenceStore().setValue(Preferences.MODULE_KIND(currentProfile), "none"); module.load(); } module.setEnabled(!bundle.getBooleanValue(), parent); bundlesDirectory.setEnabled(bundle.getBooleanValue(), parent); BooleanFieldEditor declaration = this.getField(Preferences.DECLARATION(DEFAULT_PROFILE_NAME)); StringFieldEditor declarationDirectory = this .getField(Preferences.DECLARATION_DIRECTORY(DEFAULT_PROFILE_NAME)); declarationDirectory.setEnabled(declaration.getBooleanValue(), parent); } }
@Override protected void createFieldEditors() { addField(new ComboFieldEditor(PreferenceKeys.SEEK_OUTPUT_TYPE, local.getString("seekOutType"), SEEK_OUTPUT_TYPES, getFieldEditorParent())); addField(new ColorFieldEditor(PreferenceKeys.SEEK_GRAPH_COMPUTER_COLOR, local.getString("seekGraphCompCol"), getFieldEditorParent())); addField(new ColorFieldEditor(PreferenceKeys.SEEK_GRAPH_MANY_COLOR, local.getString("seekGraphManyCol"), getFieldEditorParent())); addField(new ColorFieldEditor(PreferenceKeys.SEEK_GRAPH_RATED_COLOR, local.getString("seekGraphRatCol"), getFieldEditorParent())); addField(new ColorFieldEditor(PreferenceKeys.SEEK_GRAPH_UNRATED_COLOR, local.getString("seekGraphUnratCol"), getFieldEditorParent())); }
@Override protected void createFieldEditors() { addField(new BooleanFieldEditor(PreferenceKeys.RESULTS_FADE_AWAY_MODE, local.getString("resFedAw"), getFieldEditorParent())); addField(new ComboFieldEditor(PreferenceKeys.RESULTS_ANIMATION_DELAY, local.getString("resAnDel"), RESULTS_ANIMATION_DELAY_OPTIONS, getFieldEditorParent())); addField(new ComboFieldEditor(PreferenceKeys.RESULTS_WIDTH_PERCENTAGE, local.getString("resPreSz"), RESULTS_PERCENTAGE, getFieldEditorParent())); addField(new ColorFieldEditor(PreferenceKeys.RESULTS_COLOR, local.getString("resCol"), getFieldEditorParent())); addField(new FontFieldEditor(PreferenceKeys.RESULTS_FONT, local.getString("resFnt"), 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 ComboFieldEditor(JSS_COMPATIBILITY_VERSION, Messages.StudioPreferencePage_versionLabel, JRXmlWriterHelper.getVersions(), getFieldEditorParent())); addField(new BooleanFieldEditor(JSS_COMPATIBILITY_SHOW_DIALOG, Messages.StudioPreferencePage_showCompDialog, getFieldEditorParent())); Label label = new Label(getFieldEditorParent(), SWT.WRAP); label.setText(Messages.StudioPreferencePage_message1); GridData gd = new GridData(GridData.FILL_HORIZONTAL); gd.horizontalSpan = 2; label.setLayoutData(gd); label = new Label(getFieldEditorParent(), SWT.WRAP); label.setText(Messages.StudioPreferencePage_message2); gd = new GridData(GridData.FILL_HORIZONTAL); gd.horizontalSpan = 2; label.setLayoutData(gd); }
/** * createFilterSelector * * @param parent */ protected void createFilterSelector(Composite parent) { // @formatter:off ComboFieldEditor fieldEditor = new ComboFieldEditor( com.aptana.editor.common.contentassist.IPreferenceConstants.CONTENT_ASSIST_USER_AGENT_FILTER_TYPE, Messages.ContentAssistPreferencePage_ProposalFilterTypeLabel, new String[][] { { Messages.ContentAssistPreferencePage_NoFilterLabel, UserAgentFilterType.NO_FILTER.getText() }, { Messages.ContentAssistPreferencePage_OneOrMoreFilterLabel, UserAgentFilterType.ONE_OR_MORE.getText() }, { Messages.ContentAssistPreferencePage_AllFilterLabel, UserAgentFilterType.ALL.getText() } }, parent ); addField(fieldEditor); // @formatter:on // We only want to enable this field editor for workspace-specific settings. // Since the UI will not draw anything unless we have at least one field-editor in this page, we have to add it // and disable it for project-specific. fieldEditor.setEnabled(!isProjectPreferencePage(), parent); }
protected void addDefaultSortColumnEditor(List<String> ids) { String entryNamesAndValues[][] = new String[ids.size()+1][2]; entryNamesAndValues[0][0] = ""; entryNamesAndValues[0][1] = P_MERGE_EDITOR_SORT_COLUMN_NONE; for(int i=0; i<ids.size(); i++) { String id = ids.get(i); entryNamesAndValues[i+1][0] = id; // should be a pretty name entryNamesAndValues[i+1][1] = id; // should be the internal id } addField(new ComboFieldEditor( P_MERGE_EDITOR_SORT_COLUMN, "Default sort column", entryNamesAndValues, getFieldEditorParent())); }
@Override public void createFieldEditors() { final Level[] logLevels = new Level[] { Level.OFF, Level.ERROR, Level.WARN, Level.INFO, Level.DEBUG, Level.TRACE }; final String[][] values = new String[logLevels.length][2]; for (int i = 0; i < logLevels.length; i++) { // constructor of ComboFieldEditor expects a two-dimensional // array with label-value pairs. values[i][0] = logLevels[i].toString(); values[i][1] = logLevels[i].toString(); } final ComboFieldEditor editor = new ComboFieldEditor( ConsoleImpl.KEY, "Log level:", values, this.getFieldEditorParent()); this.addField(editor); }
@Override protected void createFieldEditors() { String[][] entryNamesAndValues = new String[][] { new String[] { "clean all", EGradleJUnitTestTasksType.CLEAN_ALL.getId() }, new String[] { "clean tests only", EGradleJUnitTestTasksType.CLEAN_ONLY_TESTS.getId() }, new String[] { "do nothing", EGradleJUnitTestTasksType.CLEAN_NOTHING.getId() } }; /* @formatter:on */ gradleCallTypeRadioButton = new ComboFieldEditor(P_TEST_TASKS.getId(), "Before test execution", entryNamesAndValues, getFieldEditorParent()); addField(gradleCallTypeRadioButton); SWTFactory.createLabel(getFieldEditorParent(), "(This will be used by all test launch configurations)", 2); }
/** * Creates the JVM Options Preferece page field editors. * * @see org.eclipse.jface.preference.FieldEditorPreferencePage#createFieldEditors() */ @Override public void createFieldEditors() { this.setAllVMs(); this.addField(new ComboFieldEditor(PREF_JRE, JVM_JAVAVM_LABEL, this.jvmNamesAndValues, this.getFieldEditorParent())); this.addField(new JVMOptionEditor(PREF_JVM_OPTIONS, JVM_OPTIONS_LABEL, this.getFieldEditorParent())); this.addField(new PathFieldEditor(PREF_LIBPATH, JVM_LIBRARYPATH_LABEL, this.getFieldEditorParent())); }
@Override public FieldEditor createFieldEditor(Composite parent) { String[][] entryNamesAndValues = new String[values.size()][2]; for (int i = 0; i < values.size(); ++i) { entryNamesAndValues[i][0] = values.get(i).getDisplayName(); entryNamesAndValues[i][1] = values.get(i).getId(); } return new ComboFieldEditor(this.getKey(), this.getDescription(), entryNamesAndValues, parent); }
/** * 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. */ protected void createFieldEditors() { for (int i = 1; i <= NUM_STATUS_COLORS; i++) { addField(new ColorFieldEditor(getMainColorPrefName(i), "Color " + i, getFieldEditorParent())); addField(new ComboFieldEditor(getColorPredPrefName(i), "Predicate", ColorPredicate.PREDEFINED_MACROS, getFieldEditorParent())); addField(new BooleanFieldEditor(getLeafSideBarPrefName(i), "Show Leaf Steps in Side Bar", getFieldEditorParent())); addField(new BooleanFieldEditor(getAppliesToLeafPrefName(i), "Applies to Leaf Steps Only", getFieldEditorParent())); } }
@Override protected Control createContents(Composite parent) { Composite comp = new Composite(parent, SWT.NONE); comp.setFont(parent.getFont()); comp.setLayout(new GridLayout()); comp.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); String[][] uses = new String[3][2]; uses[0][0] = TypeScriptUIMessages.TypeScriptMainPreferencePage_useSalsa_Never; uses[0][1] = UseSalsa.Never.name(); uses[1][0] = TypeScriptUIMessages.TypeScriptMainPreferencePage_useSalsa_EveryTime; uses[1][1] = UseSalsa.EveryTime.name(); uses[2][0] = TypeScriptUIMessages.TypeScriptMainPreferencePage_useSalsa_WhenNoJSDTNature; uses[2][1] = UseSalsa.WhenNoJSDTNature.name(); ComboFieldEditor ternServerEditor = new ComboFieldEditor( TypeScriptCorePreferenceConstants.USE_SALSA_AS_JS_INFERENCE, TypeScriptUIMessages.TypeScriptMainPreferencePage_useSalsa, uses, comp); initEditor(ternServerEditor, getPreferenceStore()); Group refactoringGroup = new Group(comp, SWT.NONE); refactoringGroup.setLayout(new GridLayout()); GridData data = new GridData(GridData.FILL_HORIZONTAL); data.horizontalSpan = 2; refactoringGroup.setLayoutData(data); refactoringGroup.setText(TypeScriptUIMessages.TypeScriptMainPreferencePage_refactoring_title); BooleanFieldEditor refactoringAutoSave = new BooleanFieldEditor( TypeScriptCorePreferenceConstants.REFACTOR_SAVE_ALL_EDITORS, TypeScriptUIMessages.TypeScriptMainPreferencePage_refactoring_auto_save, refactoringGroup); initEditor(refactoringAutoSave, getPreferenceStore()); BooleanFieldEditor refactoringLightweight = new BooleanFieldEditor( TypeScriptCorePreferenceConstants.REFACTOR_LIGHTWEIGHT, TypeScriptUIMessages.TypeScriptMainPreferencePage_refactoring_lightweight, refactoringGroup); initEditor(refactoringLightweight, getPreferenceStore()); initGroup(refactoringGroup); return comp; }
@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); }
@Override protected void createFieldEditors() { String[][] sliderWidthPreferences = { { local.getString("tiny"), "3" }, { local.getString("small"), "5" }, { local.getString("medium"), "8" }, { local.getString("large"), "11" }, { local.getString("extWide"), "15" } }; ComboFieldEditor setFieldEditor = new ComboFieldEditor( PreferenceKeys.APP_SASH_WIDTH, local.getString("divSashWid"), sliderWidthPreferences, getFieldEditorParent()); addField(setFieldEditor); ColorFieldEditor pingTimeColor = new ColorFieldEditor( PreferenceKeys.APP_PING_COLOR, local.getString("pingTFontCol"), getFieldEditorParent()); addField(pingTimeColor); addField(pingTimeColor); FontFieldEditor pingTimeFont = new FontFieldEditor( PreferenceKeys.APP_PING_FONT, local.getString("pingTFont"), getFieldEditorParent()); addField(pingTimeFont); ColorFieldEditor statusBarFontColor = new ColorFieldEditor( PreferenceKeys.APP_STATUS_BAR_COLOR, local.getString("statBarFontCol"), getFieldEditorParent()); addField(statusBarFontColor); FontFieldEditor statusBarFont = new FontFieldEditor( PreferenceKeys.APP_STATUS_BAR_FONT, local.getString("statBarFont"), getFieldEditorParent()); addField(statusBarFont); addField(new BooleanFieldEditor( PreferenceKeys.APP_SHOW_STATUS_BAR, local.getString("showWinStar"), getFieldEditorParent())); }
@Override protected void createFieldEditors() { addField(new BooleanFieldEditor( PreferenceKeys.ARROW_SHOW_ON_OBS_AND_OPP_MOVES, local.getString("chessBArP1"), getFieldEditorParent())); addField(new BooleanFieldEditor(PreferenceKeys.ARROW_SHOW_ON_MY_MOVES, local.getString("chessBArP2"), getFieldEditorParent())); addField(new BooleanFieldEditor( PreferenceKeys.ARROW_SHOW_ON_MOVE_LIST_MOVES, local.getString("chessBArP3"), getFieldEditorParent())); addField(new BooleanFieldEditor( PreferenceKeys.ARROW_SHOW_ON_MY_PREMOVES, local.getString("chessBArP4"), getFieldEditorParent())); addField(new BooleanFieldEditor(PreferenceKeys.ARROW_FADE_AWAY_MODE, local.getString("chessBArP5"), getFieldEditorParent())); addField(new ComboFieldEditor(PreferenceKeys.ARROW_ANIMATION_DELAY, local.getString("chessBArP6"), ARROW_ANIMATION_DELAY_OPTIONS, getFieldEditorParent())); addField(new ComboFieldEditor(PreferenceKeys.ARROW_WIDTH_PERCENTAGE, local.getString("chessBArP7"), ARROW_BORDER_PERCENTAGE_OPTIONS, getFieldEditorParent())); addField(new ColorFieldEditor(PreferenceKeys.ARROW_MY_COLOR, local.getString("chessBArP8"), getFieldEditorParent())); addField(new ColorFieldEditor(PreferenceKeys.ARROW_PREMOVE_COLOR, local.getString("chessBArP9"), getFieldEditorParent())); addField(new ColorFieldEditor(PreferenceKeys.ARROW_OBS_OPP_COLOR, local.getString("chessBArP10"), getFieldEditorParent())); addField(new ColorFieldEditor(PreferenceKeys.ARROW_OBS_COLOR, local.getString("chessBArP11"), getFieldEditorParent())); }
@Override protected void createFieldEditors() { addField(new BooleanFieldEditor(P_IDENTIFIER_QUOTEONLYEXCEPTIONS, Messages.SQLEditorPreferencesPage_0, getFieldEditorParent())); addField(new BooleanFieldEditor(P_USE_JDBC_QUOTE, Messages.SQLEditorPreferencesPage_1, getFieldEditorParent())); addField(new ComboFieldEditor(P_IDENTIFIER_QUOTE, Messages.SQLEditorPreferencesPage_comboLabel, new String[][] { { "id", "" }, { "\"id\"", "\"" }, { "`id`", "`" }, { "[id]", "[" } }, getFieldEditorParent())); //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$ //$NON-NLS-8$ //$NON-NLS-9$ }
/** * */ public void createFieldEditors() { addField(new ComboFieldEditor( P_ELEMENT_DESIGN_BORDER_STYLE, Messages.DesignerPreferencePage_element_design_border_style, new String[][] { { Messages.DesignerPreferencePage_corners, "corners" }, { Messages.common_rectangle, "rectangle" } }, getFieldEditorParent())); //$NON-NLS-1$ //$NON-NLS-2$ addField(new ColorFieldEditor(P_ELEMENT_DESIGN_BORDER_COLOR, Messages.DesignerPreferencePage_elementbordercolor, getFieldEditorParent())); addField(new ComboFieldEditor(P_PAGE_DESIGN_BORDER_STYLE, Messages.DesignerPreferencePage_page_border_style, new String[][] { { Messages.DesignerPreferencePage_fancy_shadow, DEFAULT_BORDERSTYLE }, { Messages.DesignerPreferencePage_simple_shadow, "rectangle" } }, getFieldEditorParent())); //$NON-NLS-1$ //$NON-NLS-2$ addField(new ComboFieldEditor(P_PAGE_DEFAULT_UNITS, Messages.DesignerPreferencePage_unit, Unit.getUnits2(), getFieldEditorParent())); addField(new BooleanFieldEditor(P_SHOW_REPORT_BAND_NAMES, Messages.DesignerPreferencePage_show_band_names, getFieldEditorParent())); addField(new ColorFieldEditor(P_CONTAINER_MARGIN_COLOR, Messages.DesignerPreferencePage_common_bandmargincolor, getFieldEditorParent())); addField(new ColorFieldEditor(P_PAGE_MARGIN_COLOR, Messages.DesignerPreferencePage_pageprintmargincolor, getFieldEditorParent())); addField(new ColorFieldEditor(P_PAGE_BACKGROUND, Messages.DesignerPreferencePage_pagebackground, getFieldEditorParent())); addField(new FontFieldEditor(P_INTERNAL_EDITORS_FONT, Messages.DesignerPreferencePage_InternalEditorsFont, getFieldEditorParent())); addField(new ComboFieldEditor(BEHAVIOR_ON_FIELD_DROP, Messages.DesignerPreferencePage_field_behavior, new String[][] { { Messages.DesignerPreferencePage_field_behavior_label, BEHAVIOR_CREATE_LABEL }, { Messages.DesignerPreferencePage_field_behavior_nothing, BEHAVIOR_DO_NOTHING }, { Messages.DesignerPreferencePage_field_behavior_ask, BEHAVIOR_ASK_EVERYTIME } }, getFieldEditorParent())); addField(new BooleanFieldEditor(P_USE_FIELD_DESCRIPTION, Messages.DesignerPreferencePage_UseDescriptionForLabelText, getFieldEditorParent())); addField(new BooleanFieldEditor(P_SAVE_ON_PREVIEW, Messages.DesignerPreferencePage_savereportonpreview, getFieldEditorParent())); addField(new BooleanFieldEditor(P_CENTER_SELECTION, Messages.DesignerPreferencePage_centerEditorOption, getFieldEditorParent())); addField(new BooleanFieldEditor(P_RESIZE_CONTAINER, Messages.DesignerPreferencePage_autoresizeBand, getFieldEditorParent())); }
@Override public FieldEditor createFieldEditor(Composite parent) { MethodContentStrategyIdentifier[] values = MethodContentStrategyIdentifier.values(); String[][] comboValues = new String[values.length][2]; for (int i = 0; i < values.length; i++) { comboValues[i] = new String[] { values[i].name(), values[i].name() }; } return new ComboFieldEditor(this.getKey(), this.getDescription(), comboValues, parent); }
@Test public void testCreateFieldEditor() { Display.getDefault().asyncExec(new Runnable() { @Override public void run() { assertEquals(new ComboFieldEditor(KEY, DESCRIPTION, comboValues, parent), pluginPreference.createFieldEditor(parent)); } }); }
@Override protected void createFieldEditors() { String[][] entryNamesAndValues = getEntryNamesAndValues(); addField(new ComboFieldEditor(P_SORT_COLUMN, "Default &Sort Column", entryNamesAndValues, getFieldEditorParent())); Collection<String> groupableHeaderTexts = getGroupableHeaderTexts(); PickListFieldEditor groupByEditor = new PickListFieldEditor(P_GROUP_BY_COLUMNS, "Grouping Columns", getFieldEditorParent(), groupableHeaderTexts, true); addField(groupByEditor); }
private void addTooltipSpeedEditor(Group nodeGroup) { String tooltipValues[][] = new String[3][2]; tooltipValues[0] = new String[] { "Normal", Tooltip.NORMAL + "" }; tooltipValues[1] = new String[] { "Fast", Tooltip.FAST + "" }; tooltipValues[2] = new String[] { "None", Tooltip.NONE + "" }; ComboFieldEditor tooltipEditor = new ComboFieldEditor( P_TOOLTIP_SPEED, "Tool Tip Speed: ", tooltipValues, nodeGroup); addField(tooltipEditor); }
private void addNodeDecoratorFields(Composite parent) { TextDecoratorFieldProvider p = ClassRegistry.createInstance(TextDecoratorFieldProvider.class); if (p != null) { Group nodeTextGroup = createGroup(parent); nodeTextGroup.setText("Activity Text"); String labelValues[][] = p.getFieldValues(); addField(new ComboFieldEditor( P_DECORATOR_TEXT_KEY, "Label parameter: ", labelValues, nodeTextGroup)); } }
public void createFieldEditors() { // addField(new DirectoryFieldEditor("PATH", "&Directory preference:", // getFieldEditorParent())); // addField(new BooleanFieldEditor("BOOLEAN_VALUE", // "&An example of a boolean preference", getFieldEditorParent())); // // addField(new RadioGroupFieldEditor("CHOICE", // "An example of a multiple-choice preference", 1, // new String[][] { { "&Choice 1", "choice1" }, // { "C&hoice 2", "choice2" } }, getFieldEditorParent())); // addField(new StringFieldEditor("MySTRING1", "A &text preference:", // getFieldEditorParent())); // addField(new StringFieldEditor("MySTRING2", "A &text preference:", // getFieldEditorParent())); addField(new BooleanFieldEditor(AnATLyzerPreferenceInitializer.BUILDER_ANALYSE_OPEN_ONLY, "&Analyse only open files", getFieldEditorParent())); addField(new IntegerFieldEditor(AnATLyzerPreferenceInitializer.TIMEOUT_PREFERENCE, "Default time out", getFieldEditorParent())); addField(new IntegerFieldEditor(AnATLyzerPreferenceInitializer.MIN_BOUNDS, "Min. bounds", getFieldEditorParent())); addField(new IntegerFieldEditor(AnATLyzerPreferenceInitializer.MAX_BOUNDS, "Max. bounds", getFieldEditorParent())); addField(new BooleanFieldEditor(AnATLyzerPreferenceInitializer.SPECULATIVE_QUICKFIXES_ENABLED, "Enable speculative quick fixes", getFieldEditorParent())); addField(new ComboFieldEditor(AnATLyzerPreferenceInitializer.DEFAULT_ANALYSIS_CONFIGURATION, "Default batch configuration", new String[][] { { "Model finding on errors", DefaultAnalysisConfiguration.MODEL_FINDING_ON_ERRORS.name() }, { "All errors in continous mode", DefaultAnalysisConfiguration.ALL_CONTINOUS.name() }, { "No model finding", DefaultAnalysisConfiguration.NO_MODEL_FINDING.name() } }, 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() { addField(new StringFieldEditor(PreferenceConstants.HOST_ADDRESS, "Host IPv4 address:", getFieldEditorParent())); addField(new IntegerFieldEditor(PreferenceConstants.HOST_PORT, "Host port number:", getFieldEditorParent())); addField(new StringFieldEditor(PreferenceConstants.SERVICE_NAME, "Service name:", getFieldEditorParent())); addField(new StringFieldEditor(PreferenceConstants.MATLAB_PATH, "(optional - MatlabControl only) Path to Matlab executable", getFieldEditorParent())); String[][] connectors = processAvailableConnectors(); addField(new ComboFieldEditor(PreferenceConstants.MATLAB_CONNECTOR, "Matlab Connector", connectors, getFieldEditorParent())); }
@Override protected void createFieldEditors() { addField(new ComboFieldEditor("prefCombo", "A combo field", new String[][]{{"display1", "value1"},{"display2", "value2"}}, getFieldEditorParent())); addField(new ColorFieldEditor("prefColor", "Color for table items : ", getFieldEditorParent())); addField(new BooleanFieldEditor("prefBoolean", "A boolean : ", getFieldEditorParent())); addField(new StringFieldEditor("prefString", "A string : ", getFieldEditorParent())); }
protected void createFieldEditors() { // Initialize all field editors. String[][] algos = new String[StrategyEvaluationPreferences.NUM_ALGORITHMS][1]; algos[StrategyEvaluationPreferences.QUALITATIVE_ALGORITHM] = new String[] { Messages.getString("GeneralPreferencePage.GrlStrategiesElementAlgorithm.QualitativeGRL"), (StrategyEvaluationPreferences.QUALITATIVE_ALGORITHM + "") }; //$NON-NLS-1$ //$NON-NLS-2$ algos[StrategyEvaluationPreferences.QUANTITATIVE_ALGORITHM] = new String[] { Messages.getString("GeneralPreferencePage.GrlStrategiesElementAlgorithm.QuantitativeGRL"), (StrategyEvaluationPreferences.QUANTITATIVE_ALGORITHM + "") }; //$NON-NLS-1$ //$NON-NLS-2$ algos[StrategyEvaluationPreferences.MIXED_ALGORITHM] = new String[] { Messages.getString("GeneralPreferencePage.GrlStrategiesElementAlgorithm.MixedGRL"), (StrategyEvaluationPreferences.MIXED_ALGORITHM + "") }; //$NON-NLS-1$ //$NON-NLS-2$ algos[StrategyEvaluationPreferences.FORMULA_BASED_ALGORITHM] = new String[] { Messages.getString("GeneralPreferencePage.GrlStrategiesElementAlgorithm.FormulaBasedGRL"), (StrategyEvaluationPreferences.FORMULA_BASED_ALGORITHM + "") }; //$NON-NLS-1$ //$NON-NLS-2$ algos[StrategyEvaluationPreferences.CONDITIONAL_GRL_ALGORITHM] = new String[] { Messages.getString("GeneralPreferencePage.GrlStrategiesElementAlgorithm.ConditionalGRLAlgorithm"), (StrategyEvaluationPreferences.CONDITIONAL_GRL_ALGORITHM + "") }; //$NON-NLS-1$ //$NON-NLS-2$ algos[StrategyEvaluationPreferences.CONSTRAINT_SOLVER_ALGORITHM] = new String[] { Messages.getString("GeneralPreferencePage.GrlStrategiesElementAlgorithm.HAO_2011_GRL_ALGORITHM"), (StrategyEvaluationPreferences.CONSTRAINT_SOLVER_ALGORITHM + "") }; //$NON-NLS-1$ //$NON-NLS-2$ ComboFieldEditor pref_algorithm = new ComboFieldEditor(StrategyEvaluationPreferences.PREF_ALGORITHM, Messages .getString("GeneralPreferencePage.GrlStrategiesElementAlgorithm"), algos, getFieldEditorParent()); //$NON-NLS-1$ addField(pref_algorithm); IntegerFieldEditor tolerance = new IntegerFieldEditor(StrategyEvaluationPreferences.PREF_TOLERANCE, Messages .getString("GeneralPreferencePage.GRLEvaluationAlgorithmTolerance"), getFieldEditorParent()); //$NON-NLS-1$ addField(tolerance); BooleanFieldEditor eval_filled = new BooleanFieldEditor(StrategyEvaluationPreferences.PREF_EVALFILLED, Messages .getString("GeneralPreferencePage.GrlStrategiesElementFilled"), getFieldEditorParent()); //$NON-NLS-1$ addField(eval_filled); BooleanFieldEditor visualize_as_positive = new BooleanFieldEditor(StrategyEvaluationPreferences.PREF_VISUALIZEASPOSITIVERANGE, Messages.getString("StrategyEvaluationPreferencePage.VisualizeAsZeroToHundred"), getFieldEditorParent()); //$NON-NLS-1$ addField(visualize_as_positive); }
/** * 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( ScriptPreferences.CMDLINE_FONT, "Schrift:", getFieldEditorParent()) ); addField(new IntegerFieldEditor( ScriptPreferences.CMDLINE_INDENT_WIDTH, "Einrückungstiefe", getFieldEditorParent()) ); addField(new ColorListEditor(new String[][] { {ScriptPreferences.CMDLINE_BACKGROUND_COLOR, "Hintergrund Farbe"}, {ScriptPreferences.CMDLINE_COLOR_DEFAULT, "Default Farbe"}, {ScriptPreferences.CMDLINE_COLOR_COMMENT, "Kommentare"}, {ScriptPreferences.CMDLINE_COLOR_CONTROL, "Kontrollstrukturen"}, {ScriptPreferences.CMDLINE_COLOR_ASSIGNMENT, "Zuweisungen"}, {ScriptPreferences.CMDLINE_COLOR_FUNCTION, "Funktionen"}, }, "Farb-Schema:", getFieldEditorParent()) ); addField(new ComboFieldEditor(ScriptPreferences.CMDLINE_DEFAULT_NODE, "Standard Dialog", new String[][] { {ScriptUtil.getTitleForNode(CallNode.class), "CallNode"}, {ScriptUtil.getTitleForNode(AsgNode.class), "AsgNode"}, {ScriptUtil.getTitleForNode(IfNode.class), "IfNode"}, {ScriptUtil.getTitleForNode(WhileNode.class), "WhileNode"}, {ScriptUtil.getTitleForNode(CaseNode.class), "CaseNode"}, }, getFieldEditorParent())); }
@Override public void createFieldEditors() { dataTypeMappingGroup = new Group(getFieldEditorParent(), SWT.NONE); dataTypeMappingGroup.setLayout(new GridLayout(16, false)); dataTypeMappingGroup.setText("Data Type Mapping"); GridLayout layout = new GridLayout(1, false); layout.marginRight = 5; layout.marginLeft = 10; dataTypeMappingGroup.setLayout(layout); Composite labelComposite = new Composite(dataTypeMappingGroup, SWT.NONE); GridData gridData = new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1); gridData.widthHint = 400; labelComposite.setLayoutData(gridData); Label outputLabel = new Label(labelComposite, SWT.NONE); outputLabel.setText("AADL types with size specifications will be mapped to\n" + "the corresponding MATLAB types automatically.\n\n" + "AADL types without size specifications will be mapped\n" + "to MATLAB types according to the below settings.\n\n"); outputLabel.pack(); Composite dataTypeComposite = new Composite(dataTypeMappingGroup, SWT.NONE); gridData = new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1); gridData.widthHint = 400; dataTypeComposite.setLayoutData(gridData); intTypeFieldEditor = new ComboFieldEditor(PreferenceConstants.PREF_INT, "AADL Integer data type maps to MATLAB type", INT_TYPES, dataTypeComposite); addField(intTypeFieldEditor); realTypeFieldEditor = new ComboFieldEditor(PreferenceConstants.PREF_REAL, "AADL Real data type maps to MATLAB type", REAL_TYPES, dataTypeComposite); addField(realTypeFieldEditor); dataTypeMappingGroup.pack(); }
private void createIlcdOtherContents(Composite parent) { Group section = new Group(parent, SWT.SHADOW_OUT); section.setText(M.ILCDOtherSettings); ComboFieldEditor langEditor = new ComboFieldEditor( IoPreference.ILCD_LANG, M.Language, getLanguages(), section); addField(langEditor); UI.gridLayout(section, 2); UI.gridData(section, true, false); }
@Override protected void createFieldEditors() { versionsEditor = new ComboFieldEditor(GRADLE_VERSION_ID, "Gradle Version", AVAILABLE_VERSIONS, getFieldEditorParent()); gradleHomeField = new DirectoryFieldEditor(GRADLE_HOME_ID, "Home", getFieldEditorParent()); gradleHomeField.setErrorMessage("Yoy must specify a valid gradle installation"); gradleHomeField.setEmptyStringAllowed(!shouldUseGradleHome); addField(versionsEditor); addField(gradleHomeField); addField(new StringFieldEditor(GRADLE_PLUGIN_VERSION_ID, "Plugin Version", getFieldEditorParent())); addField(new ComboFieldEditor(GRADLE_LOG_LEVEL_ID, "Log level", LOG_LEVELS, getFieldEditorParent())); addField(new BooleanFieldEditor(GRADLE_PRINT_STACKTRACES_ID, "Print stacktraces", getFieldEditorParent())); }
/** * Configuration of Locations Provider. */ private void addLocationsProviderPrefsEditor() { ComboFieldEditor editor = new ComboFieldEditor(WaqtSalatPreferenceConstants.P_LOCATIONS_PROVIDER, "Locations Providers", getLocationsProviders(), getFieldEditorParent()); editor.getLabelControl(getFieldEditorParent()).setToolTipText( "Set the locations provider to use in order to retrieve the list of cities, coordinates and so forth."); addField(editor); }
/** * Configuration of Calculation method. */ private void addCalculationMethodsPrefsEditor() { ComboFieldEditor editor = new ComboFieldEditor(WaqtSalatPreferenceConstants.P_CALCULATION_METHOD, "Calculation method", this.getCalculationMethods(), getFieldEditorParent()); editor.getLabelControl(getFieldEditorParent()) .setToolTipText( "This represent the calculation method used in order to retrieve the most accurately possible the pray times for the specified location."); addField(editor); }
/** * Configuration of timezone. */ private void addTimezonePrefsEditors() { timezonePrefsGroup = new Group(getFieldEditorParent(), SWT.NONE); timezonePrefsGroup.setLayout(new GridLayout(1, false)); timezonePrefsGroup.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false)); timezonePrefsGroup.setText("Timezone settings"); timezoneFromCountryEditor = new BooleanFieldEditor(WaqtSalatPreferenceConstants.P_GET_TIMEZONE_FROM_COUNTRY, "Try to get timezone from country/city", timezonePrefsGroup); // FIXME: fix tooltip display issues in windows XP // timezoneFromCountryEditor // .getLabelControl(timezonePrefsGroup) // .setToolTipText( // "Be aware that there may exist several timezones for the same country. In that case, it is highly recommended to set explicitely the timezone or even use system default timezone."); useSystemTimezoneEditor = new BooleanFieldEditor(WaqtSalatPreferenceConstants.P_USE_SYSTEM_TIMEZONE, "Use system timezone", timezonePrefsGroup); timezonesEditor = new ComboFieldEditor(WaqtSalatPreferenceConstants.P_TIMEZONE, "Timezone", getAvailableTimezones(), timezonePrefsGroup); BooleanFieldEditor daylightSavingsEditor = new BooleanFieldEditor( WaqtSalatPreferenceConstants.P_DAYLIGHT_SAVINGS, "Daylight savings", timezonePrefsGroup); for (FieldEditor editor : new FieldEditor[] { timezoneFromCountryEditor, useSystemTimezoneEditor, timezonesEditor, daylightSavingsEditor }) { editor.setPreferenceStore(getPreferenceStore()); editor.load(); addField(editor); } }
private void addAdjustingMethodEditor() { ComboFieldEditor adjustingMethodEditor = new ComboFieldEditor(WaqtSalatPreferenceConstants.P_ADJUSTING_METHOD, "Adjusting method", getAdjustingMethods(), getFieldEditorParent()); adjustingMethodEditor.getLabelControl(getFieldEditorParent()).setToolTipText( "Set the adjusting method to use for higher latitudes."); addField(adjustingMethodEditor); }