Example usage for org.eclipse.jface.preference BooleanFieldEditor SEPARATE_LABEL

List of usage examples for org.eclipse.jface.preference BooleanFieldEditor SEPARATE_LABEL

Introduction

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

Prototype

int SEPARATE_LABEL

To view the source code for org.eclipse.jface.preference BooleanFieldEditor SEPARATE_LABEL.

Click Source Link

Document

Style constant (value 1) indicating a layout where the field editor's label appears on the left with a check box on the right.

Usage

From source file:com.aptana.js.interactive_console.console.prefs.InteractiveConsolePrefs.java

License:Open Source License

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

    ColorFieldEditor sysout = new ColorFieldEditor(JSConsoleConstants.CONSOLE_OUTPUT_COLOR, "Stdout color", p);
    ColorFieldEditor syserr = new ColorFieldEditor(JSConsoleConstants.CONSOLE_ERROR_COLOR, "Stderr color", p);
    ColorFieldEditor sysin = new ColorFieldEditor(JSConsoleConstants.CONSOLE_INPUT_COLOR, "Stdin color", p);
    ColorFieldEditor prompt = new ColorFieldEditor(JSConsoleConstants.CONSOLE_PROMPT_COLOR, "Prompt color", p);
    ColorFieldEditor background = new ColorFieldEditor(JSConsoleConstants.CONSOLE_BACKGROUND_COLOR,
            "Background color", p);
    ColorFieldEditor debugBackground = new ColorFieldEditor(JSConsoleConstants.DEBUG_CONSOLE_BACKGROUND_COLOR,
            "Debug console background color", p);

    addField(sysout);//from w w  w .  jav a  2 s  .  c o  m
    addField(syserr);
    addField(sysin);
    addField(prompt);
    addField(background);
    addField(debugBackground);

    addField(new MultiStringFieldEditor(JSConsoleConstants.INITIAL_INTERPRETER_CMDS,
            "Initial\ninterpreter\ncommands:\n", p));

    addField(new StringFieldEditor(JSConsoleConstants.INTERACTIVE_CONSOLE_VM_ARGS,
            "Vm Args for Rhino\n(used only on external\nprocess option):", p));

    addField(new IntegerFieldEditor(JSConsoleConstants.INTERACTIVE_CONSOLE_MAXIMUM_CONNECTION_ATTEMPTS,
            "Maximum connection attempts\nfor initial communication:", p));

    addField(new BooleanFieldEditor(JSConsoleConstants.INTERACTIVE_CONSOLE_FOCUS_ON_CONSOLE_START,
            "Focus console when it's started?", BooleanFieldEditor.SEPARATE_LABEL, p));

    addField(new BooleanFieldEditor(
            JSConsoleConstants.INTERACTIVE_CONSOLE_SEND_INITIAL_COMMAND_WHEN_CREATED_FROM_EDITOR,
            "When creating console send\ncurrent selection/editor\ncontents for execution?",
            BooleanFieldEditor.SEPARATE_LABEL, p));

    addField(new BooleanFieldEditor(JSConsoleConstants.INTERACTIVE_CONSOLE_FOCUS_ON_SEND_COMMAND,
            "Focus console when an evaluate\ncommand is sent from the editor?",
            BooleanFieldEditor.SEPARATE_LABEL, p));

}

From source file:com.ge.research.sadl.ui.preferences.ReasonerConfigurationDialog.java

License:Open Source License

