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

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

Introduction

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

Prototype

int DEFAULT

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

Click Source Link

Document

Style constant (value 0) indicating the default layout where the field editor's check box appears to the left of the label.

Usage

From source file:ca.uvic.cs.tagsea.monitoring.internal.ui.MonitoringPreferencePage.java

License:Open Source License

@Override
protected Control createContents(Composite parent) {
    Composite page = new Composite(parent, SWT.NONE);
    GridLayout layout = new GridLayout(2, false);
    GridDataFactory fill = GridDataFactory.fillDefaults();
    GridDataFactory but = GridDataFactory.createFrom(new GridData(SWT.CENTER, SWT.CENTER, false, false));
    page.setLayout(layout);//from w  w  w.ja v  a 2 s . c o  m
    GridData data = fill.create();
    data.widthHint = 300;
    page.setLayoutData(data);
    Text intro = new Text(page, SWT.WRAP | SWT.MULTI | SWT.READ_ONLY);
    //intro.setEditable(false);
    //@tag incomplete
    intro.setText("Some monitors have been contributed to the TagSEA plugin. The following pages will "
            + "present you with agreements to allow TagSEA to monitor your interactions with it. Please "
            + "read the agreement carefully. If you do not agree, TagSEA will not use the monitor to monitor "
            + "your usage of TagSEA.");
    data = fill.create();
    data.horizontalSpan = 2;
    data.grabExcessHorizontalSpace = false;
    data.widthHint = 300;
    intro.setLayoutData(data);
    String[] keys = Monitoring.getDefault().getPreferenceKeys();
    editors = new ArrayList<BooleanFieldEditor>();
    IPreferenceStore store = TagSEAPlugin.getDefault().getPreferenceStore();
    for (String key : keys) {
        ITagSEAMonitor mon = Monitoring.getDefault().getMonitorForPreference(key);
        if (mon != null) {
            Composite editorParent = new Composite(page, SWT.NONE);
            editorParent.setLayoutData(fill.create());
            BooleanFieldEditor editor = new BooleanStringFieldEditor(key, mon.getName(),
                    BooleanFieldEditor.DEFAULT, editorParent);
            editor.setPreferenceStore(store);
            editors.add(editor);
            Button agreement = new Button(page, SWT.PUSH);
            agreement.setText("Agreement...");
            agreement.addSelectionListener(new AgreementSelection(mon));
            agreement.setLayoutData(but.create());
        }
    }
    loadEditors();
    return page;
}

From source file:com.chookapp.org.bracketeer.preferences.HighlightingBracketsPrefPage.java

License:Open Source License

/**
 * Create contents of the preference page.
 * @param parent/*from   w w w.  java 2  s .  c om*/
 */
