當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。