Search in sources :

Example 6 with RadioGroupFieldEditor

use of org.eclipse.jface.preference.RadioGroupFieldEditor in project linuxtools by eclipse.

the class RpmlintPreferencePage method createFieldEditors.

@Override
protected void createFieldEditors() {
    FileFieldEditor rpmlintFileFieldEditor = new FileFieldEditor(PreferenceConstants.P_RPMLINT_PATH, Messages.RpmlintPreferencePage_0, getFieldEditorParent());
    addField(rpmlintFileFieldEditor);
    RadioGroupFieldEditor spacesAndTabsRadioGroup = new RadioGroupFieldEditor(PreferenceConstants.P_RPMLINT_TABS_AND_SPACES, Messages.RpmlintPreferencePage_1, 1, new String[][] { { Messages.RpmlintPreferencePage_2, PreferenceConstants.P_RPMLINT_SPACES }, { Messages.RpmlintPreferencePage_3, PreferenceConstants.P_RPMLINT_TABS } }, getFieldEditorParent(), true);
    addField(spacesAndTabsRadioGroup);
}
Also used : FileFieldEditor(org.eclipse.jface.preference.FileFieldEditor) RadioGroupFieldEditor(org.eclipse.jface.preference.RadioGroupFieldEditor)

Example 7 with RadioGroupFieldEditor

use of org.eclipse.jface.preference.RadioGroupFieldEditor in project knime-core by knime.

the class HeadlessPreferencePage method createFieldEditors.

/**
 * {@inheritDoc}
 */
@Override
protected void createFieldEditors() {
    Composite parent = getFieldEditorParent();
    // Specify the minimum log level for log file
    addField(new RadioGroupFieldEditor(HeadlessPreferencesConstants.P_LOGLEVEL_LOG_FILE, "Log File Log Level", 4, new String[][] { { "&DEBUG", LEVEL.DEBUG.name() }, { "&INFO", LEVEL.INFO.name() }, { "&WARN", LEVEL.WARN.name() }, { "&ERROR", LEVEL.ERROR.name() } }, parent));
    addField(new BooleanFieldEditor(HeadlessPreferencesConstants.P_LOG_FILE_LOCATION, "Enable per workflow logs", parent));
    m_logDirGLobal = new BooleanFieldEditor(HeadlessPreferencesConstants.P_LOG_GLOBAL_IN_WF_DIR, "Log global messages also to workflow log", parent);
    addField(m_logDirGLobal);
    // number threads
    IntegerFieldEditor maxThreadEditor = new IntegerFieldEditor(HeadlessPreferencesConstants.P_MAXIMUM_THREADS, "Maximum working threads for all nodes", parent, 3);
    maxThreadEditor.setValidRange(1, Math.max(100, Runtime.getRuntime().availableProcessors() * 4));
    maxThreadEditor.setTextLimit(3);
    addField(maxThreadEditor);
    // temp dir
    DirectoryFieldEditor tempDirEditor = new TempDirFieldEditor(HeadlessPreferencesConstants.P_TEMP_DIR, "Directory for temporary files\n(you should restart KNIME after" + " changing this value)", parent);
    tempDirEditor.setEmptyStringAllowed(false);
    addField(tempDirEditor);
    addField(new HorizontalLineField(parent));
    addField(new LabelField(parent, "Improve KNIME", SWT.BOLD));
    addField(new LabelField(parent, "Help us improve KNIME by sending anonymous usage data."));
    addField(new LabelField(parent, "Click <a href=\"https://www.knime.com/faq#usage_data\">here</a> to find out what is being transmitted."));
    BooleanFieldEditor sendAnonymousStatisticsEditor = new BooleanFieldEditor(HeadlessPreferencesConstants.P_SEND_ANONYMOUS_STATISTICS, "Yes, help improve KNIME.", parent);
    addField(sendAnonymousStatisticsEditor);
}
Also used : RadioGroupFieldEditor(org.eclipse.jface.preference.RadioGroupFieldEditor) Composite(org.eclipse.swt.widgets.Composite) IntegerFieldEditor(org.eclipse.jface.preference.IntegerFieldEditor) BooleanFieldEditor(org.eclipse.jface.preference.BooleanFieldEditor) DirectoryFieldEditor(org.eclipse.jface.preference.DirectoryFieldEditor)

Example 8 with RadioGroupFieldEditor

use of org.eclipse.jface.preference.RadioGroupFieldEditor in project knime-core by knime.

the class MainPreferencePage method createFieldEditors.

