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


Java IEclipsePreferences.remove方法代码示例

本文整理汇总了Java中org.eclipse.core.runtime.preferences.IEclipsePreferences.remove方法的典型用法代码示例。如果您正苦于以下问题:Java IEclipsePreferences.remove方法的具体用法?Java IEclipsePreferences.remove怎么用?Java IEclipsePreferences.remove使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.eclipse.core.runtime.preferences.IEclipsePreferences的用法示例。


在下文中一共展示了IEclipsePreferences.remove方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: removePluginDefaults

import org.eclipse.core.runtime.preferences.IEclipsePreferences; //导入方法依赖的package包/类
/**
 * This method removes the spaces for tabs and tab width preferences from the default scope of the plugin preference
 * store.
 */
protected void removePluginDefaults()
{
	IEclipsePreferences store = getDefaultPluginPreferenceStore();
	if (store == null)
	{
		return;
	}

	store.remove(AbstractDecoratedTextEditorPreferenceConstants.EDITOR_SPACES_FOR_TABS);
	store.remove(AbstractDecoratedTextEditorPreferenceConstants.EDITOR_TAB_WIDTH);
	try
	{
		store.flush();
	}
	catch (BackingStoreException e)
	{
		IdeLog.logError(CommonEditorPlugin.getDefault(), e);
	}
}
 
开发者ID:apicloudcom,项目名称:APICloud-Studio,代码行数:24,代码来源:CommonEditorPreferencePage.java

示例2: restoreDefaults

import org.eclipse.core.runtime.preferences.IEclipsePreferences; //导入方法依赖的package包/类
@Override
public void restoreDefaults()
{
	// Wipe the user prefs for the problem severities
	IEclipsePreferences prefs = EclipseUtil.instanceScope().getNode(getPreferenceNode());
	for (ProblemType type : ProblemType.values())
	{
		prefs.remove(type.getPrefKey());
	}
	try
	{
		prefs.flush();
	}
	catch (BackingStoreException e)
	{
		IdeLog.logError(BuildPathCorePlugin.getDefault(), e);
	}
	// Let super class handle cleaning up enablement and filters
	super.restoreDefaults();
}
 
开发者ID:apicloudcom,项目名称:APICloud-Studio,代码行数:21,代码来源:HTMLTidyValidator.java

示例3: remove

import org.eclipse.core.runtime.preferences.IEclipsePreferences; //导入方法依赖的package包/类
protected synchronized void remove(IServer server) {
	dataByServer.remove(server);

	String serverId = server.getAttribute(DockerFoundryServer.PROP_SERVER_ID, (String) null);
	if (serverId != null) {
		IEclipsePreferences node = new InstanceScope().getNode(DockerFoundryPlugin.PLUGIN_ID);
		node.remove(KEY_MODULE_MAPPING_LIST + ":" + serverId); //$NON-NLS-1$
		try {
			node.flush();
		}
		catch (BackingStoreException e) {
			DockerFoundryPlugin
					.getDefault()
					.getLog()
					.log(new Status(IStatus.ERROR, DockerFoundryPlugin.PLUGIN_ID,
							"Failed to remove application mappings", e)); //$NON-NLS-1$
		}
	}
}
 
开发者ID:osswangxining,项目名称:dockerfoundry,代码行数:20,代码来源:ModuleCache.java

示例4: setOrganizeImportSettings

import org.eclipse.core.runtime.preferences.IEclipsePreferences; //导入方法依赖的package包/类
protected void setOrganizeImportSettings(
    String[] order, int threshold, int staticThreshold, IJavaProject project) {
  IEclipsePreferences scope =
      new ProjectScope(project.getProject()).getNode("org.eclipse.jdt.ui");
  if (order == null) {
    scope.remove(PreferenceConstants.ORGIMPORTS_IMPORTORDER);
    scope.remove(PreferenceConstants.ORGIMPORTS_ONDEMANDTHRESHOLD);
  } else {
    StringBuffer buf = new StringBuffer();
    for (int i = 0; i < order.length; i++) {
      buf.append(order[i]);
      buf.append(';');
    }
    scope.put(PreferenceConstants.ORGIMPORTS_IMPORTORDER, buf.toString());
    scope.put(PreferenceConstants.ORGIMPORTS_ONDEMANDTHRESHOLD, String.valueOf(threshold));
    scope.put(
        PreferenceConstants.ORGIMPORTS_STATIC_ONDEMANDTHRESHOLD, String.valueOf(staticThreshold));
  }
}
 
