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.autocomplete.ui.preferences.PreferencePage.java

License:Open Source License

/** {@inheritDoc} */
@Override//  w  ww .j av  a  2s  .co  m
protected void createFieldEditors() {
    final Composite parent = getFieldEditorParent();

    addField(new StringFieldEditor(Preferences.HISTORY_SIZE, Messages.PrefPage_HistorySize, parent));

    final Button clearHistory = new Button(parent, SWT.PUSH);
    clearHistory.setText(Messages.PrefPage_ClearHistory);
    clearHistory.setLayoutData(new GridData());
    clearHistory.addSelectionListener(new SelectionAdapter() {
        @Override
        public void widgetSelected(final SelectionEvent e) {
            AutoCompleteUIPlugin.getDefault().clearSettings();
        }
    });

    final Composite noteWrapper = new Composite(parent, SWT.NONE);
    noteWrapper.setLayoutData(new GridData());
    noteWrapper.setLayout(new GridLayout(2, false));

    final Label noteLabel = new Label(noteWrapper, SWT.NONE);
    FontData fontData = noteLabel.getFont().getFontData()[0];
    fontData.setStyle(SWT.BOLD);
    noteLabel.setFont(new Font(parent.getDisplay(), fontData));
    noteLabel.setText("Note: ");

    final Text note = new Text(noteWrapper, SWT.MULTI | SWT.READ_ONLY);
    note.setBackground(parent.getBackground());
    note.setText(
            "The 'History size' value is the maximum number of entries in the History.\nEach entry is stored only once and the entries of the History are sorted \naccording to their occurrence.");
}

From source file:org.csstudio.debugging.jmsmonitor.PreferencePage.java

License:Open Source License

/** {@inheritDoc */
@Override/*from w  w  w.  ja v  a2s .  c  o m*/
protected void createFieldEditors() {
    final Composite parent = getFieldEditorParent();
    addField(new StringFieldEditor(Preferences.JMS_URL, Messages.Preferences_JMS_URL, parent));
    addField(new StringFieldEditor(Preferences.JMS_USER, Messages.Preferences_JMS_USER, parent));
    addField(new PasswordFieldEditor(Activator.ID, Preferences.JMS_PASSWORD, Messages.Preferences_JMS_PASSWORD,
            parent));
    final IntegerFieldEditor max_messages = new IntegerFieldEditor(Preferences.MAX_MESSAGES,
            Messages.Preferences_MAX_MESSAGES, parent);
    max_messages.setValidRange(1, Integer.MAX_VALUE);
    addField(max_messages);
}

From source file:org.csstudio.desy.logging.ui.LoggingPreferencePage.java

License:Open Source License

private void makeFileInfoArea() {
    StringFieldEditor fileNameEditor = new StringFieldEditor("FileName", "&File", getFieldEditorParent());
    fileNameEditor.setEnabled(false, getFieldEditorParent());
    fileNameEditor.setStringValue(getFilePath());
    addField(fileNameEditor);/*www  . j av a  2  s .  c o m*/
}

From source file:org.csstudio.diirt.util.preferences.ChannelAccessPreferencePage.java

License:Open Source License

/**
 * Create contents of the preference page.
 * @param parent//from  ww w . j  a  v  a2  s  . c  o m
 */