@Override
public Control createPageContents(Composite parent) {
    Composite container = new Composite(parent, SWT.NULL);
    container.setLayout(new FillLayout(SWT.HORIZONTAL));

    TabFolder tabFolder = new TabFolder(container, SWT.NONE);

    IConfigurationElement[] config = Platform.getExtensionRegistry()
            .getConfigurationElementsFor(ProcessorsRegistry.PROC_FACTORY_ID);

    if (config.length == 0) {
        Text txtNoBracketeerEditor = new Text(container, SWT.BORDER | SWT.READ_ONLY | SWT.WRAP | SWT.MULTI);
        txtNoBracketeerEditor.setText(Messages.MainPrefPage_txtNoBracketeerEditor_text);

        return container;
    }

    // If we want to re-enable design mode, we should comment out this "for", and comment in this stub
    //        IConfigurationElement element = null; // stub
    for (IConfigurationElement element : config) {
        String pluginName = element.getAttribute("name"); //$NON-NLS-1$
        TabInfo tabInfo = new TabInfo();
        _tabInfos.add(tabInfo);
        tabInfo._name = pluginName;

        TabItem tbtmNewItem = new TabItem(tabFolder, SWT.NONE);
        tbtmNewItem.setText(pluginName);

        Composite composite = new Composite(tabFolder, SWT.NONE);
        tbtmNewItem.setControl(composite);
        composite.setLayout(new GridLayout(1, false));

        Group grpHighlight = new Group(composite, SWT.NONE);
        grpHighlight.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1));
        grpHighlight.setText(Messages.HighlightingBracketsPrefPage_BrktHighlighting);
        grpHighlight.setLayout(new GridLayout(3, false));

        Composite composite_13 = new Composite(grpHighlight, SWT.NONE);
        composite_13.setLayoutData(new GridData(SWT.LEFT, SWT.FILL, false, false, 1, 1));
        composite_13.setLayout(new GridLayout(1, false));

        List list = new List(composite_13, SWT.BORDER);
        list.addSelectionListener(new SelectionAdapter() {
            @Override
            public void widgetSelected(SelectionEvent e) {
                updateHihglightFieldEditors();
            }
        });
        list.setItems(new String[] { Messages.HighlightingBracketsPrefPage_DefaultItem,
                Messages.HighlightingBracketsPrefPage_Pair1, Messages.HighlightingBracketsPrefPage_Pair2,
                Messages.HighlightingBracketsPrefPage_Pair3, Messages.HighlightingBracketsPrefPage_Pair4,
                Messages.HighlightingBracketsPrefPage_MissingPair });
        GridData gd_list = new GridData(SWT.LEFT, SWT.FILL, false, true, 1, 1);
        gd_list.widthHint = 119;
        list.setLayoutData(gd_list);
        list.setSize(71, 177);
        list.setSelection(0);
        tabInfo._highlighList = list;

        Composite composite_1 = new Composite(grpHighlight, SWT.NONE);
        composite_1.setLayout(new GridLayout(1, false));

        Group grpForegroundColor = new Group(composite_1, SWT.NONE);
        grpForegroundColor.setText(Messages.HighlightingBracketsPrefPage_FgColor);
        grpForegroundColor.setLayout(new GridLayout(1, false));

        Composite composite_2 = new Composite(grpForegroundColor, SWT.NONE);
        BooleanFieldEditor bfe = new BooleanFieldEditor(
                PreferencesConstants.preferencePath(pluginName)
                        + PreferencesConstants.Highlights.getAttrPath(0, true)
                        + PreferencesConstants.Highlights.UseDefault,
                Messages.HighlightingBracketsPrefPage_UseDef, BooleanFieldEditor.DEFAULT, composite_2);
        addField(bfe);
        tabInfo._highlighUseDefualtFE.add(bfe);

        Composite composite_10 = new Composite(grpForegroundColor, SWT.NONE);
        GridLayout gl_composite_10 = new GridLayout(1, false);
        gl_composite_10.marginLeft = 10;
        composite_10.setLayout(gl_composite_10);

        Composite composite_4 = new Composite(composite_10, SWT.NONE);
        ColorFieldEditor cfe = new ColorFieldEditor(PreferencesConstants.preferencePath(pluginName)
                + PreferencesConstants.Highlights.getAttrPath(0, true) + PreferencesConstants.Highlights.Color,
                Messages.HighlightingBracketsPrefPage_Color, composite_4);
        addField(cfe);
        tabInfo._highlighColorFE.add(cfe);
        tabInfo._highlighColorFEparent.add(composite_4);

        Group grpBackgroundColor = new Group(composite_1, SWT.NONE);
        grpBackgroundColor.setText(Messages.HighlightingBracketsPrefPage_BgColor);
        grpBackgroundColor.setLayout(new GridLayout(1, false));

        Composite composite_3 = new Composite(grpBackgroundColor, SWT.NONE);
        bfe = new BooleanFieldEditor(
                PreferencesConstants.preferencePath(pluginName)
                        + PreferencesConstants.Highlights.getAttrPath(0, false)
                        + PreferencesConstants.Highlights.UseDefault,
                Messages.HighlightingBracketsPrefPage_UseDef, BooleanFieldEditor.DEFAULT, composite_3);
        addField(bfe);
        tabInfo._highlighUseDefualtFE.add(bfe);

        Composite composite_14 = new Composite(grpBackgroundColor, SWT.NONE);
        GridLayout gl_composite_14 = new GridLayout(1, false);
        gl_composite_14.marginLeft = 10;
        composite_14.setLayout(gl_composite_14);

        Composite composite_5 = new Composite(composite_14, SWT.NONE);
        cfe = new ColorFieldEditor(PreferencesConstants.preferencePath(pluginName)
                + PreferencesConstants.Highlights.getAttrPath(0, false) + PreferencesConstants.Highlights.Color,
                Messages.HighlightingBracketsPrefPage_Color, composite_5);
        addField(cfe);
        tabInfo._highlighColorFE.add(cfe);
        tabInfo._highlighColorFEparent.add(composite_5);

        Composite composite_15 = new Composite(composite_14, SWT.NONE);
        composite_15.setSize(230, 25);
        ComboFieldEditor cofe = new ComboFieldEditor(
                PreferencesConstants.preferencePath(tabInfo._name)
                        + PreferencesConstants.Highlights.getAttrPath(0, false)
                        + PreferencesConstants.Highlights.HighlightTypeAttr,
                Messages.HighlightingBracketsPrefPage_BgStyle,
                new String[][] {
                        { PreferencesConstants.Highlights.HighlightTypeValNone,
                                Messages.HighlightingBracketsPrefPage_None },
                        { PreferencesConstants.Highlights.HighlightTypeValSolid,
                                Messages.HighlightingBracketsPrefPage_Solid },
                        { PreferencesConstants.Highlights.HighlightTypeValOutline,
                                Messages.HighlightingBracketsPrefPage_Outline } },
                composite_15);
        addField(cofe);
        tabInfo._highlighStyleFE = cofe;
        tabInfo._highlighStyleFEparent = composite_15;

        Group grpAnnotation = new Group(grpHighlight, SWT.NONE);
        grpAnnotation.setLayoutData(new GridData(SWT.LEFT, SWT.TOP, false, false, 1, 1));
        grpAnnotation.setText(Messages.HighlightingBracketsPrefPage_grpAnnotation_text);
        grpAnnotation.setLayout(new GridLayout(1, false));

        Composite composite_19 = new Composite(grpAnnotation, SWT.NONE);
        composite_19.setLayout(new GridLayout(1, false));

        tabInfo._annotationComposite = composite_19;
        Composite composite_20 = new Composite(composite_19, SWT.NONE);
        bfe = new BooleanFieldEditor(
                PreferencesConstants.preferencePath(tabInfo._name) + PreferencesConstants.Annotations.Enable,
                Messages.HighlightingBracketsPrefPage_enableAnnotation, BooleanFieldEditor.DEFAULT,
                composite_20);
        addField(bfe);

        Link link = new Link(composite_19, SWT.NONE);
        GridData gd_link = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1);
        gd_link.horizontalIndent = 10;
        link.setLayoutData(gd_link);
        link.setBounds(0, 0, 54, 17);
        link.setText(Messages.HighlightingBracketsPrefPage_annotationLink);
        link.addSelectionListener(new SelectionAdapter() {
            public void widgetSelected(SelectionEvent e) {
                PreferencesUtil.createPreferenceDialogOn(getShell(),
                        "org.eclipse.ui.editors.preferencePages.Annotations", null, null); //$NON-NLS-1$
            }
        });

        Group grpSurroundingBrackets = new Group(composite, SWT.NONE);
        grpSurroundingBrackets.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1));
        grpSurroundingBrackets.setText(Messages.HighlightingBracketsPrefPage_SurroundingBrkt);
        grpSurroundingBrackets.setLayout(new GridLayout(1, false));

        Composite composite_6 = new Composite(grpSurroundingBrackets, SWT.NONE);
        bfe = new BooleanFieldEditor(
                PreferencesConstants.preferencePath(pluginName) + PreferencesConstants.Surrounding.Enable,
                Messages.HighlightingBracketsPrefPage_Enable, BooleanFieldEditor.DEFAULT, composite_6);
        addField(bfe);
        tabInfo._surroundingEnableFE = bfe;

        Composite composite_7 = new Composite(grpSurroundingBrackets, SWT.NONE);
        GridLayout gl_composite_7 = new GridLayout(2, false);
        gl_composite_7.marginLeft = 10;
        composite_7.setLayout(gl_composite_7);
        tabInfo._surroundingComposite = composite_7;

        Composite composite_8 = new Composite(composite_7, SWT.NONE);
        GridLayout gl_composite_8 = new GridLayout(1, false);
        gl_composite_8.marginWidth = 10;
        composite_8.setLayout(gl_composite_8);

        Group grpPairsToShow = new Group(composite_8, SWT.NONE);
        grpPairsToShow.setText(Messages.HighlightingBracketsPrefPage_PairsToShow);
        grpPairsToShow.setLayout(new GridLayout(2, false));

        Composite composite_16 = new Composite(composite_7, SWT.NONE);
        composite_16.setLayout(new GridLayout(1, false));

        // If we want to re-enable design mode, we should comment out this field addition
        addField(new StringPartCheckBoxes(
                PreferencesConstants.preferencePath(pluginName) + PreferencesConstants.Surrounding.ShowBrackets,
                grpPairsToShow, element.getAttribute(ProcessorsRegistry.SUPPORTED_BRACKETS_ATTR)));

        Composite composite_12 = new Composite(composite_16, SWT.NONE);
        composite_12.setLayout(new GridLayout(3, false));

        Composite composite_11 = new Composite(composite_12, SWT.NONE);
        SpinnerFieldEditor spinner = new SpinnerFieldEditor(
                PreferencesConstants.preferencePath(pluginName)
                        + PreferencesConstants.Surrounding.NumBracketsToShow,
                Messages.HighlightingBracketsPrefPage_ShowUpTo, composite_11);
        addField(spinner);
        spinner.getSpinner().setMinimum(1);
        spinner.getSpinner().setMaximum(PreferencesConstants.MAX_PAIRS);

        Label lblNewLabel = new Label(composite_12, SWT.NONE);
        lblNewLabel.setAlignment(SWT.RIGHT);
        lblNewLabel.setText(Messages.HighlightingBracketsPrefPage_Pairs);

        Composite composite_17 = new Composite(composite_16, SWT.NONE);
        composite_17.setLayout(new GridLayout(3, false));

        Composite composite_18 = new Composite(composite_17, SWT.NONE);
        spinner = new SpinnerFieldEditor(
                PreferencesConstants.preferencePath(pluginName)
                        + PreferencesConstants.Surrounding.MinDistanceBetweenBrackets,
                Messages.HighlightingBracketsPrefPage_ShowPairsWhichAreAtLeast, composite_18);
        addField(spinner);
        lblNewLabel = new Label(composite_17, SWT.NONE);
        lblNewLabel.setAlignment(SWT.RIGHT);
        lblNewLabel.setText(Messages.HighlightingBracketsPrefPage_charsApart);

        Group grpHovering = new Group(composite, SWT.NONE);
        grpHovering.setLayout(new GridLayout(1, false));
        grpHovering.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1));
        grpHovering.setText(Messages.HighlightingBracketsPrefPage_Hover);

        Composite composite_9 = new Composite(grpHovering, SWT.NONE);
        addField(new BooleanFieldEditor(
                PreferencesConstants.preferencePath(pluginName) + PreferencesConstants.Hovering.Enable,
                Messages.HighlightingBracketsPrefPage_ShowHoveredPairs, BooleanFieldEditor.DEFAULT,
                composite_9));

        Composite composite_21 = new Composite(grpHovering, SWT.NONE);
        bfe = new BooleanFieldEditor(
                PreferencesConstants.preferencePath(pluginName) + PreferencesConstants.Hovering.PopupEnable,
                Messages.HighlightingBracketsPrefPage_ShowPopup, BooleanFieldEditor.DEFAULT, composite_21);
        addField(bfe);
        tabInfo._popupEn = bfe;

        Composite composite_22 = new Composite(grpHovering, SWT.NONE);
        GridData gd_composite_22 = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1);
        gd_composite_22.horizontalIndent = 20;
        composite_22.setLayoutData(gd_composite_22);
        bfe = new BooleanFieldEditor(
                PreferencesConstants.preferencePath(pluginName)
                        + PreferencesConstants.Hovering.PopupOnlyWithoutHint,
                Messages.HighlightingBracketsPrefPage_PopupOnlyWithoutHint, BooleanFieldEditor.DEFAULT,
                composite_22);
        addField(bfe);
        tabInfo._popupWithoutHint = composite_22;
    }

    PlatformUI.getWorkbench().getHelpSystem().setHelp(getControl(),
            "com.choockapp.org.bracketeer.highlight_pref"); //$NON-NLS-1$
    return container;
}

