use of org.eclipse.jface.preference.BooleanFieldEditor in project linuxtools by eclipse.
the class ColorPreferencePage method createFieldEditors.
@Override
protected void createFieldEditors() {
fbfeUseColors = new BooleanFieldEditor(PREFKEY_COV_USE_COLORS, Messages.ColorPreferencePage_ColorizeCode, this.getFieldEditorParent());
this.addField(fbfeUseColors);
fbfeUseGradient = new BooleanFieldEditor(PREFKEY_COV_USE_GRADIENT, Messages.ColorPreferencePage_UseGradient, this.getFieldEditorParent());
this.addField(fbfeUseGradient);
fcfeMax = new ColorFieldEditor(PREFKEY_COV_MAX_COLOR, Messages.ColorPreferencePage_BackColorHighest, this.getFieldEditorParent());
this.addField(fcfeMax);
fcfeMin = new ColorFieldEditor(PREFKEY_COV_MIN_COLOR, Messages.ColorPreferencePage_BackColorLowest, this.getFieldEditorParent());
this.addField(fcfeMin);
fcfeMno = new ColorFieldEditor(PREFKEY_COV_0_COLOR, Messages.ColorPreferencePage_BackColorNotCovered, this.getFieldEditorParent());
this.addField(fcfeMno);
}
use of org.eclipse.jface.preference.BooleanFieldEditor in project linuxtools by eclipse.
the class GraphPreferencePage method createFieldEditors.
@Override
public void createFieldEditors() {
addField(new BooleanFieldEditor(GraphingPreferenceConstants.P_SHOW_X_GRID_LINES, // $NON-NLS-1$
Localization.getString("GraphPreferencePage.ShowXGridLines"), getFieldEditorParent()));
addField(new BooleanFieldEditor(GraphingPreferenceConstants.P_SHOW_Y_GRID_LINES, // $NON-NLS-1$
Localization.getString("GraphPreferencePage.ShowYGridLines"), getFieldEditorParent()));
addField(new IntegerFieldEditor(GraphingPreferenceConstants.P_VIEWABLE_DATA_ITEMS, // $NON-NLS-1$
Localization.getString("GraphPreferencePage.ViewableDataItems"), getFieldEditorParent()));
addField(new IntegerFieldEditor(GraphingPreferenceConstants.P_X_SERIES_TICKS, // $NON-NLS-1$
Localization.getString("GraphPreferencePage.XSeriesTicks"), getFieldEditorParent()));
addField(new IntegerFieldEditor(GraphingPreferenceConstants.P_Y_SERIES_TICKS, // $NON-NLS-1$
Localization.getString("GraphPreferencePage.YSeriesTicks"), getFieldEditorParent()));
}
use of org.eclipse.jface.preference.BooleanFieldEditor in project linuxtools by eclipse.
the class MainPreferencePage method createFieldEditors.
@Override
public void createFieldEditors() {
GridData data = new GridData();
data.horizontalSpan = 2;
final Composite parent = getFieldEditorParent();
Link link = new Link(parent, SWT.NONE);
link.setText(Messages.MainPreferencePage_0);
link.addSelectionListener(SelectionListener.widgetSelectedAdapter(e -> PreferencesUtil.createPreferenceDialogOn(parent.getShell(), e.text, null, null)));
addField(changelogEntryFormatFieldEditor(parent));
Label labelLocal = new Label(parent, SWT.NONE);
labelLocal.setText(Messages.MainPreferencePage_1);
labelLocal.setLayoutData(data);
createLocalesCombo(parent);
addField(new BooleanFieldEditor(PreferenceConstants.P_SPACES_FOR_TABS, Messages.MainPreferencePage_6, parent));
Composite numEditorComp = new Composite(parent, SWT.NONE);
IntegerFieldEditor numEditor = new IntegerFieldEditor(PreferenceConstants.P_NBR_OF_SPACES_FOR_TAB, Messages.MainPreferencePage_7, numEditorComp, 1);
addField(numEditor);
}
use of org.eclipse.jface.preference.BooleanFieldEditor in project linuxtools by eclipse.
the class CreaterepoGeneralPropertyPage method addContents.
@Override
protected Composite addContents(Composite parent) {
Composite composite = new Composite(parent, SWT.NONE);
GridLayout layout = new GridLayout(2, false);
GridData layoutData = new GridData();
composite.setLayout(layout);
// TODO: use BooleanFieldEditor and get it to layout properly
// with the link (lnWorkspaceSettings)
btnProjectSettings = new Button(composite, SWT.CHECK);
btnProjectSettings.addListener(SWT.Selection, event -> toggleEnabled());
layoutData = new GridData();
layoutData.horizontalAlignment = GridData.BEGINNING;
layoutData.horizontalAlignment = GridData.FILL;
layoutData.grabExcessHorizontalSpace = true;
btnProjectSettings.setText(Messages.CreaterepoGeneralPropertyPage_projectSettings);
btnProjectSettings.setLayoutData(layoutData);
btnProjectSettings.setSelection(Activator.getDefault().getPreferenceStore().getBoolean(CreaterepoPreferenceConstants.PREF_GENERAL_ENABLED));
btnProjectSettings.addSelectionListener(SelectionListener.widgetSelectedAdapter(e -> checkState()));
lnWorkspaceSettings = new Link(composite, SWT.NONE);
layoutData = new GridData();
layoutData.horizontalAlignment = SWT.END;
lnWorkspaceSettings.setLayoutData(layoutData);
lnWorkspaceSettings.setText(NLS.bind(linkTags, Messages.CreaterepoGeneralPropertyPage_workspaceSettings));
lnWorkspaceSettings.setFont(parent.getFont());
lnWorkspaceSettings.addListener(SWT.Selection, event -> {
PreferenceDialog preferenceDialog = PreferencesUtil.createPreferenceDialogOn(getShell(), CREATEREPO_PREFERENCE_ID, new String[] { CREATEREPO_PREFERENCE_ID }, null);
preferenceDialog.open();
});
// general group
generalGroup = new Group(composite, SWT.SHADOW_ETCHED_IN);
layout = new GridLayout(2, false);
generalGroup.setLayout(layout);
generalGroup.setText(Messages.CreaterepoPreferencePage_generalGroupLabel);
GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).grab(true, false).span(2, 1).applyTo(generalGroup);
// generate unique metadata filenames
bfeIncludeChecksum = new BooleanFieldEditor(CreaterepoPreferenceConstants.PREF_UNIQUE_MD_NAME, Messages.CreaterepoPreferencePage_booleanChecksumName, generalGroup);
bfeIncludeChecksum.fillIntoGrid(generalGroup, 2);
bfeIncludeChecksum.setPreferenceStore(preferenceStore);
bfeIncludeChecksum.setPropertyChangeListener(this);
bfeIncludeChecksum.load();
// generate sqlite databases
bfeSQLDB = new BooleanFieldEditor(CreaterepoPreferenceConstants.PREF_GENERATE_DB, Messages.CreaterepoPreferencePage_booleanGenerateSQLDB, generalGroup);
bfeSQLDB.fillIntoGrid(generalGroup, 2);
bfeSQLDB.setPreferenceStore(preferenceStore);
bfeSQLDB.setPropertyChangeListener(this);
bfeSQLDB.load();
// ignore symlinks for packages
bfeIgnoreSymlinks = new BooleanFieldEditor(CreaterepoPreferenceConstants.PREF_IGNORE_SYMLINKS, Messages.CreaterepoPreferencePage_booleanIgnoreSymlinks, generalGroup);
bfeIgnoreSymlinks.fillIntoGrid(generalGroup, 2);
bfeIgnoreSymlinks.setPreferenceStore(preferenceStore);
bfeIgnoreSymlinks.setPropertyChangeListener(this);
bfeIgnoreSymlinks.load();
// output files in pretty xml format
bfePrettyXML = new BooleanFieldEditor(CreaterepoPreferenceConstants.PREF_PRETTY_XML, Messages.CreaterepoPreferencePage_booleanPrettyXML, generalGroup);
bfePrettyXML.fillIntoGrid(generalGroup, 2);
bfePrettyXML.setPreferenceStore(preferenceStore);
bfePrettyXML.setPropertyChangeListener(this);
bfePrettyXML.load();
// number of workers
ifeSpawns = new IntegerFieldEditor(CreaterepoPreferenceConstants.PREF_WORKERS, Messages.CreaterepoPreferencePage_numWorkers, generalGroup);
ifeSpawns.fillIntoGrid(generalGroup, 2);
// more than 128 is alot. limiting. (createrepo warning)
ifeSpawns.setValidRange(0, 128);
ifeSpawns.setPreferenceStore(preferenceStore);
ifeSpawns.setPropertyChangeListener(this);
ifeSpawns.load();
updateGroupSpacing(generalGroup);
// updates group
updatesGroup = new Group(composite, SWT.SHADOW_ETCHED_IN);
updatesGroup.setText(Messages.CreaterepoPreferencePage_updateGroupLabel);
GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).grab(true, false).span(2, 1).hint(10, SWT.DEFAULT).applyTo(updatesGroup);
// don't generate repo metadata, if their timestamps are newer than its rpms
bfeSameFilename = new BooleanFieldEditor(CreaterepoPreferenceConstants.PREF_CHECK_TS, Messages.CreaterepoPreferencePage_booleanCheckTS, updatesGroup);
bfeSameFilename.fillIntoGrid(updatesGroup, 2);
bfeSameFilename.setPreferenceStore(preferenceStore);
bfeSameFilename.setPropertyChangeListener(this);
bfeSameFilename.load();
// note of caution
lblCheckTs = new Label(updatesGroup, SWT.WRAP);
lblCheckTs.setText(Messages.CreaterepoPreferencePage_checkTSNote);
layoutData = new GridData();
layoutData.widthHint = 130;
layoutData.horizontalAlignment = SWT.FILL;
layoutData.grabExcessHorizontalSpace = true;
layoutData.horizontalIndent = 5;
lblCheckTs.setLayoutData(layoutData);
updateGroupSpacing(updatesGroup);
// changelog group
changelogGroup = new Group(composite, SWT.SHADOW_ETCHED_IN);
changelogGroup.setText(Messages.CreaterepoPreferencePage_changelogGroupLabel);
GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).grab(true, false).span(2, 1).hint(10, SWT.DEFAULT).applyTo(changelogGroup);
// don't generate repo metadata, if their timestamps are newer than its rpms
ifeChangelogLimit = new IntegerFieldEditor(CreaterepoPreferenceConstants.PREF_CHANGELOG_LIMIT, Messages.CreaterepoPreferencePage_numChangelogLimit, changelogGroup);
ifeChangelogLimit.fillIntoGrid(changelogGroup, 2);
ifeChangelogLimit.setValidRange(0, Integer.MAX_VALUE);
ifeChangelogLimit.setPreferenceStore(preferenceStore);
ifeChangelogLimit.setPropertyChangeListener(this);
ifeChangelogLimit.load();
updateGroupSpacing(changelogGroup);
checksumsContainer = new Composite(composite, SWT.NONE);
checksumsContainer.setLayout(new GridLayout());
GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).indent(0, 20).grab(true, false).applyTo(checksumsContainer);
// available checksums
rgfeChecksums = new RadioGroupFieldEditor(CreaterepoPreferenceConstants.PREF_CHECKSUM, Messages.CreaterepoPreferencePage_checksumGroupLabel, 1, new String[][] { { ICreaterepoChecksums.SHA1, ICreaterepoChecksums.SHA1 }, { ICreaterepoChecksums.MD5, ICreaterepoChecksums.MD5 }, { ICreaterepoChecksums.SHA256, ICreaterepoChecksums.SHA256 }, { ICreaterepoChecksums.SHA512, ICreaterepoChecksums.SHA512 } }, checksumsContainer, true);
rgfeChecksums.setPreferenceStore(preferenceStore);
rgfeChecksums.setPropertyChangeListener(this);
rgfeChecksums.load();
compressContainer = new Composite(composite, SWT.NONE);
compressContainer.setLayout(new GridLayout());
GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).indent(0, 20).grab(true, false).applyTo(compressContainer);
// available compression types
rgfeCompressionTypes = new RadioGroupFieldEditor(CreaterepoPreferenceConstants.PREF_COMPRESSION_TYPE, Messages.CreaterepoPreferencePage_compressionGroupLabel, 1, new String[][] { { ICreaterepoCompressionTypes.COMPAT, ICreaterepoCompressionTypes.COMPAT }, { ICreaterepoCompressionTypes.XZ, ICreaterepoCompressionTypes.XZ }, { ICreaterepoCompressionTypes.GZ, ICreaterepoCompressionTypes.GZ }, { ICreaterepoCompressionTypes.BZ2, ICreaterepoCompressionTypes.BZ2 } }, compressContainer, true);
rgfeCompressionTypes.setPreferenceStore(preferenceStore);
rgfeCompressionTypes.setPropertyChangeListener(this);
rgfeCompressionTypes.load();
toggleEnabled();
return composite;
}
use of org.eclipse.jface.preference.BooleanFieldEditor in project knime-core by knime.
the class MasterKeyPreferencePage method createFieldEditors.
/**
* {@inheritDoc}
*/
@Override
protected void createFieldEditors() {
final Composite parent = getFieldEditorParent();
m_isMasterKey = new BooleanFieldEditor(HeadlessPreferencesConstants.P_MASTER_KEY_ENABLED, "Enable password en-/decryption", parent) {
/**
* {@inheritDoc}
*/
@Override
protected void valueChanged(final boolean old, final boolean neu) {
enableFields(neu);
}
};
m_isMasterKey.load();
super.addField(m_isMasterKey);
m_masterKey = new StringFieldEditor("master_key_field", "Master Key: ", 20, parent);
m_masterKey.getTextControl(parent).setEchoChar('*');
super.addField(m_masterKey);
m_masterKeyConfirm = new StringFieldEditor("master_key_field", "Confirm: ", 20, parent);
m_masterKeyConfirm.getTextControl(parent).setEchoChar('*');
super.addField(m_masterKeyConfirm);
m_saveMasterKey = new BooleanFieldEditor(HeadlessPreferencesConstants.P_MASTER_KEY_SAVED, "Save Master Key and don't ask again on restart (unsafe)", parent);
m_saveMasterKey.load();
super.addField(m_saveMasterKey);
}
Aggregations