Example usage for org.eclipse.jface.preference StringFieldEditor StringFieldEditor

List of usage examples for org.eclipse.jface.preference StringFieldEditor StringFieldEditor

Introduction

In this page you can find the example usage for org.eclipse.jface.preference StringFieldEditor StringFieldEditor.

Prototype

public StringFieldEditor(String name, String labelText, Composite parent) 

Source Link

Document

Creates a string field editor of unlimited width.

Usage

From source file:org.csstudio.opibuilder.preferences.OPIRuntimePreferencePage.java

License:Open Source License

@Override
protected void createFieldEditors() {
    final Composite parent = getFieldEditorParent();

    macrosEditor = new StringTableFieldEditor(PreferencesHelper.RUN_MACROS, "Macros: ", parent,
            new String[] { "Name", "Value" }, new boolean[] { true, true },
            new MacroEditDialog(parent.getShell()), new int[] { 120, 120 }) {

        @Override// ww w  . j  av a  2 s  . co m
        public boolean isValid() {
            String reason;
            for (String[] row : items) {
                reason = Verifier.checkElementName(row[0]);
                if (reason != null) {
                    wrongMacroName = row[0];
                    return false;
                }
            }
            return true;
        }

        @Override
        protected void doStore() {
            if (!isValid())
                return;
            super.doStore();
        }

        @Override
        protected void doFillIntoGrid(Composite parent, int numColumns) {
            super.doFillIntoGrid(parent, numColumns);
            tableEditor.getTableViewer().getTable().addKeyListener(new KeyAdapter() {
                @Override
                public void keyReleased(KeyEvent e) {
                    boolean valid = isValid();
                    fireStateChanged(IS_VALID, !valid, valid);
                }
            });
            tableEditor.getTableViewer().getTable().addFocusListener(new FocusListener() {

                @Override
                public void focusLost(FocusEvent e) {
                    boolean valid = isValid();
                    fireStateChanged(IS_VALID, !valid, valid);
                }

                @Override
                public void focusGained(FocusEvent e) {
                    boolean valid = isValid();
                    fireStateChanged(IS_VALID, !valid, valid);
                }
            });
        }

    };
    addField(macrosEditor);

    IntegerFieldEditor guiRefreshCycleEditor = new IntegerFieldEditor(PreferencesHelper.OPI_GUI_REFRESH_CYCLE,
            "OPI GUI Refresh Cycle (ms)", parent);
    guiRefreshCycleEditor.setValidRange(10, 5000);
    guiRefreshCycleEditor.getTextControl(parent)
            .setToolTipText("The fastest refresh cycle for OPI GUI in millisecond");
    addField(guiRefreshCycleEditor);

    IntegerFieldEditor pulsingMinorPeriodFieldEditor = new IntegerFieldEditor(
            PreferencesHelper.PULSING_ALARM_MINOR_PERIOD,
            "Time period of MINOR alarm if pulsing alarm selected (ms)", parent);
    pulsingMinorPeriodFieldEditor.setValidRange(100, 10000);
    pulsingMinorPeriodFieldEditor.getTextControl(parent)
            .setToolTipText("If the pulsing alarm box is checked for a widget that monitors a PV, "
                    + "then what is the time period of the pulse with the PV is in MINOR alarm severity");
    addField(pulsingMinorPeriodFieldEditor);

    IntegerFieldEditor pulsingMajorPeriodFieldEditor = new IntegerFieldEditor(
            PreferencesHelper.PULSING_ALARM_MAJOR_PERIOD,
            "Time period of MAJOR alarm if pulsing alarm selected (ms)", parent);
    pulsingMajorPeriodFieldEditor.setValidRange(100, 10000);
    pulsingMajorPeriodFieldEditor.getTextControl(parent)
            .setToolTipText("If the pulsing alarm box is checked for a widget that monitors a PV, "
                    + "then what is the time period of the pulse with the PV is in MAJOR alarm severity");
    addField(pulsingMajorPeriodFieldEditor);

    String[] allPVFactories = SimplePVLayer.getAllPVFactoryExtensions();
    String[][] entries = new String[allPVFactories.length][2];
    for (int i = 0; i < allPVFactories.length; i++) {
        entries[i][0] = allPVFactories[i];
        entries[i][1] = allPVFactories[i];
    }
    ComboFieldEditor pvConnectionLayerEditor = new ComboFieldEditor(PreferencesHelper.PV_CONNECTION_LAYER,
            "PV Connection Layer", entries, parent);
    addField(pvConnectionLayerEditor);

    ComboFieldEditor popupConsoleEditor = new ComboFieldEditor(PreferencesHelper.POPUP_CONSOLE,
            "Console Popup Level",
            new String[][] { { "Error, Warning and Info", ConsolePopupLevel.ALL.toString() },
                    { "Only Info", ConsolePopupLevel.ONLY_INFO.toString() },
                    { "Don't Popup", ConsolePopupLevel.NO_POP.toString() } },
            parent);
    addField(popupConsoleEditor);

    StringFieldEditor pythonPathEditor = new StringFieldEditor(PreferencesHelper.PYTHON_PATH, "PYTHONPATH",
            parent);
    pythonPathEditor.getTextControl(parent).setToolTipText("The path to search python modules");
    addField(pythonPathEditor);

    BooleanFieldEditor showCompactModeDialogEditor = new BooleanFieldEditor(
            PreferencesHelper.SHOW_COMPACT_MODE_DIALOG, "Show tip dialog about how to exit compact mode",
            parent);
    addField(showCompactModeDialogEditor);

    BooleanFieldEditor showFullScreenDialogEditor = new BooleanFieldEditor(
            PreferencesHelper.SHOW_FULLSCREEN_DIALOG, "Show tip dialog about how to exit fullscreen", parent);
    addField(showFullScreenDialogEditor);

    BooleanFieldEditor startWindowInCompactEditor = new BooleanFieldEditor(
            PreferencesHelper.START_WINDOW_IN_COMPACT_MODE, "Start application window in compact mode.",
            parent);
    addField(startWindowInCompactEditor);

    BooleanFieldEditor startWindowInFullScreen = new BooleanFieldEditor(
            PreferencesHelper.START_WINDOW_IN_FULL_SCREEN_MODE, "Start application window in full screen mode.",
            parent);
    addField(startWindowInFullScreen);

    BooleanFieldEditor showStatusLineInCompactMode = new BooleanFieldEditor(
            PreferencesHelper.SHOW_STATUS_LINE_IN_FULL_COMPACT_MODE, "Show status line in compact mode.",
            parent);
    addField(showStatusLineInCompactMode);

    BooleanFieldEditor showStatusLineInFullScreenMode = new BooleanFieldEditor(
            PreferencesHelper.SHOW_STATUS_LINE_IN_FULL_SCREEN_MODE, "Show status line in full screen mode.",
            parent);
    addField(showStatusLineInFullScreenMode);
}