@Override
protected Control createDialogArea(Composite parent) {
    Composite composite = (Composite) super.createDialogArea(parent);

    editors = new ArrayList<FieldEditor>();
    messageArea = new DialogMessageArea();

    page = new FieldEditorPreferencePage(FieldEditorPreferencePage.GRID) {
        @Override//w  w  w . j  a  va2 s .c o  m
        public void createControl(Composite parentComposite) {
            noDefaultAndApplyButton();
            super.createControl(parentComposite);
        }

        @SuppressWarnings("synthetic-access")
        @Override
        protected void createFieldEditors() {
            rcps = this.doGetPreferenceStore();
            if (rcps == null) {
                rcps = new PreferenceStore();
            }
            FieldEditor editor;
            if (config != null) {
                for (Map.Entry<String, ConfigurationOption> entry : config.entrySet()) {
                    String key = entry.getKey();
                    ConfigurationOption option = entry.getValue();
                    if (key.equalsIgnoreCase("builtin")) {
                        continue;
                    }
                    String optionDescription = option.getDescription();
                    Object currentValue = currentConfig.get(key);
                    Object optionValue = option.getValue();
                    if (currentValue != null) {
                        optionValue = currentValue;
                    }
                    logger.debug(key + " class = " + optionValue.getClass().getName());
                    Object[] optionPossibleValues = option.getPossibleValues();
                    if (optionPossibleValues != null && optionPossibleValues.length > 0) {
                        // Option has a list of values so create a dropdown box
                        String[][] nv = new String[optionPossibleValues.length][2];
                        for (int i = 0; i < optionPossibleValues.length; i++) {
                            nv[i][0] = optionPossibleValues[i].toString();
                            nv[i][1] = optionPossibleValues[i].toString();
                        }
                        editor = new ComboFieldEditor(key, optionDescription, nv, getFieldEditorParent());
                        rcps.setValue(editor.getPreferenceName(), optionValue.toString());
                        editor.setPreferenceStore(rcps);
                        addField(editor);
                        editor.load();
                        editors.add(editor);
                    } else if (optionValue.getClass().getName().equalsIgnoreCase("java.lang.String")) {
                        editor = new StringFieldEditor(key, optionDescription, getFieldEditorParent());
                        rcps.setValue(editor.getPreferenceName(), optionValue.toString());
                        editor.setPreferenceStore(rcps);
                        addField(editor);
                        editor.load();
                        editors.add(editor);
                    } else if (optionValue.getClass().getName().equalsIgnoreCase("java.lang.Boolean")) {
                        editor = new BooleanFieldEditor(key, optionDescription,
                                BooleanFieldEditor.SEPARATE_LABEL, getFieldEditorParent());
                        rcps.setValue(editor.getPreferenceName(), optionValue.toString());
                        editor.setPreferenceStore(rcps);
                        addField(editor);
                        editor.load();
                        editors.add(editor);
                    } else if (optionValue.getClass().getName().equalsIgnoreCase("java.lang.Integer")) {
                        editor = new IntegerFieldEditor(key, optionDescription, getFieldEditorParent());
                        rcps.setValue(editor.getPreferenceName(), optionValue.toString());
                        editor.setPreferenceStore(rcps);
                        addField(editor);
                        editor.setPage(page);
                        editor.load();
                        editors.add(editor);
                    } else if (optionValue.getClass().getName().equalsIgnoreCase("java.lang.Double")) {
                        editor = new DoubleFieldEditor(key, optionDescription, getFieldEditorParent());
                        rcps.setValue(editor.getPreferenceName(), optionValue.toString());
                        editor.setPreferenceStore(rcps);
                        addField(editor);
                        editor.load();
                        editors.add(editor);
                    }
                }
            } else {
                logger.info("No configuration options available");
            }
        }

        @SuppressWarnings("synthetic-access")
        @Override
        protected void updateApplyButton() {
            updateButtons(isValid());
            super.updateApplyButton();
        }

    };

    messageArea.createContents(composite);
    messageArea.showTitle(reasonerCategory + " Configuration Options", null);
    messageArea.setMessageLayoutData(new GridData(GridData.FILL_BOTH));
    page.createControl(composite);
    for (FieldEditor editor : editors) {
        editor.setPreferenceStore(rcps);
    }
    Control pageControl = page.getControl();
    pageControl.setLayoutData(new GridData(GridData.FILL_BOTH));
    return pageControl;
}

From source file:com.ge.research.sadl.ui.preferences.TranslatorConfigurationDialog.java

License:Open Source License