From source file:com.chookapp.org.bracketeer.preferences.HintsPrefPage.java

License:Open Source License

/**
 * Create contents of the preference page.
 * @param parent// ww  w . j a  v  a  2s  . c o m
 */
@Override
public Control createPageContents(Composite parent) {
    Composite container = new Composite(parent, SWT.NULL);
    container.setLayout(new GridLayout(1, false));

    TabFolder tabFolder = new TabFolder(container, SWT.NONE);
    tabFolder.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));

    IConfigurationElement[] config = Platform.getExtensionRegistry()
            .getConfigurationElementsFor(ProcessorsRegistry.PROC_FACTORY_ID);

    if (config.length == 0) {
        Text txtNoBracketeerEditor = new Text(container, SWT.BORDER | SWT.READ_ONLY | SWT.WRAP | SWT.MULTI);
        txtNoBracketeerEditor.setText(Messages.MainPrefPage_txtNoBracketeerEditor_text);

        return container;
    }

    // If we want to re-enable design mode, we should comment out this "for", and comment in this stub
    //        IConfigurationElement element = null; // stub
    for (IConfigurationElement element : config) {
        String pluginName = element.getAttribute("name"); //$NON-NLS-1$
        TabInfo tabInfo = new TabInfo();
        _tabInfos.add(tabInfo);
        tabInfo._name = pluginName;
        tabInfo._dynamicFe = new ArrayList<FEInfo>();
        String basePref = PreferencesConstants.Hints.preferencePath(pluginName,
                PreferencesConstants.Hints.DEFAULT_TYPE);

        TabItem tbtmNewItem = new TabItem(tabFolder, SWT.NONE);
        tbtmNewItem.setText(pluginName);

        Composite composite = new Composite(tabFolder, SWT.NONE);
        tbtmNewItem.setControl(composite);
        composite.setLayout(new GridLayout(1, false));

        IConfigurationElement[] hints = element.getChildren("Hint"); //$NON-NLS-1$
        if (hints.length == 0) {
            Label lable = new Label(composite, NONE);
            lable.setText(Messages.HintsPrefPage_NotSupported);

            tabInfo._hintsList = null;
            // If we want to re-enable design mode, we should comment out this line
            continue;
        }

        Composite composite_2 = new Composite(composite, SWT.NONE);
        addField(new BooleanFieldEditor(
                PreferencesConstants.preferencePath(pluginName)
                        + PreferencesConstants.Hints.Globals.SHOW_IN_EDITOR,
                Messages.HintsPrefPage_DisplayHintsInEditor, BooleanFieldEditor.DEFAULT, composite_2));

        Composite composite_3 = new Composite(composite, SWT.NONE);
        BooleanFieldEditor bfe = new BooleanFieldEditor(
                PreferencesConstants.preferencePath(pluginName) + PreferencesConstants.Hints.Hover.ENABLE,
                Messages.HintsPrefPage_HintOnHover, BooleanFieldEditor.DEFAULT, composite_3);
        addField(bfe);
        tabInfo._hoverEn = bfe;

        Composite composite_24 = new Composite(composite, SWT.NONE);
        GridLayout gl_composite_24 = new GridLayout(1, false);
        gl_composite_24.verticalSpacing = 0;
        gl_composite_24.marginHeight = 0;
        gl_composite_24.marginLeft = 10;
        composite_24.setLayout(gl_composite_24);

        Composite composite_23 = new Composite(composite_24, SWT.NONE);

        SpinnerFieldEditor spinner = new SpinnerFieldEditor(
                PreferencesConstants.preferencePath(pluginName) + PreferencesConstants.Hints.Hover.MAX_LEN,
                Messages.HintsPrefPage_OverrideMaxLength, composite_23);
        spinner.setLabelText(Messages.HintsPrefPage_HintHoverMaxLen);
        addField(spinner);
        tabInfo._hoverMaxLen = composite_23;

        Group grpHintsConfiguration = new Group(composite, SWT.NONE);
        grpHintsConfiguration.setText(Messages.HintsPrefPage_grpHintsConfiguration_text);
        grpHintsConfiguration.setLayout(new GridLayout(1, false));

        //            Composite composite_3 = new Composite(composite, SWT.NONE);
        //            addField(new BooleanFieldEditor(PreferencesConstants.Hints.Globals.SHOW_ON_HOVER,
        //                                            "Display tooltip on hover", BooleanFieldEditor.DEFAULT, composite_3));

        Composite composite_1 = new Composite(grpHintsConfiguration, SWT.NONE);
        composite_1.setLayout(new GridLayout(2, false));

        Composite composite_4 = new Composite(composite_1, SWT.NONE);
        composite_4.setLayoutData(new GridData(SWT.LEFT, SWT.FILL, false, false, 1, 1));
        composite_4.setBounds(0, 0, 64, 64);
        composite_4.setLayout(new GridLayout(1, false));

        List list = new List(composite_4, SWT.BORDER);
        GridData gd_list = new GridData(SWT.LEFT, SWT.FILL, false, true, 1, 1);
        gd_list.widthHint = 148;
        list.setLayoutData(gd_list);
        tabInfo._hintsList = list;
        list.addSelectionListener(new SelectionAdapter() {
            @Override
            public void widgetSelected(SelectionEvent e) {
                updateHintFieldEditors();
            }
        });
        list.add(Messages.HintsPrefPage_DefaultEntry);

        for (IConfigurationElement hint : hints) {
            String hintType = hint.getAttribute("type"); //$NON-NLS-1$
            list.add(hintType);
        }
        list.setSelection(0);

        Composite composite_5 = new Composite(composite_1, SWT.NONE);
        composite_5.setLayout(new GridLayout(1, false));
        composite_5.setLayoutData(new GridData(SWT.LEFT, SWT.FILL, true, false, 1, 1));
        composite_5.setBounds(0, 0, 64, 64);

        Group grpWhenToShow = new Group(composite_5, SWT.NONE);
        grpWhenToShow.setText(Messages.HintsPrefPage_WhenToShow);
        grpWhenToShow.setLayout(new GridLayout(1, false));

        Composite composite_6 = new Composite(grpWhenToShow, SWT.NONE);
        bfe = new BooleanFieldEditor(basePref + PreferencesConstants.Hints.WhenToShow.USE_DEFAULT,
                Messages.HintsPrefPage_UseDef, BooleanFieldEditor.DEFAULT, composite_6);
        addField(bfe);
        addDynamicFE(tabInfo, bfe, PreferencesConstants.Hints.WhenToShow.USE_DEFAULT);
        tabInfo._whenToShowUseDef = bfe;
        tabInfo._whenToShowUseDefParent = composite_6;

        Composite composite_15 = new Composite(grpWhenToShow, SWT.NONE);
        GridLayout gl_composite_15 = new GridLayout(1, false);
        gl_composite_15.marginLeft = 10;
        composite_15.setLayout(gl_composite_15);

        Composite composite_7 = new Composite(composite_15, SWT.NONE);
        bfe = new BooleanFieldEditor(basePref + PreferencesConstants.Hints.WhenToShow.SHOW_IN_EDITOR,
                Messages.HintsPrefPage_DisplayHintsInEditor, BooleanFieldEditor.DEFAULT, composite_7);
        addField(bfe);
        addDynamicFE(tabInfo, bfe, PreferencesConstants.Hints.WhenToShow.SHOW_IN_EDITOR);
        tabInfo._showInEditor = bfe;
        tabInfo._showInEditorParent = composite_7;

        Composite composite_14 = new Composite(composite_15, SWT.NONE);
        spinner = new SpinnerFieldEditor(basePref + PreferencesConstants.Hints.WhenToShow.MIN_LINES_DISTANCE,
                Messages.HintsPrefPage_MinLines, composite_14);
        addField(spinner);
        addDynamicFE(tabInfo, spinner, PreferencesConstants.Hints.WhenToShow.MIN_LINES_DISTANCE);
        tabInfo._whenToShowMinLines = composite_14;

        Composite composite_20 = new Composite(composite_5, SWT.NONE);
        composite_20.setLayout(new GridLayout(2, false));

        Group grpFont = new Group(composite_20, SWT.NONE);
        grpFont.setLayoutData(new GridData(SWT.LEFT, SWT.FILL, false, false, 1, 1));
        grpFont.setText(Messages.HintsPrefPage_Font);
        grpFont.setBounds(0, 0, 209, 147);
        grpFont.setLayout(new GridLayout(1, false));

        Composite composite_8 = new Composite(grpFont, SWT.NONE);
        bfe = new BooleanFieldEditor(basePref + PreferencesConstants.Hints.Font.USE_DEFAULT,
                Messages.HintsPrefPage_UseDef, BooleanFieldEditor.DEFAULT, composite_8);
        addField(bfe);
        addDynamicFE(tabInfo, bfe, PreferencesConstants.Hints.Font.USE_DEFAULT);
        tabInfo._fontUseDef = bfe;
        tabInfo._fontUseDefParent = composite_8;

        Composite composite_9 = new Composite(grpFont, SWT.NONE);
        composite_9.setBounds(0, 0, 64, 64);
        GridLayout gl_composite_9 = new GridLayout(1, false);
        gl_composite_9.marginLeft = 10;
        composite_9.setLayout(gl_composite_9);
        tabInfo._fontGrp = composite_9;

        Group grpForegroundColor = new Group(composite_9, SWT.NONE);
        grpForegroundColor.setText(Messages.HintsPrefPage_FgColor);
        grpForegroundColor.setLayout(new GridLayout(1, false));

        Composite composite_21 = new Composite(grpForegroundColor, SWT.NONE);
        bfe = new BooleanFieldEditor(basePref + PreferencesConstants.Hints.Font.FG_DEFAULT,
                Messages.HintsPrefPage_UseSysDef, BooleanFieldEditor.DEFAULT, composite_21);
        addField(bfe);
        addDynamicFE(tabInfo, bfe, PreferencesConstants.Hints.Font.FG_DEFAULT);
        tabInfo._fontFgDef = bfe;

        Composite composite_10 = new Composite(grpForegroundColor, SWT.NONE);
        ColorFieldEditor cfe = new ColorFieldEditor(basePref + PreferencesConstants.Hints.Font.FG_COLOR,
                Messages.HintsPrefPage_Color, composite_10);
        addField(cfe);
        addDynamicFE(tabInfo, cfe, PreferencesConstants.Hints.Font.FG_COLOR);
        tabInfo._fontFgColor = composite_10;

        Group grpBackgroundColor = new Group(composite_9, SWT.NONE);
        grpBackgroundColor.setText(Messages.HintsPrefPage_BgColor);
        grpBackgroundColor.setLayout(new GridLayout(1, false));

        Composite composite_22 = new Composite(grpBackgroundColor, SWT.NONE);
        bfe = new BooleanFieldEditor(basePref + PreferencesConstants.Hints.Font.BG_DEFAULT,
                Messages.HintsPrefPage_UseSysDef, BooleanFieldEditor.DEFAULT, composite_22);
        addField(bfe);
        addDynamicFE(tabInfo, bfe, PreferencesConstants.Hints.Font.BG_DEFAULT);
        tabInfo._fontBgDef = bfe;

        Composite composite_11 = new Composite(grpBackgroundColor, SWT.NONE);
        cfe = new ColorFieldEditor(basePref + PreferencesConstants.Hints.Font.BG_COLOR,
                Messages.HintsPrefPage_Color, composite_11);
        addField(cfe);
        addDynamicFE(tabInfo, cfe, PreferencesConstants.Hints.Font.BG_COLOR);
        tabInfo._fontBgColor = composite_11;

        Composite composite_12 = new Composite(composite_9, SWT.NONE);
        bfe = new BooleanFieldEditor(basePref + PreferencesConstants.Hints.Font.ITALIC,
                Messages.HintsPrefPage_Italic, BooleanFieldEditor.DEFAULT, composite_12);
        addField(bfe);
        addDynamicFE(tabInfo, bfe, PreferencesConstants.Hints.Font.ITALIC);

        Group grpShow = new Group(composite_20, SWT.NONE);
        grpShow.setLayoutData(new GridData(SWT.LEFT, SWT.TOP, false, false, 1, 1));
        grpShow.setSize(160, 183);
        grpShow.setText(Messages.HintsPrefPage_Display);
        grpShow.setLayout(new GridLayout(1, false));

        Composite composite_13 = new Composite(grpShow, SWT.NONE);
        bfe = new BooleanFieldEditor(basePref + PreferencesConstants.Hints.Display.USE_DEFAULT,
                Messages.HintsPrefPage_UseDef, BooleanFieldEditor.DEFAULT, composite_13);
        addField(bfe);
        addDynamicFE(tabInfo, bfe, PreferencesConstants.Hints.Display.USE_DEFAULT);
        tabInfo._displayUseDef = bfe;
        tabInfo._displayUseDefParnet = composite_13;

        Composite composite_18 = new Composite(grpShow, SWT.NONE);
        GridLayout gl_composite_18 = new GridLayout(1, false);
        gl_composite_18.marginLeft = 10;
        composite_18.setLayout(gl_composite_18);
        tabInfo._displayGrp = composite_18;

        Composite composite_19 = new Composite(composite_18, SWT.NONE);
        spinner = new SpinnerFieldEditor(basePref + PreferencesConstants.Hints.Display.MAX_LENGTH,
                Messages.HintsPrefPage_MaxLen, composite_19);
        addField(spinner);
        addDynamicFE(tabInfo, spinner, PreferencesConstants.Hints.Display.MAX_LENGTH);

        Composite composite_17 = new Composite(composite_18, SWT.NONE);
        bfe = new BooleanFieldEditor(basePref + PreferencesConstants.Hints.Display.STRIP_WHITESPACE,
                Messages.HintsPrefPage_StipWhitespace, BooleanFieldEditor.DEFAULT, composite_17);
        addField(bfe);
        addDynamicFE(tabInfo, bfe, PreferencesConstants.Hints.Display.STRIP_WHITESPACE);

        Composite composite_16 = new Composite(composite_18, SWT.NONE);
        {
            RadioGroupFieldEditor radioGroupFieldEditor = new RadioGroupFieldEditor(
                    basePref + PreferencesConstants.Hints.Display.Ellipsis.ATTR,
                    Messages.HintsPrefPage_Ellipsis, 1,
                    new String[][] {
                            { Messages.HintsPrefPage_Mid, PreferencesConstants.Hints.Display.Ellipsis.VAL_MID },
                            { Messages.HintsPrefPage_End,
                                    PreferencesConstants.Hints.Display.Ellipsis.VAL_END } },
                    composite_16, false);
            radioGroupFieldEditor.setIndent(0);
            addField(radioGroupFieldEditor);
            addDynamicFE(tabInfo, radioGroupFieldEditor, PreferencesConstants.Hints.Display.Ellipsis.ATTR);
        }
    }

    PlatformUI.getWorkbench().getHelpSystem().setHelp(getControl(), "com.choockapp.org.bracketeer.hints_pref"); //$NON-NLS-1$
    return container;
}