@Override
public Control createContents(Composite parent) {

    IPreferenceStore store = getPreferenceStore();
    Composite container = new Composite(parent, SWT.NULL);

    container.setLayoutData(new GridData(GridData.FILL_BOTH));
    container.setLayout(new GridLayout());

    contextOuterGroup = new Group(container, SWT.NONE);

    contextOuterGroup.setText(Messages.CAPP_contextGroup_text);
    contextOuterGroup.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false, 1, 1));
    contextOuterGroup.setLayout(new GridLayout());

    contextInnerGroup = new Composite(contextOuterGroup, SWT.DOUBLE_BUFFERED);

    contextInnerGroup.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false, 1, 1));
    contextInnerGroup.setLayout(new GridLayout());

    //  JCA no more available since DIIRT 3.1.7 ---------------------------
    //pureJavaEditor = new RadioGroupFieldEditor(PREF_PURE_JAVA, Messages.CAPP_modeCaption_text, 2, AVAILABLE_MODES, contextInnerGroup, false);
    //
    //addField(pureJavaEditor, contextInnerGroup, true, () -> store.getDefaultString(PREF_PURE_JAVA), () -> store.getString(PREF_PURE_JAVA));
    //  -------------------------------------------------------------------

    addressListEditor = new StringFieldEditor(PREF_ADDR_LIST, Messages.CAPP_addressListCaption_text,
            contextInnerGroup);

    addField(addressListEditor, contextInnerGroup, true, () -> store.getDefaultString(PREF_ADDR_LIST),
            () -> store.getString(PREF_ADDR_LIST));

    autoAddressListEditor = new BooleanFieldEditor(PREF_AUTO_ADDR_LIST, Messages.CAPP_autoCheckButton_text,
            BooleanFieldEditor.SEPARATE_LABEL, contextInnerGroup);

    addField(autoAddressListEditor, contextInnerGroup, true, () -> store.getDefaultBoolean(PREF_AUTO_ADDR_LIST),
            () -> store.getBoolean(PREF_AUTO_ADDR_LIST));

    new Separator(contextInnerGroup).setLayoutData(new GridData(SWT.CENTER, SWT.CENTER, true, false, 2, 1));

    connectionTimeoutEditor = new DoubleFieldEditor(PREF_CONNECTION_TIMEOUT,
            Messages.CAPP_connectionTimeoutCaption_text, contextInnerGroup);

    connectionTimeoutEditor.setValidRange(0, 300);
    connectionTimeoutEditor.setTextLimit(32);
    connectionTimeoutEditor.getTextControl(contextInnerGroup).setLayoutData(createIntegerFieldEditorGridData());

    addField(connectionTimeoutEditor, contextInnerGroup, true,
            () -> store.getDefaultString(PREF_CONNECTION_TIMEOUT),
            () -> store.getString(PREF_CONNECTION_TIMEOUT));

    beaconPeriodEditor = new DoubleFieldEditor(PREF_BEACON_PERIOD, Messages.CAPP_beaconPeriodCaption_text,
            contextInnerGroup);

    beaconPeriodEditor.setValidRange(0, 300);
    beaconPeriodEditor.setTextLimit(32);
    beaconPeriodEditor.getTextControl(contextInnerGroup).setLayoutData(createIntegerFieldEditorGridData());

    addField(beaconPeriodEditor, contextInnerGroup, true, () -> store.getDefaultString(PREF_BEACON_PERIOD),
            () -> store.getString(PREF_BEACON_PERIOD));

    new Separator(contextInnerGroup).setLayoutData(new GridData(SWT.CENTER, SWT.CENTER, true, false, 2, 1));

    serverPortEditor = new IntegerFieldEditor(PREF_SERVER_PORT, Messages.CAPP_serverPortCaption_text,
            contextInnerGroup);

    serverPortEditor.setValidRange(1024, 65535);
    serverPortEditor.setTextLimit(32);
    serverPortEditor.getTextControl(contextInnerGroup).setLayoutData(createIntegerFieldEditorGridData());

    addField(serverPortEditor, contextInnerGroup, true, () -> store.getDefaultString(PREF_SERVER_PORT),
            () -> store.getString(PREF_SERVER_PORT));

    repeaterPortEditor = new IntegerFieldEditor(PREF_REPEATER_PORT, Messages.CAPP_repeaterPortCaption_text,
            contextInnerGroup);

    repeaterPortEditor.setValidRange(1024, 65535);
    repeaterPortEditor.setTextLimit(32);
    repeaterPortEditor.getTextControl(contextInnerGroup).setLayoutData(createIntegerFieldEditorGridData());

    addField(repeaterPortEditor, contextInnerGroup, true, () -> store.getDefaultString(PREF_REPEATER_PORT),
            () -> store.getString(PREF_REPEATER_PORT));

    new Separator(contextInnerGroup).setLayoutData(new GridData(SWT.CENTER, SWT.CENTER, true, false, 2, 1));

    maxArraySizeEditor = new IntegerFieldEditor(PREF_MAX_ARRAY_SIZE,
            Messages.CAPP_maxArraySizeSpinnerCaption_text, contextInnerGroup);

    maxArraySizeEditor.setValidRange(16384, Integer.MAX_VALUE);
    maxArraySizeEditor.setTextLimit(32);
    maxArraySizeEditor.getTextControl(contextInnerGroup).setLayoutData(createIntegerFieldEditorGridData());

    addField(maxArraySizeEditor, contextInnerGroup, true, () -> store.getDefaultString(PREF_MAX_ARRAY_SIZE),
            () -> store.getString(PREF_MAX_ARRAY_SIZE));

    optionsOuterGroup = new Group(container, SWT.NONE);

    optionsOuterGroup.setText(Messages.CAPP_optionsGroup_text);
    optionsOuterGroup.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false, 1, 1));
    optionsOuterGroup.setLayout(new GridLayout());

    optionsInnerGroup = new Composite(optionsOuterGroup, SWT.DOUBLE_BUFFERED);

    optionsInnerGroup.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false, 1, 1));
    optionsInnerGroup.setLayout(new GridLayout());

    monitorMaskEditor = new RadioGroupFieldEditor(PREF_MONITOR_MASK, Messages.CAPP_monitorMaskCaption_text, 4,
            AVAILABLE_MONITOR_MASKS, optionsInnerGroup, false);

    addField(monitorMaskEditor, optionsInnerGroup, true, () -> store.getDefaultString(PREF_MONITOR_MASK),
            () -> store.getString(PREF_MONITOR_MASK), e -> {

                customMaskEditor.setEnabled(MonitorMask.CUSTOM.name().equals(e.getNewValue()),
                        optionsInnerGroup);

                if (MonitorMask.VALUE.name().equals(e.getNewValue())) {
                    customMaskEditor.getTextControl(optionsInnerGroup)
                            .setText(Integer.toString(MonitorMask.VALUE.mask()));
                } else if (MonitorMask.ARCHIVE.name().equals(e.getNewValue())) {
                    customMaskEditor.getTextControl(optionsInnerGroup)
                            .setText(Integer.toString(MonitorMask.ARCHIVE.mask()));
                } else if (MonitorMask.ALARM.name().equals(e.getNewValue())) {
                    customMaskEditor.getTextControl(optionsInnerGroup)
                            .setText(Integer.toString(MonitorMask.ALARM.mask()));
                }

            });

    customMaskEditor = new IntegerFieldEditor(PREF_CUSTOM_MASK, "", optionsInnerGroup);

    customMaskEditor.setEnabled(MonitorMask.CUSTOM.name().equals(store.getString(PREF_MONITOR_MASK)),
            optionsInnerGroup);
    customMaskEditor.setValidRange(0, 65536);
    customMaskEditor.setTextLimit(32);
    customMaskEditor.getTextControl(optionsInnerGroup).setLayoutData(createIntegerFieldEditorGridData());

    addField(customMaskEditor, optionsInnerGroup, true, () -> store.getDefaultString(PREF_CUSTOM_MASK),
            () -> store.getString(PREF_CUSTOM_MASK));

    new Separator(optionsInnerGroup).setLayoutData(new GridData(SWT.CENTER, SWT.CENTER, true, false, 2, 1));

    variableArrayEditor = new RadioGroupFieldEditor(PREF_VARIABLE_LENGTH_ARRAY,
            Messages.CAPP_variableLengthArrayCaption_text, 3, AVAILABLE_VAR_ARRAY_SUPPORTS, optionsInnerGroup,
            false);

    addField(variableArrayEditor, optionsInnerGroup, true,
            () -> store.getDefaultString(PREF_VARIABLE_LENGTH_ARRAY),
            () -> store.getString(PREF_VARIABLE_LENGTH_ARRAY));

    new Separator(optionsInnerGroup).setLayoutData(new GridData(SWT.CENTER, SWT.CENTER, true, false, 2, 1));

    dbePropertySupportedEditor = new BooleanFieldEditor(PREF_DBE_PROPERTY_SUPPORTED,
            Messages.CAPP_dbePropertySupportedCheckBox_text, BooleanFieldEditor.SEPARATE_LABEL,
            optionsInnerGroup);

    addField(dbePropertySupportedEditor, optionsInnerGroup, true,
            () -> store.getDefaultBoolean(PREF_DBE_PROPERTY_SUPPORTED),
            () -> store.getBoolean(PREF_DBE_PROPERTY_SUPPORTED));

    honorZeropRecisionEditor = new BooleanFieldEditor(PREF_HONOR_ZERO_PRECISION,
            Messages.CAPP_honorCheckBox_text, BooleanFieldEditor.SEPARATE_LABEL, optionsInnerGroup);

    addField(honorZeropRecisionEditor, optionsInnerGroup, true,
            () -> store.getDefaultBoolean(PREF_HONOR_ZERO_PRECISION),
            () -> store.getBoolean(PREF_HONOR_ZERO_PRECISION));

    valueRTYPMonitorEditor = new BooleanFieldEditor(PREF_VALUE_RTYP_MONITOR,
            Messages.CAPP_valueOnlyCheckBox_text, BooleanFieldEditor.SEPARATE_LABEL, optionsInnerGroup);

    addField(valueRTYPMonitorEditor, optionsInnerGroup, true,
            () -> store.getDefaultBoolean(PREF_VALUE_RTYP_MONITOR),
            () -> store.getBoolean(PREF_VALUE_RTYP_MONITOR));

    initializeValues(store);

    return container;

}