@Override
protected Control createDialogArea(Composite parent) {
    Composite composite = (Composite) super.createDialogArea(parent);

    editors = new ArrayList<FieldEditor>();
    messageArea = new DialogMessageArea();

    page = new FieldEditorPreferencePage(FieldEditorPreferencePage.GRID) {
        @Override//from ww  w  .  j  a  v a 2  s . c  o  m
        public void createControl(Composite parentComposite) {
            noDefaultAndApplyButton();
            super.createControl(parentComposite);
        }

        @SuppressWarnings("synthetic-access")
        @Override
        protected void createFieldEditors() {
            rcps = this.doGetPreferenceStore();
            if (rcps == null) {
                rcps = new PreferenceStore();
            }
            FieldEditor editor;
            if (config == null) {
                messageArea.updateText("No options available", IMessageProvider.NONE);
                return;
            }
            for (Map.Entry<String, ConfigurationOption> entry : config.entrySet()) {
                String key = entry.getKey();
                ConfigurationOption option = entry.getValue();
                if (key.equalsIgnoreCase("builtin")) {
                    continue;
                }
                String optionDescription = option.getDescription();
                Object currentValue = currentConfig.get(key);
                Object optionValue = option.getValue();
                if (currentValue != null) {
                    optionValue = currentValue;
                }
                logger.debug(
                        key + " class = " + (optionValue != null ? optionValue.getClass().getName() : "null"));
                Object[] optionPossibleValues = option.getPossibleValues();
                if (optionPossibleValues != null && optionPossibleValues.length > 0) {
                    // Option has a list of values so create a dropdown box
                    String[][] nv = new String[optionPossibleValues.length][2];
                    for (int i = 0; i < optionPossibleValues.length; i++) {
                        nv[i][0] = optionPossibleValues[i].toString();
                        nv[i][1] = optionPossibleValues[i].toString();
                    }
                    editor = new ComboFieldEditor(key, optionDescription, nv, getFieldEditorParent());
                    rcps.setValue(editor.getPreferenceName(), optionValue.toString());
                    editor.setPreferenceStore(rcps);
                    addField(editor);
                    editor.load();
                    editors.add(editor);
                } else if (optionValue == null) {
                    editor = new StringFieldEditor(key, optionDescription, getFieldEditorParent());
                    editor.setPreferenceStore(rcps);
                    addField(editor);
                    editor.load();
                    editors.add(editor);
                } else if (optionValue.getClass().getName().equalsIgnoreCase("java.lang.String")) {
                    editor = new StringFieldEditor(key, optionDescription, getFieldEditorParent());
                    rcps.setValue(editor.getPreferenceName(), optionValue.toString());
                    editor.setPreferenceStore(rcps);
                    addField(editor);
                    editor.load();
                    editors.add(editor);
                } else if (optionValue.getClass().getName().equalsIgnoreCase("java.lang.Boolean")) {
                    editor = new BooleanFieldEditor(key, optionDescription, BooleanFieldEditor.SEPARATE_LABEL,
                            getFieldEditorParent());
                    rcps.setValue(editor.getPreferenceName(), optionValue.toString());
                    editor.setPreferenceStore(rcps);
                    addField(editor);
                    editor.load();
                    editors.add(editor);
                } else if (optionValue.getClass().getName().equalsIgnoreCase("java.lang.Integer")) {
                    editor = new IntegerFieldEditor(key, optionDescription, getFieldEditorParent());
                    rcps.setValue(editor.getPreferenceName(), optionValue.toString());
                    editor.setPreferenceStore(rcps);
                    addField(editor);
                    editor.setPage(page);
                    editor.load();
                    editors.add(editor);
                } else if (optionValue.getClass().getName().equalsIgnoreCase("java.lang.Double")) {
                    editor = new DoubleFieldEditor(key, optionDescription, getFieldEditorParent());
                    rcps.setValue(editor.getPreferenceName(), optionValue.toString());
                    editor.setPreferenceStore(rcps);
                    addField(editor);
                    editor.load();
                    editors.add(editor);
                }
            }
        }

        @SuppressWarnings("synthetic-access")
        @Override
        protected void updateApplyButton() {
            updateButtons(isValid());
            super.updateApplyButton();
        }

    };

    messageArea.createContents(composite);
    messageArea.showTitle(translatorCategory + " Configuration Options", null);
    messageArea.setMessageLayoutData(new GridData(GridData.FILL_BOTH));
    page.createControl(composite);
    for (FieldEditor editor : editors) {
        editor.setPreferenceStore(rcps);
    }
    Control pageControl = page.getControl();
    pageControl.setLayoutData(new GridData(GridData.FILL_BOTH));
    return pageControl;
}

