org.eclipse.jface.preference.BooleanFieldEditor Java Examples

The following examples show how to use org.eclipse.jface.preference.BooleanFieldEditor. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: FindBarPreferencePage.java    From APICloud-Studio with GNU General Public License v3.0 6 votes vote down vote up
@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));
}
 
Example #2
Source File: ViewerSettingsPreferencePage.java    From texlipse with Eclipse Public License 1.0 6 votes vote down vote up
/**
    * Creates the page components.
 */
protected void createFieldEditors() {
       
       TexlipsePreferencePage.addSpacer(2, getFieldEditorParent());
       ViewerListFieldEditor vfe = new ViewerListFieldEditor(TexlipsePlugin.getResourceString("preferenceViewerConfigsLabel"), getFieldEditorParent());
       addField(vfe);
       PlatformUI.getWorkbench().getHelpSystem().setHelp(vfe.getListControl(getFieldEditorParent()), TexlipseHelpIds.VIEWER_LIST);
       
       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()));
       
       PlatformUI.getWorkbench().getHelpSystem().setHelp(port.getTextControl(getFieldEditorParent()), TexlipseHelpIds.VIEWER_PORT);
   }
 
Example #3
Source File: PydevVerticalIndentGuidePreferencesPage.java    From Pydev with Eclipse Public License 1.0 6 votes vote down vote up
@Override
protected void createFieldEditors() {
    Composite p = getFieldEditorParent();

    showVerticalindentGuideFieldEditor = new BooleanFieldEditor(PyDevEditorPreferences.USE_VERTICAL_INDENT_GUIDE,
            "Show vertical indent guide?", p);
    addField(showVerticalindentGuideFieldEditor);

    useEditorForegroundAsColorFieldEditor = new BooleanFieldEditor(
            PyDevEditorPreferences.USE_VERTICAL_INDENT_COLOR_EDITOR_FOREGROUND,
            "Use the editor foreground as the color?", p);
    addField(useEditorForegroundAsColorFieldEditor);

    selectionColorFieldEditor = new ColorFieldEditor(PyDevEditorPreferences.VERTICAL_INDENT_COLOR,
            "Vertical indent guide color.", p);
    addField(selectionColorFieldEditor);

    transparencyFieldEditor = new IntegerFieldEditor(PyDevEditorPreferences.VERTICAL_INDENT_TRANSPARENCY,
            "Vertical indent guide transparency\n(0 = transparent, 255 = opaque).", p);
    transparencyFieldEditor.setValidRange(0, 255);
    addField(transparencyFieldEditor);

    updateInitialState();
}
 
Example #4
Source File: EsbPreferencePage.java    From tesb-studio-se with Apache License 2.0 6 votes vote down vote up
@Override
protected void createFieldEditors() {
    StringFieldEditor localRestServiceUri = new StringFieldEditor(Activator.REST_URI_PREFERENCE,
            Messages.EsbPreferencePage_DEFAULT_REST_ENDPOINT_URI, getFieldEditorParent());
    localRestServiceUri.setEmptyStringAllowed(false);
    addField(localRestServiceUri);

    StringFieldEditor defaultServiceNamespace = new StringFieldEditor(Activator.DEFAULT_SL_NAMESPACE_PREF,
            Messages.EsbPreferencePage_SL_NAMESPACE, getFieldEditorParent());
    defaultServiceNamespace.setEmptyStringAllowed(false);
    addField(defaultServiceNamespace);
    
    BooleanFieldEditor ignoreSLStudio = new BooleanFieldEditor(Activator.IGNORE_SL_STUDIO,
            Messages.EsbPreferencePage_IGNORE_SL_STUDIO, getFieldEditorParent());
    addField(ignoreSLStudio);
}
 
Example #5
Source File: RefactoringPreferencePage.java    From xtext-eclipse with Eclipse Public License 2.0 6 votes vote down vote up
@Override
protected void 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();
}
 
