Java Code Examples for org.eclipse.jface.preference.BooleanFieldEditor#setEnabled()

The following examples show how to use org.eclipse.jface.preference.BooleanFieldEditor#setEnabled() . 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: ParserPreferencePage.java    From tlaplus with MIT License 6 votes vote down vote up
/**
 * 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);

}
 
Example 2
Source File: StatechartAppearancePreferencePage.java    From statecharts with Eclipse Public License 1.0 6 votes vote down vote up
protected void createMiscellaneousEditors(Composite main) {
	Composite composite = createGroupComposite(main, "Miscellaneous");

	// Syntax coloring:
	BooleanFieldEditor fontScalingEditor = new BooleanFieldEditor(StatechartPreferenceConstants.PREF_FONT_SCALING,
			"Enable font scaling (Windows)", composite);
	addField(fontScalingEditor);
	if (System.getProperty("os.name").toLowerCase().indexOf("win") == -1) {
		fontScalingEditor.setEnabled(false, composite);
	}

	// Syntax coloring:
	BooleanFieldEditor syntaxColoringEditor = new BooleanFieldEditor(
			StatechartPreferenceConstants.PREF_SYNTAX_COLORING, "Enable syntax coloring", composite);
	addField(syntaxColoringEditor);

	// Priority labels:
	BooleanFieldEditor priorityLabelsEditor = new BooleanFieldEditor(
			StatechartPreferenceConstants.PREF_PRIORITY_LABELS, "Show transition and region priority", composite);
	addField(priorityLabelsEditor);

	// Live validation:
	BooleanFieldEditor liveValidationEditor = new BooleanFieldEditor(
			StatechartPreferenceConstants.PREF_LIVE_VALIDATION, "Enable live validation", composite);
	addField(liveValidationEditor);
}
 
Example 3
Source File: SettingsPreferencePage.java    From cppcheclipse with Apache License 2.0 5 votes vote down vote up
private void refresh() {
	numberOfThreads.setEnabled(!unusedFunctionsCheck.getBooleanValue()
			&& !allCheck.getBooleanValue(), getFieldEditorParent());
	for (BooleanFieldEditor editor : checkEditors) {
		editor.setEnabled(!allCheck.getBooleanValue(), checkGroup);
	}
}
 
Example 4
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);
}
 
Example 5
Source File: BonitaDatabasePreferencePage.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_database, Pics.getImage(PicsConstants.preferenceDB), false);

    dropDB = new BooleanFieldEditor(BonitaPreferenceConstants.DELETE_TENANT_ON_EXIT, Messages.deleteTenantOnExit,
            getFieldEditorParent());
    addField(dropDB);
    usersAndRoles = new BooleanFieldEditor(BonitaPreferenceConstants.LOAD_ORGANIZATION,
            Messages.reloadDefaultOrganization, getFieldEditorParent()) {

        @Override
        protected org.eclipse.swt.widgets.Button getChangeControl(final org.eclipse.swt.widgets.Composite parent) {
            checkbox = super.getChangeControl(parent);
            return checkbox;
        }

    };
    addField(usersAndRoles);
    usersAndRoles.setEnabled(
            BonitaStudioPreferencesPlugin.getDefault().getPreferenceStore()
                    .getBoolean(BonitaPreferenceConstants.DELETE_TENANT_ON_EXIT),
            getFieldEditorParent());

    createPreferenceEditorContributions(DATABASE_CONTRIBUTOR_ID);
}
 
Example 6
Source File: ControlPreferencePage.java    From tracecompass with Eclipse Public License 2.0 4 votes vote down vote up
@Override
protected void createFieldEditors() {

    StringFieldEditor tracingGroup = new StringFieldEditor(ControlPreferences.TRACE_CONTROL_TRACING_GROUP_PREF, Messages.TraceControl_TracingGroupPreference, getFieldEditorParent());
    addField(tracingGroup);

    BooleanFieldEditor logCommand = new BooleanFieldEditor(ControlPreferences.TRACE_CONTROL_LOG_COMMANDS_PREF, Messages.TraceControl_LoggingPreference, getFieldEditorParent());
    addField(logCommand);

    StringFieldEditor logfile = new StringFieldEditor(ControlPreferences.TRACE_CONTROL_LOG_FILE_PATH_PREF, Messages.TraceControl_LogfilePath, getFieldEditorParent());
    addField(logfile);

    fIsAppend = new BooleanFieldEditor(ControlPreferences.TRACE_CONTROL_LOG_APPEND_PREF, Messages.TraceControl_AppendLogfilePreference, getFieldEditorParent());
    addField(fIsAppend);

    fVerboseLevel = new RadioGroupFieldEditor (
            ControlPreferences.TRACE_CONTROL_VERBOSE_LEVEL_PREF,
            Messages.TraceControl_VerboseLevelsPreference,
            4,
            new String[][] {
                {
                    Messages.TraceControl_VerboseLevelNonePreference,
                    ControlPreferences.TRACE_CONTROL_VERBOSE_LEVEL_NONE,
                },
                {
                    Messages.TraceControl_VerboseLevelVerbosePreference,
                    ControlPreferences.TRACE_CONTROL_VERBOSE_LEVEL_VERBOSE
                },
                {
                    Messages.TraceControl_VerboseLevelVeryVerbosePreference,
                    ControlPreferences.TRACE_CONTROL_VERBOSE_LEVEL_V_VERBOSE
                },
                {
                    Messages.TraceControl_VerboseLevelVeryVeryVerbosePreference,
                    ControlPreferences.TRACE_CONTROL_VERBOSE_LEVEL_V_V_VERBOSE
                }
            },
            getFieldEditorParent(),
            true);

    addField(fVerboseLevel);

    Boolean enabled = ControlPreferences.getInstance().isLoggingEnabled();
    fVerboseLevel.setEnabled(enabled, getFieldEditorParent());
    fIsAppend.setEnabled(enabled, getFieldEditorParent());
    logfile.setEnabled(false, getFieldEditorParent());

}