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


Java IEclipsePreferences.flush方法代码示例

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


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

示例1: save

import org.eclipse.core.runtime.preferences.IEclipsePreferences; //导入方法依赖的package包/类
@Override
public IStatus save() {
	try {
		final IEclipsePreferences node = InstanceScope.INSTANCE.getNode(QUALIFIER);
		for (final Entry<Binary, URI> entry : getOrCreateState().entrySet()) {
			final URI path = entry.getValue();
			if (null != path) {
				final File file = new File(path);
				if (file.isDirectory()) {
					node.put(entry.getKey().getId(), file.getAbsolutePath());
				}
			} else {
				// Set to default.
				node.put(entry.getKey().getId(), "");
			}
		}
		node.flush();
		return OK_STATUS;
	} catch (final BackingStoreException e) {
		final String message = "Unexpected error when trying to persist binary preferences.";
		LOGGER.error(message, e);
		return statusHelper.createError(message, e);
	}
}
 
开发者ID:eclipse,项目名称:n4js,代码行数:25,代码来源:OsgiBinariesPreferenceStore.java

示例2: save

import org.eclipse.core.runtime.preferences.IEclipsePreferences; //导入方法依赖的package包/类
@Override
public void save() throws BackingStoreException {
	// Save Themes in the
	// "${workspace_loc}/metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.tm4e.ui.prefs"
	String json = PreferenceHelper.toJsonThemes(
			Arrays.stream(getThemes()).filter(t -> t.getPluginId() == null).collect(Collectors.toList()));
	IEclipsePreferences prefs = InstanceScope.INSTANCE.getNode(TMUIPlugin.PLUGIN_ID);
	prefs.put(PreferenceConstants.THEMES, json);

	// Save Theme associations in the
	// "${workspace_loc}/metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.tm4e.ui.prefs"
	json = PreferenceHelper.toJsonThemeAssociations(Arrays.stream(getAllThemeAssociations())
			.filter(t -> t.getPluginId() == null).collect(Collectors.toList()));
	prefs.put(PreferenceConstants.THEME_ASSOCIATIONS, json);

	// Save preferences
	prefs.flush();
}
 
开发者ID:eclipse,项目名称:tm4e,代码行数:19,代码来源:ThemeManager.java

示例3: 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

示例4: 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

示例5: setFilePermissions

import org.eclipse.core.runtime.preferences.IEclipsePreferences; //导入方法依赖的package包/类
/**
 * Sets the specific permissions used for new files created when transferring.
 * 
 * @param permissions
 *            permissions in decimal form
 * @param direction
 *            indicates if this is for upload or download permissions
 */
public static void setFilePermissions(long permissions, PermissionDirection direction)
{
	IEclipsePreferences prefs = EclipseUtil.instanceScope().getNode(CoreIOPlugin.PLUGIN_ID);
	switch (direction)
	{
		case UPLOAD:
			prefs.putLong(IPreferenceConstants.UPLOAD_FILE_PERMISSION, permissions);
			break;
		case DOWNLOAD:
			prefs.putLong(IPreferenceConstants.DOWNLOAD_FILE_PERMISSION, permissions);
			break;
	}
	try
	{
		prefs.flush();
	}
	catch (BackingStoreException e)
	{
		IdeLog.logError(CoreIOPlugin.getDefault(), e);
	}
}
 
开发者ID:apicloudcom,项目名称:APICloud-Studio,代码行数:30,代码来源:PreferenceUtils.java

示例6: doSave

import org.eclipse.core.runtime.preferences.IEclipsePreferences; //导入方法依赖的package包/类
@Override
protected IStatus doSave(final ExternalLibraryPreferenceModel modelToSave) {
	final IEclipsePreferences node = InstanceScope.INSTANCE.getNode(QUALIFIER);
	node.put(CONFIGURATION_KEY, modelToSave.toJsonString());
	try {
		node.flush();
		return OK_STATUS;
	} catch (final BackingStoreException e) {
		final String message = "Unexpected error when trying to persist external library preferences.";
		LOGGER.error(message, e);
		return statusHelper.createError(message, e);
	}
}
 
开发者ID:eclipse,项目名称:n4js,代码行数:14,代码来源:OsgiExternalLibraryPreferenceStore.java

示例7: saveSettings

import org.eclipse.core.runtime.preferences.IEclipsePreferences; //导入方法依赖的package包/类
public EclipsePreferencesSerializer<T> saveSettings(final T settings) {
	IEclipsePreferences preferences = ConfigurationScope.INSTANCE.getNode(prefereneceId);
	Gson gson = new Gson();
	preferences.put(preferenceKey, gson.toJson(settings));
	try {
		preferences.flush();
	} catch (BackingStoreException e) {
		throw new RuntimeException(e);
	}
	return this;
}
 