From source file:org.csstudio.pch.eventlist.PreferencePage.java

License:Open Source License

/** {@inheritDoc */
@Override//  w  w w  .ja  va2  s.  c  o m
protected void createFieldEditors() {
    final Composite parent = getFieldEditorParent();
    addField(new StringFieldEditor(Preferences.RDB_URL, Messages.Pref_URL, parent));
    addField(new StringFieldEditor(Preferences.RDB_USER, Messages.Pref_User, parent));
    addField(new PasswordFieldEditor(Activator.ID, Preferences.RDB_PASSWORD, Messages.Pref_Password, parent));
    addField(new StringFieldEditor(Preferences.RDB_SCHEMA, Messages.Pref_Schema, parent));
    addField(new StringFieldEditor(Preferences.START, Messages.Pref_Starttime, parent));
    addField(new StringFieldEditor(Preferences.AUTO_REFRESH_PERIOD, Messages.Pref_AutoRefreshPeriod, parent));
    final IntegerFieldEditor max_properties = new IntegerFieldEditor(Preferences.MAX_PROPERTIES,
            Messages.Pref_MaxProperties, parent);
    max_properties.setValidRange(0, Integer.MAX_VALUE);
    addField(max_properties);
    addField(new TableColumnsFieldEditor(parent));
}