From source file:com.ge.research.sadl.ui.properties.ReasonerConfigurationDialog.java

License:Open Source License

@Override
protected Control createDialogArea(Composite parent) {
    Composite composite = (Composite) super.createDialogArea(parent);

    editors = new ArrayList<FieldEditor>();
    messageArea = new DialogMessageArea();

    page = new FieldEditorPreferencePage(FieldEditorPreferencePage.GRID) {
        @Override//  ww  w.j  av a  2s .  c o  m
        public void createControl(Composite parentComposite) {
            noDefaultAndApplyButton();
            super.createControl(parentComposite);
        }

        @SuppressWarnings("synthetic-access")
        @Override
        protected void createFieldEditors() {
            rcps = this.doGetPreferenceStore();
            if (rcps == null) {
                rcps = new PreferenceStore();
            }
            FieldEditor editor;
            for (Map.Entry<String, ConfigurationOption> entry : config.entrySet()) {
                String key = entry.getKey();
                ConfigurationOption option = entry.getValue();
                if (key.equalsIgnoreCase("builtin")) {
                    continue;
                }
                String optionDescription = option.getDescription();
                Object currentValue = currentConfig.get(key);
                Object optionValue = option.getValue();
                if (currentValue != null) {
                    optionValue = currentValue;
                }
                logger.debug(key + " class = " + optionValue.getClass().getName());
                Object[] optionPossibleValues = option.getPossibleValues();
                if (optionPossibleValues != null && optionPossibleValues.length > 0) {
                    // Option has a list of values so create a dropdown box
                    String[][] nv = new String[optionPossibleValues.length][2];
                    for (int i = 0; i < optionPossibleValues.length; i++) {
                        nv[i][0] = optionPossibleValues[i].toString();
                        nv[i][1] = optionPossibleValues[i].toString();
                    }
                    editor = new ComboFieldEditor(key, optionDescription, nv, getFieldEditorParent());
                    rcps.setValue(editor.getPreferenceName(), optionValue.toString());
                    editor.setPreferenceStore(rcps);
                    addField(editor);
                    editor.load();
                    editors.add(editor);
                } else if (optionValue.getClass().getName().equalsIgnoreCase("java.lang.String")) {
                    editor = new StringFieldEditor(key, optionDescription, getFieldEditorParent());
                    rcps.setValue(editor.getPreferenceName(), optionValue.toString());
                    editor.setPreferenceStore(rcps);
                    addField(editor);
                    editor.load();
                    editors.add(editor);
                } else if (optionValue.getClass().getName().equalsIgnoreCase("java.lang.Boolean")) {
                    editor = new BooleanFieldEditor(key, optionDescription, BooleanFieldEditor.SEPARATE_LABEL,
                            getFieldEditorParent());
                    rcps.setValue(editor.getPreferenceName(), optionValue.toString());
                    editor.setPreferenceStore(rcps);
                    addField(editor);
                    editor.load();
                    editors.add(editor);
                } else if (optionValue.getClass().getName().equalsIgnoreCase("java.lang.Integer")) {
                    editor = new IntegerFieldEditor(key, optionDescription, getFieldEditorParent());
                    rcps.setValue(editor.getPreferenceName(), optionValue.toString());
                    editor.setPreferenceStore(rcps);
                    addField(editor);
                    editor.setPage(page);
                    editor.load();
                    editors.add(editor);
                } else if (optionValue.getClass().getName().equalsIgnoreCase("java.lang.Double")) {
                    editor = new DoubleFieldEditor(key, optionDescription, getFieldEditorParent());
                    rcps.setValue(editor.getPreferenceName(), optionValue.toString());
                    editor.setPreferenceStore(rcps);
                    addField(editor);
                    editor.load();
                    editors.add(editor);
                }
            }
        }

        @SuppressWarnings("synthetic-access")
        @Override
        protected void updateApplyButton() {
            updateButtons(isValid());
            super.updateApplyButton();
        }

    };

    messageArea.createContents(composite);
    messageArea.showTitle(reasonerCategory + " Configuration Options", null);
    messageArea.setMessageLayoutData(new GridData(GridData.FILL_BOTH));
    page.createControl(composite);
    for (FieldEditor editor : editors) {
        editor.setPreferenceStore(rcps);
    }
    Control pageControl = page.getControl();
    pageControl.setLayoutData(new GridData(GridData.FILL_BOTH));
    return pageControl;
}