开发者ID:eclipse,项目名称:che,代码行数:20,代码来源:ImportOrganizeTest.java

示例5: setPreferenceShellPath

import org.eclipse.core.runtime.preferences.IEclipsePreferences; //导入方法依赖的package包/类
public static void setPreferenceShellPath(IPath path)
{
	IEclipsePreferences prefs = EclipseUtil.instanceScope().getNode(CorePlugin.PLUGIN_ID);
	if (path != null)
	{
		prefs.put(ICorePreferenceConstants.PREF_SHELL_EXECUTABLE_PATH, path.toOSString());
	}
	else
	{
		prefs.remove(ICorePreferenceConstants.PREF_SHELL_EXECUTABLE_PATH);
	}
	try
	{
		prefs.flush();
	}
	catch (BackingStoreException e)
	{
		IdeLog.logError(CorePlugin.getDefault(), "Saving preferences failed.", e); //$NON-NLS-1$
	}
	shellPath = null;
	shellEnvironment = null;
}
 
开发者ID:apicloudcom,项目名称:APICloud-Studio,代码行数:23,代码来源:ShellExecutable.java

示例6: migratePreference

import org.eclipse.core.runtime.preferences.IEclipsePreferences; //导入方法依赖的package包/类
/**
 * Migrate the existing preferences from instance scope to configuration scope and then remove the preference key
 * from the instance scope.
 */
public static void migratePreference(String pluginId, String preferenceKey)
{
	IEclipsePreferences configNode = EclipseUtil.configurationScope().getNode(pluginId);
	if (StringUtil.isEmpty(configNode.get(preferenceKey, null))) // no value in config scope
	{
		IEclipsePreferences instanceNode = EclipseUtil.instanceScope().getNode(pluginId);
		String instancePrefValue = instanceNode.get(preferenceKey, null);
		if (!StringUtil.isEmpty(instancePrefValue))
		{
			// only migrate if there is a value!
			configNode.put(preferenceKey, instancePrefValue);
			instanceNode.remove(preferenceKey);
			try
			{
				configNode.flush();
				instanceNode.flush();
			}
			catch (BackingStoreException e)
			{
				IdeLog.logWarning(CorePlugin.getDefault(), e.getMessage(), e);
			}
		}
	}
}
 
开发者ID:apicloudcom,项目名称:APICloud-Studio,代码行数:29,代码来源:EclipseUtil.java

示例7: setSemanticToken

import org.eclipse.core.runtime.preferences.IEclipsePreferences; //导入方法依赖的package包/类
protected void setSemanticToken(IEclipsePreferences prefs, Theme theme, String ourTokenType, String jdtToken,
		boolean revertToDefaults)
{
	String prefix = "semanticHighlighting."; //$NON-NLS-1$
	jdtToken = prefix + jdtToken;
	if (revertToDefaults)
	{
		prefs.remove(jdtToken + ".color"); //$NON-NLS-1$
		prefs.remove(jdtToken + ".bold"); //$NON-NLS-1$
		prefs.remove(jdtToken + ".italic"); //$NON-NLS-1$
		prefs.remove(jdtToken + ".underline"); //$NON-NLS-1$
		prefs.remove(jdtToken + ".strikethrough"); //$NON-NLS-1$
		prefs.remove(jdtToken + ".enabled"); //$NON-NLS-1$
	}
	else
	{
		TextAttribute attr = theme.getTextAttribute(ourTokenType);
		prefs.put(jdtToken + ".color", StringConverter.asString(attr.getForeground().getRGB())); //$NON-NLS-1$
		prefs.putBoolean(jdtToken + ".bold", (attr.getStyle() & SWT.BOLD) != 0); //$NON-NLS-1$
		prefs.putBoolean(jdtToken + ".italic", (attr.getStyle() & SWT.ITALIC) != 0); //$NON-NLS-1$
		prefs.putBoolean(jdtToken + ".underline", (attr.getStyle() & TextAttribute.UNDERLINE) != 0); //$NON-NLS-1$
		prefs.putBoolean(jdtToken + ".strikethrough", (attr.getStyle() & TextAttribute.STRIKETHROUGH) != 0); //$NON-NLS-1$
		prefs.putBoolean(jdtToken + ".enabled", true); //$NON-NLS-1$
	}
}
 