开发者ID:dakaraphi,项目名称:eclipse-plugin-commander,代码行数:12,代码来源:EclipsePreferencesSerializer.java

示例8: 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

示例9: saveLastDb

import org.eclipse.core.runtime.preferences.IEclipsePreferences; //导入方法依赖的package包/类
public static void saveLastDb(DbInfo lastDb, IProject project) {
    IEclipsePreferences prefs = PgDbProject.getPrefs(project);
    if (prefs != null) {
        prefs.put(PROJ_PREF.LAST_DB_STORE, lastDb.toString());
        try {
            prefs.flush();
        } catch (BackingStoreException ex) {
            Log.log(ex);
        }
    }
}
 
开发者ID:pgcodekeeper,项目名称:pgcodekeeper,代码行数:12,代码来源:ProjectEditorDiffer.java

示例10: saveLastDb

import org.eclipse.core.runtime.preferences.IEclipsePreferences; //导入方法依赖的package包/类
public static void saveLastDb(DbInfo lastDb, IEditorInput inputForProject) {
    IResource res = ResourceUtil.getResource(inputForProject);
    if (res != null) {
        IEclipsePreferences prefs = PgDbProject.getPrefs(res.getProject());
        if (prefs != null) {
            prefs.put(PROJ_PREF.LAST_DB_STORE_EDITOR, lastDb.toString());
            try {
                prefs.flush();
            } catch (BackingStoreException ex) {
                Log.log(ex);
            }
        }
    }
}
 
开发者ID:pgcodekeeper,项目名称:pgcodekeeper,代码行数:15,代码来源:SQLEditor.java

示例11: folderChoosed

import org.eclipse.core.runtime.preferences.IEclipsePreferences; //导入方法依赖的package包/类
public void folderChoosed(String folderPath) {
	this.folderPath = folderPath;
	doResetProvider();
	IEclipsePreferences node = ConfigurationScope.INSTANCE.getNode(PrefEditorPlugin.PLUGIN_ID);
	node.put(CHOOSED_FOLDER_PREF, folderPath);
	try {
		node.flush();
	} catch (BackingStoreException e) {
		PrefEditorPlugin.log(e);
	}
	setViewerTitle(folderPath);
}
 
开发者ID:32kda,项目名称:com.onpositive.prefeditor,代码行数:13,代码来源:FolderViewerPage.java

示例12: saveChoosedPage

import org.eclipse.core.runtime.preferences.IEclipsePreferences; //导入方法依赖的package包/类
protected void saveChoosedPage(int selectionIndex) {
	IEclipsePreferences node = InstanceScope.INSTANCE.getNode(PrefEditorPlugin.PLUGIN_ID);
	node.putInt(CHOOSED_PAGE_PREF, selectionIndex);
	try {
		node.flush();
	} catch (BackingStoreException e) {
		PrefEditorPlugin.log(e);
	}
}
 
开发者ID:32kda,项目名称:com.onpositive.prefeditor,代码行数:10,代码来源:PreferenceView.java

示例13: saveBoolPref

import org.eclipse.core.runtime.preferences.IEclipsePreferences; //导入方法依赖的package包/类
protected void saveBoolPref(String key, boolean value) {
	IEclipsePreferences node = InstanceScope.INSTANCE.getNode(PrefEditorPlugin.PLUGIN_ID);
	node.putBoolean(key, value);
	try {
		node.flush();
	} catch (BackingStoreException e) {
		PrefEditorPlugin.log(e);
	}
}
 
开发者ID:32kda,项目名称:com.onpositive.prefeditor,代码行数:10,代码来源:PreferenceView.java

示例14: flush

import org.eclipse.core.runtime.preferences.IEclipsePreferences; //导入方法依赖的package包/类
protected void flush(IEclipsePreferences node) {
	try {
		node.flush();
	} catch (BackingStoreException e) {
		MessageDialog.openError(Display.getDefault().getActiveShell(), "Error saving preference", "Error saving preference value for node " + node.name() + " . Check error log for details");
		PrefEditorPlugin.log(e);
	}
}
 
开发者ID:32kda,项目名称:com.onpositive.prefeditor,代码行数:9,代码来源:PlatformPreferenceProvider.java

示例15: savePrevFolderChoices

import org.eclipse.core.runtime.preferences.IEclipsePreferences; //导入方法依赖的package包/类
public static void savePrevFolderChoices(String[] choices) {
	IEclipsePreferences node = InstanceScope.INSTANCE.getNode(PrefEditorPlugin.PLUGIN_ID);
	node.put(PREV_FOLDERS_KEY, String.join(";", choices));
	try {
		node.flush();
	} catch (BackingStoreException e) {
		PrefEditorPlugin.log(e);
	}
}
 
开发者ID:32kda,项目名称:com.onpositive.prefeditor,代码行数:10,代码来源:PrefEditorPlugin.java


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