From source file:com.iw.plugins.spindle.preferences.SpindleTooltipPreferencePage.java

License:Mozilla Public License

/**
 * @see org.eclipse.jface.preference.FieldEditorPreferencePage#createFieldEditors()
 *//*from w  w w .j a  va  2s. c  om*/
protected void createFieldEditors() {

    BooleanFieldEditor hideNewBindingDialogTootips = new BooleanFieldEditor(
            ChooseBindingTypeDialog.DISABLE_TOOLTIPS_PREFERENCE,
            "Disable Spindle tooltips on the New Binding Dialog", BooleanFieldEditor.DEFAULT,
            getFieldEditorParent());

    addField(hideNewBindingDialogTootips);

}

From source file:com.iw.plugins.spindle.ui.preferences.SpecFoldingPreferencePage.java

License:Mozilla Public License

protected Control createContents(Composite parent) {
    initializeDialogUnits(parent);// w  w  w.j  a  va  2 s .c  om
    Font font = parent.getFont();
    GridData gd;

    Composite top = new Composite(parent, SWT.LEFT);
    top.setFont(font);
    int numColumns = 1;
    GridLayout layout = new GridLayout();
    layout.marginHeight = 0;
    layout.marginWidth = 0;
    top.setLayout(layout);

    // Sets the layout data for the top composite's
    // place in its parent's layout.
    top.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));

    fFoldOnEditorOpen = new BooleanFieldEditor(FOLDING_ENABLED,
            UIPlugin.getString("preference-editor-folding-enabled"), BooleanFieldEditor.DEFAULT, top);

    fFoldOnEditorOpen.setPreferencePage(this);
    fFoldOnEditorOpen.setPreferenceStore(UIPlugin.getDefault().getPreferenceStore());
    fFoldOnEditorOpen.load();
    fFoldOnEditorOpen.setPropertyChangeListener(this);

    return top;
}

