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();
}
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;
}
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));
}
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()));
}
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()));
}
Aggregations