From source file:org.csstudio.diirt.util.preferences.DataSourcesPreferencePage.java

License:Open Source License

/**
 * Create contents of the preference page.
 *
 * @param parent//from  w  w  w  .ja  v  a 2  s. c om
 */
@Override
public Control createContents(Composite parent) {

    IPreferenceStore store = getPreferenceStore();
    Composite container = new Composite(parent, SWT.NULL);

    container.setLayoutData(new GridData(GridData.FILL_BOTH));
    container.setLayout(new GridLayout());

    directoryEditor = new ConfigurationDirectoryFieldEditor(PREF_CONFIGURATION_DIRECTORY,
            Messages.DSPP_directoryCaption_text, container, store);

    directoryEditor.setChangeButtonText(Messages.DSPP_browseButton_text);
    directoryEditor.getTextControl(container).setEditable(false);
    directoryEditor.getTextControl(container)
            .setBackground(SWTResourceManager.getColor(SWT.COLOR_WIDGET_BACKGROUND));
    directoryEditor.getTextControl(container)
            .setForeground(SWTResourceManager.getColor(SWT.COLOR_WIDGET_FOREGROUND));

    addField(directoryEditor, container, false, () -> store.getString(PREF_CONFIGURATION_DIRECTORY));

    Composite treeComposite = new Composite(container, SWT.NONE);
    GridData gd_treeComposite = new GridData(SWT.FILL, SWT.FILL, true, true, 3, 1);

    gd_treeComposite.heightHint = -14;
    treeComposite.setLayoutData(gd_treeComposite);
    treeComposite.setLayout(new GridLayout());

    treeViewer = new TreeViewer(treeComposite);

    GridData gridData = new GridData(GridData.FILL_BOTH);

    gridData.heightHint = -16;
    treeViewer.getTree().setLayoutData(gridData);
    treeViewer.setLabelProvider(new FileTreeLabelProvider());
    treeViewer.setContentProvider(new FileTreeContentProvider());
    treeViewer.addDoubleClickListener(new IDoubleClickListener() {
        @Override
        public void doubleClick(DoubleClickEvent event) {

            TreeSelection selection = (TreeSelection) event.getSelection();
            File fileSelection = (File) selection.getFirstElement();

            try {
                if (fileSelection.isFile()) {
                    clearWarning();
                    Program.launch(fileSelection.getCanonicalPath());
                }
            } catch (IOException ex) {
                notifyWarning(NLS.bind(Messages.DSPP_resolveMessage, ex.getMessage()));
            }

        }
    });

    cdsOuterGroup = new Group(container, SWT.NONE);

    cdsOuterGroup.setText(Messages.DSPP_cdsGroup_text);
    cdsOuterGroup.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false, 3, 1));
    cdsOuterGroup.setLayout(new GridLayout());

    cdsInnerGroup = new Composite(cdsOuterGroup, SWT.DOUBLE_BUFFERED);

    cdsInnerGroup.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
    cdsInnerGroup.setLayout(new GridLayout());

    defaultDataSourceEditor = new ComboFieldEditor(PREF_DEFAULT, Messages.DSPP_defaultDataSourceCaption_text,
            AVAILABLE_DATA_SOURCES, cdsInnerGroup);

    addField(defaultDataSourceEditor, cdsInnerGroup, true, () -> store.getDefaultString(PREF_DEFAULT),
            () -> store.getString(PREF_DEFAULT));

    delimiterEditor = new StringFieldEditor(PREF_DELIMITER, Messages.DSPP_delimiterCaption_text, cdsInnerGroup);

    delimiterEditor.getTextControl(cdsInnerGroup)
            .setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1));

    addField(delimiterEditor, cdsInnerGroup, true, () -> store.getDefaultString(PREF_DELIMITER),
            () -> store.getString(PREF_DELIMITER));

    initializeValues(store);

    return container;

}