Example #6
Source File: MechanicPreferencePage.java    From workspacemechanic with Eclipse Public License 1.0 6 votes vote down vote up
/**
   * 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());
  }
 
Example #7
Source File: PreferencePage.java    From uima-uimaj with Apache License 2.0 6 votes vote down vote up
@Override
public void createFieldEditors() {
  addField(new BooleanFieldEditor(P_JCAS, "&Automatically run JCasGen when Types change",
          getFieldEditorParent()));

  addField(new BooleanFieldEditor(P_JCAS_LIMIT_TO_PROJECT_SCOPE, "&Limit JCasGen to types defined in this project",
      getFieldEditorParent()));

  addField(new BooleanFieldEditor(P_SHOW_FULLY_QUALIFIED_NAMES, "&Show fully qualified names",
          getFieldEditorParent()));

  addField(new IntegerFieldEditor(P_XML_TAB_SPACES, "&XML indentation", getFieldEditorParent()));

  addField(new StringFieldEditor(P_VNS_HOST, "&Vinci Name Service Host IP address",
          getFieldEditorParent()));

  addField(new StringFieldEditor(P_VNS_PORT, "Vinci NameService &Port number",
          getFieldEditorParent()));
}
 
Example #8
Source File: HTMLPreferencePage.java    From APICloud-Studio with GNU General Public License v3.0 6 votes vote down vote up
@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;
}
 
Example #9
Source File: CSSPreferencePage.java    From APICloud-Studio with GNU General Public License v3.0 6 votes vote down vote up
@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;
}
 
Example #10
Source File: IndentationPreferencePage.java    From texlipse with Eclipse Public License 1.0 6 votes vote down vote up
/**
    * 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()));
}
 
Example #11
Source File: GeneralPreferencePage.java    From tlaplus with MIT License 6 votes vote down vote up
/**
 * 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);
}
 
Example #12
Source File: MedicationSettings.java    From elexis-3-core with Eclipse Public License 1.0 6 votes vote down vote up
@Override
protected void createFieldEditors(){
	addField(new BooleanFieldEditor(
		CreatePrescriptionHelper.MEDICATION_SETTINGS_ALWAYS_SHOW_SIGNATURE_DIALOG,
		"Signatur Dialog auch bei vorhandener Std. Signatur anzeigen", getFieldEditorParent()));
	
	addField(new BooleanFieldEditor(
		CreatePrescriptionHelper.MEDICATION_SETTINGS_SIGNATURE_STD_DISPENSATION,
		"Bei Signatur Dialog Abgabe vorselektieren", getFieldEditorParent()));
	
	addField(new BooleanFieldEditor(
		CreatePrescriptionHelper.MEDICATION_SETTINGS_DISPENSE_ARTIKELSTAMM_CONVERT,
		"Beim dispensieren auf Artikelstamm prüfen, und konvertieren", getFieldEditorParent()));
	
	sortingFieldEditor =
		new BooleanFieldEditor(MedicationUiTester.MEDICATION_SETTINGS_SHOW_CUSTOM_SORT,
			"Persönliche Sortierung anzeigen", getFieldEditorParent());
	addField(sortingFieldEditor);
	addField(new BooleanFieldEditor(Preferences.USR_SUPPRESS_INTERACTION_CHECK,
			ch.elexis.core.l10n.Messages.UserSettings2_SuppressInteractionCheck, getFieldEditorParent()));

	addField(new MultilineFieldEditor(Preferences.MEDICATION_SETTINGS_EMEDIPLAN_HEADER_COMMENT, "Eine Bemerkung auf dem eMediplan anzeigen"
		, getFieldEditorParent()));
}
 
Example #13
Source File: OpenApi3ValidationPreferences.java    From KaiZen-OpenAPI-Editor with Eclipse Public License 1.0 6 votes vote down vote up
@Override
protected void createFieldEditors() {
    Composite parent = new Composite(getFieldEditorParent(), SWT.NONE);

    GridLayoutFactory.fillDefaults() //
            .numColumns(2) //
            .margins(5, 8) //
            .spacing(5, 20) //
            .applyTo(parent);

    // Should wrap the fields in a composite to allow use of spacing.
    {
        Composite composite = new Composite(parent, SWT.NONE);
        GridDataFactory.fillDefaults().span(2, 1).applyTo(composite);
        addField(new BooleanFieldEditor(ADVANCED_VALIDATION, "Enable advanced validation", composite));
    }

    Set<PreferenceProvider> providers = ExtensionUtils.getPreferenceProviders(VALIDATION_PREFERENCE_PAGE);
    providers.forEach(provider -> {
        for (FieldEditor field : provider.createFields(Version.OPENAPI, parent)) {
            addField(field);
        }
    });
}
 
Example #14
Source File: TmfTracingPreferencePage.java    From tracecompass with Eclipse Public License 2.0 6 votes vote down vote up
@Override
protected void createFieldEditors() {
    BooleanFieldEditor explorerRange = new BooleanFieldEditor(ITmfUIPreferences.TRACE_DISPLAY_RANGE_PROJECTEXPLORER,
            Messages.TmfTracingPreferencePage_TraceRangeInProjectExplorer, getFieldEditorParent());
    addField(explorerRange);

    BooleanFieldEditor confirmDeletionSupplementaryFiles = new BooleanFieldEditor(ITmfUIPreferences.CONFIRM_DELETION_SUPPLEMENTARY_FILES,
            Messages.TmfTracingPreferencePage_ConfirmDeletionSupplementaryFiles, getFieldEditorParent());
    addField(confirmDeletionSupplementaryFiles);

    BooleanFieldEditor resourceRefresh = new BooleanFieldEditor(ITmfUIPreferences.ALWAYS_CLOSE_ON_RESOURCE_CHANGE,
            Messages.TmfTracingPreferencePage_AlwaysCloseOnResourceChange, getFieldEditorParent());
    addField(resourceRefresh);

    BooleanFieldEditor treeXyWarning = new BooleanFieldEditor(ITmfUIPreferences.HIDE_MANY_ENTRIES_SELECTED_TOGGLE,
            Messages.TmfTracingPreferencePage_HideManyEntriesSelectedWarning, getFieldEditorParent());
    addField(treeXyWarning);

    BooleanFieldEditor useBrowserTooltips = new BooleanFieldEditor(ITmfUIPreferences.USE_BROWSER_TOOLTIPS,
            Messages.TmfTracingPreferencePage_UseBrowserTooltips, getFieldEditorParent());
    addField(useBrowserTooltips);
}
 
Example #15
Source File: PreferencePage.java    From jd-eclipse with GNU General Public License v3.0 6 votes vote down vote up
/**
 * 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_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_METADATA, 
		"Show metadata", fieldEditorParent));
}
 
Example #16
Source File: AnnotationEditorPreferencePage.java    From uima-uimaj with Apache License 2.0 6 votes vote down vote up
@Override
protected void createFieldEditors() {
  // editor line length hint
  mEditorLineLengthHint = new IntegerFieldEditor(
          AnnotationEditorPreferenceConstants.EDITOR_LINE_LENGTH_HINT,
          "Line Length Hint", getFieldEditorParent());
  addField(mEditorLineLengthHint);
  
  // editor text size
  mEditorTextSize = new IntegerFieldEditor(
          AnnotationEditorPreferenceConstants.ANNOTATION_EDITOR_TEXT_SIZE,
          "Editor Text Size", getFieldEditorParent());
  addField(mEditorTextSize);
  
  // load CAS with partial type system
  BooleanFieldEditor editorPartialTypesystem = new BooleanFieldEditor(
      AnnotationEditorPreferenceConstants.ANNOTATION_EDITOR_PARTIAL_TYPESYSTEM,
      "Load CAS leniently (WARNING: only for experienced users)", getFieldEditorParent());
  addField(editorPartialTypesystem);
  
}
 
Example #17
Source File: MoosePreferencePage.java    From ice with Eclipse Public License 1.0 6 votes vote down vote up
@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()));
}
 
Example #18
Source File: EditorsPreferencePage.java    From APICloud-Studio with GNU General Public License v3.0 5 votes vote down vote up
/**
 * 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 appearanceComposite = getFieldEditorParent();

	// Typing
	Composite group = AptanaPreferencePage.createGroup(appearanceComposite, Messages.EditorsPreferencePage_Typing);
	addField(new BooleanFieldEditor(IPreferenceConstants.ENABLE_CHARACTER_PAIR_COLORING,
			Messages.EditorsPreferencePage_Colorize_Matching_Character_Pairs, group));
	addField(new BooleanFieldEditor(IPreferenceConstants.EDITOR_PEER_CHARACTER_CLOSE,
			Messages.EditorsPreferencePage_Close_Matching_Character_Pairs, group));
	addField(new BooleanFieldEditor(IPreferenceConstants.EDITOR_WRAP_SELECTION,
			Messages.EditorsPreferencePage_Wrap_Selection, group));

	// Save Actions
	group = AptanaPreferencePage.createGroup(appearanceComposite, Messages.EditorsPreferencePage_saveActionsGroup);
	addField(new BooleanFieldEditor(IPreferenceConstants.EDITOR_REMOVE_TRAILING_WHITESPACE,
			Messages.EditorsPreferencePage_saveActionRemoveWhitespaceCharacters, group));

	// Syntax coloring
	group = AptanaPreferencePage.createGroup(appearanceComposite, Messages.EditorsPreferencePage_SyntaxColoring);
	group.setLayout(GridLayoutFactory.swtDefaults().create());
	group.setLayoutData(GridDataFactory.fillDefaults().grab(true, false).create());
	IntegerFieldEditor colEditor = new IntegerFieldEditor(IPreferenceConstants.EDITOR_MAX_COLORED_COLUMNS,
			StringUtil.makeFormLabel(Messages.EditorsPreferencePage_MaxColumnsLabel), group);
	colEditor.setValidRange(-1, Integer.MAX_VALUE);
	addField(colEditor);

	// Word Wrap
	addField(new BooleanFieldEditor(IPreferenceConstants.ENABLE_WORD_WRAP,
			Messages.EditorsPreferencePage_Enable_WordWrap, appearanceComposite));

	createTextEditorLink(appearanceComposite);
}
 
Example #19
Source File: CommonEditorPreferencePage.java    From APICloud-Studio with GNU General Public License v3.0 5 votes vote down vote up
/**
 * Create the Mark Occurrences group and options if there are any for this language/editor.
 * 
 * @param parent
 */