From source file:com.iw.plugins.spindle.ui.preferences.SpindleEditorPreferencePage.java

License:Mozilla Public License

protected Control createContents(Composite parent) {
    initializeDialogUnits(parent);//from ww  w.  java  2s  .c om
    Font font = parent.getFont();
    GridData gd;

    Composite top = new Composite(parent, SWT.LEFT);
    top.setFont(font);
    int numColumns = 2;
    Composite result = new Composite(parent, SWT.NONE);
    GridLayout layout = new GridLayout();
    layout.marginHeight = 0;
    layout.marginWidth = 0;
    top.setLayout(layout);

    // Sets the layout data for the top composite's
    // place in its parent's layout.
    top.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));

    Group group = createGroup(2, top, "Content Assist");
    Label spacer = new Label(group, SWT.NULL);
    spacer.setText(" ");
    GridData data = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
    data.horizontalSpan = 2;
    data.heightHint = 5;
    spacer.setLayoutData(data);
    fAutoActivateContentAssist = new BooleanFieldEditor(AUTO_ACTIVATE_CONTENT_ASSIST,
            UIPlugin.getString("preference-editor-auto-insert-assist"), BooleanFieldEditor.DEFAULT, group);

    fAutoActivateContentAssist.setPreferencePage(this);
    fAutoActivateContentAssist.setPreferenceStore(UIPlugin.getDefault().getPreferenceStore());
    fAutoActivateContentAssist.load();
    fAutoActivateContentAssist.setPropertyChangeListener(this);

    fOfferXHTML = new RadioGroupFieldEditor(OFFER_XHTML, UIPlugin.getString("preference-offer-xhtml-proposals"),
            4, OFFER_XHTML_OPTIONS, group);

    fOfferXHTML.setPreferencePage(this);
    fOfferXHTML.setPreferenceStore(UIPlugin.getDefault().getPreferenceStore());
    fOfferXHTML.load();
    fOfferXHTML.setPropertyChangeListener(this);

    int heightHint = convertVerticalDLUsToPixels(IDialogConstants.BUTTON_HEIGHT);

    spacer = new Label(top, SWT.NULL);
    spacer.setText(" ");
    data = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
    data.horizontalSpan = 2;
    data.heightHint = heightHint;
    spacer.setLayoutData(data);

    Group revalidationGroup = createGroup(2, top, "Enable 'As-You-Type' Validation (requires editor restart)");

    // Label restart = new Label(revalidationGroup, SWT.NULL);
    // restart.setText(UIPlugin.getString("preference-editor-as-you-type-requires-restart"));
    // data = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
    // data.horizontalSpan = 2;
    // restart.setLayoutData(data);

    spacer = new Label(revalidationGroup, SWT.NULL);
    spacer.setText(" ");
    data = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
    data.horizontalSpan = 2;
    data.heightHint = 5;
    spacer.setLayoutData(data);

    fAsYouTypeSpec = new BooleanFieldEditor(AS_YOU_TYPE_SPEC,
            UIPlugin.getString("preference-editor-as-you-type-spec"), BooleanFieldEditor.DEFAULT,
            revalidationGroup);

    fAsYouTypeSpec.setPreferencePage(this);
    fAsYouTypeSpec.setPreferenceStore(UIPlugin.getDefault().getPreferenceStore());
    fAsYouTypeSpec.load();
    fAsYouTypeSpec.setPropertyChangeListener(this);

    fAsYouTypeTemplate = new BooleanFieldEditor(AS_YOU_TYPE_TEMPLATE,
            UIPlugin.getString("preference-editor-as-you-type-template"), BooleanFieldEditor.DEFAULT,
            revalidationGroup);

    fAsYouTypeTemplate.setPreferencePage(this);
    fAsYouTypeTemplate.setPreferenceStore(UIPlugin.getDefault().getPreferenceStore());
    fAsYouTypeTemplate.load();
    fAsYouTypeTemplate.setPropertyChangeListener(this);

    spacer = new Label(revalidationGroup, SWT.NULL);
    spacer.setText(" ");
    data = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
    data.horizontalSpan = 2;
    data.heightHint = 5;
    spacer.setLayoutData(data);

    Label warning = new Label(revalidationGroup, SWT.WRAP);
    warning.setText(
            "WARNING: If 'As-You-Type' is disabled, things like syntax completion may stop or give wrong results until you save the file.");
    data = new GridData(SWT.FILL, SWT.TOP, true, false, 2, 1);
    data.widthHint = convertWidthInCharsToPixels(30);
    warning.setLayoutData(data);

    Label warning2 = new Label(revalidationGroup, SWT.NULL);
    warning2.setText("");
    data = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
    data.horizontalSpan = 2;
    warning2.setLayoutData(data);

    spacer = new Label(top, SWT.NULL);
    spacer.setText(" ");
    data = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
    data.horizontalSpan = 2;
    data.heightHint = heightHint;
    spacer.setLayoutData(data);

    Label message = new Label(top, SWT.NULL);
    message.setText("Spindle Editors respond to changes on page: ");
    data = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
    data.horizontalSpan = 2;
    message.setLayoutData(data);

    Label message2 = new Label(top, SWT.NULL);
    message2.setText("  Workbench -> Editors -> Text Editor ");
    data = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
    data.horizontalSpan = 2;
    message2.setLayoutData(data);

    return top;
}