From source file:org.csstudio.display.builder.rcp.preferences.DisplayPreferencePage.java

License:Open Source License

@Override
public void createFieldEditors() {

    addField(new StringFieldEditor(org.csstudio.display.builder.model.Preferences.CLASS_FILES,
            "Widget Class Files:", getFieldEditorParent()) {
        @Override/*w w w .  j  a  v  a2  s.c  o m*/
        public IPreferenceStore getPreferenceStore() {
            return model_prefs;
        }

        @Override
        public void store() {
            doStore();
        }
    });

    addField(new StringFieldEditor(org.csstudio.display.builder.model.Preferences.COLOR_FILES, "Color File:",
            getFieldEditorParent()) {
        @Override
        public IPreferenceStore getPreferenceStore() {
            return model_prefs;
        }

        @Override
        public void store() {
            doStore();
        }
    });

    addField(new StringFieldEditor(org.csstudio.display.builder.model.Preferences.FONT_FILES, "Font File:",
            getFieldEditorParent()) {
        @Override
        public IPreferenceStore getPreferenceStore() {
            return model_prefs;
        }

        @Override
        public void store() {
            doStore();
        }
    });

    addField(new StringFieldEditor(org.csstudio.display.builder.runtime.Preferences.PYTHON_PATH, "Jython Path:",
            getFieldEditorParent()) {
        @Override
        public IPreferenceStore getPreferenceStore() {
            return runtime_prefs;
        }

        @Override
        public void store() {
            doStore();
        }
    });

    addField(new StringFieldEditor(org.csstudio.display.builder.model.Preferences.READ_TIMEOUT,
            "File Read Timeout [ms]:", getFieldEditorParent()) { // Field uses pref. store that differs from the page's default store
        @Override
        public IPreferenceStore getPreferenceStore() {
            return model_prefs;
        }

        // Need to force doStore() for pref store that differs from page default
        @Override
        public void store() {
            doStore();
        }
    });

    addField(new StringFieldEditor(org.csstudio.display.builder.model.Preferences.CACHE_TIMEOUT,
            "URL cache Timeout [sec]:", getFieldEditorParent()) { // Field uses pref. store that differs from the page's default store
        @Override
        public IPreferenceStore getPreferenceStore() {
            return model_prefs;
        }

        // Need to force doStore() for pref store that differs from page default
        @Override
        public void store() {
            doStore();
        }
    });

    final String[] implementations = PVFactory.getImplementations();
    // Combo needs list where each entry is [ label, value ].
    // We use [ implementation, implementation ].
    final String[][] pv_factories = new String[implementations.length][];
    for (int i = 0; i < implementations.length; ++i)
        pv_factories[i] = new String[] { implementations[i], implementations[i] };

    addField(new ComboFieldEditor(org.csstudio.display.builder.runtime.Preferences.PV_FACTORY, "PV Factory:",
            pv_factories, getFieldEditorParent()) {
        @Override
        public IPreferenceStore getPreferenceStore() {
            return runtime_prefs;
        }

        @Override
        public void store() {
            doStore();
        }
    });

    // TODO Custom table editor for display Name, path, macros
    addField(new TextAreaFieldEditor(org.csstudio.display.builder.rcp.Preferences.TOP_DISPLAYS, "Top Displays:",
            getFieldEditorParent(), 50, 10));

    addField(new MacrosFieldEditor(org.csstudio.display.builder.model.Preferences.MACROS, "Macros:",
            getFieldEditorParent()) {
        @Override
        public IPreferenceStore getPreferenceStore() {
            return model_prefs;
        }

        @Override
        public void store() {
            doStore();
        }
    });

    addField(new StringFieldEditor(org.csstudio.display.builder.model.Preferences.LEGACY_FONT_CALIBRATION,
            "Legacy Font Calibration:", getFieldEditorParent()) {
        @Override
        public IPreferenceStore getPreferenceStore() {
            return model_prefs;
        }

        private double getFactor() {
            try {
                return Double.parseDouble(getStringValue());
            } catch (NumberFormatException ex) {
                return Double.NaN;
            }
        }

        @Override
        protected boolean doCheckState() {
            final double factor = getFactor();
            if (factor > 0.0)
                return true;
            setErrorMessage("Invalid font scaling, must be > 0");
            return false;
        }

        @Override
        public void store() {
            doStore();
        }
    });

    addField(new BooleanFieldEditor(org.csstudio.display.builder.rcp.Preferences.SHOW_RUNTIME_STACKS,
            "Show Runtime Perspective Placeholders", getFieldEditorParent()));

    addField(new BooleanFieldEditor(org.csstudio.display.builder.model.Preferences.SUPPORT_STANDALONE_WINDOW,
            "Support 'standalone' window mode", getFieldEditorParent()) {
        @Override
        public IPreferenceStore getPreferenceStore() {
            return model_prefs;
        }
    });
}