From source file:com.ge.research.sadl.ui.properties.TranslatorConfigurationDialog.java

License:Open Source License

@Override
protected Control createDialogArea(Composite parent) {
    Composite composite = (Composite) super.createDialogArea(parent);

    editors = new ArrayList<FieldEditor>();
    messageArea = new DialogMessageArea();

    page = new FieldEditorPreferencePage(FieldEditorPreferencePage.GRID) {
        @Override//from  w  w  w  .  j av  a2  s.  com
        public void createControl(Composite parentComposite) {
            noDefaultAndApplyButton();
            super.createControl(parentComposite);
        }

        @SuppressWarnings("synthetic-access")
        @Override
        protected void createFieldEditors() {
            rcps = this.doGetPreferenceStore();
            if (rcps == null) {
                rcps = new PreferenceStore();
            }
            FieldEditor editor;
            if (config == null) {
                messageArea.updateText("No options available", IMessageProvider.NONE);
                return;
            }
            for (Map.Entry<String, ConfigurationOption> entry : config.entrySet()) {
                String key = entry.getKey();
                ConfigurationOption option = entry.getValue();
                if (key.equalsIgnoreCase("builtin")) {
                    continue;
                }
                String optionDescription = option.getDescription();
                Object currentValue = currentConfig.get(key);
                Object optionValue = option.getValue();
                if (currentValue != null) {
                    optionValue = currentValue;
                }
                logger.debug(key + " class = " + optionValue.getClass().getName());
                Object[] optionPossibleValues = option.getPossibleValues();
                if (optionPossibleValues != null && optionPossibleValues.length > 0) {
                    // Option has a list of values so create a dropdown box
                    String[][] nv = new String[optionPossibleValues.length][2];
                    for (int i = 0; i < optionPossibleValues.length; i++) {
                        nv[i][0] = optionPossibleValues[i].toString();
                        nv[i][1] = optionPossibleValues[i].toString();
                    }
                    editor = new ComboFieldEditor(key, optionDescription, nv, getFieldEditorParent());
                    rcps.setValue(editor.getPreferenceName(), optionValue.toString());
                    editor.setPreferenceStore(rcps);
                    addField(editor);
                    editor.load();
                    editors.add(editor);
                } else if (optionValue.getClass().getName().equalsIgnoreCase("java.lang.String")) {
                    editor = new StringFieldEditor(key, optionDescription, getFieldEditorParent());
                    rcps.setValue(editor.getPreferenceName(), optionValue.toString());
                    editor.setPreferenceStore(rcps);
                    addField(editor);
                    editor.load();
                    editors.add(editor);
                } else if (optionValue.getClass().getName().equalsIgnoreCase("java.lang.Boolean")) {
                    editor = new BooleanFieldEditor(key, optionDescription, BooleanFieldEditor.SEPARATE_LABEL,
                            getFieldEditorParent());
                    rcps.setValue(editor.getPreferenceName(), optionValue.toString());
                    editor.setPreferenceStore(rcps);
                    addField(editor);
                    editor.load();
                    editors.add(editor);
                } else if (optionValue.getClass().getName().equalsIgnoreCase("java.lang.Integer")) {
                    editor = new IntegerFieldEditor(key, optionDescription, getFieldEditorParent());
                    rcps.setValue(editor.getPreferenceName(), optionValue.toString());
                    editor.setPreferenceStore(rcps);
                    addField(editor);
                    editor.setPage(page);
                    editor.load();
                    editors.add(editor);
                } else if (optionValue.getClass().getName().equalsIgnoreCase("java.lang.Double")) {
                    editor = new DoubleFieldEditor(key, optionDescription, getFieldEditorParent());
                    rcps.setValue(editor.getPreferenceName(), optionValue.toString());
                    editor.setPreferenceStore(rcps);
                    addField(editor);
                    editor.load();
                    editors.add(editor);
                }
            }
        }

        @SuppressWarnings("synthetic-access")
        @Override
        protected void updateApplyButton() {
            updateButtons(isValid());
            super.updateApplyButton();
        }

    };

    messageArea.createContents(composite);
    messageArea.showTitle(translatorCategory + " Configuration Options", null);
    messageArea.setMessageLayoutData(new GridData(GridData.FILL_BOTH));
    page.createControl(composite);
    for (FieldEditor editor : editors) {
        editor.setPreferenceStore(rcps);
    }
    Control pageControl = page.getControl();
    pageControl.setLayoutData(new GridData(GridData.FILL_BOTH));
    return pageControl;
}

