@Override protected void createFieldEditors() { addField(new BooleanFieldEditor(PREF.PGDUMP_SWITCH, Messages.generalPrefPage_pg_dump_switch, getFieldEditorParent())); addField(new FileFieldEditor(PREF.PGDUMP_EXE_PATH, Messages.generalPrefPage_pg_dump_executable, getFieldEditorParent()){ @Override protected boolean checkState() { return true; } }); addField(new StringFieldEditor(PREF.PGDUMP_CUSTOM_PARAMS, Messages.generalPrefPage_pg_dump_custom_parameters, getFieldEditorParent())); addField(new BooleanFieldEditor(PREF.FORCE_SHOW_CONSOLE, Messages.generalPrefPage_show_console_when_program_write_to_console, getFieldEditorParent())); addField(new BooleanFieldEditor(PREF.NO_PRIVILEGES, Messages.dbUpdatePrefPage_ignore_privileges, getFieldEditorParent())); }
@Override protected Control createDialogArea(Composite parent) { Composite top = (Composite) super.createDialogArea(parent); Composite editArea = new Composite(top, SWT.NONE); editArea.setLayout(new GridLayout()); editArea.setLayoutData(new GridData(GridData.FILL_BOTH | GridData.GRAB_HORIZONTAL | GridData.GRAB_VERTICAL)); runInBackground = new BooleanFieldEditor(IProgressConstants.RUN_IN_BACKGROUND, ProgressMessages.JobsViewPreferenceDialog_RunInBackground, editArea); runInBackground.setPreferenceName(IProgressConstants.RUN_IN_BACKGROUND); runInBackground.setPreferenceStore(preferenceStore); runInBackground.load(); showSystemJob = new BooleanFieldEditor(IProgressConstants.SHOW_SYSTEM_JOBS, ProgressMessages.JobsViewPreferenceDialog_ShowSystemJobs, editArea); showSystemJob.setPreferenceName(IProgressConstants.SHOW_SYSTEM_JOBS); showSystemJob.setPreferenceStore(preferenceStore); showSystemJob.load(); Dialog.applyDialogFont(top); return top; }
/** * 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() { GridData groupLayoutData = new GridData(); groupLayoutData.horizontalAlignment = GridData.FILL; groupLayoutData.verticalAlignment = GridData.BEGINNING; groupLayoutData.grabExcessHorizontalSpace = true; groupLayoutData.grabExcessVerticalSpace = false; groupLayoutData.verticalSpan = 2; groupLayoutData.horizontalSpan = 3; automaticalDeriveBuildFolders= new BooleanFieldEditor( EGradleIdePreferenceConstants.P_FILEHANDLING_AUTOMATICALLY_DERIVE_BUILDFOLDERS.getId(), "Automatically derive build folders", getFieldEditorParent()); String info = "(Importer and 'refresh eclipse' action will automatically derive build folders)"; addField(automaticalDeriveBuildFolders); SWTFactory.createLabel(getFieldEditorParent(), info, 2); }
/** * 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() { GridData groupLayoutData = new GridData(); groupLayoutData.horizontalAlignment = GridData.FILL; groupLayoutData.verticalAlignment = GridData.BEGINNING; groupLayoutData.grabExcessHorizontalSpace = true; groupLayoutData.grabExcessVerticalSpace = false; groupLayoutData.verticalSpan = 2; groupLayoutData.horizontalSpan = 3; outputValidationEnabled= new BooleanFieldEditor( EGradleIdePreferenceConstants.P_OUTPUT_VALIDATION_ENABLED.getId(), "Output validation enabled", getFieldEditorParent()); addField(outputValidationEnabled); showConsoleViewOnBuildFailed= new BooleanFieldEditor( EGradleIdePreferenceConstants.P_SHOW_CONSOLE_VIEW_ON_BUILD_FAILED_ENABLED.getId(), "Show console view on build failure", getFieldEditorParent()); addField(showConsoleViewOnBuildFailed); }
/** * 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() { GridData groupLayoutData = new GridData(); groupLayoutData.horizontalAlignment = GridData.FILL; groupLayoutData.verticalAlignment = GridData.BEGINNING; groupLayoutData.grabExcessHorizontalSpace = true; groupLayoutData.grabExcessVerticalSpace = false; groupLayoutData.verticalSpan = 2; groupLayoutData.horizontalSpan = 3; subProjectWithIconDecorationEnabled= new BooleanFieldEditor( EGradleIdePreferenceConstants.P_DECORATION_SUBPROJECTS_WITH_ICON_ENABLED.getId(), "Subproject are decorated with gradle icon", getFieldEditorParent()); addField(subProjectWithIconDecorationEnabled); }
/** * 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() { GridData groupLayoutData = new GridData(); groupLayoutData.horizontalAlignment = GridData.FILL; groupLayoutData.verticalAlignment = GridData.BEGINNING; groupLayoutData.grabExcessHorizontalSpace = true; groupLayoutData.grabExcessVerticalSpace = false; groupLayoutData.verticalSpan = 2; groupLayoutData.horizontalSpan = 3; executeAssembleTask = new BooleanFieldEditor( EGradleIdePreferenceConstants.P_IMPORT__EXECUTE_ASSEMBLE_TASK.getId(), "Execute assemble task", getFieldEditorParent()); String executeAssembleTaskInfo = "(main build folders and generated resources will exist after import)"; addField(executeAssembleTask); SWTFactory.createLabel(getFieldEditorParent(), executeAssembleTaskInfo, 2); /* clean eclipse projects */ cleanEclipseProjects = new BooleanFieldEditor(EGradleIdePreferenceConstants.P_IMPORT__DO_CLEAN_PROJECTS.getId(), "Clean eclipse projects", getFieldEditorParent()); String cleanEclipseProjectsInfo = "(after import 'clean all projects' is executed inside eclipse )"; addField(cleanEclipseProjects); SWTFactory.createLabel(getFieldEditorParent(), cleanEclipseProjectsInfo, 2); }
@Override protected void createFieldEditors() { Composite parent = getFieldEditorParent(); colorComment = new ColorFieldEditor(GradleEditorConstants.KEY_COLOR_COMMENT, "Comment color:", parent); addField(colorComment); colorDoc = new ColorFieldEditor(GradleEditorConstants.KEY_COLOR_DOC, "Doc color:", parent); addField(colorDoc); colorKeyword = new ColorFieldEditor(GradleEditorConstants.KEY_COLOR_KEYWORD, "Keyword color:", parent); addField(colorKeyword); boldAttributeKeyword = new BooleanFieldEditor(GradleEditorConstants.KEY_BOLD_KEYWORD, "Bold keywords", parent); addField(boldAttributeKeyword); colorString = new ColorFieldEditor(GradleEditorConstants.KEY_COLOR_STRING, "String color:", parent); addField(colorString); colorNumber = new ColorFieldEditor(GradleEditorConstants.KEY_COLOR_NUMBER, "Number color:", parent); addField(colorNumber); colorNormal = new ColorFieldEditor(GradleEditorConstants.KEY_COLOR_NORMAL, "Normal text color:", parent); addField(colorNormal); }
/** * Add edit fields to the preference page. */ @Override public void createFieldEditors() { addField(newMinimumRangeFieldEditor( IMechanicPreferences.SLEEPAGE_PREF, "Task scan frequency (seconds):", IMechanicPreferences.MINIMUM_SLEEP_SECONDS, "Task scan frequency", getFieldEditorParent())); addField(new DirectoryOrUrlEditor(IMechanicPreferences.DIRS_PREF, "Task sources:", getFieldEditorParent())); blockedEditor = new BlockedTaskEditor(IMechanicPreferences.BLOCKED_PREF, "Blocked tasks:", getFieldEditorParent()); addField(blockedEditor); addField(new BooleanFieldEditor(IMechanicPreferences.SHOW_POPUP_PREF, "Show popup when tasks fail", getFieldEditorParent())); // addCacheFields(getFieldEditorParent()); }
protected void createFieldEditors() { // Smart backspace addField(new BooleanFieldEditor(TexlipseProperties.SMART_BACKSPACE, TexlipsePlugin.getResourceString("preferenceSmartBackspace"), getFieldEditorParent())); Label backspaceLabel = new Label(getFieldEditorParent(),SWT.LEFT | SWT.WRAP); backspaceLabel.setText(TexlipsePlugin.getResourceString("preferenceSmartBackspaceText")); // Smart quotes addField(new BooleanFieldEditor(TexlipseProperties.SMART_QUOTES, TexlipsePlugin.getResourceString("preferenceSmartReplaceQuotes"), getFieldEditorParent())); Label quotesLabel = new Label(getFieldEditorParent(),SWT.LEFT | SWT.WRAP); quotesLabel.setText(TexlipsePlugin.getResourceString("preferenceSmartReplaceQuotesText")); // Smart parens addField(new BooleanFieldEditor(TexlipseProperties.SMART_PARENS, TexlipsePlugin.getResourceString("preferenceSmartBracketCompletion"), getFieldEditorParent())); Label bracketLabel = new Label(getFieldEditorParent(),SWT.LEFT | SWT.WRAP); bracketLabel.setText(TexlipsePlugin.getResourceString("preferenceSmartBracketCompletionText")); // Smart \ldots addField(new BooleanFieldEditor(TexlipseProperties.SMART_LDOTS, TexlipsePlugin.getResourceString("preferenceSmartLdots"), getFieldEditorParent())); }
/** * 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())); }
/** * 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 field editors */ protected void createFieldEditors() { addField(new BooleanFieldEditor(IPreferenceConstants.I_PARSER_POPUP_ERRORS, "&Always pop up Parsing Errors view", getFieldEditorParent())); addField(new BooleanFieldEditor(IPreferenceConstants.I_PARSE_MODULE_ON_MODIFY, "&Re-parse module on save", getFieldEditorParent())); /*addField(new BooleanFieldEditor(IPreferenceConstants.I_PARSE_FILES_ON_MODIFY, "&Automatic re-parse all module dependent files (experimental)", getFieldEditorParent()));*/ /* It is necessary to make this a field in order to enable and disable it when * parse module on modify is selected and de-selected */ parseSpecField = new BooleanFieldEditor(IPreferenceConstants.I_PARSE_SPEC_ON_MODIFY, "&Re-parse specification on spec module save", getFieldEditorParent()); if (!getPreferenceStore().getBoolean(IPreferenceConstants.I_PARSE_MODULE_ON_MODIFY)) { parseSpecField.setEnabled(false, getFieldEditorParent()); } addField(parseSpecField); }
/** * This overrides the method in {@link FieldEditorPreferencePage}. * It disables the parse spec on spec module modify if the parse * module on modify option is de-selected and enables it when parse * module on modify is selected. */ public void propertyChange(PropertyChangeEvent event) { if (event.getSource() instanceof BooleanFieldEditor) { BooleanFieldEditor parseModuleOnModifyField = (BooleanFieldEditor) event.getSource(); if (parseModuleOnModifyField.getPreferenceName().equals(IPreferenceConstants.I_PARSE_MODULE_ON_MODIFY)) { boolean parseModuleOnModify = parseModuleOnModifyField.getBooleanValue(); if (parseModuleOnModify) { parseSpecField.setEnabled(true, getFieldEditorParent()); } else { parseSpecField.setEnabled(false, getFieldEditorParent()); } } } super.propertyChange(event); }
/** 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)); }
/** 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() { 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); }
@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 createFieldEditors() { super.createFieldEditors(); Composite parent = getFieldEditorParent(); Group refactoringGroup = new Group(parent, SWT.SHADOW_IN); refactoringGroup.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false)); refactoringGroup.setText("Refactoring"); GridLayout layout = new GridLayout(1, false); refactoringGroup.setLayout(layout); Composite composite = new Composite(refactoringGroup, SWT.NONE); addField(new BooleanFieldEditor(RefactoringPreferences.SAVE_ALL_BEFORE_REFACTORING, "Save all modified resources automatically prior to refactoring", composite)); addField(new BooleanFieldEditor(RefactoringPreferences.USE_INLINE_REFACTORING, "Rename in editor without dialog if possible", composite)); refactoringGroup.pack(); }
@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 public void createFieldEditors() { Composite parent = getFieldEditorParent(); addField( new BooleanFieldEditor(PreferenceConstants.P_ORDER_BY_NAME, "Sort by name", parent)); addField(new ListEditor(PreferenceConstants.P_ORDER, "Order of members", parent) { @Override protected String createList(String[] items) { return OrderConverter.convert(items); } @Override protected String[] parseString(String stringList) { return OrderConverter.convert(stringList); } }); }
@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() { Composite fieldEditorParent = getFieldEditorParent(); new Label(fieldEditorParent, SWT.NONE); addField(new BooleanFieldEditor( JavaDecompilerPlugin.PREF_ESCAPE_UNICODE_CHARACTERS, "Escape unicode characters", fieldEditorParent)); addField(new BooleanFieldEditor( JavaDecompilerPlugin.PREF_OMIT_PREFIX_THIS, "Omit the prefix 'This' if possible", fieldEditorParent)); addField(new BooleanFieldEditor( JavaDecompilerPlugin.PREF_REALIGN_LINE_NUMBERS, "Realign line numbers", fieldEditorParent)); addField(new BooleanFieldEditor( JavaDecompilerPlugin.PREF_SHOW_LINE_NUMBERS, "Show original line numbers", fieldEditorParent)); addField(new BooleanFieldEditor( JavaDecompilerPlugin.PREF_SHOW_DEFAULT_CONSTRUCTOR, "Show default constructor", fieldEditorParent)); addField(new BooleanFieldEditor( JavaDecompilerPlugin.PREF_SHOW_METADATA, "Show metadata", fieldEditorParent)); }
@Override protected void createFieldEditors() { // IMPORTANT: FieldEditorPreferencePage does not work very well with complex layouts and nested widgets. // Consider switching to com.modelsolv.reprezen.generators.ui.preferences.GroupedFieldEditorPreferencePage from // the RepreZen repo before modifying it Composite refValidationComposite = new Composite(getFieldEditorParent(), SWT.BORDER); GridLayoutFactory.fillDefaults().applyTo(refValidationComposite); GridDataFactory.fillDefaults().grab(true, false).indent(0, 10).applyTo(refValidationComposite); Label header = new Label(refValidationComposite, SWT.NONE); header.setText("Allow JSON references in additional contexts:"); addField(new BooleanFieldEditor(VALIDATION_REF_SECURITY_DEFINITIONS_OBJECT, "Security Definitions Object", refValidationComposite)); addField(new BooleanFieldEditor(VALIDATION_REF_SECURITY_SCHEME_OBJECT, "Security Scheme Object", refValidationComposite)); addField(new BooleanFieldEditor(VALIDATION_REF_SECURITY_REQUIREMENTS_ARRAY, "Security Requirements Array", refValidationComposite)); addField(new BooleanFieldEditor(VALIDATION_REF_SECURITY_REQUIREMENT_OBJECT, "Security Requirement Object", refValidationComposite)); }
@Override protected void createFieldEditors() { FileFieldEditor defaultFilter = new FileFieldEditor(PREF_CUST_FILTER, "Custom XSLT Filter", getFieldEditorParent()); addField(defaultFilter); BooleanFieldEditor mimcXmlDeclaration = new BooleanFieldEditor(PREF_MIMICXMLDECL, "Mimic Dora XML Declaration (no 'encoding=UTF-8')", getFieldEditorParent()); addField(mimcXmlDeclaration); BooleanFieldEditor dontAddNewLine = new BooleanFieldEditor(PREF_MIMIC_DXLEXPORT_EOF, "Mimic EOF of DXL Export (Add extra Line Endings to end of file)", getFieldEditorParent()); addField(dontAddNewLine); if (!isPropertyPage()) { BooleanFieldEditor enableAll = new BooleanFieldEditor(PREF_ENABLE_ALL, "Enable Swiper for ALL Projects", getFieldEditorParent()); addField(enableAll); } }
private void createJExcelAPI(CTabFolder tabFolder) { CTabItem ptab = new CTabItem(tabFolder, SWT.NONE); ptab.setText(Messages.ExcelExporterPreferencePage_60); ScrolledComposite scompo = new ScrolledComposite(tabFolder, SWT.V_SCROLL | SWT.H_SCROLL); scompo.setExpandHorizontal(true); scompo.setExpandVertical(true); Composite sc = new Composite(scompo, SWT.NONE); sc.setLayout(new GridLayout(3, false)); BooleanFieldEditor bf = new BooleanFieldEditor(XlsExporterConfiguration.PROPERTY_CREATE_CUSTOM_PALETTE, Messages.ExcelExporterPreferencePage_61, sc); addField(bf); HelpSystem.setHelp(bf.getDescriptionControl(sc), StudioPreferencePage.REFERENCE_PREFIX + bf.getPreferenceName()); addField(new BooleanFieldEditor(JxlExporterConfiguration.PROPERTY_USE_TEMP_FILE, Messages.ExcelExporterPreferencePage_62, sc)); addField(new BooleanFieldEditor(JxlReportConfiguration.PROPERTY_COMPLEX_FORMAT, Messages.ExcelExporterPreferencePage_63, sc)); scompo.setMinSize(sc.getSize()); scompo.setContent(sc); ptab.setControl(scompo); }
private void createJExcelAPI(CTabFolder tabFolder) { CTabItem ptab = new CTabItem(tabFolder, SWT.NONE); ptab.setText(Messages.ExcelExporterPreferencePage_60); ScrolledComposite scompo = new ScrolledComposite(tabFolder, SWT.V_SCROLL | SWT.H_SCROLL); scompo.setExpandHorizontal(true); scompo.setExpandVertical(true); Composite sc = new Composite(scompo, SWT.NONE); sc.setLayout(new GridLayout(3, false)); BooleanFieldEditor bf = new BooleanFieldEditor(XlsExporterConfiguration.PROPERTY_CREATE_CUSTOM_PALETTE, Messages.ExcelExporterPreferencePage_61, sc); addField(bf); HelpSystem.setHelp(bf.getDescriptionControl(sc), StudioPreferencePage.REFERENCE_PREFIX + bf.getPreferenceName()); addField(new BooleanFieldEditor(NSF_EXPORT_XLS_USE_TMP_FILE, Messages.ExcelExporterPreferencePage_62, sc)); addField(new BooleanFieldEditor(NSF_EXPORT_XLS_CELL_COMPLEX_FORMAT, Messages.ExcelExporterPreferencePage_63, sc)); scompo.setMinSize(sc.getSize()); scompo.setContent(sc); ptab.setControl(scompo); }
/** * 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); }
/** * 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() { this.createBeyondCompareFieldEditors(); this.addField(new EmptyFieldEitor(this.getFieldEditorParent())); this.createTortoiseFieldEditors("SVN", "TortoiseProc.exe", "TortoiseMerge.exe", PreferenceConstants.TORTOISE_SVN); this.addField(new EmptyFieldEitor(this.getFieldEditorParent())); this.createTortoiseFieldEditors("Git", "TortoiseGitProc.exe", "TortoiseGitMerge.exe", PreferenceConstants.TORTOISE_GIT); /*final String tortoiseHgExecutable = "thg.exe"; this.addField(new EmptyFieldEitor(this.getFieldEditorParent())); this.createTortoiseFieldEditors("Hg", tortoiseHgExecutable, tortoiseHgExecutable, PreferenceConstants.TORTOISE_HG); */ for (BooleanFieldEditor featureEnabledEditor : this.controlMapping.keySet()) { featureEnabledEditor.setPropertyChangeListener(this); final boolean featureEnabled = this.getPreferenceStore().getBoolean(featureEnabledEditor.getPreferenceName()); for (FieldEditor fieldEditor : this.controlMapping.get(featureEnabledEditor)) { fieldEditor.setPropertyChangeListener(this); fieldEditor.setEnabled(featureEnabled, getFieldEditorParent()); } } }
@Override public final void propertyChange(final PropertyChangeEvent event) { final Object eventSource = event.getSource(); if (eventSource instanceof BooleanFieldEditor) { final BooleanFieldEditor featureEnabledEditor = (BooleanFieldEditor) eventSource; if (this.controlMapping.keySet().contains(featureEnabledEditor)) { final boolean featureEnabled = featureEnabledEditor.getBooleanValue(); for (FieldEditor fieldEditor : this.controlMapping.get(featureEnabledEditor)) { fieldEditor.setEnabled(featureEnabled, getFieldEditorParent()); } } } // Updated the apply button in every case because the property change // can be caused by a changed string or path value this.updateApplyButton(); }
@Override public final boolean isValid() { // Search for enabled features wit invalid configuration options for (BooleanFieldEditor featureEnabledEditor : this.controlMapping.keySet()) { if (featureEnabledEditor.getBooleanValue() == true) { for (FieldEditor fieldEditor : this.controlMapping.get(featureEnabledEditor)) { if (fieldEditor.isValid() == false) { return false; } } } } return true; }
@Override public void propertyChange(final PropertyChangeEvent event) { super.propertyChange(event); if (event.getSource() instanceof BooleanFieldEditor) { final BooleanFieldEditor changedBooleanFieldEditor = (BooleanFieldEditor) event.getSource(); final Boolean parentEnabled = (Boolean) event.getNewValue(); for (final Entry<IPreference, FieldEditorWrapper> entry : fieldEditorMap.entrySet()) { if (entry.getValue().getFieldEditor().equals(changedBooleanFieldEditor)) { // Found! for (final IPreference childPreference : entry.getKey().getChildren()) { updateChildrenStatus(childPreference, parentEnabled); } break; // Done! } } } }
protected boolean getParentsEnabled(final IPreference preference) { final FieldEditorWrapper fieldEditorWrapper = universe.get(preference); boolean parentEnabled; if (fieldEditorWrapper == null) { // Field belongs to a not-yet-created page. parentEnabled = getBooleanFromStore(preference); } else { try { parentEnabled = ((BooleanFieldEditor) fieldEditorWrapper.getFieldEditor()).getBooleanValue(); } catch (final NullPointerException e) { // Uninitialized field. logger.log(Level.FINE, e.toString(), e); parentEnabled = getPreferenceStore().getBoolean(preference.getName()); } } if (preference.getParent() != null) { return parentEnabled && getParentsEnabled(preference.getParent()); } else { return parentEnabled; } }
protected boolean checkParentsEnabled(final Set<IPreference> parents) { boolean parentEnabled = true; for (final IPreference preference : parents) { final FieldEditorWrapper fieldEditorWrapper = universe.get(preference); if (fieldEditorWrapper == null) { parentEnabled = getBooleanFromStore(preference); } else { final FieldEditor fieldEditor = fieldEditorWrapper.getFieldEditor(); if (fieldEditor instanceof BooleanFieldEditor) { try { parentEnabled = ((BooleanFieldEditor) fieldEditor).getBooleanValue(); } catch (final NullPointerException e) { logger.log(Level.FINE, e.toString(), e); parentEnabled = getBooleanFromStore(preference); } } } if (!parentEnabled) { break; // don't waste time } } return parentEnabled; }
@Override protected void createFieldEditors() { Composite p = getFieldEditorParent(); // Users can choose whether they want to use Aptana's find bar or the default find bar. addField(new BooleanFieldEditor(IPreferencesConstants.USE_CUSTOM_FIND_BAR, MessageFormat.format( Messages.FindBarPreferencesPage_AskUseCustomFindBar, EclipseUtil.getStudioPrefix()), p)); // Users can choose whether to do incremental searches or not. addField(new BooleanFieldEditor(IPreferencesConstants.INCREMENTAL_SEARCH_ON_FIND_BAR, Messages.FindBarPreferencesPage_AskIncrementalSearchesOnFindBar, p)); addField(new BooleanFieldEditor(IPreferencesConstants.CTRL_F_TWICE_OPENS_ECLIPSE_FIND_BAR, Messages.FindBarPreferencesPage_AskCtrlFTwiceOpensEclipseSearchOnFindBar, p)); }
@Override protected Composite createFoldingOptions(Composite parent) { this.foldingGroup = super.createFoldingOptions(parent); // Initially fold these elements: Label initialFoldLabel = new Label(foldingGroup, SWT.WRAP); initialFoldLabel.setText(Messages.CSSPreferencePage_initial_fold_options_label); // Comments foldComments = new BooleanFieldEditor(IPreferenceConstants.INITIALLY_FOLD_COMMENTS, Messages.CSSPreferencePage_fold_comments_label, foldingGroup); addField(foldComments); // Rules foldRules = new BooleanFieldEditor(IPreferenceConstants.INITIALLY_FOLD_RULES, Messages.CSSPreferencePage_fold_rules_label, foldingGroup); addField(foldRules); return foldingGroup; }
@Override protected Composite createContentAssistOptions(Composite parent) { Composite caOptions = super.createContentAssistOptions(parent); final Composite fieldEditorGroup = new Composite(parent, SWT.NONE); fieldEditorGroup.setLayoutData(GridDataFactory.fillDefaults().span(2, 1).create()); // Auto-insert closing tags BooleanFieldEditor closingTag = new BooleanFieldEditor(IPreferenceConstants.HTML_AUTO_CLOSE_TAG_PAIRS, Messages.HTMLPreferencePage_AutoInsertCloseTagLabel, fieldEditorGroup); addField(closingTag); // Hit remote URLs for src/href path children proposals BooleanFieldEditor remoteHREFProposals = new BooleanFieldEditor( IPreferenceConstants.HTML_REMOTE_HREF_PROPOSALS, Messages.HTMLPreferencePage_TraverseRemoteURIsForPathAssistLabel, fieldEditorGroup); addField(remoteHREFProposals); return caOptions; }
private void createUI_20_Cleanup(final Composite parent) { final Group group = new Group(parent, SWT.NONE); group.setText(Messages.PrefPage_Photo_ThumbStore_Group_Cleanup); GridDataFactory.fillDefaults().grab(true, false).applyTo(group); { /* * field: use default location */ _editorBoolDoCleanup = new BooleanFieldEditor( IPhotoPreferences.PHOTO_THUMBNAIL_STORE_IS_CLEANUP, Messages.PrefPage_Photo_ThumbStore_Checkbox_Cleanup, group); _editorBoolDoCleanup.setPage(this); _editorBoolDoCleanup.setPreferenceStore(_prefStore); addField(_editorBoolDoCleanup); createUI_30_CleanupOptions(group); createUI_40_CleanupNow(group); createUI_50_LastCleanup(group); } // !!! set layout after the editor was created because the editor sets the parents layout GridLayoutFactory.swtDefaults().numColumns(1).applyTo(group); }
private void createUI_30_ApplyOption(final Composite parent) { /* * checkbox: pace min/max value */ _booleanEditorApplyOption = new BooleanFieldEditor( IPreferences.SRTM_APPLY_WHEN_PROFILE_IS_SELECTED, Messages.prefPage_srtm_profile_option_apply_when_selected, parent); _booleanEditorApplyOption.setPreferenceStore(_prefStore); _booleanEditorApplyOption.setPage(this); _booleanEditorApplyOption.setPropertyChangeListener(new IPropertyChangeListener() { @Override public void propertyChange(final PropertyChangeEvent event) { if (((Boolean) event.getNewValue())) { // apply profile final Object firstElement = ((StructuredSelection) _profileViewer.getSelection()).getFirstElement(); if (firstElement instanceof SRTMProfile) { onSelectProfile((SRTMProfile) firstElement, true); } } } }); }
@Override protected 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())); }
protected void createOtherFieldEditors(Composite appearanceComposite) { /* OTHER */ Composite otherComposite = new Composite(appearanceComposite, SWT.NONE); GridLayout otherLayout = new GridLayout(); otherLayout.marginWidth = 0; otherLayout.marginHeight = 0; otherComposite.setLayout(otherLayout); /* linking with outline */ linkEditorWithOutline = new BooleanFieldEditor(P_LINK_OUTLINE_WITH_EDITOR.getId(), "New opened editors are linked with outline", otherComposite); linkEditorWithOutline.getDescriptionControl(otherComposite) .setToolTipText("Via this setting the default behaviour for new opened outlines is set"); addField(linkEditorWithOutline); }