From source file:org.csstudio.display.pace.gui.PreferencePage.java

License:Open Source License

/** {@inheritDoc */
@Override//from w w  w .ja v a  2  s.  co m
protected void createFieldEditors() {
    final Composite parent = getFieldEditorParent();

    // RDB
    addField(new StringFieldEditor(Preferences.DEFAULT_LOGBOOK, Messages.Preferences_DefaultLogbook, parent));
}

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

License:Open Source License

@Override
protected void createFieldEditors() {
    setMessage(Messages.Preferences);
    final Composite parent = getFieldEditorParent();
    addField(new StringFieldEditor(Preferences.SMTP_HOST, Messages.SMTPHost, parent));
}

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

License:Open Source License

/** Creates the field editors.
 *  Each one knows how to save and restore itself.
 *//*from  w w w. j ava 2  s .c  o  m*/
@Override
protected void createFieldEditors() {
    final Composite parent = getFieldEditorParent();

    addField(new LabelFieldEditor(Messages.GlobalSettings, false, parent));

    final String levels[][] = new String[][] { { Level.OFF.getLocalizedName(), Level.OFF.getName() },
            { Level.SEVERE.getLocalizedName(), Level.SEVERE.getName() },
            { Level.WARNING.getLocalizedName(), Level.WARNING.getName() },
            { Level.INFO.getLocalizedName(), Level.INFO.getName() },
            { Level.CONFIG.getLocalizedName(), Level.CONFIG.getName() },
            { Level.FINE.getLocalizedName(), Level.FINE.getName() },
            { Level.FINER.getLocalizedName(), Level.FINER.getName() },
            { Level.FINEST.getLocalizedName(), Level.FINEST.getName() },
            { Level.ALL.getLocalizedName(), Level.ALL.getName() }, };
    addField(new ComboFieldEditor(Preferences.CONSOLE_LEVEL, Messages.GlobalLevel, levels, parent));

    int size = LogFormatDetail.values().length;
    final String detail[][] = new String[size][2];
    for (int i = 0; i < size; ++i) {
        detail[i][0] = LogFormatDetail.values()[i].toString();
        detail[i][1] = LogFormatDetail.values()[i].name();
    }
    addField(new ComboFieldEditor(Preferences.DETAIL, Messages.MessageDetail, detail, parent));

    addField(new LabelFieldEditor(Messages.FileLogSettings, true, parent));
    addField(new ComboFieldEditor(Preferences.FILE_LEVEL, Messages.FileLevel, levels, parent));
    addField(new StringFieldEditor(Preferences.FILE_PATTERN, Messages.FilePathPattern, parent));
    addField(new IntegerFieldEditor(Preferences.FILE_BYTES, Messages.FileSize, parent));
    addField(new IntegerFieldEditor(Preferences.FILE_COUNT, Messages.FileCount, parent));

    addField(new LabelFieldEditor(Messages.JMSLogSettings, true, parent));
    addField(new ComboFieldEditor(Preferences.JMS_LEVEL, Messages.JMSLevel, levels, parent));
    addField(new StringFieldEditor(Preferences.JMS_URL, Messages.JMSURL, parent));
    addField(new StringFieldEditor(Preferences.JMS_TOPIC, Messages.JMSTopic, parent));
}

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