From source file:com.google.devtools.depan.maven.eclipse.preferences.AnalysisPreferencesPage.java

License:Apache License

@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);//from  w ww.j av  a  2s .c o m
    addField(systemjava);
    addField(javahome);
    addField(effectivepom);
}

From source file:com.skratchdot.electribe.model.esx.preferences.EsxPreferencePagePatterns.java

License:Open Source License

/**
 * Create contents of the preference page.
 *///  w w w. j av a2 s.co m
@Override
protected void createFieldEditors() {
    // Create the field editors
    addField(new BooleanFieldEditor(EsxPreferenceNames.PATTERNS_USE_SCROLL_SPEED, "Use Scroll Speed",
            BooleanFieldEditor.SEPARATE_LABEL, getFieldEditorParent()));
    {
        IntegerFieldEditor integerFieldEditor = new IntegerFieldEditor(EsxPreferenceNames.PATTERNS_SCROLL_SPEED,
                "Scroll Speed (in ms)", getFieldEditorParent());
        integerFieldEditor.setValidRange(10, 200);
        addField(integerFieldEditor);
    }
    addField(new ColorFieldEditor(EsxPreferenceNames.PATTERNS_BACKGROUND_COLOR_WHEN_NOT_EMPTY,
            "Background Color When Not Empty", getFieldEditorParent()));
    addField(new ColorFieldEditor(EsxPreferenceNames.PATTERNS_FOREGROUND_COLOR_WHEN_NOT_EMPTY,
            "Foreground Color When Not Empty", getFieldEditorParent()));
    addField(new ColorFieldEditor(EsxPreferenceNames.PATTERNS_BACKGROUND_COLOR_WHEN_EMPTY,
            "Background Color When Empty", getFieldEditorParent()));
    addField(new ColorFieldEditor(EsxPreferenceNames.PATTERNS_FOREGROUND_COLOR_WHEN_EMPTY,
            "Foreground Color When Empty", getFieldEditorParent()));
}

From source file:com.skratchdot.electribe.model.esx.preferences.EsxPreferencePageSamples.java

License:Open Source License

/**
 * Create contents of the preference page.
 *//*from   w ww  .  j  a v  a 2s  .c  o m*/
@Override
protected void createFieldEditors() {
    // Create the field editors
    addField(new BooleanFieldEditor(EsxPreferenceNames.SAMPLES_USE_SCROLL_SPEED, "Use Scroll Speed",
            BooleanFieldEditor.SEPARATE_LABEL, getFieldEditorParent()));
    {
        IntegerFieldEditor integerFieldEditor = new IntegerFieldEditor(EsxPreferenceNames.SAMPLES_SCROLL_SPEED,
                "Scroll Speed (in ms)", getFieldEditorParent());
        integerFieldEditor.setValidRange(10, 200);
        addField(integerFieldEditor);
    }
    addField(new ColorFieldEditor(EsxPreferenceNames.SAMPLES_BACKGROUND_COLOR_WHEN_NOT_EMPTY,
            "Background Color When Not Empty", getFieldEditorParent()));
    addField(new ColorFieldEditor(EsxPreferenceNames.SAMPLES_FOREGROUND_COLOR_WHEN_NOT_EMPTY,
            "Foreground Color When Not Empty", getFieldEditorParent()));
    addField(new ColorFieldEditor(EsxPreferenceNames.SAMPLES_BACKGROUND_COLOR_WHEN_EMPTY,
            "Background Color When Empty", getFieldEditorParent()));
    addField(new ColorFieldEditor(EsxPreferenceNames.SAMPLES_FOREGROUND_COLOR_WHEN_EMPTY,
            "Foreground Color When Empty", getFieldEditorParent()));
}