From source file:org.csstudio.platform.internal.ldapauthorization.ui.PreferencePage.java

License:Open Source License

@Override
protected void createFieldEditors() {
    addField(new StringFieldEditor(PreferenceConstants.LDAP_URL, "URL:", getFieldEditorParent()));
    addField(new StringFieldEditor(PreferenceConstants.LDAP_USER, "User:", getFieldEditorParent()));
    addField(new StringFieldEditor(PreferenceConstants.LDAP_PASSWORD, "Password:", getFieldEditorParent()));
}

From source file:org.csstudio.platform.libs.epics.ui.EpicsPreferencePage.java

License:Open Source License

/** Creates the field editors.
 *  Each field editor knows how to save and restore itself.
 *///from w  w  w .  j av a  2s.  co m
@Override
public void createFieldEditors() {
    final String sep = ":"; //$NON-NLS-1$
    final String context_types[][] = { { Messages.EpicsPreferencePage_CONTEXT_CAJ, Boolean.TRUE.toString() },
            { Messages.EpicsPreferencePage_CONTEXT_JNI, Boolean.FALSE.toString() } };
    final Composite parent = getFieldEditorParent();
    addField(new RadioGroupFieldEditor(PreferenceConstants.PURE_JAVA, Messages.EpicsPreferencePage_CONTEXT,
            context_types.length, context_types, parent));

    final String subscription_types[][] = {
            { Messages.EpicsPreferencePage_MONITOR_VALUE, MonitorMask.VALUE.name() },
            { Messages.EpicsPreferencePage_MONITOR_ARCHIVE, MonitorMask.ARCHIVE.name() },
            { Messages.EpicsPreferencePage_MONITOR_ALARM, MonitorMask.ALARM.name() } };
    addField(new RadioGroupFieldEditor(PreferenceConstants.MONITOR, Messages.EpicsPreferencePage_MONITOR,
            subscription_types.length, subscription_types, parent));

    addField(new StringFieldEditor(PreferenceConstants.ADDR_LIST, PreferenceConstants.ADDR_LIST + sep, parent));
    addField(new BooleanFieldEditor(PreferenceConstants.AUTO_ADDR_LIST,
            PreferenceConstants.AUTO_ADDR_LIST + sep, parent));
    addField(new StringFieldEditor(PreferenceConstants.TIMEOUT, PreferenceConstants.TIMEOUT + sep, parent));
    addField(new StringFieldEditor(PreferenceConstants.BEACON_PERIOD, PreferenceConstants.BEACON_PERIOD + sep,
            parent));
    addField(new StringFieldEditor(PreferenceConstants.REPEATER_PORT, PreferenceConstants.REPEATER_PORT + sep,
            parent));
    addField(new StringFieldEditor(PreferenceConstants.SERVER_PORT, PreferenceConstants.SERVER_PORT + sep,
            parent));
    addField(new StringFieldEditor(PreferenceConstants.MAX_ARRAY_BYTES,
            PreferenceConstants.MAX_ARRAY_BYTES + sep, parent));

    addField(new BooleanFieldEditor(PreferenceConstants.DBE_PROPERTY_SUPPORTED,
            Messages.EpicsPreferencePage_DBE_PROPERTY_SUPPORTED, parent));
    addField(new BooleanFieldEditor(PreferenceConstants.HONOR_ZERO_PRECISION,
            Messages.EpicsPreferencePage_HONOR_ZERO_PRECISION, parent));
    addField(new BooleanFieldEditor(PreferenceConstants.RTYP_VALUE_ONLY,
            Messages.EpicsPreferencePage_RTYP_VALUE_ONLY, parent));

    final String varArrayOptions[][] = { { Messages.EpicsPreferencePage_VAR_ARRAY_SUPPORT_AUTO, "Auto" },
            { Messages.EpicsPreferencePage_VAR_ARRAY_SUPPORT_ENABLED, "Enabled" },
            { Messages.EpicsPreferencePage_VAR_ARRAY_SUPPORT_DISABLED, "Disabled" } };
    addField(new RadioGroupFieldEditor(PreferenceConstants.VAR_ARRAY_SUPPORT,
            Messages.EpicsPreferencePage_VAR_ARRAY_SUPPORT, varArrayOptions.length, varArrayOptions, parent));
}