From source file:com.python.pydev.analysis.ui.AnalysisPreferencesPage.java

License:Open Source License

@Override
public void createFieldEditors() {
    final Composite initialParent = getFieldEditorParent();
    Composite p = initialParent;//w  ww  .  ja  va2s. c  o m

    addField(new LabelFieldEditor("Analysis_pref_note",
            "NOTE: Any file with the comment below will not be analyzed.\n\n#@PydevCodeAnalysisIgnore\n\nOptions:\n\n",
            p));

    TabFolder tabFolder = new TabFolder(p, SWT.NONE);
    tabFolder.setLayoutData(new GridData(GridData.FILL_BOTH));

    p = createTab(tabFolder, "Options");
    String[][] whenAnalyze = new String[][] {
            { "Only on save", String.valueOf(IAnalysisPreferences.ANALYZE_ON_SAVE) },
            { "On any successful parse", String.valueOf(IAnalysisPreferences.ANALYZE_ON_SUCCESFUL_PARSE) } };
    addField(new BooleanFieldEditor(AnalysisPreferenceInitializer.DO_CODE_ANALYSIS, "Do code analysis?",
            BooleanFieldEditor.DEFAULT, p));
    addField(new RadioGroupFieldEditor(AnalysisPreferenceInitializer.WHEN_ANALYZE, "When do we analyze?", 2,
            whenAnalyze, p, true));

    String[][] values = new String[][] { { "Error", String.valueOf(IMarker.SEVERITY_ERROR) },
            { "Warning", String.valueOf(IMarker.SEVERITY_WARNING) },
            { "Ignore", String.valueOf(IMarker.SEVERITY_INFO) } };

    p = createTab(tabFolder, "Unused");
    addField(new RadioGroupFieldEditor(AnalysisPreferenceInitializer.SEVERITY_UNUSED_IMPORT, "Unused import", 3,
            values, p, true));
    addField(new RadioGroupFieldEditor(AnalysisPreferenceInitializer.SEVERITY_UNUSED_WILD_IMPORT,
            "Unused wild import", 3, values, p, true));
    addField(new StringFieldEditor(AnalysisPreferenceInitializer.NAMES_TO_IGNORE_UNUSED_IMPORT,
            "Don't report unused imports in modules named: (comma separated)", p));
    addField(new RadioGroupFieldEditor(AnalysisPreferenceInitializer.SEVERITY_UNUSED_PARAMETER,
            "Unused parameter", 3, values, p, true));
    addField(new RadioGroupFieldEditor(AnalysisPreferenceInitializer.SEVERITY_UNUSED_VARIABLE,
            "Unused variable", 3, values, p, true));
    addField(new StringFieldEditor(AnalysisPreferenceInitializer.NAMES_TO_IGNORE_UNUSED_VARIABLE,
            "Don't report unused variable if name starts with: (comma separated)", p) {
        @Override
        public int getNumberOfControls() {
            return 1;
        }
    });

    p = createTab(tabFolder, "Undefined");
    addField(new StringFieldEditor(AnalysisPreferenceInitializer.NAMES_TO_CONSIDER_GLOBALS,
            "Consider the following names as globals: (comma separated)", p));
    addField(new RadioGroupFieldEditor(AnalysisPreferenceInitializer.SEVERITY_UNDEFINED_VARIABLE,
            "Undefined variable", 3, values, p, true));
    addField(new RadioGroupFieldEditor(AnalysisPreferenceInitializer.SEVERITY_UNDEFINED_IMPORT_VARIABLE,
            "Undefined variable from import", 3, values, p, true));

    p = createTab(tabFolder, "Imports");
    addField(new RadioGroupFieldEditor(AnalysisPreferenceInitializer.SEVERITY_REIMPORT, "Import redefinition",
            3, values, p, true));
    addField(new RadioGroupFieldEditor(AnalysisPreferenceInitializer.SEVERITY_UNRESOLVED_IMPORT,
            "Import not found", 3, values, p, true));

    p = createTab(tabFolder, "Others");
    addField(new RadioGroupFieldEditor(AnalysisPreferenceInitializer.SEVERITY_DUPLICATED_SIGNATURE,
            "Duplicated signature", 3, values, p, true));
    addField(new RadioGroupFieldEditor(AnalysisPreferenceInitializer.SEVERITY_NO_SELF,
            "'self' not specified in class method", 3, values, p, true));
    addField(new RadioGroupFieldEditor(AnalysisPreferenceInitializer.SEVERITY_NO_EFFECT_STMT,
            "Statement has no effect", 3, values, p, true));
    addField(new RadioGroupFieldEditor(AnalysisPreferenceInitializer.SEVERITY_INDENTATION_PROBLEM,
            "Indentation problems and mixing of tabs/spaces", 3, values, p, true));
    addField(new RadioGroupFieldEditor(AnalysisPreferenceInitializer.SEVERITY_ASSIGNMENT_TO_BUILT_IN_SYMBOL,
            "Redefinition of builtin symbols", 3, values, p, true));
    //TODO: Add ARGUMENTS_MISMATCH again later on
    //addField(new RadioGroupFieldEditor(AnalysisPreferenceInitializer.SEVERITY_ARGUMENTS_MISMATCH, "Arguments mismatch", 3,values,p, true));

    p = createTab(tabFolder, "pep8.py");

    String[][] pep8values = new String[][] { { "Error", String.valueOf(IMarker.SEVERITY_ERROR) },
            { "Warning", String.valueOf(IMarker.SEVERITY_WARNING) },
            { "Don't run", String.valueOf(IMarker.SEVERITY_INFO) } };

    addField(new RadioGroupFieldEditor(AnalysisPreferenceInitializer.SEVERITY_PEP8, "Pep8", 3, pep8values, p,
            true) {
        @Override
        protected void doFillIntoGrid(Composite parent, int numColumns) {
            super.doFillIntoGrid(parent, 3);
            adjustForNumColumns(3);
        }
    });
    if (SHOW_IN_PEP8_FEATURE_ENABLED) {
        addField(new BooleanFieldEditor(USE_PEP8_CONSOLE, "Redirect pep8 output to console?", p) {
            @Override
            protected void doFillIntoGrid(Composite parent, int numColumns) {
                super.doFillIntoGrid(parent, 3);
                adjustForNumColumns(3);
            }
        });
    }
    addField(new BooleanFieldEditor(PEP8_USE_SYSTEM, "Use system interpreter", p) {
        @Override
        protected void doFillIntoGrid(Composite parent, int numColumns) {
            super.doFillIntoGrid(parent, 3);
            adjustForNumColumns(3);
        }
    });

    addField(new LinkFieldEditor(PEP8_COMMAND_LINE,
            "Additional command line arguments (i.e.: --ignore=E5,W391). See <a>pep8 docs</a> for details.", p,
            new SelectionListener() {

                public void widgetSelected(SelectionEvent e) {
                    Program.launch("http://pypi.python.org/pypi/pep8");
                }

                public void widgetDefaultSelected(SelectionEvent e) {
                }
            }) {

        @Override
        protected void doFillIntoGrid(Composite parent, int numColumns) {
            numColumns = 3;
            Link linkControl = getLinkControl(parent);
            Object layoutData = linkControl.getLayoutData();
            if (layoutData == null) {
                layoutData = new GridData();
                linkControl.setLayoutData(layoutData);
            }
            ((GridData) layoutData).horizontalSpan = numColumns;
            adjustForNumColumns(3);
        }
    });

    addField(new StringFieldEditor(PEP8_COMMAND_LINE, "Arguments: ", p) {
        @Override
        protected void doFillIntoGrid(Composite parent, int numColumns) {
            super.doFillIntoGrid(parent, 3);
            adjustForNumColumns(3);
        }
    });

    addField(new ScopedPreferencesFieldEditor(initialParent, PyAnalysisScopedPreferences.ANALYSIS_SCOPE, this));
}