开发者ID:apicloudcom,项目名称:APICloud-Studio,代码行数:26,代码来源:InvasiveThemeHijacker.java

示例8: setToken

import org.eclipse.core.runtime.preferences.IEclipsePreferences; //导入方法依赖的package包/类
protected void setToken(IEclipsePreferences prefs, Theme theme, String ourTokenType, String jdtToken,
		boolean revertToDefaults)
{
	if (revertToDefaults)
	{
		prefs.remove(jdtToken);
		prefs.remove(jdtToken + "_bold"); //$NON-NLS-1$
		prefs.remove(jdtToken + "_italic"); //$NON-NLS-1$
		prefs.remove(jdtToken + "_underline"); //$NON-NLS-1$
		prefs.remove(jdtToken + "_strikethrough"); //$NON-NLS-1$
	}
	else
	{
		TextAttribute attr = theme.getTextAttribute(ourTokenType);
		prefs.put(jdtToken, StringConverter.asString(attr.getForeground().getRGB()));
		prefs.putBoolean(jdtToken + "_bold", (attr.getStyle() & SWT.BOLD) != 0); //$NON-NLS-1$
		prefs.putBoolean(jdtToken + "_italic", (attr.getStyle() & SWT.ITALIC) != 0); //$NON-NLS-1$
		prefs.putBoolean(jdtToken + "_underline", (attr.getStyle() & TextAttribute.UNDERLINE) != 0); //$NON-NLS-1$
		prefs.putBoolean(jdtToken + "_strikethrough", (attr.getStyle() & TextAttribute.STRIKETHROUGH) != 0); //$NON-NLS-1$
	}
}
 
开发者ID:apicloudcom,项目名称:APICloud-Studio,代码行数:22,代码来源:InvasiveThemeHijacker.java

示例9: remove

import org.eclipse.core.runtime.preferences.IEclipsePreferences; //导入方法依赖的package包/类
/**
 * Remove preferences for the passed project
 * 
 * @param project
 * @param values
 * @throws BackingStoreException
 */
public static void remove(IProject project, String[] values) throws BackingStoreException {
	IEclipsePreferences projectPreferences = getProjectPreference(project);
	for (int i = 0; i < values.length; i++) {
		projectPreferences.remove(values[i]);
	}
	projectPreferences.flush();
}
 
开发者ID:gw4e,项目名称:gw4e.project,代码行数:15,代码来源:SettingsManager.java

示例10: remove

import org.eclipse.core.runtime.preferences.IEclipsePreferences; //导入方法依赖的package包/类
@Override
public void remove(KeyValue keyValue) {
	String parentCategory = keyValue.getParentNode();	
	IEclipsePreferences node = getNode(parentCategory);
	if (node == null) {
		PrefEditorPlugin.log("Node " + parentCategory + " can't be obtained");
		return;
	}
	node.remove(keyValue.getKey());
	flush(node);
}
 
开发者ID:32kda,项目名称:com.onpositive.prefeditor,代码行数:12,代码来源:PlatformPreferenceProvider.java

示例11: setValue

import org.eclipse.core.runtime.preferences.IEclipsePreferences; //导入方法依赖的package包/类
private void setValue(IProject project, String propertyValue) {
	/*
	 * On fait l'action dans un job asynchrone pour éviter une ResourceException: The resource tree is locked for modifications
	 */

	Job job = new Job("KspPreferenceSaving") {

		@Override
		protected IStatus run(IProgressMonitor monitor) {
			IEclipsePreferences node = getProjectPluginNode(project);
			if (node == null) {
				LogUtils.info("Set " + propertyName + " : node null !");
				return Status.OK_STATUS;
			}
			if (VertigoStringUtils.isEmpty(propertyValue)) {
				node.remove(propertyName);
			} else {
				node.put(propertyName, propertyValue);
			}

			try {
				node.flush();
			} catch (BackingStoreException e) {
				ErrorUtils.handle(e);
			}
			return Status.OK_STATUS;
		}
	};

	job.setPriority(Job.SHORT);
	job.schedule();
}
 
开发者ID:sebez,项目名称:vertigo-chroma-kspplugin,代码行数:33,代码来源:PropertyUtils.java

示例12: convertAbsoluteToRelative

