Example usage for org.eclipse.jface.preference IPreferenceStore FALSE

List of usage examples for org.eclipse.jface.preference IPreferenceStore FALSE

Introduction

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

Prototype

String FALSE

To view the source code for org.eclipse.jface.preference IPreferenceStore FALSE.

Click Source Link

Document

The string representation used for false ("false").

Usage

From source file:com.agynamix.platform.frontend.preferences.ApplicationPreferenceStore.java

License:Open Source License

/**
 * Helper method: sets the value for a given name.
 * // w  w  w .  j  a v a  2 s .  com
 * @param p
 * @param name
 * @param value
 */
private void setValue(Properties p, String name, boolean value) {
    Assert.isTrue(p != null);
    p.put(name, value == true ? IPreferenceStore.TRUE : IPreferenceStore.FALSE);
}

From source file:com.aptana.internal.ui.text.spelling.SpellingConfigurationBlock.java

License:Open Source License

protected Control createContents(final Composite parent) {

    final Composite composite = new Composite(parent, SWT.NONE);
    composite.setLayout(new GridLayout());

    final List allControls = new ArrayList();
    final PixelConverter converter = new PixelConverter(parent);

    final String[] trueFalse = new String[] { IPreferenceStore.TRUE, IPreferenceStore.FALSE };

    final Group user = new Group(composite, SWT.NONE);
    user.setText(PreferencesMessages.SpellingPreferencePage_group_user);
    user.setLayout(new GridLayout());
    user.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    allControls.add(user);//from  w w w.  j  av a 2  s  .  c  o m

    String label = PreferencesMessages.SpellingPreferencePage_ignore_digits_label;
    Control slave = this.addCheckBox(user, label, PREF_SPELLING_IGNORE_DIGITS, trueFalse, 0);
    allControls.add(slave);

    label = PreferencesMessages.SpellingPreferencePage_ignore_mixed_label;
    slave = this.addCheckBox(user, label, PREF_SPELLING_IGNORE_MIXED, trueFalse, 0);
    allControls.add(slave);

    label = PreferencesMessages.SpellingPreferencePage_ignore_sentence_label;
    slave = this.addCheckBox(user, label, PREF_SPELLING_IGNORE_SENTENCE, trueFalse, 0);
    allControls.add(slave);

    label = PreferencesMessages.SpellingPreferencePage_ignore_upper_label;
    slave = this.addCheckBox(user, label, PREF_SPELLING_IGNORE_UPPER, trueFalse, 0);
    allControls.add(slave);

    label = PreferencesMessages.SpellingPreferencePage_ignore_url_label;
    slave = this.addCheckBox(user, label, PREF_SPELLING_IGNORE_URLS, trueFalse, 0);
    allControls.add(slave);

    label = PreferencesMessages.SpellingPreferencePage_ignore_non_letters_label;
    slave = this.addCheckBox(user, label, PREF_SPELLING_IGNORE_NON_LETTERS, trueFalse, 0);
    allControls.add(slave);

    label = PreferencesMessages.SpellingPreferencePage_ignore_single_letters_label;
    slave = this.addCheckBox(user, label, PREF_SPELLING_IGNORE_SINGLE_LETTERS, trueFalse, 0);
    allControls.add(slave);

    // label=
    // PreferencesMessages.SpellingPreferencePage_ignore_java_strings_label;
    // slave= addCheckBox(user, label, PREF_SPELLING_IGNORE_JAVA_STRINGS,
    // trueFalse, 0);
    // allControls.add(slave);
    //      
    // label= PreferencesMessages.
    // SpellingPreferencePage_ignore_ampersand_in_properties_label;
    // slave= addCheckBox(user, label,
    // PREF_SPELLING_IGNORE_AMPERSAND_IN_PROPERTIES, trueFalse, 0);
    // allControls.add(slave);

    final Set locales = SpellCheckEngine.getLocalesWithInstalledDictionaries();
    final boolean hasPlaformDictionaries = locales.size() > 0;

    final Group engine = new Group(composite, SWT.NONE);
    if (hasPlaformDictionaries) {
        engine.setText(PreferencesMessages.SpellingPreferencePage_group_dictionaries);
    } else {
        engine.setText(PreferencesMessages.SpellingPreferencePage_group_dictionary);
    }
    engine.setLayout(new GridLayout(4, false));
    engine.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    allControls.add(engine);

    if (hasPlaformDictionaries) {
        label = PreferencesMessages.SpellingPreferencePage_dictionary_label;
        final Combo combo = this.addComboBox(engine, label, PREF_SPELLING_LOCALE, getDictionaryCodes(locales),
                getDictionaryLabels(locales), 0);
        combo.setEnabled(locales.size() > 0);
        allControls.add(combo);
        allControls.add(this.fLabels.get(combo));

        new Label(engine, SWT.NONE); // placeholder
    }

    label = PreferencesMessages.SpellingPreferencePage_workspace_dictionary_label;
    this.fDictionaryPath = this.addTextField(engine, label, PREF_SPELLING_USER_DICTIONARY, 0, 0);
    GridData gd = (GridData) this.fDictionaryPath.getLayoutData();
    gd.grabExcessHorizontalSpace = true;
    gd.widthHint = converter.convertWidthInCharsToPixels(40);
    allControls.add(this.fDictionaryPath);
    allControls.add(this.fLabels.get(this.fDictionaryPath));

    final Composite buttons = new Composite(engine, SWT.NONE);
    buttons.setLayout(new GridLayout(2, true));
    buttons.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));

    Button button = new Button(buttons, SWT.PUSH);
    button.setText(PreferencesMessages.SpellingPreferencePage_browse_label);
    button.addSelectionListener(new SelectionAdapter() {

        public void widgetSelected(final SelectionEvent event) {
            SpellingConfigurationBlock.this.handleBrowseButtonSelected();
        }
    });
    SWTUtil.setButtonDimensionHint(button);
    button.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL));
    allControls.add(button);

    // Description for user dictionary
    new Label(engine, SWT.NONE); // filler
    final Label description = new Label(engine, SWT.NONE);
    gd = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
    gd.horizontalSpan = 3;
    description.setLayoutData(gd);
    description.setText(PreferencesMessages.SpellingPreferencePage_user_dictionary_description);
    allControls.add(description);

    this.createEncodingFieldEditor(engine, allControls);

    final Group advanced = new Group(composite, SWT.NONE);
    advanced.setText(PreferencesMessages.SpellingPreferencePage_group_advanced);
    advanced.setLayout(new GridLayout(3, false));
    advanced.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    allControls.add(advanced);

    label = PreferencesMessages.SpellingPreferencePage_problems_threshold;
    int digits = 4;
    Text text = this.addTextField(advanced, label, PREF_SPELLING_PROBLEMS_THRESHOLD, 0,
            converter.convertWidthInCharsToPixels(digits + 1));
    text.setTextLimit(digits);
    allControls.add(text);
    allControls.add(this.fLabels.get(text));

    label = PreferencesMessages.SpellingPreferencePage_proposals_threshold;
    digits = 3;
    text = this.addTextField(advanced, label, PREF_SPELLING_PROPOSAL_THRESHOLD, 0,
            converter.convertWidthInCharsToPixels(digits + 1));
    text.setTextLimit(digits);
    gd = new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING);
    allControls.add(text);
    allControls.add(this.fLabels.get(text));

    if (SUPPORT_CONTENT_ASSIST_PROPOSALS) {
        label = PreferencesMessages.SpellingPreferencePage_enable_contentassist_label;
        button = this.addCheckBox(advanced, label, PREF_SPELLING_ENABLE_CONTENTASSIST, trueFalse, 0);
        allControls.add(button);
    }

    this.fAllControls = (Control[]) allControls.toArray(new Control[allControls.size()]);

    // PlatformUI.getWorkbench().getHelpSystem().setHelp(composite,
    // IJavaHelpContextIds.SPELLING_CONFIGURATION_BLOCK);
    return composite;
}