/**
 * 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() {
    final Composite parent = getFieldEditorParent();
    // Specify the minimum log level for the console
    m_consoleLogEditor = new RadioGroupFieldEditor(KNIMECorePlugin.P_LOGLEVEL_CONSOLE, "Console View Log Level", 4, new String[][] { { "&DEBUG", LEVEL.DEBUG.name() }, { "&INFO", LEVEL.INFO.name() }, { "&WARN", LEVEL.WARN.name() }, { "&ERROR", LEVEL.ERROR.name() } }, parent);
    addField(m_consoleLogEditor);
    addField(new HorizontalLineField(parent));
    addField(new BooleanFieldEditor(PreferenceConstants.P_CONFIRM_RESET, "Confirm Node Reset", parent));
    addField(new BooleanFieldEditor(PreferenceConstants.P_CONFIRM_DELETE, "Confirm Node/Connection Deletion", parent));
    addField(new BooleanFieldEditor(PreferenceConstants.P_CONFIRM_RECONNECT, "Confirm reconnection of already connected nodes", parent));
    addField(new BooleanFieldEditor(PreferenceConstants.P_CONFIRM_EXEC_NODES_NOT_SAVED, "Confirm if executing nodes are not saved", parent));
    addField(new BooleanFieldEditor(PreferenceConstants.P_CONFIRM_LOAD_NIGHTLY_BUILD_WORKFLOW, "Confirm when loading workflows created by a nightly build", parent));
    ComboFieldEditor dataAwareExecutePromptEditor = new ComboFieldEditor(PreferenceConstants.P_EXEC_NODES_DATA_AWARE_DIALOGS, "Execute upstream nodes when needed", new String[][] { { "Always", MessageDialogWithToggle.ALWAYS }, { "Never", MessageDialogWithToggle.NEVER }, { "Prompt", MessageDialogWithToggle.PROMPT } }, getFieldEditorParent());
    addField(dataAwareExecutePromptEditor);
    addField(new HorizontalLineField(parent));
    final BooleanFieldEditor enableAutoSaveBooleanField = new BooleanFieldEditor(PreferenceConstants.P_AUTO_SAVE_ENABLE, "Auto Save open workflows", parent) {

        @Override
        protected void valueChanged(final boolean old, final boolean neu) {
            m_autoSaveIntervalEditor.setEnabled(neu, parent);
            m_autoSaveWithDataEditor.setEnabled(neu, parent);
        }
    };
    m_autoSaveIntervalEditor = new IntegerFieldEditor(PreferenceConstants.P_AUTO_SAVE_INTERVAL, "Auto-Save Interval (in secs)", parent);
    m_autoSaveWithDataEditor = new BooleanFieldEditor(PreferenceConstants.P_AUTO_SAVE_DATA, "Save with data", parent);
    addField(enableAutoSaveBooleanField);
    addField(m_autoSaveIntervalEditor);
    addField(m_autoSaveWithDataEditor);
    addField(new HorizontalLineField(parent));
    addField(new BooleanFieldEditor(PreferenceConstants.P_WRAP_TABLE_HEADER, "Wrap Column Header in Table Views", parent));
    addField(new IntegerFieldEditor(PreferenceConstants.P_ANNOTATION_BORDER_SIZE, "Workflow Annotation border size (in px)", parent));
    addField(new HorizontalLineField(parent));
    ComboFieldEditor updateMetaNodeLinkOnLoadEditor = new ComboFieldEditor(PreferenceConstants.P_META_NODE_LINK_UPDATE_ON_LOAD, "Update metanode links when workflow loads", new String[][] { { "Always", MessageDialogWithToggle.ALWAYS }, { "Never", MessageDialogWithToggle.NEVER }, { "Prompt", MessageDialogWithToggle.PROMPT } }, getFieldEditorParent());
    addField(updateMetaNodeLinkOnLoadEditor);
    addField(new HorizontalLineField(parent));
    addField(new BooleanFieldEditor(PreferenceConstants.P_OMIT_MISSING_BROWSER_WARNING, "Suppress warnings about missing browser integration", parent));
    addField(new HorizontalLineField(parent));
    addField(new LabelField(parent, "Settings for the 'Favorite Nodes' view"));
    IntegerFieldEditor freqHistorySizeEditor = new IntegerFieldEditor(PreferenceConstants.P_FAV_FREQUENCY_HISTORY_SIZE, "Maximal size for most frequently used nodes", parent, 3);
    freqHistorySizeEditor.setValidRange(1, 50);
    freqHistorySizeEditor.setTextLimit(3);
    freqHistorySizeEditor.load();
    IntegerFieldEditor usedHistorySizeEditor = new IntegerFieldEditor(PreferenceConstants.P_FAV_LAST_USED_SIZE, "Maximal size for last used nodes", parent, 3);
    usedHistorySizeEditor.setValidRange(1, 50);
    usedHistorySizeEditor.setTextLimit(3);
    usedHistorySizeEditor.load();
    addField(usedHistorySizeEditor);
    addField(freqHistorySizeEditor);
}
Also used : RadioGroupFieldEditor(org.eclipse.jface.preference.RadioGroupFieldEditor) Composite(org.eclipse.swt.widgets.Composite) IntegerFieldEditor(org.eclipse.jface.preference.IntegerFieldEditor) BooleanFieldEditor(org.eclipse.jface.preference.BooleanFieldEditor) ComboFieldEditor(org.eclipse.jface.preference.ComboFieldEditor)

Example 9 with RadioGroupFieldEditor

use of org.eclipse.jface.preference.RadioGroupFieldEditor in project janrufmonitor by tbrandt77.

the class Dialog method createFieldEditors.

protected void createFieldEditors() {
    super.createFieldEditors();
    BooleanFieldEditor bfe = null;
    if (isExpertMode()) {
        bfe = new BooleanFieldEditor(this.getConfigNamespace() + SEPARATOR + "outgoing", this.m_i18n.getString(this.getNamespace(), "outgoing", "label", this.m_language), this.getFieldEditorParent());
        addField(bfe);
        bfe = new BooleanFieldEditor(this.getConfigNamespace() + SEPARATOR + "balloon", this.m_i18n.getString(this.getNamespace(), "balloon", "label", this.m_language), this.getFieldEditorParent());
        addField(bfe);
        bfe = new BooleanFieldEditor(this.getConfigNamespace() + SEPARATOR + "focus", this.m_i18n.getString(this.getNamespace(), "focus", "label", this.m_language), this.getFieldEditorParent());
        addField(bfe);
    }
    RadioGroupFieldEditor rgfe = new RadioGroupFieldEditor(this.CONFIG_NAMESPACE + SEPARATOR + "position", this.m_i18n.getString(this.getNamespace(), "position", "label", this.m_language), 2, new String[][] { { this.m_i18n.getString(this.getNamespace(), "lefttop", "label", this.m_language), "left-top" }, { this.m_i18n.getString(this.getNamespace(), "leftbottom", "label", this.m_language), "left-bottom" }, { this.m_i18n.getString(this.getNamespace(), "righttop", "label", this.m_language), "right-top" }, { this.m_i18n.getString(this.getNamespace(), "rightbottom", "label", this.m_language), "right-bottom" }, { this.m_i18n.getString(this.getNamespace(), "center", "label", this.m_language), "center" } }, this.getFieldEditorParent(), true);
    addField(rgfe);
    if (isExpertMode()) {
        bfe = new BooleanFieldEditor(this.getConfigNamespace() + SEPARATOR + "freepos", this.m_i18n.getString(this.getNamespace(), "freepos", "label", this.m_language), this.getFieldEditorParent());
        addField(bfe);
    }
    StringFieldEditor sfe = null;
    if (isExpertMode()) {
        new Label(this.getFieldEditorParent(), SWT.NULL);
        rgfe = new RadioGroupFieldEditor(this.getConfigNamespace() + SEPARATOR + "showtime", this.m_i18n.getString(this.getNamespace(), "showtime", "label", this.m_language), 1, new String[][] { { this.m_i18n.getString(this.getNamespace(), "hide", "label", this.m_language), "-1" }, { this.m_i18n.getString(this.getNamespace(), "manual", "label", this.m_language), "-2" }, { this.m_i18n.getString(this.getNamespace(), "time", "label", this.m_language), "1" } }, this.getFieldEditorParent(), true);
        addField(rgfe);
        sfe = new StringFieldEditor(this.getConfigNamespace() + SEPARATOR + "showduration", this.m_i18n.getString(this.getNamespace(), "showduration", "label", this.m_language), 5, this.getFieldEditorParent());
        sfe.setEmptyStringAllowed(false);
        addField(sfe);
        new Label(this.getFieldEditorParent(), SWT.NULL);
        bfe = new BooleanFieldEditor(this.getConfigNamespace() + SEPARATOR + "assign", this.m_i18n.getString(this.getNamespace(), "assign", "label", this.m_language), this.getFieldEditorParent());
        addField(bfe);
    }
    ColorFieldEditor cfe = new ColorFieldEditor(this.getConfigNamespace() + SEPARATOR + "fontcolor", this.m_i18n.getString(this.getNamespace(), "fontcolor", "label", this.m_language), this.getFieldEditorParent());
    addField(cfe);
    bfe = new BooleanFieldEditor(this.getConfigNamespace() + SEPARATOR + "usemsncolor", this.m_i18n.getString(this.getNamespace(), "usemsncolor", "label", this.m_language), this.getFieldEditorParent());
    addField(bfe);
    bfe = new BooleanFieldEditor(this.getConfigNamespace() + SEPARATOR + "spamcolor", this.m_i18n.getString(this.getNamespace(), "spamcolor", "label", this.m_language), this.getFieldEditorParent());
    addField(bfe);
    sfe = new StringFieldEditor(this.getConfigNamespace() + SEPARATOR + "fontsize", this.m_i18n.getString(this.getNamespace(), "fontsize", "label", this.m_language), 5, this.getFieldEditorParent());
    sfe.setEmptyStringAllowed(false);
    addField(sfe);
}
Also used : StringFieldEditor(org.eclipse.jface.preference.StringFieldEditor) RadioGroupFieldEditor(org.eclipse.jface.preference.RadioGroupFieldEditor) ColorFieldEditor(org.eclipse.jface.preference.ColorFieldEditor) Label(org.eclipse.swt.widgets.Label) BooleanFieldEditor(org.eclipse.jface.preference.BooleanFieldEditor)

Example 10 with RadioGroupFieldEditor

use of org.eclipse.jface.preference.RadioGroupFieldEditor in project egit by eclipse.

the class SynchronizePreferencePage method createFieldEditors.

@Override
protected void createFieldEditors() {
    addField(new BooleanFieldEditor(UIPreferences.SYNC_VIEW_FETCH_BEFORE_LAUNCH, UIText.GitPreferenceRoot_fetchBeforeSynchronization, getFieldEditorParent()));
    addField(new BooleanFieldEditor(UIPreferences.SYNC_VIEW_ALWAYS_SHOW_CHANGESET_MODEL, UIText.GitPreferenceRoot_automaticallyEnableChangesetModel, getFieldEditorParent()));
    addField(new BooleanFieldEditor(UIPreferences.USE_LOGICAL_MODEL, UIText.GitPreferenceRoot_useLogicalModel, getFieldEditorParent()));
    Label spacer = new Label(getFieldEditorParent(), SWT.NONE);
    spacer.setSize(0, 12);
    Composite modelStrategyParent = getFieldEditorParent();
    preferredMergeStrategyEditor = new RadioGroupFieldEditor(GitCorePreferences.core_preferredMergeStrategy, UIText.GitPreferenceRoot_preferreMergeStrategy_group, 1, getAvailableMergeStrategies(), modelStrategyParent, false);
    preferredMergeStrategyEditor.getLabelControl(modelStrategyParent).setToolTipText(UIText.GitPreferenceRoot_preferreMergeStrategy_label);
    addField(preferredMergeStrategyEditor);
}
Also used : RadioGroupFieldEditor(org.eclipse.jface.preference.RadioGroupFieldEditor) Composite(org.eclipse.swt.widgets.Composite) Label(org.eclipse.swt.widgets.Label) BooleanFieldEditor(org.eclipse.jface.preference.BooleanFieldEditor)

Aggregations

RadioGroupFieldEditor (org.eclipse.jface.preference.RadioGroupFieldEditor)23 BooleanFieldEditor (org.eclipse.jface.preference.BooleanFieldEditor)12 Composite (org.eclipse.swt.widgets.Composite)12 IntegerFieldEditor (org.eclipse.jface.preference.IntegerFieldEditor)5 StringFieldEditor (org.eclipse.jface.preference.StringFieldEditor)5 GridLayout (org.eclipse.swt.layout.GridLayout)5 Label (org.eclipse.swt.widgets.Label)4 ComboFieldEditor (org.eclipse.jface.preference.ComboFieldEditor)3 DirectoryFieldEditor (org.eclipse.jface.preference.DirectoryFieldEditor)3 GridData (org.eclipse.swt.layout.GridData)3 Group (org.eclipse.swt.widgets.Group)3 IPropertyChangeListener (org.eclipse.jface.util.IPropertyChangeListener)2 PropertyChangeEvent (org.eclipse.jface.util.PropertyChangeEvent)2 Control (org.eclipse.swt.widgets.Control)2 File (java.io.File)1 ArrayList (java.util.ArrayList)1 TraceType (org.csstudio.javafx.rtplot.TraceType)1 ArchiveRescale (org.csstudio.trends.databrowser3.model.ArchiveRescale)1 DefaultScope (org.eclipse.core.runtime.preferences.DefaultScope)1 IPreferenceChangeListener (org.eclipse.core.runtime.preferences.IEclipsePreferences.IPreferenceChangeListener)1