import org.eclipse.core.runtime.preferences.IEclipsePreferences; //导入方法依赖的package包/类
private static void convertAbsoluteToRelative(final IEclipsePreferences projectPrefs, final String path) {
	projectPrefs.remove(IPreferenceConstants.P_PROJECT_ROOT_FILE);
	projectPrefs.put(IPreferenceConstants.P_PROJECT_ROOT_FILE, path);
	try {
		projectPrefs.flush();
		projectPrefs.sync();
	} catch (BackingStoreException notExpectedToHappen) {
		Activator.getDefault().logError(
				"Failed to store rewritten absolute to relative root file name: " + path,
				notExpectedToHappen);
	}
}
 
开发者ID:tlaplus,项目名称:tlaplus,代码行数:13,代码来源:PreferenceStoreHelper.java

示例13: clearActivation

import org.eclipse.core.runtime.preferences.IEclipsePreferences; //导入方法依赖的package包/类
public void clearActivation() {

		IEclipsePreferences prefs = new ConfigurationScope()
				.getNode(GUIEditorPlugin.PLUGIN_ID);

		prefs.remove(USER_ID_PROP_NAME);
		prefs.remove(ACTIVATION_V_PROP_NAME);
		try {
			prefs.flush();
		} catch (BackingStoreException e) {
			logError("Error resetting pres", e);
		}

	}
 
开发者ID:ShoukriKattan,项目名称:ForgedUI-Eclipse,代码行数:15,代码来源:ActivationService.java

示例14: storePreference

import org.eclipse.core.runtime.preferences.IEclipsePreferences; //导入方法依赖的package包/类
/**
 * Store the preferences value for the given option name.
 *
 * @param optionName The name of the option
 * @param optionValue The value of the option. If <code>null</code>, then the option will be
 *     removed from the preferences instead.
 * @param eclipsePreferences The eclipse preferences to be updated
 * @param otherOptions more options being stored, used to avoid conflict between deprecated option
 *     and its compatible
 * @return <code>true</code> if the preferences have been changed, <code>false</code> otherwise.
 */
public boolean storePreference(
    String optionName,
    String optionValue,
    IEclipsePreferences eclipsePreferences,
    Map otherOptions) {
  int optionLevel = this.getOptionLevel(optionName);
  if (optionLevel == UNKNOWN_OPTION) return false; // unrecognized option

  // Store option value
  switch (optionLevel) {
    case org.eclipse.jdt.internal.core.JavaModelManager.VALID_OPTION:
      if (optionValue == null) {
        eclipsePreferences.remove(optionName);
      } else {
        eclipsePreferences.put(optionName, optionValue);
      }
      break;
    case org.eclipse.jdt.internal.core.JavaModelManager.DEPRECATED_OPTION:
      // Try to migrate deprecated option
      eclipsePreferences.remove(optionName); // get rid off old preference
      String[] compatibleOptions = (String[]) this.deprecatedOptions.get(optionName);
      for (int co = 0, length = compatibleOptions.length; co < length; co++) {
        if (otherOptions != null && otherOptions.containsKey(compatibleOptions[co]))
          continue; // don't overwrite explicit value of otherOptions at compatibleOptions[co]
        if (optionValue == null) {
          eclipsePreferences.remove(compatibleOptions[co]);
        } else {
          eclipsePreferences.put(compatibleOptions[co], optionValue);
        }
      }
      break;
    default:
      return false;
  }
  return true;
}
 
开发者ID:eclipse,项目名称:che,代码行数:48,代码来源:JavaModelManager.java

示例15: setGwtMavenModuleShortName

import org.eclipse.core.runtime.preferences.IEclipsePreferences; //导入方法依赖的package包/类
public static void setGwtMavenModuleShortName(IProject project, String gwtMavenModuleShortName)
    throws BackingStoreException {
  IEclipsePreferences prefs = getProjectProperties(project);
  if (gwtMavenModuleShortName == null) {
    try {
      prefs.remove(GWT_MAVEN_MODULE_SHORT_NAME);
    } catch (Exception e) {
      e.printStackTrace();
    }
  } else {
    prefs.put(GWT_MAVEN_MODULE_SHORT_NAME, gwtMavenModuleShortName);
    prefs.flush();
  }
}
 
开发者ID:gwt-plugins,项目名称:gwt-eclipse-plugin,代码行数:15,代码来源:WebAppProjectProperties.java


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