From source file:com.google.dart.tools.deploy.ApplicationWorkbenchAdvisor.java

License:Open Source License

private void checkForWorkbenchStateReset(IWorkbenchConfigurer workbenchConfigurer) {
    //this particular reset is necessitated by a move of plugin control contributions
    final String NEEDS_RESET = "needsReset"; //$NON-NLS-1$

    if (!Activator.getDefault().getPreferenceStore().contains(NEEDS_RESET)) {
        Activator.getDefault().getPreferenceStore().putValue(NEEDS_RESET, IPreferenceStore.FALSE);

        //set to false to ensure old state does not get re-loaded; this will be reset to true in 
        //ApplicationWorkbenchWindowAdvisor.preWindowOpen()
        workbenchConfigurer.setSaveAndRestore(false);
    }// w w  w.j  a v  a 2s  .c om
}

From source file:com.safi.workshop.sqlexplorer.sqleditor.AbstractSQLScanner.java

License:Open Source License

private void adaptToStyleChange(Token token, PropertyChangeEvent event) {
    boolean bold = false;
    Object value = event.getNewValue();
    if (value instanceof Boolean)
        bold = ((Boolean) value).booleanValue();
    else if (value instanceof String) {
        String s = (String) value;
        if (IPreferenceStore.TRUE.equals(s))
            bold = true;/* www  . j  a va  2s  .  c  om*/
        else if (IPreferenceStore.FALSE.equals(s))
            bold = false;
    }

    Object data = token.getData();
    if (data instanceof TextAttribute) {
        TextAttribute oldAttr = (TextAttribute) data;
        boolean isBold = (oldAttr.getStyle() == SWT.BOLD);
        if (isBold != bold)
            token.setData(new TextAttribute(oldAttr.getForeground(), oldAttr.getBackground(),
                    bold ? SWT.BOLD : SWT.NORMAL));
    }
}

