本文整理匯總了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;
}