Search in sources :

Example 6 with BooleanFieldEditor

use of org.eclipse.jface.preference.BooleanFieldEditor in project tdi-studio-se by Talend.

the class DocumentationPreferencePage method createFieldEditors.

/*
     * (non-Javadoc)
     * 
     * @see org.eclipse.jface.preference.FieldEditorPreferencePage#createFieldEditors()
     */
@Override
protected void createFieldEditors() {
    sourceCodeGenFieldEditor = new BooleanFieldEditor(ITalendCorePrefConstants.DOC_GENERATESOURCECODE, org.talend.repository.i18n.Messages.getString("DocumentationPreferencePage.sourceCodeToHTML"), //$NON-NLS-1$
    getFieldEditorParent());
    addField(sourceCodeGenFieldEditor);
    generateLatestVersionFieldEditor = new BooleanFieldEditor(ITalendCorePrefConstants.DOC_GENERATE_LASTEST_VERSION, Messages.getString("PerformancePreferencePage.generateLatestVersion"), //$NON-NLS-1$
    getFieldEditorParent());
    addField(generateLatestVersionFieldEditor);
    // see the bug 7073,qli
    if (isDocumentationPluginLoaded) {
        BooleanFieldEditor booleanFieldEditor = new BooleanFieldEditor(ITalendCorePrefConstants.DOC_GENERATION, Messages.getString("PerformancePreferencePage.autoUpdateDoc"), //$NON-NLS-1$
        getFieldEditorParent());
        addField(booleanFieldEditor);
        FileFieldEditor documentationLogo = new FileFieldEditor(ITalendCorePrefConstants.DOC_USER_LOGO, Messages.getString("DocumentationPreferencePage.userDocLogo"), getFieldEditorParent());
        addField(documentationLogo);
        StringFieldEditor companyName = new StringFieldEditor(ITalendCorePrefConstants.DOC_COMPANY_NAME, Messages.getString("DocumentationPreferencePage.companyName"), getFieldEditorParent());
        addField(companyName);
    }
    useCss = new BooleanFieldEditor(ITalendCorePrefConstants.USE_CSS_TEMPLATE, Messages.getString("DocumentationPreferencePage.use_css_template"), //$NON-NLS-1$
    getFieldEditorParent());
    addField(useCss);
    documentCssFile = new FileFieldEditor(ITalendCorePrefConstants.CSS_FILE_PATH, Messages.getString("DocumentationPreferencePage.css_file"), //$NON-NLS-1$
    getFieldEditorParent());
    //$NON-NLS-1$
    documentCssFile.setFileExtensions(new String[] { "*.css" });
    addField(documentCssFile);
    activateFields(getPreferenceStore().getBoolean(ITalendCorePrefConstants.USE_CSS_TEMPLATE));
    addCssFileListener();
}
Also used : StringFieldEditor(org.eclipse.jface.preference.StringFieldEditor) FileFieldEditor(org.eclipse.jface.preference.FileFieldEditor) BooleanFieldEditor(org.eclipse.jface.preference.BooleanFieldEditor)

Example 7 with BooleanFieldEditor

use of org.eclipse.jface.preference.BooleanFieldEditor in project AutoRefactor by JnRouvignac.

the class WorkspacePreferencePage method createControls.