From source file:org.csstudio.platform.utility.jms.ui.preferences.SharedJmsConnectionPreferencePage.java

License:Open Source License

/**
 * 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./*from   w  ww. j av  a 2s  .  c om*/
 */
@Override
public void createFieldEditors() {
    addField(new StringFieldEditor(PreferenceConstants.SENDER_BROKER_URL,
            Messages.SharedJmsConnectionPreferencePage_SenderUrlLabel, getFieldEditorParent()));
    addField(new StringFieldEditor(PreferenceConstants.RECEIVER_BROKER_URL_1,
            Messages.SharedJmsConnectionPreferencePage_ReceiverUrl1Label, getFieldEditorParent()));
    addField(new StringFieldEditor(PreferenceConstants.RECEIVER_BROKER_URL_2,
            Messages.SharedJmsConnectionPreferencePage_ReceiverUrl2Label, getFieldEditorParent()));
}

From source file:org.csstudio.scan.ui.PreferencePage.java

License:Open Source License

/** {@inheritDoc} */
@Override/*from w  ww  .  j  a  v a 2  s.  c om*/
protected void createFieldEditors() {
    final Composite parent = getFieldEditorParent();

    addField(new StringFieldEditor("server_host", Messages.ServerHost, parent));
    addField(new IntegerFieldEditor("server_port", Messages.ServerPort, parent));
}

From source file:org.csstudio.sds.ui.internal.preferences.DefaultDisplayPreferencePage.java

License:Open Source License

@Override
protected void createFieldEditors() {
    WorkspaceFileFieldEditor displayPathFieldEditor = new WorkspaceFileFieldEditor(
            DefaultDisplayPreference.DEFAULT_DISPLAY_PATH.getKeyAsString(), "Default display file",
            getFieldEditorParent());//from w  w  w.j  av a 2 s .  c  om
    displayPathFieldEditor.setFilter(new ViewerFilter() {

        @Override
        public boolean select(Viewer viewer, Object parentElement, Object element) {
            if (element instanceof IFile) {
                IFile file = (IFile) element;
                if (file != null && file.getFileExtension() != null) {
                    return file.getFileExtension().toLowerCase().equals("css-sds");
                }
                return false;
            }
            return true;
        }
    });
    addField(displayPathFieldEditor);

    addField(new StringFieldEditor(DefaultDisplayPreference.DEFAULT_DISPLAY_ALIAS.getKeyAsString(), "Alias:",
            getFieldEditorParent()));
    addField(new BooleanFieldEditor(DefaultDisplayPreference.OPEN_AS_SHELL.getKeyAsString(), "Open as shell",
            getFieldEditorParent()));
}

From source file:org.csstudio.sns.ldapauthorization.ui.PreferencePage.java

License:Open Source License

@Override
protected void createFieldEditors() {
    addField(new StringFieldEditor(PreferenceConstants.LDAP_URL, "URL:", getFieldEditorParent()));
    addField(new PasswordFieldEditor(PreferenceConstants.LDAP_USER, "User:", getFieldEditorParent(),
            Activator.PLUGIN_ID, false));
    addField(new PasswordFieldEditor(PreferenceConstants.LDAP_PASSWORD, "Password:", getFieldEditorParent(),
            Activator.PLUGIN_ID));
}

From source file:org.csstudio.trends.databrowser2.preferences.PreferencePage.java

License:Open Source License