From source file:com.skratchdot.electribe.model.esx.preferences.EsxPreferencePageSongs.java

License:Open Source License

/**
 * Create contents of the preference page.
 *//*from  ww w. ja  v  a 2  s.  c o m*/
@Override
protected void createFieldEditors() {
    // Create the field editors
    addField(new BooleanFieldEditor(EsxPreferenceNames.SONGS_USE_SCROLL_SPEED, "Use Scroll Speed",
            BooleanFieldEditor.SEPARATE_LABEL, getFieldEditorParent()));
    {
        IntegerFieldEditor integerFieldEditor = new IntegerFieldEditor(EsxPreferenceNames.SONGS_SCROLL_SPEED,
                "Scroll Speed (in ms)", getFieldEditorParent());
        integerFieldEditor.setValidRange(10, 200);
        addField(integerFieldEditor);
    }
    addField(new ColorFieldEditor(EsxPreferenceNames.SONGS_BACKGROUND_COLOR_WHEN_NOT_EMPTY,
            "Background Color When Not Empty", getFieldEditorParent()));
    addField(new ColorFieldEditor(EsxPreferenceNames.SONGS_FOREGROUND_COLOR_WHEN_NOT_EMPTY,
            "Foreground Color When Not Empty", getFieldEditorParent()));
    addField(new ColorFieldEditor(EsxPreferenceNames.SONGS_BACKGROUND_COLOR_WHEN_EMPTY,
            "Background Color When Empty", getFieldEditorParent()));
    addField(new ColorFieldEditor(EsxPreferenceNames.SONGS_FOREGROUND_COLOR_WHEN_EMPTY,
            "Foreground Color When Empty", getFieldEditorParent()));
}

From source file:eu.esdihumboldt.hale.io.gml.ui.InspireDatasetFeedConfigurationPage.java

License:Open Source License

@Override
protected void createContent(Composite page) {
    parent = page;//from w ww  . j a v a  2s .c o  m
    GridLayoutFactory.swtDefaults().numColumns(2).equalWidth(false).spacing(6, 12).applyTo(page);

    // TODO "intro" explanation

    FieldDecoration fieldDec = FieldDecorationRegistry.getDefault()
            .getFieldDecoration(FieldDecorationRegistry.DEC_INFORMATION);
    Image infoImage = fieldDec.getImage();

    create = new BooleanFieldEditor("create", "Create feed", BooleanFieldEditor.SEPARATE_LABEL, page);
    create.setPropertyChangeListener(new IPropertyChangeListener() {

        @Override
        public void propertyChange(PropertyChangeEvent event) {
            updateStatus();
        }
    });
    title = new StringFieldEditor("title", "Feed title", page);
    subTitle = new StringFieldEditor("subtitle", "Feed sub title", page);
    rights = new StringFieldEditor("rights", "Rights", page); // e
    ControlDecoration rightsExplanation = new ControlDecoration(rights.getTextControl(page),
            SWT.LEFT | SWT.TOP);
    rightsExplanation.setImage(infoImage);
    rightsExplanation.setDescriptionText("Any information about rights or restrictions to the dataset.");
    authorName = new StringFieldEditor("name", "Author name", page);
    authorMail = new StringFieldEditor("mail", "Author mail", page);
    selfLink = new StringFieldEditor("self", "Feed URI", page); // e
    ControlDecoration selfLinkExplanation = new ControlDecoration(selfLink.getTextControl(page),
            SWT.LEFT | SWT.TOP);
    selfLinkExplanation.setImage(infoImage);
    selfLinkExplanation.setDescriptionText("The address under which the feed will be accessible.\n"
            + "Changes do not affect the location of the created file.");
    gmlLink = new StringFieldEditor("gml", "GML URI", page);// e
    ControlDecoration gmlLinkExplanation = new ControlDecoration(gmlLink.getTextControl(page),
            SWT.LEFT | SWT.TOP);
    gmlLinkExplanation.setImage(infoImage);
    gmlLinkExplanation.setDescriptionText("The address under which the gml data will be accessible.\n"
            + "Changes do not affect the location of the created file.");
    updateStatus();
}