private Group createControls(final Composite parent, final List<RefactoringRule> allRefactoringRules) {
    fieldEditorParent = new Composite(parent, SWT.FILL);
    fields = new ArrayList<FieldEditor>(1 + allRefactoringRules.size());
    fields.add(new BooleanFieldEditor(DEBUG_MODE_ON.getName(), DEBUG_MODE_ON.getDescription(), fieldEditorParent));
    final Group ruleGroup = new Group(fieldEditorParent, SWT.FILL);
    ruleGroup.setText("Rules by default");
    // All rule checkbox
    toggleAllRules = new Button(ruleGroup, SWT.CHECK | SWT.LEFT);
    toggleAllRules.setFont(ruleGroup.getFont());
    toggleAllRules.setText("Toggle all the rules");
    toggleAllRules.addSelectionListener(new SelectionAdapter() {

        public void widgetSelected(SelectionEvent e) {
            boolean isSelected = WorkspacePreferencePage.this.toggleAllRules.getSelection();
            for (BooleanFieldEditor rule : WorkspacePreferencePage.this.rules) {
                ((Button) rule.getDescriptionControl(ruleGroup)).setSelection(isSelected);
            }
        }
    });
    // Add a space
    Composite spacer = new Composite(ruleGroup, SWT.NULL);
    spacer.setLayoutData(new GridData(0, 5));
    rules = new ArrayList<BooleanFieldEditor>(allRefactoringRules.size());
    for (final RefactoringRule refactoringRule : allRefactoringRules) {
        final BooleanFieldEditor booleanFieldEditor = new BooleanFieldEditor(refactoringRule.getClass().getCanonicalName(), refactoringRule.getName(), SWT.WRAP, ruleGroup);
        booleanFieldEditor.getDescriptionControl(ruleGroup).setToolTipText(refactoringRule.getDescription());
        ((Button) booleanFieldEditor.getDescriptionControl(ruleGroup)).addSelectionListener(new SelectionAdapter() {

            public void widgetSelected(final SelectionEvent e) {
                invalidateToggleRules(ruleGroup);
            }
        });
        rules.add(booleanFieldEditor);
    }
    fields.addAll(rules);
    return ruleGroup;
}
Also used : BooleanFieldEditor(org.eclipse.jface.preference.BooleanFieldEditor) FieldEditor(org.eclipse.jface.preference.FieldEditor) Group(org.eclipse.swt.widgets.Group) RefactoringRule(org.autorefactor.refactoring.RefactoringRule) Composite(org.eclipse.swt.widgets.Composite) Button(org.eclipse.swt.widgets.Button) SelectionAdapter(org.eclipse.swt.events.SelectionAdapter) SelectionEvent(org.eclipse.swt.events.SelectionEvent) GridData(org.eclipse.swt.layout.GridData) BooleanFieldEditor(org.eclipse.jface.preference.BooleanFieldEditor)

Example 8 with BooleanFieldEditor

use of org.eclipse.jface.preference.BooleanFieldEditor in project gfm_viewer by satyagraha.

the class PreferencePage method createFieldEditors.

/**
     * Creates the field editors. Field editors are abstractions of the common
     * GUI blocks needed to manipulate various types of preferences. Each field
     * editor knows how to save and restore itself.
     */
@Override
public void createFieldEditors() {
    Composite parent = getFieldEditorParent();
    addField(new BooleanFieldEditor(P_USE_TEMP_DIR, "Use temp dir", parent));
    addField(new StringFieldEditor(P_API_URL, "API URL:", parent));
    addField(new StringFieldEditor(P_USERNAME, "Username:", parent));
    StringFieldEditor passwordFieldEditor = new StringFieldEditor(P_PASSWORD, "Password:", parent);
    passwordFieldEditor.getTextControl(parent).setEchoChar('*');
    addField(passwordFieldEditor);
    FileFieldEditor templateEditor = new FileFieldEditor(P_TEMPLATE, "Template File:", true, parent);
    templateEditor.setFilterPath(File.listRoots()[0]);
    addField(templateEditor);
    addField(new StringFieldEditor(P_CSS_URL_1, "CSS URL 1:", parent));
    addField(new StringFieldEditor(P_CSS_URL_2, "CSS URL 2:", parent));
    addField(new StringFieldEditor(P_CSS_URL_3, "CSS URL 3:", parent));
    addField(new StringFieldEditor(P_JS_URL_1, "JS URL 1:", parent));
    addField(new StringFieldEditor(P_JS_URL_2, "JS URL 2:", parent));
    addField(new StringFieldEditor(P_JS_URL_3, "JS URL 3:", parent));
    addField(new BooleanFieldEditor(P_USE_ECLIPSE_CONSOLE, "Use Eclipse Console", parent));
    addField(new StringFieldEditor(P_MARKDOWN_EXTENSIONS, "Markdown Extensions", parent));
}
Also used : StringFieldEditor(org.eclipse.jface.preference.StringFieldEditor) FileFieldEditor(org.eclipse.jface.preference.FileFieldEditor) Composite(org.eclipse.swt.widgets.Composite) BooleanFieldEditor(org.eclipse.jface.preference.BooleanFieldEditor)

Example 9 with BooleanFieldEditor

