本文整理汇总了Java中org.eclipse.jface.preference.BooleanFieldEditor.getBooleanValue方法的典型用法代码示例。如果您正苦于以下问题:Java BooleanFieldEditor.getBooleanValue方法的具体用法?Java BooleanFieldEditor.getBooleanValue怎么用?Java BooleanFieldEditor.getBooleanValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.jface.preference.BooleanFieldEditor
的用法示例。
在下文中一共展示了BooleanFieldEditor.getBooleanValue方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: propertyChange
import org.eclipse.jface.preference.BooleanFieldEditor; //导入方法依赖的package包/类
/**
* This overrides the method in {@link FieldEditorPreferencePage}.
* It disables the parse spec on spec module modify if the parse
* module on modify option is de-selected and enables it when parse
* module on modify is selected.
*/
public void propertyChange(PropertyChangeEvent event)
{
if (event.getSource() instanceof BooleanFieldEditor)
{
BooleanFieldEditor parseModuleOnModifyField = (BooleanFieldEditor) event.getSource();
if (parseModuleOnModifyField.getPreferenceName().equals(IPreferenceConstants.I_PARSE_MODULE_ON_MODIFY))
{
boolean parseModuleOnModify = parseModuleOnModifyField.getBooleanValue();
if (parseModuleOnModify)
{
parseSpecField.setEnabled(true, getFieldEditorParent());
} else
{
parseSpecField.setEnabled(false, getFieldEditorParent());
}
}
}
super.propertyChange(event);
}
示例2: updateFieldEditors
import org.eclipse.jface.preference.BooleanFieldEditor; //导入方法依赖的package包/类
@Override
protected void updateFieldEditors() {
super.updateFieldEditors();
// update editor states if needed
if (this.isPageEnabled()) {
Composite parent = this.getFieldEditorParent();
BooleanFieldEditor bundle = this.getField(Preferences.BUNDLE(DEFAULT_PROFILE_NAME));
StringFieldEditor bundlesDirectory = this.getField(Preferences.BUNDLES_DIRECTORY(DEFAULT_PROFILE_NAME));
ComboFieldEditor module = this.getField(Preferences.MODULE_KIND(DEFAULT_PROFILE_NAME));
if (bundle.getBooleanValue()) {
getPreferenceStore().setValue(Preferences.MODULE_KIND(currentProfile), "none");
module.load();
}
module.setEnabled(!bundle.getBooleanValue(), parent);
bundlesDirectory.setEnabled(bundle.getBooleanValue(), parent);
BooleanFieldEditor declaration = this.getField(Preferences.DECLARATION(DEFAULT_PROFILE_NAME));
StringFieldEditor declarationDirectory = this
.getField(Preferences.DECLARATION_DIRECTORY(DEFAULT_PROFILE_NAME));
declarationDirectory.setEnabled(declaration.getBooleanValue(), parent);
}
}
示例3: propertyChange
import org.eclipse.jface.preference.BooleanFieldEditor; //导入方法依赖的package包/类
@Override
public final void propertyChange(final PropertyChangeEvent event)
{
final Object eventSource = event.getSource();
if (eventSource instanceof BooleanFieldEditor)
{
final BooleanFieldEditor featureEnabledEditor = (BooleanFieldEditor) eventSource;
if (this.controlMapping.keySet().contains(featureEnabledEditor))
{
final boolean featureEnabled = featureEnabledEditor.getBooleanValue();
for (FieldEditor fieldEditor : this.controlMapping.get(featureEnabledEditor))
{
fieldEditor.setEnabled(featureEnabled, getFieldEditorParent());
}
}
}
// Updated the apply button in every case because the property change
// can be caused by a changed string or path value
this.updateApplyButton();
}
示例4: isValid
import org.eclipse.jface.preference.BooleanFieldEditor; //导入方法依赖的package包/类
@Override
public final boolean isValid()
{
// Search for enabled features wit invalid configuration options
for (BooleanFieldEditor featureEnabledEditor : this.controlMapping.keySet())
{
if (featureEnabledEditor.getBooleanValue() == true)
{
for (FieldEditor fieldEditor : this.controlMapping.get(featureEnabledEditor))
{
if (fieldEditor.isValid() == false)
{
return false;
}
}
}
}
return true;
}
示例5: updateChildrenStatus
import org.eclipse.jface.preference.BooleanFieldEditor; //导入方法依赖的package包/类
protected void updateChildrenStatus(final IPreference childPreference, final Boolean parentEnabled) {
final FieldEditorWrapper childFieldEditor = fieldEditorMap.get(childPreference);
updateChildStatus(childFieldEditor, parentEnabled);
// Recurse descendants...
if (childFieldEditor != null && childFieldEditor.getFieldEditor() instanceof BooleanFieldEditor) {
final BooleanFieldEditor childBooleanFieldEditor = (BooleanFieldEditor) childFieldEditor.getFieldEditor();
for (final IPreference descendantPreference : childPreference.getChildren()) { // Exit condition
final boolean childEnabled = childBooleanFieldEditor.getBooleanValue();
updateChildrenStatus(descendantPreference, childEnabled && parentEnabled);
}
}
}
示例6: 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);
}
}
示例7: 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;
}