protected void createMarkOccurrenceOptions(Composite parent)
{
	Composite group = AptanaPreferencePage.createGroup(parent, "Mark Occurrences"); //$NON-NLS-1$

	// @formatter:off
	addField(
		new BooleanFieldEditor(
			IPreferenceConstants.EDITOR_MARK_OCCURRENCES,
			Messages.EditorsPreferencePage_MarkOccurrences,
			group
		)
	);
	// @formatter:on
}
 
Example #20
Source File: CommonEditorPreferencePage.java    From APICloud-Studio with GNU General Public License v3.0 5 votes vote down vote up
protected void createAutoIndentOptions(Composite parent)
{
	Composite autoIndentGroup = new Composite(parent, SWT.NONE);
	autoIndentGroup.setLayoutData(GridDataFactory.fillDefaults().span(3, 1).create());

	addField(new BooleanFieldEditor(IPreferenceConstants.EDITOR_AUTO_INDENT,
			Messages.CommonEditorPreferencePage_auto_indent_label, autoIndentGroup));
}
 
Example #21
Source File: CommonEditorPreferencePage.java    From APICloud-Studio with GNU General Public License v3.0 5 votes vote down vote up
protected Composite createFoldingOptions(Composite parent)
{
	Composite foldingGroup = new Composite(parent, SWT.NONE);
	foldingGroup.setLayoutData(GridDataFactory.fillDefaults().span(1, 1).create());

	addField(enableFolding = new BooleanFieldEditor(IPreferenceConstants.EDITOR_ENABLE_FOLDING,
			Messages.CommonEditorPreferencePage_enable_folding_label, foldingGroup));

	return foldingGroup;
}
 
