本文整理汇总了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);
}
}
示例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();
}
示例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$
}
}
}
示例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));
}
}
示例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;
}
示例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);
}
}
}
}
示例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$
}
}
示例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$
}
}
示例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();
}
示例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);
}
示例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();
}
示例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);
}
}
示例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);
}
}
示例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;
}
示例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();
}
}