use of org.eclipse.jface.preference.BooleanFieldEditor in project sling by apache.

the class MavenProjectConfiguratorPreferencesPage method createFieldEditors.

@Override
protected void createFieldEditors() {
    m2eProjectConfiguratorsForContentPackagesGroup = new Group(getFieldEditorParent(), SWT.NONE);
    GridData gd = new GridData(GridData.FILL_HORIZONTAL);
    m2eProjectConfiguratorsForContentPackagesGroup.setLayoutData(gd);
    m2eProjectConfiguratorsForContentPackagesGroup.setLayout(new GridLayout());
    m2eProjectConfiguratorsForContentPackagesGroup.setText("Maven Project Configurator for Content-Packages");
    enableProjectConfiguratorEditor = new BooleanFieldEditor(Preferences.ENABLE_CONTENT_PACKAGE_PROJECT_CONFIGURATOR, "Enable", m2eProjectConfiguratorsForContentPackagesGroup);
    enableExtendedProjectConfigurationEditor = new BooleanFieldEditor(Preferences.ENABLE_CONTENT_PACKAGE_PROJECT_CONFIGURATOR_ADDITIONAL_WTP_FACETS, "Add additional WTP natures and facets", m2eProjectConfiguratorsForContentPackagesGroup);
    addField(enableProjectConfiguratorEditor);
    addField(enableExtendedProjectConfigurationEditor);
    addField(new BooleanFieldEditor(Preferences.ENABLE_BUNDLE_PROJECT_CONFIGURATOR, "Enable Maven Project Configurator for Bundles", getFieldEditorParent()));
}
Also used : Group(org.eclipse.swt.widgets.Group) GridLayout(org.eclipse.swt.layout.GridLayout) GridData(org.eclipse.swt.layout.GridData) BooleanFieldEditor(org.eclipse.jface.preference.BooleanFieldEditor)

Example 10 with BooleanFieldEditor

use of org.eclipse.jface.preference.BooleanFieldEditor in project linuxtools by eclipse.

the class LibHoverPreferencePage method createFieldEditors.

/**
 * Creates the field editors. Field editors are abstractions of
 * the common GUI blocks needed to manipulate various types
 * of preferences. Each field editor knows how to save and
 * restore itself.
 */
@Override
public void createFieldEditors() {
    addField(new BooleanFieldEditor(PreferenceConstants.CACHE_EXT_LIBHOVER, LibHoverMessages.getString(CACHE_EXT), getFieldEditorParent()));
    addField(new BooleanFieldEditor(PreferenceConstants.LAZY_LOAD, LibHoverMessages.getString(LOAD_ON_STARTUP), getFieldEditorParent()));
}
Also used : BooleanFieldEditor(org.eclipse.jface.preference.BooleanFieldEditor)

Aggregations

BooleanFieldEditor (org.eclipse.jface.preference.BooleanFieldEditor)37 Composite (org.eclipse.swt.widgets.Composite)20 IntegerFieldEditor (org.eclipse.jface.preference.IntegerFieldEditor)15 StringFieldEditor (org.eclipse.jface.preference.StringFieldEditor)11 GridData (org.eclipse.swt.layout.GridData)10 Label (org.eclipse.swt.widgets.Label)9 RadioGroupFieldEditor (org.eclipse.jface.preference.RadioGroupFieldEditor)8 Group (org.eclipse.swt.widgets.Group)8 GridLayout (org.eclipse.swt.layout.GridLayout)7 ComboFieldEditor (org.eclipse.jface.preference.ComboFieldEditor)5 Button (org.eclipse.swt.widgets.Button)4 FieldEditor (org.eclipse.jface.preference.FieldEditor)3 SelectionAdapter (org.eclipse.swt.events.SelectionAdapter)3 SelectionEvent (org.eclipse.swt.events.SelectionEvent)3 Link (org.eclipse.swt.widgets.Link)3 ColorFieldEditor (org.eclipse.jface.preference.ColorFieldEditor)2 DirectoryFieldEditor (org.eclipse.jface.preference.DirectoryFieldEditor)2 FileFieldEditor (org.eclipse.jface.preference.FileFieldEditor)2 SWT (org.eclipse.swt.SWT)2 SelectionListener (org.eclipse.swt.events.SelectionListener)2