Example #22
Source File: AutoImportsPreferencesPage.java    From Pydev with Eclipse Public License 1.0 5 votes vote down vote up
@Override
public void createFieldEditors() {
    Composite p = getFieldEditorParent();

    addField(new BooleanFieldEditor(AnalysisPreferenceInitializer.DO_AUTO_IMPORT, "Do auto import?",
            BooleanFieldEditor.DEFAULT, p));

    addField(new BooleanFieldEditor(AnalysisPreferenceInitializer.DO_IGNORE_IMPORTS_STARTING_WITH_UNDER,
            "Ignore last modules starting with '_' when doing auto-import/quick fix?", BooleanFieldEditor.DEFAULT,
            p));

    addField(new BooleanFieldEditor(AnalysisPreferenceInitializer.DO_AUTO_IMPORT_ON_ORGANIZE_IMPORTS,
            "Do auto import on organize imports (Ctrl+Shift+O)?", BooleanFieldEditor.DEFAULT, p));
}
 
Example #23
Source File: SwaggerValidationPreferences.java    From KaiZen-OpenAPI-Editor with Eclipse Public License 1.0 5 votes vote down vote up
@Override
protected void createFieldEditors() {
    Composite composite = new Composite(getFieldEditorParent(), SWT.NONE);

    GridLayoutFactory.fillDefaults() //
            .numColumns(2) //
            .margins(5, 8) //
            .spacing(5, 20) //
            .applyTo(composite);

    Group group = new Group(composite, SWT.SHADOW_ETCHED_IN);
    GridDataFactory.fillDefaults().span(2, 1).applyTo(group);

    group.setText("Allow JSON references in additional contexts");

    addField(new BooleanFieldEditor(VALIDATION_REF_SECURITY_DEFINITIONS_OBJECT, "Security Definitions Object",
            group));
    addField(new BooleanFieldEditor(VALIDATION_REF_SECURITY_SCHEME_OBJECT, "Security Scheme Object", group));
    addField(new BooleanFieldEditor(VALIDATION_REF_SECURITY_REQUIREMENTS_ARRAY, "Security Requirements Array",
            group));
    addField(new BooleanFieldEditor(VALIDATION_REF_SECURITY_REQUIREMENT_OBJECT, "Security Requirement Object",
            group));

    // FieldEditor set parent layout to GridLayout with margin = 0
    ((GridLayout) group.getLayout()).marginTop = 8;
    ((GridLayout) group.getLayout()).marginBottom = 8;
    ((GridLayout) group.getLayout()).marginLeft = 8;
    ((GridLayout) group.getLayout()).marginRight = 8;

    // Validation

    Set<PreferenceProvider> providers = ExtensionUtils.getPreferenceProviders(VALIDATION_PREFERENCE_PAGE);
    providers.forEach(provider -> {
        for (FieldEditor field : provider.createFields(Version.SWAGGER, composite)) {
            addField(field);
        }
    });
}
 