From source file:descent.internal.ui.preferences.NewJavaProjectPreferencePage.java

License:Open Source License

protected Control createContents(Composite parent) {
    initializeDialogUnits(parent);/*  w w w .j av  a 2  s .  com*/

    Composite result = new Composite(parent, SWT.NONE);
    GridLayout layout = new GridLayout();
    layout.marginHeight = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN);
    layout.marginWidth = 0;
    layout.verticalSpacing = convertVerticalDLUsToPixels(10);
    layout.horizontalSpacing = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING);
    layout.numColumns = 2;
    result.setLayout(layout);

    GridData gd = new GridData(GridData.FILL_HORIZONTAL);
    gd.horizontalSpan = 2;

    Group sourceFolderGroup = new Group(result, SWT.NONE);
    layout = new GridLayout();
    layout.numColumns = 2;
    sourceFolderGroup.setLayout(layout);
    sourceFolderGroup.setLayoutData(gd);
    sourceFolderGroup.setText(PreferencesMessages.NewJavaProjectPreferencePage_sourcefolder_label);

    int indent = 0;

    fProjectAsSourceFolder = addRadioButton(sourceFolderGroup,
            PreferencesMessages.NewJavaProjectPreferencePage_sourcefolder_project, SRCBIN_FOLDERS_IN_NEWPROJ,
            IPreferenceStore.FALSE, indent);
    fProjectAsSourceFolder.addSelectionListener(fSelectionListener);

    fFoldersAsSourceFolder = addRadioButton(sourceFolderGroup,
            PreferencesMessages.NewJavaProjectPreferencePage_sourcefolder_folder, SRCBIN_FOLDERS_IN_NEWPROJ,
            IPreferenceStore.TRUE, indent);
    fFoldersAsSourceFolder.addSelectionListener(fSelectionListener);

    indent = convertWidthInCharsToPixels(4);

    fSrcFolderNameLabel = new Label(sourceFolderGroup, SWT.NONE);
    fSrcFolderNameLabel.setText(PreferencesMessages.NewJavaProjectPreferencePage_folders_src);
    fSrcFolderNameText = addTextControl(sourceFolderGroup, fSrcFolderNameLabel, SRCBIN_SRCNAME, indent);
    fSrcFolderNameText.addModifyListener(fModifyListener);

    fBinFolderNameLabel = new Label(sourceFolderGroup, SWT.NONE);
    fBinFolderNameLabel.setText(PreferencesMessages.NewJavaProjectPreferencePage_folders_bin);
    fBinFolderNameText = addTextControl(sourceFolderGroup, fBinFolderNameLabel, SRCBIN_BINNAME, indent);
    fBinFolderNameText.addModifyListener(fModifyListener);

    String[] jreNames = getJRENames();
    if (jreNames.length > 0) {
        Label jreSelectionLabel = new Label(result, SWT.NONE);
        jreSelectionLabel.setText(PreferencesMessages.NewJavaProjectPreferencePage_jrelibrary_label);
        jreSelectionLabel.setLayoutData(new GridData());

        int index = getPreferenceStore().getInt(CLASSPATH_JRELIBRARY_INDEX);
        fJRECombo = new Combo(result, SWT.READ_ONLY);
        fJRECombo.setItems(jreNames);
        fJRECombo.select(index);
        fJRECombo.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL));
    }

    validateFolders();

    Dialog.applyDialogFont(result);
    return result;
}