From source file:com.python.pydev.analysis.ui.AutoImportsPreferencesPage.java

License:Open Source License

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

    addField(new BooleanFieldEditor(AnalysisPreferenceInitializer.DO_AUTO_IMPORT, "Do auto import?",
            BooleanFieldEditor.DEFAULT, p));

    addField(new BooleanFieldEditor(AnalysisPreferenceInitializer.DO_IGNORE_IMPORTS_STARTING_WITH_UNDER,
            "Ignore last modules starting with '_' when doing auto-import/quick fix?",
            BooleanFieldEditor.DEFAULT, p));

    addField(new BooleanFieldEditor(AnalysisPreferenceInitializer.DO_AUTO_IMPORT_ON_ORGANIZE_IMPORTS,
            "Do auto import on organize imports (Ctrl+Shift+O)?", BooleanFieldEditor.DEFAULT, p));
}

From source file:com.telink.tc32eclipse.ui.preferences.PathsPreferencePage.java

License:Open Source License

@Override
public void createFieldEditors() {

    // This page has two fields:
    // The first one to inhibit the startup search for changed system paths
    // The second to edit all paths.

    Composite parent = getFieldEditorParent();

    Label filler = new Label(parent, SWT.NONE);
    filler.setLayoutData(new GridData(SWT.FILL, SWT.NONE, true, false, 2, 1));

    // Startup search inhibit

    BooleanFieldEditor autoScanBoolean = new BooleanFieldEditor(TC32PathsPreferences.KEY_NOSTARTUPSCAN,
            "Disable search for system paths at startup", BooleanFieldEditor.DEFAULT, parent);
    addField(autoScanBoolean);//  ww w.  ja v  a  2s  .  c  om

    Composite note = createNoteComposite(JFaceResources.getDialogFont(), parent, "Note:",
            "If disabled, a manual rescan may be required when a new tc32-elf-tcctoolchain has been installed.\n");
    note.setLayoutData(new GridData(SWT.FILL, SWT.NONE, true, false, 2, 1));

    filler = new Label(parent, SWT.NONE);
    filler.setLayoutData(new GridData(SWT.FILL, SWT.NONE, true, false, 2, 1));

    // Path editor field control.

    TC32PathsFieldEditor pathEditor = new TC32PathsFieldEditor(parent);
    addField(pathEditor);

}