Example #24
Source File: PreferencesPage.java    From JReFrameworker with MIT License 5 votes vote down vote up
@Override
protected void createFieldEditors() {
	StringFieldEditor mergeRenamingPrefixStringField = new StringFieldEditor(JReFrameworkerPreferences.MERGE_RENAMING_PREFIX, "&" + MERGE_RENAME_PREFIX_DESCRIPTION, getFieldEditorParent());
	// class files do not have a defined max length, see http://stackoverflow.com/a/695959/475329
	// but if long prefixes becomes a problem use the setTextLimit(int) method to limit input length
	mergeRenamingPrefixStringField.setEmptyStringAllowed(false);
	String mergeRenamingPrefix = JReFrameworkerPreferences.getMergeRenamingPrefix();
	if(mergeRenamingPrefix == null || mergeRenamingPrefix.equals("")){
		mergeRenamingPrefixStringField.setStringValue(JReFrameworkerPreferences.MERGE_RENAMING_PREFIX_DEFAULT);
	}
	addField(mergeRenamingPrefixStringField);
	addField(new BooleanFieldEditor(JReFrameworkerPreferences.VERBOSE_LOGGING, "&" + VERBOSE_LOGGING_DESCRIPTION, getFieldEditorParent()));
}
 
Example #25
Source File: BonitaAdvancedPreferencePage.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
/**
 * 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() {

    createTitleBar(Messages.BonitaPreferenceDialog_Advanced, Pics.getImage(PicsConstants.preferenceAdvanced), false);

    askSaveDiagramAfterFirstSave = new BooleanFieldEditor(BonitaPreferenceConstants.ASK_RENAME_ON_FIRST_SAVE,
            Messages.askRenameDiagram,
            getFieldEditorParent());
    addField(askSaveDiagramAfterFirstSave);

    showConnectorEditionConfirmation = new BooleanFieldEditor(
            HIDE_CONNECTOR_DEFINITION_CHANGE_WARNING,
            Messages.doNotDisplayConnectorDefConfirmationMessage, getFieldEditorParent());
    addField(showConnectorEditionConfirmation);

    new Label(getFieldEditorParent(), SWT.NONE);
    new Label(getFieldEditorParent(), SWT.NONE);

    final Label separator = new Label(getFieldEditorParent(), SWT.SEPARATOR | SWT.HORIZONTAL);
    separator.setLayoutData(GridDataFactory.fillDefaults().grab(true, false).span(2, 1).create());

    new Label(getFieldEditorParent(), SWT.NONE);
    new Label(getFieldEditorParent(), SWT.NONE);

    createPreferenceEditorContributions(ADVANCED_CONTRIBUTOR_ID);
}
 
Example #26
Source File: AnalysisPreferencesPage.java    From depan with Apache License 2.0 5 votes vote down vote up
@Override
protected void createFieldEditors() {
  Composite parent = getFieldEditorParent();

  FileFieldEditor executable = new FileFieldEditor(
      AnalysisPreferenceIds.MVN_ANALYSIS_EXECUTABLE,
      "Maven Executable", 
      true, parent);
  executable.setEmptyStringAllowed(false);

  BooleanFieldEditor systemjava = new BooleanFieldEditor(
      AnalysisPreferenceIds.MVN_ANALYSIS_SYSTEMJAVA,
      "Use System JAVA_HOME",
      BooleanFieldEditor.SEPARATE_LABEL, parent);

  final DirectoryFieldEditor javahome = new DirectoryFieldEditor(
      AnalysisPreferenceIds.MVN_ANALYSIS_JAVAHOME,
      "JAVA_HOME", parent);

  StringFieldEditor effectivepom = new StringFieldEditor(
      AnalysisPreferenceIds.MVN_ANALYSIS_EFFECTIVEPOM,
      "Maven Effective POM command", parent);
  effectivepom.setEmptyStringAllowed(false);

  addField(executable);
  addField(systemjava);
  addField(javahome);
  addField(effectivepom);
}
 
Example #27
Source File: AnalysisPreferencesPage.java    From depan with Apache License 2.0 5 votes vote down vote up
@Override
protected void createFieldEditors() {
  Composite parent = getFieldEditorParent();

  FileFieldEditor executable = new FileFieldEditor(
      AnalysisPreferenceIds.MVN_ANALYSIS_EXECUTABLE,
      "Maven Executable", 
      true, parent);
  executable.setEmptyStringAllowed(false);

  BooleanFieldEditor systemjava = new BooleanFieldEditor(
      AnalysisPreferenceIds.MVN_ANALYSIS_SYSTEMJAVA,
      "Use System JAVA_HOME",
      BooleanFieldEditor.SEPARATE_LABEL, parent);

  final DirectoryFieldEditor javahome = new DirectoryFieldEditor(
      AnalysisPreferenceIds.MVN_ANALYSIS_JAVAHOME,
      "JAVA_HOME", parent);

  StringFieldEditor effectivepom = new StringFieldEditor(
      AnalysisPreferenceIds.MVN_ANALYSIS_EFFECTIVEPOM,
      "Maven Effective POM command", parent);
  effectivepom.setEmptyStringAllowed(false);

  addField(executable);
  addField(systemjava);
  addField(javahome);
  addField(effectivepom);
}
 
Example #28
Source File: CasEditorIdePreferencePage.java    From uima-uimaj with Apache License 2.0 5 votes vote down vote up
@Override
protected void createFieldEditors() {
 
  // should the editor use the last selected type system to open the cas?
  BooleanFieldEditor mEditorRememberTypesystem = new BooleanFieldEditor(CasEditorIdePreferenceConstants.CAS_EDITOR_REMEMBER_TYPESYSTEM,
      "Use the previously selected type system to open a CAS", getFieldEditorParent());
  addField(mEditorRememberTypesystem);
}
 
Example #29
Source File: DropBusinessDataDBFieldEditorContribution.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
@Override
public List<FieldEditor> createFieldEditors(final Composite parent) {
    final List<FieldEditor> editors = new ArrayList<FieldEditor>();

    final BooleanFieldEditor dropOnExitFieldEditor = new BooleanFieldEditor(EnginePreferenceConstants.DROP_BUSINESS_DATA_DB_ON_EXIT_PREF,
            Messages.dropBusinessDataDBOnExit,
            BooleanFieldEditor.DEFAULT, parent);
    dropOnExitFieldEditor.setPreferenceStore(EnginePlugin.getDefault().getPreferenceStore());
    editors.add(dropOnExitFieldEditor);

    return editors;
}
 
Example #30
Source File: CppStylePerfPage.java    From CppStyle with MIT License 5 votes vote down vote up
/**
 * 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() {
	clangFormatPath = new FileFieldEditor(CppStyleConstants.CLANG_FORMAT_PATH, "Clang-format path:",
			getFieldEditorParent());

	addField(clangFormatPath);

	cpplintPath = new FileFieldEditor(CppStyleConstants.CPPLINT_PATH, "Cpplint path:", getFieldEditorParent());

	addField(cpplintPath);

	enableCpplintOnSave = new BooleanFieldEditor(CppStyleConstants.ENABLE_CPPLINT_ON_SAVE,
			CppStyleConstants.ENABLE_CPPLINT_TEXT, getFieldEditorParent());

	if (!checkPathExist(CppStyle.getCpplintPath())) {
		enableCpplintOnSave.setEnabled(false, getFieldEditorParent());
	}

	addField(enableCpplintOnSave);

	enableClangFormatOnSave = new BooleanFieldEditor(CppStyleConstants.ENABLE_CLANGFORMAT_ON_SAVE,
			CppStyleConstants.ENABLE_CLANGFORMAT_TEXT, getFieldEditorParent());

	if (!checkPathExist(ClangFormatFormatter.getClangFormatPath())) {
		enableClangFormatOnSave.setEnabled(false, getFieldEditorParent());
	}

	addField(enableClangFormatOnSave);
}