From source file:eclipse.spellchecker.preferences.SpellingConfigurationBlock.java

License:Open Source License

@Override
protected Control createContents(final Composite parent) {

    Composite composite = new Composite(parent, SWT.NONE);
    composite.setLayout(new GridLayout());

    List<Control> allControls = new ArrayList<Control>();
    final PixelConverter converter = new PixelConverter(parent);

    final String[] trueFalse = new String[] { IPreferenceStore.TRUE, IPreferenceStore.FALSE };

    Group user = new Group(composite, SWT.NONE);
    user.setText(PreferencesMessages.SpellingPreferencePage_group_user);
    user.setLayout(new GridLayout());
    user.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    allControls.add(user);// w  ww.j  a  v  a  2 s  .  c o m

    String label = PreferencesMessages.SpellingPreferencePage_ignore_digits_label;
    Control slave = addCheckBox(user, label, PREF_SPELLING_IGNORE_DIGITS, trueFalse, 0);
    allControls.add(slave);

    label = PreferencesMessages.SpellingPreferencePage_ignore_mixed_label;
    slave = addCheckBox(user, label, PREF_SPELLING_IGNORE_MIXED, trueFalse, 0);
    allControls.add(slave);

    label = PreferencesMessages.SpellingPreferencePage_ignore_sentence_label;
    slave = addCheckBox(user, label, PREF_SPELLING_IGNORE_SENTENCE, trueFalse, 0);
    allControls.add(slave);

    label = PreferencesMessages.SpellingPreferencePage_ignore_upper_label;
    slave = addCheckBox(user, label, PREF_SPELLING_IGNORE_UPPER, trueFalse, 0);
    allControls.add(slave);

    label = PreferencesMessages.SpellingPreferencePage_ignore_url_label;
    slave = addCheckBox(user, label, PREF_SPELLING_IGNORE_URLS, trueFalse, 0);
    allControls.add(slave);

    label = PreferencesMessages.SpellingPreferencePage_ignore_non_letters_label;
    slave = addCheckBox(user, label, PREF_SPELLING_IGNORE_NON_LETTERS, trueFalse, 0);
    allControls.add(slave);

    label = PreferencesMessages.SpellingPreferencePage_ignore_single_letters_label;
    slave = addCheckBox(user, label, PREF_SPELLING_IGNORE_SINGLE_LETTERS, trueFalse, 0);
    allControls.add(slave);

    label = PreferencesMessages.SpellingPreferencePage_ignore_java_strings_label;
    slave = addCheckBox(user, label, PREF_SPELLING_IGNORE_JAVA_STRINGS, trueFalse, 0);
    allControls.add(slave);

    label = PreferencesMessages.SpellingPreferencePage_ignore_ampersand_in_properties_label;
    slave = addCheckBox(user, label, PREF_SPELLING_IGNORE_AMPERSAND_IN_PROPERTIES, trueFalse, 0);
    allControls.add(slave);

    final Set<Locale> locales = SpellCheckEngine.getLocalesWithInstalledDictionaries();
    boolean hasPlaformDictionaries = locales.size() > 0;

    final Group engine = new Group(composite, SWT.NONE);
    if (hasPlaformDictionaries)
        engine.setText(PreferencesMessages.SpellingPreferencePage_group_dictionaries);
    else
        engine.setText(PreferencesMessages.SpellingPreferencePage_group_dictionary);
    engine.setLayout(new GridLayout(4, false));
    engine.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    allControls.add(engine);

    if (hasPlaformDictionaries) {
        label = PreferencesMessages.SpellingPreferencePage_dictionary_label;
        Combo combo = addComboBox(engine, label, PREF_SPELLING_LOCALE, getDictionaryCodes(locales),
                getDictionaryLabels(locales), 0);
        combo.setEnabled(locales.size() > 0);
        allControls.add(combo);
        allControls.add(fLabels.get(combo));

        new Label(engine, SWT.NONE); // placeholder
    }

    label = PreferencesMessages.SpellingPreferencePage_workspace_dictionary_label;
    fDictionaryPath = addTextField(engine, label, PREF_SPELLING_USER_DICTIONARY, 0, 0);
    GridData gd = (GridData) fDictionaryPath.getLayoutData();
    gd.grabExcessHorizontalSpace = true;
    gd.widthHint = converter.convertWidthInCharsToPixels(40);
    allControls.add(fDictionaryPath);
    allControls.add(fLabels.get(fDictionaryPath));

    Composite buttons = new Composite(engine, SWT.NONE);
    buttons.setLayout(new GridLayout(2, true));
    buttons.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));

    Button button = new Button(buttons, SWT.PUSH);
    button.setText(PreferencesMessages.SpellingPreferencePage_browse_label);
    button.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(final SelectionEvent event) {
            handleBrowseButtonSelected();
        }
    });
    SWTUtil.setButtonDimensionHint(button);
    button.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL));
    allControls.add(button);

    button = new Button(buttons, SWT.PUSH);
    button.setText(PreferencesMessages.SpellingPreferencePage_variables);
    button.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent e) {
            handleVariablesButtonSelected();
        }

    });
    SWTUtil.setButtonDimensionHint(button);
    button.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL));
    allControls.add(button);

    // Description for user dictionary
    new Label(engine, SWT.NONE); // filler
    Label description = new Label(engine, SWT.NONE);
    gd = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
    gd.horizontalSpan = 3;
    description.setLayoutData(gd);
    description.setText(PreferencesMessages.SpellingPreferencePage_user_dictionary_description);
    allControls.add(description);

    createEncodingFieldEditor(engine, allControls);

    Group advanced = new Group(composite, SWT.NONE);
    advanced.setText(PreferencesMessages.SpellingPreferencePage_group_advanced);
    advanced.setLayout(new GridLayout(3, false));
    advanced.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    allControls.add(advanced);

    label = PreferencesMessages.SpellingPreferencePage_problems_threshold;
    int digits = 4;
    Text text = addTextField(advanced, label, PREF_SPELLING_PROBLEMS_THRESHOLD, 0,
            converter.convertWidthInCharsToPixels(digits + 1));
    text.setTextLimit(digits);
    allControls.add(text);
    allControls.add(fLabels.get(text));

    label = PreferencesMessages.SpellingPreferencePage_proposals_threshold;
    digits = 3;
    text = addTextField(advanced, label, PREF_SPELLING_PROPOSAL_THRESHOLD, 0,
            converter.convertWidthInCharsToPixels(digits + 1));
    text.setTextLimit(digits);
    gd = new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING);
    allControls.add(text);
    allControls.add(fLabels.get(text));

    if (SUPPORT_CONTENT_ASSIST_PROPOSALS) {
        label = PreferencesMessages.SpellingPreferencePage_enable_contentassist_label;
        button = addCheckBox(advanced, label, PREF_SPELLING_ENABLE_CONTENTASSIST, trueFalse, 0);
        allControls.add(button);
    }

    fAllControls = allControls.toArray(new Control[allControls.size()]);

    PlatformUI.getWorkbench().getHelpSystem().setHelp(composite,
            IJavaHelpContextIds.SPELLING_CONFIGURATION_BLOCK);
    return composite;
}