/** {@inheritDoc} */
@Override/* w ww. jav a2 s. c o  m*/
protected void createFieldEditors() {
    final Composite parent = getFieldEditorParent();

    // Time span: 60 seconds .. 1 month
    final IntegerFieldEditor timespan = new IntegerFieldEditor(Preferences.TIME_SPAN,
            Messages.PrefPage_TimeRange, parent);
    timespan.setValidRange(60, 60 * 60 * 24 * 30);
    addField(timespan);

    // Scan period: >=0
    final StringFieldEditor scanperiod = new StringFieldEditor(Preferences.SCAN_PERIOD,
            Messages.PrefPage_ScanPeriod, parent) {
        @Override
        protected boolean checkState() {
            final Text text = getTextControl();
            if (text == null)
                return false;
            try {
                final double period = Double.parseDouble(text.getText().trim());
                if (period < 0) {
                    showErrorMessage(Messages.ScanPeriodTT);
                    return false;
                }
                clearErrorMessage();
                return true;
            } catch (Exception ex) {
                showErrorMessage(Messages.ScanPeriodTT);
                return false;
            }
        }
    };
    addField(scanperiod);

    // Live sample buffer: 0 ... max int
    final IntegerFieldEditor buffersize = new IntegerFieldEditor(Preferences.BUFFER_SIZE,
            Messages.PrefPage_LiveBufferSize, parent);
    buffersize.setValidRange(0, Integer.MAX_VALUE);
    addField(buffersize);

    // Refresh period: >0 seconds
    final StringFieldEditor updateperiod = new StringFieldEditor(Preferences.UPDATE_PERIOD,
            Messages.PrefPage_UpdatePeriod, parent) {
        @Override
        protected boolean checkState() {
            final Text text = getTextControl();
            if (text == null)
                return false;
            try {
                final double period = Double.parseDouble(text.getText().trim());
                if (period <= 0) {
                    showErrorMessage(Messages.UpdatePeriodTT);
                    return false;
                }
                clearErrorMessage();
                return true;
            } catch (Exception ex) {
                showErrorMessage(Messages.UpdatePeriodTT);
                return false;
            }
        }
    };
    addField(updateperiod);

    // Line Width: Some pixel range
    final IntegerFieldEditor linewidth = new IntegerFieldEditor(Preferences.LINE_WIDTH,
            Messages.PrefPage_TraceLineWidth, parent);
    linewidth.setValidRange(0, 100);
    addField(linewidth);

    // Opacity: 0..100%
    final IntegerFieldEditor opacity = new IntegerFieldEditor(Preferences.OPACITY,
            Messages.PrefPage_TraceOpacity, parent);
    opacity.setValidRange(0, 100);
    addField(opacity);

    // Trace type options
    final TraceType trace_values[] = TraceType.values();
    final String trace_labels_and_values[][] = new String[trace_values.length][2];
    for (int i = 0; i < trace_values.length; ++i) {
        trace_labels_and_values[i][0] = trace_values[i].toString();
        trace_labels_and_values[i][1] = trace_values[i].name();
    }
    final ComboFieldEditor trace_types = new ComboFieldEditor(Preferences.TRACE_TYPE, Messages.TraceTypes_Label,
            trace_labels_and_values, parent);
    addField(trace_types);

    // Archive fetch delay:  0.1 .. 10 seconds
    final IntegerFieldEditor fetch_delay = new IntegerFieldEditor(Preferences.ARCHIVE_FETCH_DELAY,
            Messages.PrefPage_ArchiveFetchDelay, parent);
    fetch_delay.setValidRange(100, 10000);
    addField(fetch_delay);

    // Plot bins: 10 ... one bin per second for a year
    final IntegerFieldEditor plotbins = new IntegerFieldEditor(Preferences.PLOT_BINS,
            Messages.PrefPage_PlotBins, parent);
    plotbins.setValidRange(10, 365 * 24 * 60 * 60);
    addField(plotbins);

    // Future Buffer: 10 ...
    final IntegerFieldEditor scroll_step = new IntegerFieldEditor(Preferences.SCROLL_STEP,
            Messages.ScrollStepLbl, parent);
    scroll_step.setValidRange(1, (int) Duration.ofDays(1).getSeconds());
    ((Text) scroll_step.getTextControl(parent)).setToolTipText(Messages.ScrollStepTT);
    addField(scroll_step);

    // Archive rescale options
    final ArchiveRescale values[] = ArchiveRescale.values();
    final String labels_and_values[][] = new String[values.length][2];
    for (int i = 0; i < values.length; ++i) {
        labels_and_values[i][0] = values[i].toString();
        labels_and_values[i][1] = values[i].name();
    }
    final RadioGroupFieldEditor rescale = new RadioGroupFieldEditor(Preferences.ARCHIVE_RESCALE,
            Messages.ArchiveRescale_Label, 1, labels_and_values, parent, false);
    addField(rescale);

    // Server URLs
    final StringTableFieldEditor urls = new StringTableFieldEditor(parent, Preferences.URLS,
            Messages.PrefPage_DataServerURLs, new String[] { Messages.URL, Messages.ServerAlias },
            new boolean[] { true, true }, new int[] { 500, 100 }, new ArchiveURLEditor(parent.getShell()));
    addField(urls);

    // Default archives
    final StringTableFieldEditor archives = new StringTableFieldEditor(parent, Preferences.ARCHIVES,
            Messages.PrefPage_Archives,
            new String[] { Messages.ArchiveName, Messages.ArchiveKey, Messages.URL },
            new boolean[] { true, true, true }, new int[] { 100, 50, 500 },
            new ArchiveDataSourceEditor(parent.getShell()));
    addField(archives);

    addField(new BooleanFieldEditor(Preferences.PROMPT_FOR_ERRORS, Messages.PromptForErrors_Label, parent));

    addField(new BooleanFieldEditor(Preferences.USE_DEFAULT_ARCHIVES, Messages.UseDefaultArchives_Label,
            parent));

    addField(new BooleanFieldEditor(Preferences.USE_AUTO_SCALE, Messages.UseAutoScale_Label, parent));

    addField(new BooleanFieldEditor(Preferences.AUTOMATIC_HISTORY_REFRESH,
            Messages.PrefPage_AutomaticHistoryRefresh, parent));

    addField(new BooleanFieldEditor(Preferences.ALLOW_HIDE_TRACE, Messages.AllowHideTrace, parent));

    addField(new BooleanFieldEditor(Preferences.ALLOW_REQUEST_RAW, Messages.AllowRequestRaw, parent));
}

