当前位置: 首页>>代码示例>>Java>>正文


Java IEclipsePreferences.getBoolean方法代码示例

本文整理汇总了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;
  }
}
 
开发者ID:dsldevkit,项目名称:dsl-devkit,代码行数:31,代码来源:ValidPreferenceStore.java

示例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;
	}
}
 
开发者ID:cplutte,项目名称:bts,代码行数:32,代码来源:ScopedPreferenceStore.java

示例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;
	
}
 
开发者ID:cplutte,项目名称:bts,代码行数:18,代码来源:BTSEObjectHover.java

示例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;
	}
}
 
开发者ID:cplutte,项目名称:bts,代码行数:31,代码来源:FixedScopedPreferenceStore.java

示例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;
}
 
开发者ID:iloveeclipse,项目名称:filesync4eclipse,代码行数:26,代码来源:ProjectSyncPropertyPage.java

示例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);
}
 
开发者ID:iloveeclipse,项目名称:filesync4eclipse,代码行数:25,代码来源:SyncWizard.java

示例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;
}
 
开发者ID:apicloudcom,项目名称:APICloud-Studio,代码行数:22,代码来源:FindBarActions.java

示例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);
	}
}
 
开发者ID:apicloudcom,项目名称:APICloud-Studio,代码行数:17,代码来源:CommonEditorPreferencePage.java

示例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));
}
 
开发者ID:mnlipp,项目名称:EclipseMinifyBuilder,代码行数:15,代码来源:YuiJsMinifier.java

示例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;
}
 
开发者ID:pgcodekeeper,项目名称:pgcodekeeper,代码行数:13,代码来源:EclipseEnvironment.java

示例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);
}
 
开发者ID:GoogleCloudPlatform,项目名称:google-cloud-eclipse,代码行数:14,代码来源:DeployPreferences.java

示例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;
}
 
开发者ID:SAP,项目名称:hybris-commerce-eclipse-plugin,代码行数:19,代码来源:Activator.java

示例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);
}
 
开发者ID:eclipse,项目名称:che,代码行数:41,代码来源:WorkspaceDescription.java

示例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);
	}
}
 
开发者ID:angelozerr,项目名称:eclipse-wtp-json,代码行数:14,代码来源:JSONValidatorPreferencePage.java

示例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);
}
 
开发者ID:32kda,项目名称:com.onpositive.prefeditor,代码行数:5,代码来源:PreferenceView.java


注:本文中的org.eclipse.core.runtime.preferences.IEclipsePreferences.getBoolean方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。