From source file:ext.org.eclipse.jdt.internal.ui.preferences.NewJavaProjectPreferencePage.java

License:Open Source License

@Override
protected Control createContents(Composite parent) {
    initializeDialogUnits(parent);/*from w  w  w.  j av  a  2  s  .  c  o m*/

    Composite result = new Composite(parent, SWT.NONE);
    GridLayout layout = new GridLayout();
    layout.marginHeight = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN);
    layout.marginWidth = 0;
    layout.verticalSpacing = convertVerticalDLUsToPixels(10);
    layout.horizontalSpacing = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING);
    layout.numColumns = 2;
    result.setLayout(layout);

    GridData gd = new GridData(GridData.FILL_HORIZONTAL);
    gd.horizontalSpan = 2;

    Group sourceFolderGroup = new Group(result, SWT.NONE);
    layout = new GridLayout();
    layout.numColumns = 2;
    sourceFolderGroup.setLayout(layout);
    sourceFolderGroup.setLayoutData(gd);
    sourceFolderGroup.setText(PreferencesMessages.NewJavaProjectPreferencePage_sourcefolder_label);

    int indent = 0;

    fProjectAsSourceFolder = addRadioButton(sourceFolderGroup,
            PreferencesMessages.NewJavaProjectPreferencePage_sourcefolder_project, SRCBIN_FOLDERS_IN_NEWPROJ,
            IPreferenceStore.FALSE, indent);
    fProjectAsSourceFolder.addSelectionListener(fSelectionListener);

    fFoldersAsSourceFolder = addRadioButton(sourceFolderGroup,
            PreferencesMessages.NewJavaProjectPreferencePage_sourcefolder_folder, SRCBIN_FOLDERS_IN_NEWPROJ,
            IPreferenceStore.TRUE, indent);
    fFoldersAsSourceFolder.addSelectionListener(fSelectionListener);

    indent = convertWidthInCharsToPixels(4);

    fSrcFolderNameLabel = new Label(sourceFolderGroup, SWT.NONE);
    fSrcFolderNameLabel.setText(PreferencesMessages.NewJavaProjectPreferencePage_folders_src);
    fSrcFolderNameText = addTextControl(sourceFolderGroup, fSrcFolderNameLabel, SRCBIN_SRCNAME, indent);
    fSrcFolderNameText.addModifyListener(fModifyListener);

    fBinFolderNameLabel = new Label(sourceFolderGroup, SWT.NONE);
    fBinFolderNameLabel.setText(PreferencesMessages.NewJavaProjectPreferencePage_folders_bin);
    fBinFolderNameText = addTextControl(sourceFolderGroup, fBinFolderNameLabel, SRCBIN_BINNAME, indent);
    fBinFolderNameText.addModifyListener(fModifyListener);

    String[] jreNames = getJRENames();
    if (jreNames.length > 0) {
        Label jreSelectionLabel = new Label(result, SWT.NONE);
        jreSelectionLabel.setText(PreferencesMessages.NewJavaProjectPreferencePage_jrelibrary_label);
        jreSelectionLabel.setLayoutData(new GridData());

        int index = getPreferenceStore().getInt(CLASSPATH_JRELIBRARY_INDEX);
        fJRECombo = new Combo(result, SWT.READ_ONLY);
        fJRECombo.setItems(jreNames);
        fJRECombo.select(index);
        fJRECombo.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL));
    }

    validateFolders();

    Dialog.applyDialogFont(result);
    return result;
}