From source file:org.csstudio.trends.databrowser3.preferences.PreferencePage.java

License:Open Source License

/** {@inheritDoc} */
@Override/*from w w w. j a  va2s.c  o m*/
protected void createFieldEditors() {
    final Composite parent = getFieldEditorParent();

    // Time span: 60 seconds .. 1 month
    final IntegerFieldEditor timespan = new IntegerFieldEditor(Preferences.TIME_SPAN,
            Messages.PrefPage_TimeRange, parent);
    timespan.setValidRange(60, 60 * 60 * 24 * 30);
    addField(timespan);

    // Scan period: >=0
    final StringFieldEditor scanperiod = new StringFieldEditor(Preferences.SCAN_PERIOD,
            Messages.PrefPage_ScanPeriod, parent) {
        @Override
        protected boolean checkState() {
            final Text text = getTextControl();
            if (text == null)
                return false;
            try {
                final double period = Double.parseDouble(text.getText().trim());
                if (period < 0) {
                    showErrorMessage(Messages.ScanPeriodTT);
                    return false;
                }
                clearErrorMessage();
                return true;
            } catch (Exception ex) {
                showErrorMessage(Messages.ScanPeriodTT);
                return false;
            }
        }
    };
    addField(scanperiod);

    // Live sample buffer: 0 ... max int
    final IntegerFieldEditor buffersize = new IntegerFieldEditor(Preferences.BUFFER_SIZE,
            Messages.PrefPage_LiveBufferSize, parent);
    buffersize.setValidRange(0, Integer.MAX_VALUE);
    addField(buffersize);

    // Refresh period: >0 seconds
    final StringFieldEditor updateperiod = new StringFieldEditor(Preferences.UPDATE_PERIOD,
            Messages.PrefPage_UpdatePeriod, parent) {
        @Override
        protected boolean checkState() {
            final Text text = getTextControl();
            if (text == null)
                return false;
            try {
                final double period = Double.parseDouble(text.getText().trim());
                if (period <= 0) {
                    showErrorMessage(Messages.UpdatePeriodTT);
                    return false;
                }
                clearErrorMessage();
                return true;
            } catch (Exception ex) {
                showErrorMessage(Messages.UpdatePeriodTT);
                return false;
            }
        }
    };
    addField(updateperiod);

    // Line Width: Some pixel range
    final IntegerFieldEditor linewidth = new IntegerFieldEditor(Preferences.LINE_WIDTH,
            Messages.PrefPage_TraceLineWidth, parent);
    linewidth.setValidRange(0, 100);
    addField(linewidth);

    // Opacity: 0..100%
    final IntegerFieldEditor opacity = new IntegerFieldEditor(Preferences.OPACITY,
            Messages.PrefPage_TraceOpacity, parent);
    opacity.setValidRange(0, 100);
    addField(opacity);

    // Trace type options
    final TraceType trace_values[] = TraceType.values();
    final String trace_labels_and_values[][] = new String[trace_values.length][2];
    for (int i = 0; i < trace_values.length; ++i) {
        trace_labels_and_values[i][0] = trace_values[i].toString();
        trace_labels_and_values[i][1] = trace_values[i].name();
    }
    final ComboFieldEditor trace_types = new ComboFieldEditor(Preferences.TRACE_TYPE, Messages.TraceTypes_Label,
            trace_labels_and_values, parent);
    addField(trace_types);

    // Archive fetch delay:  0.1 .. 10 seconds
    final IntegerFieldEditor fetch_delay = new IntegerFieldEditor(Preferences.ARCHIVE_FETCH_DELAY,
            Messages.PrefPage_ArchiveFetchDelay, parent);
    fetch_delay.setValidRange(100, 10000);
    addField(fetch_delay);

    // Plot bins: 10 ... one bin per second for a year
    final IntegerFieldEditor plotbins = new IntegerFieldEditor(Preferences.PLOT_BINS,
            Messages.PrefPage_PlotBins, parent);
    plotbins.setValidRange(10, 365 * 24 * 60 * 60);
    addField(plotbins);

    // Future Buffer: 10 ...
    final IntegerFieldEditor scroll_step = new IntegerFieldEditor(Preferences.SCROLL_STEP,
            Messages.ScrollStepLbl, parent);
    scroll_step.setValidRange(1, (int) Duration.ofDays(1).getSeconds());
    ((Text) scroll_step.getTextControl(parent)).setToolTipText(Messages.ScrollStepTT);
    addField(scroll_step);

    // Archive rescale options
    final ArchiveRescale values[] = ArchiveRescale.values();
    final String labels_and_values[][] = new String[values.length][2];
    for (int i = 0; i < values.length; ++i) {
        labels_and_values[i][0] = values[i].toString();
        labels_and_values[i][1] = values[i].name();
    }
    final RadioGroupFieldEditor rescale = new RadioGroupFieldEditor(Preferences.ARCHIVE_RESCALE,
            Messages.ArchiveRescale_Label, 1, labels_and_values, parent, false);
    addField(rescale);

    // Server URLs
    final StringTableFieldEditor urls = new StringTableFieldEditor(parent, Preferences.URLS,
            Messages.PrefPage_DataServerURLs, new String[] { Messages.URL, Messages.ServerAlias },
            new boolean[] { true, true }, new int[] { 500, 100 }, new ArchiveURLEditor(parent.getShell()));
    addField(urls);

    // Default archives
    final StringTableFieldEditor archives = new StringTableFieldEditor(parent, Preferences.ARCHIVES,
            Messages.PrefPage_Archives,
            new String[] { Messages.ArchiveName, Messages.ArchiveKey, Messages.URL },
            new boolean[] { true, true, true }, new int[] { 100, 50, 500 },
            new ArchiveDataSourceEditor(parent.getShell()));
    addField(archives);

    addField(new BooleanFieldEditor(Preferences.PROMPT_FOR_ERRORS, Messages.PromptForErrors_Label, parent));

    addField(new BooleanFieldEditor(Preferences.USE_DEFAULT_ARCHIVES, Messages.UseDefaultArchives_Label,
            parent));

    addField(new BooleanFieldEditor(Preferences.USE_AUTO_SCALE, Messages.UseAutoScale_Label, parent));

    addField(new BooleanFieldEditor(Preferences.AUTOMATIC_HISTORY_REFRESH,
            Messages.PrefPage_AutomaticHistoryRefresh, parent));
}