From source file:de.innot.avreclipse.ui.preferences.PathsPreferencePage.java

License:Open Source License

@Override
public void createFieldEditors() {

    // This page has two fields:
    // The first one to inhibit the startup search for changed system paths
    // The second to edit all paths.

    Composite parent = getFieldEditorParent();

    Label filler = new Label(parent, SWT.NONE);
    filler.setLayoutData(new GridData(SWT.FILL, SWT.NONE, true, false, 2, 1));

    // Startup search inhibit

    BooleanFieldEditor autoScanBoolean = new BooleanFieldEditor(AVRPathsPreferences.KEY_NOSTARTUPSCAN,
            "Disable search for system paths at startup", BooleanFieldEditor.DEFAULT, parent);
    addField(autoScanBoolean);/*from ww  w . j  a  va2  s .  c  o  m*/

    Composite note = createNoteComposite(JFaceResources.getDialogFont(), parent, "Note:",
            "If disabled, a manual rescan may be required when a new avr-gcc toolchain has been installed.\n");
    note.setLayoutData(new GridData(SWT.FILL, SWT.NONE, true, false, 2, 1));

    filler = new Label(parent, SWT.NONE);
    filler.setLayoutData(new GridData(SWT.FILL, SWT.NONE, true, false, 2, 1));

    // Path editor field control.

    AVRPathsFieldEditor pathEditor = new AVRPathsFieldEditor(parent);
    addField(pathEditor);

}