本文整理匯總了Java中org.eclipse.jface.preference.BooleanFieldEditor.setPreferenceStore方法的典型用法代碼示例。如果您正苦於以下問題:Java BooleanFieldEditor.setPreferenceStore方法的具體用法?Java BooleanFieldEditor.setPreferenceStore怎麽用?Java BooleanFieldEditor.setPreferenceStore使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.eclipse.jface.preference.BooleanFieldEditor
的用法示例。
在下文中一共展示了BooleanFieldEditor.setPreferenceStore方法的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: createDialogArea
import org.eclipse.jface.preference.BooleanFieldEditor; //導入方法依賴的package包/類
@Override
protected Control createDialogArea(Composite parent) {
Composite top = (Composite) super.createDialogArea(parent);
Composite editArea = new Composite(top, SWT.NONE);
editArea.setLayout(new GridLayout());
editArea.setLayoutData(new GridData(GridData.FILL_BOTH | GridData.GRAB_HORIZONTAL | GridData.GRAB_VERTICAL));
runInBackground = new BooleanFieldEditor(IProgressConstants.RUN_IN_BACKGROUND, ProgressMessages.JobsViewPreferenceDialog_RunInBackground, editArea);
runInBackground.setPreferenceName(IProgressConstants.RUN_IN_BACKGROUND);
runInBackground.setPreferenceStore(preferenceStore);
runInBackground.load();
showSystemJob = new BooleanFieldEditor(IProgressConstants.SHOW_SYSTEM_JOBS, ProgressMessages.JobsViewPreferenceDialog_ShowSystemJobs, editArea);
showSystemJob.setPreferenceName(IProgressConstants.SHOW_SYSTEM_JOBS);
showSystemJob.setPreferenceStore(preferenceStore);
showSystemJob.load();
Dialog.applyDialogFont(top);
return top;
}
示例2: createUI_30_ApplyOption
import org.eclipse.jface.preference.BooleanFieldEditor; //導入方法依賴的package包/類
private void createUI_30_ApplyOption(final Composite parent) {
/*
* checkbox: pace min/max value
*/
_booleanEditorApplyOption = new BooleanFieldEditor(
IPreferences.SRTM_APPLY_WHEN_PROFILE_IS_SELECTED,
Messages.prefPage_srtm_profile_option_apply_when_selected,
parent);
_booleanEditorApplyOption.setPreferenceStore(_prefStore);
_booleanEditorApplyOption.setPage(this);
_booleanEditorApplyOption.setPropertyChangeListener(new IPropertyChangeListener() {
@Override
public void propertyChange(final PropertyChangeEvent event) {
if (((Boolean) event.getNewValue())) {
// apply profile
final Object firstElement = ((StructuredSelection) _profileViewer.getSelection()).getFirstElement();
if (firstElement instanceof SRTMProfile) {
onSelectProfile((SRTMProfile) firstElement, true);
}
}
}
});
}
示例3: createUI_20_Cleanup
import org.eclipse.jface.preference.BooleanFieldEditor; //導入方法依賴的package包/類
private void createUI_20_Cleanup(final Composite parent) {
final Group group = new Group(parent, SWT.NONE);
group.setText(Messages.PrefPage_Photo_ThumbStore_Group_Cleanup);
GridDataFactory.fillDefaults().grab(true, false).applyTo(group);
{
/*
* field: use default location
*/
_editorBoolDoCleanup = new BooleanFieldEditor(
IPhotoPreferences.PHOTO_THUMBNAIL_STORE_IS_CLEANUP,
Messages.PrefPage_Photo_ThumbStore_Checkbox_Cleanup,
group);
_editorBoolDoCleanup.setPage(this);
_editorBoolDoCleanup.setPreferenceStore(_prefStore);
addField(_editorBoolDoCleanup);
createUI_30_CleanupOptions(group);
createUI_40_CleanupNow(group);
createUI_50_LastCleanup(group);
}
// !!! set layout after the editor was created because the editor sets the parents layout
GridLayoutFactory.swtDefaults().numColumns(1).applyTo(group);
}
示例4: createUI
import org.eclipse.jface.preference.BooleanFieldEditor; //導入方法依賴的package包/類
private void createUI(final Composite parent) {
final IPreferenceStore prefStore = getPreferenceStore();
fPrefContainer = new Composite(parent, SWT.NONE);
GridDataFactory.swtDefaults().grab(true, false).applyTo(fPrefContainer);
GridLayoutFactory.fillDefaults().applyTo(fPrefContainer);
// fPrefContainer.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_YELLOW));
// checkbox: is offline enabled
fUseOffLineCache = new BooleanFieldEditor(IMappingPreferences.OFFLINE_CACHE_USE_OFFLINE,
Messages.pref_cache_use_offline,
fPrefContainer);
fUseOffLineCache.setPreferenceStore(prefStore);
fUseOffLineCache.setPage(this);
fUseOffLineCache.load();
fUseOffLineCache.setPropertyChangeListener(new IPropertyChangeListener() {
public void propertyChange(final PropertyChangeEvent event) {
enableControls();
}
});
/*
* offline cache settings
*/
final Composite offlineContainer = new Composite(fPrefContainer, SWT.NONE);
GridDataFactory.fillDefaults().grab(true, false).indent(15, 5).applyTo(offlineContainer);
GridLayoutFactory.fillDefaults().applyTo(offlineContainer);
createUICacheSettings(offlineContainer);
createUICacheInfo(offlineContainer);
/*
* hide error messages, this happend when the cache path is invalid but the offline cache is
* disabled
*/
if (fUseOffLineCache.getBooleanValue() == false) {
setErrorMessage(null);
}
}
示例5: createFieldEditors
import org.eclipse.jface.preference.BooleanFieldEditor; //導入方法依賴的package包/類
/**
* Creates the preference page fields.
*/
protected void createFieldEditors() {
Composite rootControl = getFieldEditorParent();
// Create the controls.
BooleanFieldEditor escapeValueStrings = new BooleanFieldEditor(IPreferences.HANDLE_ESCAPED_VALUES,
"Handle escapes for \" and \\ in value strings", rootControl);
escapeValueStrings.setPreferenceStore(getPreferenceStore());
addField(escapeValueStrings);
IntegerFieldEditor historySize = new IntegerFieldEditor(IPreferences.BUILD_HISTORY_SIZE, "Build history size:",
rootControl);
historySize.setPreferenceStore(getPreferenceStore());
historySize.setValidRange(1, 100);
addField(historySize);
RadioGroupFieldEditor autoSaveField = new RadioGroupFieldEditor(IPreferences.AUTO_SAVE,
"Save all modified files before building", 1,
new String[][] { { IPreferences.AUTO_SAVE_NEVER, IPreferences.AUTO_SAVE_NEVER },
{ IPreferences.AUTO_SAVE_ALWAYS, IPreferences.AUTO_SAVE_ALWAYS },
{ IPreferences.AUTO_SAVE_ASK, IPreferences.AUTO_SAVE_ASK }, },
rootControl, true);
autoSaveField.setPreferenceStore(getPreferenceStore());
addField(autoSaveField);
int lineSepLength = LineSeparator.values().length;
String[][] lineSepNames = new String[lineSepLength][2];
for(int i=0;i<lineSepLength;i++) {
lineSepNames[i][0] = LineSeparator.values()[i].getName();
lineSepNames[i][1] = LineSeparator.values()[i].name();
}
RadioGroupFieldEditor lineSeparatorField = new RadioGroupFieldEditor(IPreferences.LINE_SEPARATOR,
"Line separator", 1, lineSepNames, rootControl, true);
lineSeparatorField.setPreferenceStore(getPreferenceStore());
addField(lineSeparatorField);
int listSepModeLength = ListSeparateMode.values().length;
String[][] listSepModeNames = new String[listSepModeLength][2];
for(int i=0;i<listSepModeLength;i++) {
listSepModeNames[i][0] = ListSeparateMode.values()[i].getName();
listSepModeNames[i][1] = ListSeparateMode.values()[i].name();
}
RadioGroupFieldEditor listSepModeField = new RadioGroupFieldEditor(IPreferences.LIST_SEPARATE_MODE,
"List separate mode", 1, listSepModeNames, rootControl, true);
listSepModeField.setPreferenceStore(getPreferenceStore());
addField(listSepModeField);
int tagFormatLength = TagFormat.values().length;
String[][] tagFormatNames = new String[tagFormatLength][2];
for(int i=0;i<tagFormatLength;i++) {
tagFormatNames[i][0] = TagFormat.values()[i].getName();
tagFormatNames[i][1] = TagFormat.values()[i].name();
}
RadioGroupFieldEditor tagFormatField = new RadioGroupFieldEditor(IPreferences.TAG_FORMAT,
"TAG format", 1, tagFormatNames, rootControl, true);
tagFormatField.setPreferenceStore(getPreferenceStore());
addField(tagFormatField);
}
示例6: createUI
import org.eclipse.jface.preference.BooleanFieldEditor; //導入方法依賴的package包/類
private Control createUI(final Composite parent) {
final IPreferenceStore prefStore = getPreferenceStore();
final Composite uiContainer = new Composite(parent, SWT.NONE);
GridDataFactory.swtDefaults().grab(true, false).applyTo(uiContainer);
GridLayoutFactory.fillDefaults().applyTo(uiContainer);
// fPrefContainer.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_YELLOW));
{
// checkbox: is offline enabled
_boolEditorUseOffLineCache = new BooleanFieldEditor(
IMappingPreferences.OFFLINE_CACHE_USE_OFFLINE,
Messages.pref_cache_use_offline,
uiContainer);
_boolEditorUseOffLineCache.setPreferenceStore(prefStore);
_boolEditorUseOffLineCache.setPage(this);
_boolEditorUseOffLineCache.load();
_boolEditorUseOffLineCache.setPropertyChangeListener(new IPropertyChangeListener() {
public void propertyChange(final PropertyChangeEvent event) {
enableControls();
}
});
/*
* offline cache settings
*/
final Composite offlineContainer = new Composite(uiContainer, SWT.NONE);
GridDataFactory.fillDefaults().grab(true, false).indent(15, 5).applyTo(offlineContainer);
GridLayoutFactory.fillDefaults().applyTo(offlineContainer);
createUI_10_CacheSettings(offlineContainer);
createUI_20_CacheInfo(offlineContainer);
}
/*
* hide error messages, this happend when the cache path is invalid but the offline cache is
* disabled
*/
if (_boolEditorUseOffLineCache.getBooleanValue() == false) {
setErrorMessage(null);
}
return uiContainer;
}
示例7: createUI
import org.eclipse.jface.preference.BooleanFieldEditor; //導入方法依賴的package包/類
private Composite createUI(final Composite parent) {
final IPreferenceStore prefStore = getPreferenceStore();
final Composite container = new Composite(parent, SWT.NONE);
GridDataFactory.fillDefaults().grab(true, false).applyTo(container);
GridLayoutFactory.fillDefaults().applyTo(container);
{
final Composite infoContainer = new Composite(container, SWT.NONE);
GridDataFactory.fillDefaults().grab(true, false).applyTo(infoContainer);
GridLayoutFactory.fillDefaults().applyTo(infoContainer);
{
// checkbox: show tile info
_chkShowTileInfo = new BooleanFieldEditor(
IMappingPreferences.SHOW_MAP_TILE_INFO,
Messages.pref_map_show_tile_info,
infoContainer);
_chkShowTileInfo.setPreferenceStore(prefStore);
_chkShowTileInfo.setPage(this);
_chkShowTileInfo.load();
}
final Composite fontContainer = new Composite(container, SWT.NONE);
GridDataFactory.fillDefaults().indent(0, 20).grab(true, false).applyTo(fontContainer);
GridLayoutFactory.fillDefaults().applyTo(fontContainer);
{
// font: mono space
_monoFontEditor = new FontFieldEditor(
IMappingPreferences.THEME_FONT_LOGGING,
Messages.Theme_Font_Logging,
Messages.Theme_Font_Logging_PREVIEW_TEXT,
fontContainer);
_monoFontEditor.setPreferenceStore(prefStore);
_monoFontEditor.setPage(this);
_monoFontEditor.load();
}
// force 2 columns
final GridLayout gl = (GridLayout) fontContainer.getLayout();
gl.numColumns = 2;
gl.makeColumnsEqualWidth = true;
}
return container;
}
示例8: createUI_10_OfflineFolder
import org.eclipse.jface.preference.BooleanFieldEditor; //導入方法依賴的package包/類
private void createUI_10_OfflineFolder(final Composite parent) {
final Group group = new Group(parent, SWT.NONE);
group.setText(Messages.Pref_Map25_Offline_Group_OfflineMap);
GridDataFactory.fillDefaults().grab(true, false).applyTo(group);
{
/*
* field: use default location
*/
_editorBool_UseDefaultLocation = new BooleanFieldEditor(
ITourbookPreferences.MAP25_OFFLINE_MAP_IS_DEFAULT_LOCATION,
Messages.Pref_Map25_Offline_Checkbox_UseDefaultLocation,
group);
_editorBool_UseDefaultLocation.setPage(this);
_editorBool_UseDefaultLocation.setPreferenceStore(_prefStore);
addField(_editorBool_UseDefaultLocation);
// spacer
new Label(group, SWT.NONE);
_editorContainerLocation = new Composite(group, SWT.NONE);
GridDataFactory.fillDefaults().grab(true, false).span(3, 1).applyTo(_editorContainerLocation);
{
/*
* editor: thumbnail location
*/
_editorDir_ThumbnailLocation = new DirectoryFieldEditor(
ITourbookPreferences.MAP25_OFFLINE_MAP_CUSTOM_LOCATION,
Messages.Pref_Map25_Offline_Label_Location,
_editorContainerLocation);
_editorDir_ThumbnailLocation.setPage(this);
_editorDir_ThumbnailLocation.setPreferenceStore(_prefStore);
_editorDir_ThumbnailLocation.setEmptyStringAllowed(false);
final Text textDirEditor = _editorDir_ThumbnailLocation.getTextControl(_editorContainerLocation);
textDirEditor.addModifyListener(new ModifyListener() {
@Override
public void modifyText(final ModifyEvent e) {
_isModified = true;
isDataValid();
}
});
addField(_editorDir_ThumbnailLocation);
}
}
// !!! set layout after the editor was created because the editor sets the parents layout
GridLayoutFactory.swtDefaults().numColumns(3).applyTo(group);
}
示例9: createUI_10_Notes
import org.eclipse.jface.preference.BooleanFieldEditor; //導入方法依賴的package包/類
private void createUI_10_Notes(final Composite parent) {
_groupNotesImport = new Group(parent, SWT.NONE);
_groupNotesImport.setText(Messages.prefPage_tcx_group_importNotes);
GridDataFactory.fillDefaults().grab(true, false).applyTo(_groupNotesImport);
{
// label: description
final Label label = new Label(_groupNotesImport, SWT.NONE);
GridDataFactory.fillDefaults().span(2, 1).applyTo(label);
label.setText(Messages.prefPage_tcx_label_importNotes);
// check: import into title field
_editBool_ImportIntoTitle = new BooleanFieldEditor2(
IPreferences.IS_IMPORT_INTO_TITLE_FIELD,
Messages.prefPage_tcx_check_importIntoTitleField,
_groupNotesImport);
_editBool_ImportIntoTitle.fillIntoGrid(_groupNotesImport, 2);
_editBool_ImportIntoTitle.setPreferenceStore(_prefStore);
_editBool_ImportIntoTitle.load();
addField(_editBool_ImportIntoTitle);
/*
* setPropertyChangeListener() is occupied by the pref page when the field is added to
* the page with addField
*/
final Button chkImportIntoTitle = _editBool_ImportIntoTitle.getChangeControl(_groupNotesImport);
chkImportIntoTitle.addSelectionListener(_defaultSelectionListener);
// container: title
final Composite containerTitle = new Composite(_groupNotesImport, SWT.NONE);
GridDataFactory.fillDefaults().span(2, 1).grab(true, false).indent(15, 0).applyTo(containerTitle);
GridLayoutFactory.fillDefaults().numColumns(2).applyTo(containerTitle);
{
// radio: import all
_rdoImportAll = new Button(containerTitle, SWT.RADIO);
GridDataFactory.fillDefaults().span(2, 1).applyTo(_rdoImportAll);
_rdoImportAll.setText(Messages.prefPage_tcx_radio_importIntoTitleAll);
_rdoImportAll.addSelectionListener(_defaultSelectionListener);
// radio: import truncated
_rdoImportTruncated = new Button(containerTitle, SWT.RADIO);
_rdoImportTruncated.setText(Messages.prefPage_tcx_radio_importIntoTitleTruncated);
_rdoImportTruncated.addSelectionListener(_defaultSelectionListener);
// editor: number of characters
_containerCharacter = new Composite(containerTitle, SWT.NONE);
{
_editInt_TruncatedNotes = new IntegerFieldEditor(
IPreferences.NUMBER_OF_TITLE_CHARACTERS,
UI.EMPTY_STRING,
_containerCharacter);
_editInt_TruncatedNotes.setValidRange(10, 1000);
_editInt_TruncatedNotes.fillIntoGrid(_containerCharacter, 2);
_editInt_TruncatedNotes.setPreferenceStore(_prefStore);
_editInt_TruncatedNotes.load();
UI.setFieldWidth(_containerCharacter, _editInt_TruncatedNotes, UI.DEFAULT_FIELD_WIDTH);
addField(_editInt_TruncatedNotes);
}
}
// check: import into description field
_editBool_ImportIntoDescription = new BooleanFieldEditor(
IPreferences.IS_IMPORT_INTO_DESCRIPTION_FIELD,
Messages.prefPage_tcx_check_importIntoDescriptionField,
_groupNotesImport);
_editBool_ImportIntoDescription.fillIntoGrid(_groupNotesImport, 2);
_editBool_ImportIntoDescription.setPreferenceStore(_prefStore);
_editBool_ImportIntoDescription.load();
addField(_editBool_ImportIntoDescription);
}
// add layout to the group
final GridLayout regionalLayout = (GridLayout) _groupNotesImport.getLayout();
regionalLayout.marginWidth = 5;
regionalLayout.marginHeight = 5;
}
示例10: createUI_10_StoreLocation
import org.eclipse.jface.preference.BooleanFieldEditor; //導入方法依賴的package包/類
private void createUI_10_StoreLocation(final Composite parent) {
final Group group = new Group(parent, SWT.NONE);
group.setText(Messages.PrefPage_Photo_ThumbStore_Group_ThumbnailStoreLocation);
GridDataFactory.fillDefaults().grab(true, false).applyTo(group);
{
/*
* field: use default location
*/
_editorBoolUseDefaultLocation = new BooleanFieldEditor(
IPhotoPreferences.PHOTO_THUMBNAIL_STORE_IS_DEFAULT_LOCATION,
Messages.PrefPage_Photo_ThumbStore_Checkbox_UseDefaultLocation,
group);
_editorBoolUseDefaultLocation.setPage(this);
_editorBoolUseDefaultLocation.setPreferenceStore(_prefStore);
addField(_editorBoolUseDefaultLocation);
// spacer
new Label(group, SWT.NONE);
_containerLocation = new Composite(group, SWT.NONE);
GridDataFactory.fillDefaults().grab(true, false).span(3, 1).applyTo(_containerLocation);
{
/*
* editor: thumbnail location
*/
_editorDirThumbnailLocation = new DirectoryFieldEditor(
IPhotoPreferences.PHOTO_THUMBNAIL_STORE_CUSTOM_LOCATION,
Messages.PrefPage_Photo_ThumbStore_Text_Location,
_containerLocation);
_editorDirThumbnailLocation.setPage(this);
_editorDirThumbnailLocation.setPreferenceStore(_prefStore);
_editorDirThumbnailLocation.setEmptyStringAllowed(false);
final Text textDirEditor = _editorDirThumbnailLocation.getTextControl(_containerLocation);
textDirEditor.addModifyListener(new ModifyListener() {
@Override
public void modifyText(final ModifyEvent e) {
isDataValid();
}
});
addField(_editorDirThumbnailLocation);
}
}
// !!! set layout after the editor was created because the editor sets the parents layout
GridLayoutFactory.swtDefaults().numColumns(3).applyTo(group);
}