本文整理汇总了Java中org.eclipse.core.runtime.preferences.IEclipsePreferences.getBoolean方法的典型用法代码示例。如果您正苦于以下问题:Java IEclipsePreferences.getBoolean方法的具体用法?Java IEclipsePreferences.getBoolean怎么用?Java IEclipsePreferences.getBoolean使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.core.runtime.preferences.IEclipsePreferences
的用法示例。
在下文中一共展示了IEclipsePreferences.getBoolean方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getDefault
import org.eclipse.core.runtime.preferences.IEclipsePreferences; //导入方法依赖的package包/类
/**
* Does its best at determining the default value for the given key. Checks
* the given object's type and then looks in the list of defaults to see if
* a value exists. If not or if there is a problem converting the value, the
* default default value for that type is returned.
*
* @param key
* the key to search
* @param object
* the object who default we are looking for
* @return Object or <code>null</code>
*/
Object getDefault(final String key, final Object object) {
final IEclipsePreferences defaults = getDefaultPreferences();
if (object instanceof String) {
return defaults.get(key, STRING_DEFAULT_DEFAULT);
} else if (object instanceof Integer) {
return Integer.valueOf(defaults.getInt(key, INT_DEFAULT_DEFAULT));
} else if (object instanceof Double) {
return new Double(defaults.getDouble(key, DOUBLE_DEFAULT_DEFAULT));
} else if (object instanceof Float) {
return new Float(defaults.getFloat(key, FLOAT_DEFAULT_DEFAULT));
} else if (object instanceof Long) {
return Long.valueOf(defaults.getLong(key, LONG_DEFAULT_DEFAULT));
} else if (object instanceof Boolean) {
return defaults.getBoolean(key, BOOLEAN_DEFAULT_DEFAULT) ? Boolean.TRUE : Boolean.FALSE;
} else {
return null;
}
}
示例2: getDefault
import org.eclipse.core.runtime.preferences.IEclipsePreferences; //导入方法依赖的package包/类
/**
* Does its best at determining the default value for the given key. Checks
* the given object's type and then looks in the list of defaults to see if
* a value exists. If not or if there is a problem converting the value, the
* default default value for that type is returned.
*
* @param key
* the key to search
* @param obj
* the object who default we are looking for
* @return Object or <code>null</code>
*/
Object getDefault(String key, Object obj) {
IEclipsePreferences defaults = getDefaultPreferences();
if (obj instanceof String) {
return defaults.get(key, STRING_DEFAULT_DEFAULT);
} else if (obj instanceof Integer) {
return new Integer(defaults.getInt(key, INT_DEFAULT_DEFAULT));
} else if (obj instanceof Double) {
return new Double(defaults.getDouble(key, DOUBLE_DEFAULT_DEFAULT));
} else if (obj instanceof Float) {
return new Float(defaults.getFloat(key, FLOAT_DEFAULT_DEFAULT));
} else if (obj instanceof Long) {
return new Long(defaults.getLong(key, LONG_DEFAULT_DEFAULT));
} else if (obj instanceof Boolean) {
return defaults.getBoolean(key, BOOLEAN_DEFAULT_DEFAULT) ? Boolean.TRUE
: Boolean.FALSE;
} else {
return null;
}
}
示例3: getHoverInfo
import org.eclipse.core.runtime.preferences.IEclipsePreferences; //导入方法依赖的package包/类
public IInformationControlCreatorProvider getHoverInfo(final EObject object, final ITextViewer viewer, final IRegion region)
{
boolean showHover = true;
try {
IEclipsePreferences defaultNode = DefaultScope.INSTANCE.getNode("org.bbaw.bts.ui.corpus.egy");
IEclipsePreferences instanceNode = InstanceScope.INSTANCE.getNode("org.bbaw.bts.ui.corpus.egy");
showHover = instanceNode.getBoolean(BTSEGYUIConstants.PREF_TRANSLITERATION_EDITOR_ACTIVATE_HOVER_INFO,
defaultNode.getBoolean(BTSEGYUIConstants.PREF_TRANSLITERATION_EDITOR_ACTIVATE_HOVER_INFO, true));
} catch (Exception e) {
}
if (showHover)
{
return super.getHoverInfo(object, viewer, region);
}
return null;
}
示例4: getDefault
import org.eclipse.core.runtime.preferences.IEclipsePreferences; //导入方法依赖的package包/类
/**
* Does its best at determining the default value for the given key. Checks
* the given object's type and then looks in the list of defaults to see if
* a value exists. If not or if there is a problem converting the value, the
* default default value for that type is returned.
*
* @param key
* the key to search
* @param obj
* the object who default we are looking for
* @return Object or <code>null</code>
*/
Object getDefault(String key, Object obj) {
IEclipsePreferences defaults = getDefaultPreferences();
if (obj instanceof String) {
return defaults.get(key, STRING_DEFAULT_DEFAULT);
} else if (obj instanceof Integer) {
return Integer.valueOf(defaults.getInt(key, INT_DEFAULT_DEFAULT));
} else if (obj instanceof Double) {
return Double.valueOf(defaults.getDouble(key, DOUBLE_DEFAULT_DEFAULT));
} else if (obj instanceof Float) {
return Float.valueOf(defaults.getFloat(key, FLOAT_DEFAULT_DEFAULT));
} else if (obj instanceof Long) {
return Long.valueOf(defaults.getLong(key, LONG_DEFAULT_DEFAULT));
} else if (obj instanceof Boolean) {
return defaults.getBoolean(key, BOOLEAN_DEFAULT_DEFAULT) ? Boolean.TRUE : Boolean.FALSE;
} else {
return null;
}
}
示例5: hasChangesInDialog
import org.eclipse.core.runtime.preferences.IEclipsePreferences; //导入方法依赖的package包/类
public boolean hasChangesInDialog() {
String currSettings = getEncodedSettings();
boolean b = !currSettings.equals(oldMappings);
if(b){
return true;
}
IEclipsePreferences preferences = getPreferences(false);
boolean useCurrentDate = preferences.getBoolean(
ProjectProperties.KEY_USE_CURRENT_DATE, false);
boolean useCurrentDateNew = useCurrentDateField.isSelected();
if (useCurrentDateNew != useCurrentDate){
return true;
}
boolean includeTeamFiles = preferences.getBoolean(
ProjectProperties.KEY_INCLUDE_TEAM_PRIVATE, false);
boolean includeTeamFilesNew = includeTeamFilesField.isSelected();
if (includeTeamFiles != includeTeamFilesNew){
return true;
}
return false;
}
示例6: setProjectProps
import org.eclipse.core.runtime.preferences.IEclipsePreferences; //导入方法依赖的package包/类
public void setProjectProps(ProjectProperties props) throws IllegalArgumentException {
projectProps = props;
mappings = props.getMappings();
if (mappings == null || mappings.length == 0) {
throw new IllegalArgumentException("FileSync mapping is missing."
+ " Don't panic, simply call your project owner.");
}
IEclipsePreferences preferences = props.getPreferences(false);
String root = preferences.get(ProjectProperties.KEY_DEFAULT_DESTINATION, "");
PathVariableHelper pvh = new PathVariableHelper();
IPath projectPath = props.getProject().getLocation();
rootPath = pvh.resolveVariable(root, projectPath);
if ((rootPath == null || rootPath.isEmpty()) && usesDefaultOutputFolder()) {
throw new IllegalArgumentException("Default target folder is required"
+ " by one of mappings but not specified in properties!");
}
setDeleteDestinationOnCleanBuild(preferences.getBoolean(
ProjectProperties.KEY_CLEAN_ON_CLEAN_BUILD, false));
useCurrentDateForDestinationFiles = preferences.getBoolean(
ProjectProperties.KEY_USE_CURRENT_DATE, false);
}
示例7: execute
import org.eclipse.core.runtime.preferences.IEclipsePreferences; //导入方法依赖的package包/类
public Object execute(ExecutionEvent event) throws ExecutionException
{
FindBarDecorator dec = findBarDecorator.get();
if (dec != null)
{
IEclipsePreferences preferenceStore = EclipseUtil.instanceScope().getNode(FindBarPlugin.PLUGIN_ID);
boolean openEclipseFindBar = preferenceStore.getBoolean(
IPreferencesConstants.CTRL_F_TWICE_OPENS_ECLIPSE_FIND_BAR, false);
if (openEclipseFindBar)
{
dec.showFindReplaceDialog();
}
else
{
dec.textFind.setFocus();
dec.textFind.setSelection(new Point(0, dec.textFind.getText().length()));
}
}
return null;
}
示例8: setTabSpaceCombo
import org.eclipse.core.runtime.preferences.IEclipsePreferences; //导入方法依赖的package包/类
private void setTabSpaceCombo()
{
IEclipsePreferences store = getPluginPreferenceStore();
if (store.getBoolean(IPreferenceConstants.USE_GLOBAL_DEFAULTS, false))
{
tabSpaceCombo.setText(Messages.CommonEditorPreferencePage_UseDefaultOption);
}
else
{
boolean useSpaces = store.getBoolean(AbstractDecoratedTextEditorPreferenceConstants.EDITOR_SPACES_FOR_TABS,
true);
tabSpaceCombo.setText(useSpaces ? Messages.CommonEditorPreferencePage_UseSpacesOption
: Messages.CommonEditorPreferencePage_UseTabOption);
}
}
示例9: YuiJsMinifier
import org.eclipse.core.runtime.preferences.IEclipsePreferences; //导入方法依赖的package包/类
public YuiJsMinifier(MinifyBuilder builder, IFile srcFile, IFile destFile,
OutputStream out, IEclipsePreferences prefs)
throws IOException, CoreException {
super (builder);
preserveSemicolons = prefs.getBoolean(
PrefsAccess.preferenceKey(srcFile, MinifyBuilder.YUI_PRESERVE_SEMICOLONS), true);
disableOptimizations = prefs.getBoolean(
PrefsAccess.preferenceKey(srcFile, MinifyBuilder.YUI_DISABLE_OPTIMIZATIONS), true);
outCharset = destFile.exists() ? destFile.getCharset() : srcFile.getCharset();
writer = new OutputStreamWriter(out, outCharset);
compressor = new JavaScriptCompressor(new BufferedReader(
new InputStreamReader(srcFile.getContents(), srcFile.getCharset())),
new YuiMinifier.MinifyErrorHandler(srcFile));
}
示例10: getEventValue
import org.eclipse.core.runtime.preferences.IEclipsePreferences; //导入方法依赖的package包/类
public String getEventValue() {
Bundle bundle = Platform.getBundle(PLUGIN_ID.THIS);
if (bundle == null) {
return NOT_INSTALLED;
}
IEclipsePreferences prefs = InstanceScope.INSTANCE.getNode(PLUGIN_ID.THIS);
boolean showOnStartup = prefs.getBoolean(SHOW_BOX_ON_STARTUP, true);
if (showOnStartup) {
return TRUE;
}
return FALSE;
}
示例11: DeployPreferences
import org.eclipse.core.runtime.preferences.IEclipsePreferences; //导入方法依赖的package包/类
protected DeployPreferences(IEclipsePreferences preferenceStore) {
this.preferenceStore = preferenceStore;
accountEmail = preferenceStore.get(PREF_ACCOUNT_EMAIL, DEFAULT_ACCOUNT_EMAIL);
projectId = preferenceStore.get(PREF_PROJECT_ID, DEFAULT_PROJECT_ID);
version = preferenceStore.get(PREF_CUSTOM_VERSION, DEFAULT_CUSTOM_VERSION);
autoPromote = preferenceStore.getBoolean(PREF_ENABLE_AUTO_PROMOTE, DEFAULT_ENABLE_AUTO_PROMOTE);
includeOptionalConfigurationFiles = preferenceStore.getBoolean(
PREF_INCLUDE_OPTIONAL_CONFIGURATION_FILES, DEFAULT_INCLUDE_OPTIONAL_CONFIGURATION_FILES);
bucket = preferenceStore.get(PREF_CUSTOM_BUCKET, DEFAULT_CUSTOM_BUCKET);
stopPreviousVersion = preferenceStore.getBoolean(
PREF_STOP_PREVIOUS_VERSION, DEFAULT_STOP_PREVIOUS_VERSION);
}
示例12: disableProjectNatureSolutionLookup
import org.eclipse.core.runtime.preferences.IEclipsePreferences; //导入方法依赖的package包/类
/**
* In oxygen there is an nature solution lookup feature that causes a dialog to open for each imported project.
* We disable it since it's not a very useful feature.
*
* @return
*/
private boolean disableProjectNatureSolutionLookup()
{
IEclipsePreferences prefs = InstanceScope.INSTANCE.getNode(ORG_ECLIPSE_EPP_MPC_UI_PREFS);
boolean val = prefs.getBoolean(ORG_ECLIPSE_EPP_MPC_NATURELOOKUP, true);
prefs.putBoolean(ORG_ECLIPSE_EPP_MPC_NATURELOOKUP, false);
try {
prefs.flush();
} catch (BackingStoreException e) {
throw new IllegalStateException(e);
}
return val;
}
示例13: WorkspaceDescription
import org.eclipse.core.runtime.preferences.IEclipsePreferences; //导入方法依赖的package包/类
public WorkspaceDescription(String name) {
super(name);
// initialize based on the values in the default preferences
IEclipsePreferences node = DefaultScope.INSTANCE.getNode(ResourcesPlugin.PI_RESOURCES);
autoBuilding =
node.getBoolean(
ResourcesPlugin.PREF_AUTO_BUILDING, PreferenceInitializer.PREF_AUTO_BUILDING_DEFAULT);
maxBuildIterations =
node.getInt(
ResourcesPlugin.PREF_MAX_BUILD_ITERATIONS,
PreferenceInitializer.PREF_MAX_BUILD_ITERATIONS_DEFAULT);
applyFileStatePolicy =
node.getBoolean(
ResourcesPlugin.PREF_APPLY_FILE_STATE_POLICY,
PreferenceInitializer.PREF_APPLY_FILE_STATE_POLICY_DEFAULT);
fileStateLongevity =
node.getLong(
ResourcesPlugin.PREF_FILE_STATE_LONGEVITY,
PreferenceInitializer.PREF_FILE_STATE_LONGEVITY_DEFAULT);
maxFileStates =
node.getInt(
ResourcesPlugin.PREF_MAX_FILE_STATES,
PreferenceInitializer.PREF_MAX_FILE_STATES_DEFAULT);
maxFileStateSize =
node.getLong(
ResourcesPlugin.PREF_MAX_FILE_STATE_SIZE,
PreferenceInitializer.PREF_MAX_FILE_STATE_SIZE_DEFAULT);
snapshotInterval =
node.getLong(
ResourcesPlugin.PREF_SNAPSHOT_INTERVAL,
PreferenceInitializer.PREF_SNAPSHOT_INTERVAL_DEFAULT);
operationsPerSnapshot =
node.getInt(
PreferenceInitializer.PREF_OPERATIONS_PER_SNAPSHOT,
PreferenceInitializer.PREF_OPERATIONS_PER_SNAPSHOT_DEFAULT);
deltaExpiration =
node.getLong(
PreferenceInitializer.PREF_DELTA_EXPIRATION,
PreferenceInitializer.PREF_DELTA_EXPIRATION_DEFAULT);
}
示例14: performDefaultsForSyntaxValidationGroup
import org.eclipse.core.runtime.preferences.IEclipsePreferences; //导入方法依赖的package包/类
protected void performDefaultsForSyntaxValidationGroup() {
IEclipsePreferences modelPreferences = new DefaultScope()
.getNode(getPreferenceNodeQualifier());
boolean useExtendedSyntaxValidation = modelPreferences.getBoolean(
JSONCorePreferenceNames.SYNTAX_VALIDATION, false);
if (fExtendedSyntaxValidation != null) {
if (fExtendedSyntaxValidation.getSelection() != useExtendedSyntaxValidation) {
handleSyntaxSeveritySelection(useExtendedSyntaxValidation);
}
fExtendedSyntaxValidation.setSelection(useExtendedSyntaxValidation);
}
}
示例15: loadBoolPref
import org.eclipse.core.runtime.preferences.IEclipsePreferences; //导入方法依赖的package包/类
protected boolean loadBoolPref(String key, boolean defaultValue) {
IEclipsePreferences node = InstanceScope.INSTANCE.getNode(PrefEditorPlugin.PLUGIN_ID);
return node.getBoolean(key, defaultValue);
}