From source file:net.sourceforge.eclipsetrader.core.db.PersistentPreferenceStore.java

License:Open Source License

/**
 * Helper method: sets the value for a given name.
 * @param p//from  ww w.  j  a  va 2s . com
 * @param name
 * @param value
 */
private void setValue(Map p, String name, boolean value) {
    p.put(name, value == true ? IPreferenceStore.TRUE : IPreferenceStore.FALSE);
}

From source file:org.ebayopensource.vjet.eclipse.internal.ui.preferences.VJOBuildPathConfigurationBlock.java

License:Open Source License

public Control createControl(Composite parent) {
    initializeDialogUnits(parent);/*ww w . j  a  v a2s. c  o  m*/

    Composite composite = new Composite(parent, SWT.NONE);
    composite.setLayout(new GridLayout());

    Group sourceFolderGroup = new Group(composite, SWT.NONE);
    sourceFolderGroup.setLayout(new GridLayout(2, false));
    sourceFolderGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    sourceFolderGroup.setText(VjetPreferenceMessages.NewVJOProjectPreferencePage_sourcefolder_label);

    this.fProjectAsSourceFolder = addRadioButton(sourceFolderGroup,
            VjetPreferenceMessages.NewVJOProjectPreferencePage_sourcefolder_project, SRCBIN_FOLDERS_IN_NEWPROJ,
            IPreferenceStore.FALSE, 0);
    this.fProjectAsSourceFolder.addSelectionListener(this.fSelectionListener);

    this.fFoldersAsSourceFolder = addRadioButton(sourceFolderGroup,
            VjetPreferenceMessages.NewVJOProjectPreferencePage_sourcefolder_folder, SRCBIN_FOLDERS_IN_NEWPROJ,
            IPreferenceStore.TRUE, 0);
    this.fFoldersAsSourceFolder.addSelectionListener(this.fSelectionListener);
    this.fSrcFolderNameLabel = new Label(sourceFolderGroup, SWT.NONE);
    GridData gridData = new GridData();
    gridData.horizontalSpan = 1;
    gridData.horizontalIndent = 10;
    this.fSrcFolderNameLabel.setLayoutData(gridData);
    this.fSrcFolderNameLabel.setText(VjetPreferenceMessages.NewVJOProjectPreferencePage_folders_src);
    this.fSrcFolderNameText = addTextControl(sourceFolderGroup, this.fSrcFolderNameLabel, SRCBIN_SRCNAME, 10);
    this.fSrcFolderNameText.addModifyListener(this.fModifyListener);

    return composite;
}

From source file:org.ebayopensource.vjet.eclipse.internal.ui.preferences.VJOBuildPathConfigurationBlock.java

License:Open Source License

public void performOk() {
    if (this.fFoldersAsSourceFolder.getSelection()) {
        this.getPreferenceStore().setValue(VjetPreferenceConstants.SRCBIN_FOLDERS_IN_NEWPROJ,
                IPreferenceStore.TRUE);//  w  w  w  . j av  a  2s  .  c  om
        this.getPreferenceStore().setValue(VjetPreferenceConstants.SRC_SRCNAME,
                this.fSrcFolderNameText.getText().trim());
    } else {
        this.getPreferenceStore().setValue(VjetPreferenceConstants.SRCBIN_FOLDERS_IN_NEWPROJ,
                IPreferenceStore.FALSE);
        this.getPreferenceStore().setValue(VjetPreferenceConstants.SRC_SRCNAME, "");
    }
}