License:Open Source License

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

    WorkspaceFileFieldEditor colorEditor = new WorkspaceFileFieldEditor(PreferencesHelper.COLOR_FILE,
            "Color File: ", new String[] { "def" }, parent);//$NON-NLS-2$
    addField(colorEditor);//from  w  w w . j  a v a 2  s .co m

    WorkspaceFileFieldEditor fontEditor = new WorkspaceFileFieldEditor(PreferencesHelper.FONT_FILE,
            "Font File: ", new String[] { "def" }, parent);//$NON-NLS-2$
    addField(fontEditor);

    StringFieldEditor opiSearchPathEditor = new StringFieldEditor(PreferencesHelper.OPI_SEARCH_PATH,
            "OPI Search Path", parent);
    opiSearchPathEditor.getTextControl(parent).setToolTipText("The path to search OPI files.");
    addField(opiSearchPathEditor);

    StringFieldEditor topOPIsEditor = new StringFieldEditor(PreferencesHelper.TOP_OPIS, "Top OPIs", parent);
    topOPIsEditor.getTextControl(parent).setToolTipText("The OPIs appeared in top opi button on toolbar");
    addField(topOPIsEditor);

    WorkspaceFileFieldEditor probeOPIEditor = new WorkspaceFileFieldEditor(PreferencesHelper.PROBE_OPI,
            "Probe OPI: ", new String[] { "opi" }, parent);//$NON-NLS-2$
    probeOPIEditor.getTextControl(parent)
            .setToolTipText("The opi file to be invoked from CSS->OPI Probe context menu");
    addField(probeOPIEditor);

    BooleanFieldEditor noEditModeEditor = new BooleanFieldEditor(PreferencesHelper.NO_EDIT, "No-Editing mode",
            parent);
    addField(noEditModeEditor);

    BooleanFieldEditor showOpiRuntimeStacks = new BooleanFieldEditor(PreferencesHelper.SHOW_OPI_RUNTIME_STACKS,
            "Show OPI Runtime Stacks", parent);
    showOpiRuntimeStacks.getDescriptionControl(parent).setToolTipText(
            "Enable to add placeholders to new OPI Runtime perspective " + "as an aid to positioning displays");
    addField(showOpiRuntimeStacks);

    BooleanFieldEditor advanceGraphicsEditor = new BooleanFieldEditor(
            PreferencesHelper.DISABLE_ADVANCED_GRAPHICS, "Disable Advanced Graphics", parent);
    advanceGraphicsEditor.getDescriptionControl(parent)
            .setToolTipText("This will disable alpha, anti-alias and gradient effect. "
                    + "OPI need to be re-opened to make this take effect.");
    addField(advanceGraphicsEditor);

    BooleanFieldEditor displaySysOutEditor = new BooleanFieldEditor(PreferencesHelper.DISPLAY_SYSTEM_OUTPUT,
            "Display system output to BOY Console", parent);
    displaySysOutEditor.getDescriptionControl(parent)
            .setToolTipText("Enable this may result in undesired \ninformation displayed in BOY Console.");
    addField(displaySysOutEditor);

    BooleanFieldEditor default_type_editor = new BooleanFieldEditor(PreferencesHelper.DEFAULT_TO_CLASSIC_STYLE,
            "Default to 'classic' widget style", parent);
    default_type_editor.getDescriptionControl(parent)
            .setToolTipText("Should widgets with 'classic' as well as 'native' style default to 'classic'?");
    addField(default_type_editor);

    IntegerFieldEditor urlLoadFieldEditor = new IntegerFieldEditor(PreferencesHelper.URL_FILE_LOADING_TIMEOUT,
            "URL file loading timeout (ms)", parent);
    urlLoadFieldEditor.getTextControl(parent)
            .setToolTipText("The timeout in millisecond for loading file from a URL path.");
    addField(urlLoadFieldEditor);

}