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


Java IEclipsePreferences.node方法代码示例

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


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

示例1: storeDefaults

import org.eclipse.core.runtime.preferences.IEclipsePreferences; //导入方法依赖的package包/类
protected void storeDefaults()
{
	// Don't store builtin themes default copy in prefs!
	if (getThemeManager().isBuiltinTheme(getName()))
	{
		return;
	}
	// Only save to defaults if it has never been saved there. Basically take a snapshot of first version and
	// use that as the "default"
	IEclipsePreferences prefs = EclipseUtil.defaultScope().getNode(ThemePlugin.PLUGIN_ID);
	if (prefs == null)
	{
		return; // TODO Log something?
	}
	Preferences preferences = prefs.node(ThemeManager.THEMES_NODE);
	if (preferences == null)
	{
		return;
	}
	String value = preferences.get(getName(), null);
	if (value == null)
	{
		save(EclipseUtil.defaultScope());
	}
}
 
开发者ID:apicloudcom,项目名称:APICloud-Studio,代码行数:26,代码来源:Theme.java

示例2: addListeners

import org.eclipse.core.runtime.preferences.IEclipsePreferences; //导入方法依赖的package包/类
private void addListeners(IEclipsePreferences node) throws CoreException {
  addListener(node);

  try {
    for (String childName : node.childrenNames()) {
      IEclipsePreferences child = (IEclipsePreferences) node.node(childName);
      this.addListeners(child);
    }
  } catch (BackingStoreException e) {
    throw new CoreException(new Status(IStatus.ERROR, MechanicPlugin.PLUGIN_ID,
        "Could not read children for preference node", e));
  }
}
 
开发者ID:alfsch,项目名称:workspacemechanic,代码行数:14,代码来源:PreferenceRecorder.java

示例3: getPreferencesNode

import org.eclipse.core.runtime.preferences.IEclipsePreferences; //导入方法依赖的package包/类
private static Preferences getPreferencesNode(final String viewDataKey, final TFSTeamProjectCollection connection) {
    final IEclipsePreferences prefs = new InstanceScope().getNode(TFSCommonUIClientPlugin.PLUGIN_ID);
    Preferences node = prefs.node("WorkspacesControl"); //$NON-NLS-1$
    if (viewDataKey != null) {
        node = node.node(viewDataKey);
    }
    node = node.node(connection.getInstanceID().toString());
    node = node.node(connection.getAuthorizedTFSUser().toString());
    return node;
}
 
开发者ID:Microsoft,项目名称:team-explorer-everywhere,代码行数:11,代码来源:WorkspacesControl.java

示例4: getPreferencesNode

import org.eclipse.core.runtime.preferences.IEclipsePreferences; //导入方法依赖的package包/类
private static Preferences getPreferencesNode(final String key) {
    final IEclipsePreferences prefs = new InstanceScope().getNode(TFSCommonUIClientPlugin.PLUGIN_ID);

    Preferences node = prefs.node(TABLE_COLUMN_WIDTHS_NODE_NAME);
    node = node.node(key);

    return node;
}
 
开发者ID:Microsoft,项目名称:team-explorer-everywhere,代码行数:9,代码来源:TableColumnWidthsPersistence.java

示例5: writeConfig

import org.eclipse.core.runtime.preferences.IEclipsePreferences; //导入方法依赖的package包/类
public static void writeConfig(ArrayList<Group> groups) throws BackingStoreException {
	IEclipsePreferences pref = getPreferences();
	pref.clear();
	for(Group g: groups) {
		Preferences prefG = pref.node(GROUPID + g.getGroupID());
		
		ArrayList<String> members = g.getGroupMembers();
		prefG.putInt(MEMBERCOUNT, members.size());
		for(int i = 0; i < members.size(); ++i) {
			prefG.put(MEMBER + i, members.get(i));
		}
	}
	pref.flush();
}
 
开发者ID:CedricHanebaum,项目名称:Correct,代码行数:15,代码来源:PrefIO.java

示例6: readConfig

import org.eclipse.core.runtime.preferences.IEclipsePreferences; //导入方法依赖的package包/类
public static ArrayList<Group> readConfig() throws BackingStoreException {
	ArrayList<Group> groups = new ArrayList<Group>();
	IEclipsePreferences pref = getPreferences();
	
	for(String child: pref.childrenNames()) {
		Preferences prefG = pref.node(child);
		Group g = new Group(Integer.parseInt(child.substring(GROUPID.length())));
		for(int i = 0; i < prefG.getInt(MEMBERCOUNT, 0); ++i) {
			g.addMember(prefG.get(MEMBER + i, "default"));
		}
		groups.add(g);
	}
	
	return groups;
}
 
开发者ID:CedricHanebaum,项目名称:Correct,代码行数:16,代码来源:PrefIO.java

示例7: delete

import org.eclipse.core.runtime.preferences.IEclipsePreferences; //导入方法依赖的package包/类
private void delete(IScopeContext context)
{
	try
	{
		IEclipsePreferences prefs = context.getNode(ThemePlugin.PLUGIN_ID);
		Preferences preferences = prefs.node(ThemeManager.THEMES_NODE);
		preferences.remove(getName());
		preferences.flush();
	}
	catch (BackingStoreException e)
	{
		IdeLog.logError(ThemePlugin.getDefault(), e);
	}
}
 
开发者ID:apicloudcom,项目名称:APICloud-Studio,代码行数:15,代码来源:Theme.java

示例8: getThemeNames

import org.eclipse.core.runtime.preferences.IEclipsePreferences; //导入方法依赖的package包/类
/**
 * laziliy init the set of theme names.
 */
public synchronized Set<String> getThemeNames()
{
	if (fThemeNames == null)
	{
		fThemeNames = new HashSet<String>();
		// Add names of themes from builtins...
		fThemeNames.addAll(getBuiltinThemeNames());

		// Look in prefs to see what user themes are stored there, garb their names
		IScopeContext[] scopes = new IScopeContext[] { EclipseUtil.instanceScope(), EclipseUtil.defaultScope() };
		for (IScopeContext scope : scopes)
		{
			IEclipsePreferences prefs = scope.getNode(ThemePlugin.PLUGIN_ID);
			Preferences preferences = prefs.node(ThemeManager.THEMES_NODE);
			try
			{
				String[] themeNames = preferences.keys();
				fThemeNames.addAll(Arrays.asList(themeNames));
			}
			catch (BackingStoreException e)
			{
				IdeLog.logError(ThemePlugin.getDefault(), e);
			}
		}
	}
	return fThemeNames;
}
 
开发者ID:apicloudcom,项目名称:APICloud-Studio,代码行数:31,代码来源:ThemeManager.java

示例9: start

import org.eclipse.core.runtime.preferences.IEclipsePreferences; //导入方法依赖的package包/类
@Override
public void start(BundleContext context) throws Exception {
	super.start(context);
	plugin = this;
	IAdapterManager adapterManager = Platform.getAdapterManager();
	adapterManager.registerAdapters(bookmarkAdapterFactory, Bookmark.class);
	adapterManager.registerAdapters(bookmarkAdapterFactory, BookmarkLink.class);

	RemoteBookmarksStoreLoader remoteBookmarksStoreLoader = new RemoteBookmarksStoreLoader();
	remoteBookmarksStoreManager = new RemoteBookmarksStoreManager(remoteBookmarksStoreLoader);
	File bookmarksFile = new File(getStateLocation().toFile(), "bookmarks.json");
	BookmarksModificationValidator bookmarksModificationValidator = new BookmarksModificationValidator(
			remoteBookmarksStoreManager);
	bookmarkDatabase = loadBookmarkDatabase(bookmarksFile, bookmarksModificationValidator);
	pluginBookmarkTypes = new PluginBookmarkTypes();
	bookmarkProblemDescriptors = new BookmarkProblemDescriptors();
	bookmarkLabelProvider = new PluginBookmarkLabelProvider(pluginBookmarkTypes);
	PluginBookmarkMarkerAttributesProvider bookmarkMarkerAttributesProvider = new PluginBookmarkMarkerAttributesProvider(
			pluginBookmarkTypes);
	bookmarkPropertiesProvider = new PluginBookmarkPropertiesProvider(pluginBookmarkTypes);
	bookmarkLocationProvider = new PluginBookmarkLocationProvider(pluginBookmarkTypes);
	gotoBookmark = new PluginGotoBookmark(pluginBookmarkTypes);
	bookmarksMarkers = new BookmarksMarkers(bookmarkDatabase, bookmarkMarkerAttributesProvider);
	importTeamProjectProvider = new ImportTeamProjectProvider(pluginBookmarkTypes);
	bookmarksMarkers.init();
	LocalBookmarksSaver localBookmarksSaver = new LocalBookmarksSaver(bookmarksFile,
			new BookmarksTreeJsonSerializer(true));
	RemoteBookmarksSaver remoteBookmarksSaver = new RemoteBookmarksSaver(remoteBookmarksStoreManager);
	bookmarksSaver = new BookmarksAutoSaver(bookmarkDatabase, localBookmarksSaver, remoteBookmarksSaver);
	bookmarksSaver.init();
	IEclipsePreferences preferences = InstanceScope.INSTANCE.getNode(PLUGIN_ID);
	File mostVisitedBookmarksFile = new File(getStateLocation().toFile(), "mostVisitedBookmarks.json");
	IEventBroker eventBroker = (IEventBroker) getWorkbench().getService(IEventBroker.class);
	mostVisitedBookmarks = new VisitedBookmarksDatabase(eventBroker, bookmarkDatabase, mostVisitedBookmarksFile);
	mostVisitedBookmarks.init();
	remoteBookmarksTreeChangeEventHandler = new RemoteBookmarksTreeChangeEventHandler(eventBroker,
			new RefreshRemoteFolderOperation(bookmarkDatabase, remoteBookmarksStoreManager, bookmarksSaver));
	remoteBookmarksTreeChangeEventHandler.subscribe();
	numberedBookmarks = new NumberedBookmarks((IEclipsePreferences) preferences.node("numberedBookmarks"),
			eventBroker);
	numberedBookmarks.init();
	File recentBookmarksFile = new File(getStateLocation().toFile(), "recentBookmarks.json");
	recentBookmarks = new RecentBookmarksDatabase(eventBroker, bookmarkDatabase, recentBookmarksFile,
			Duration.ofDays(5));
	recentBookmarks.init();
	File bookmarkProblemsFile = new File(getStateLocation().toFile(), "bookmarkProblems.json");
	bookmarkProblems = new BookmarkProblemsDatabase(eventBroker, bookmarkDatabase, bookmarkProblemDescriptors,
			bookmarkProblemsFile);
	bookmarkProblems.init();
	File storeFile = new File(getStateLocation().toFile(), "placeholders.json");
	pathPlaceholdersStore = new PathPlaceholdersStore(eventBroker, storeFile);
	pathPlaceholdersStore.init();
	if (pathPlaceholdersStore.get(PLACEHOLDER_HOME_NAME) == null) {
		IPath userHome = getUserHome();
		if (userHome != null) {
			pathPlaceholdersStore.add(new PathPlaceholder(PLACEHOLDER_HOME_NAME, userHome));
		}
	}
	INewBookmarkPositionProvider newBookmarkPositionProvider = new NewBookmarkPositionProvider(bookmarkDatabase);
	bookmarksService = new BookmarksService(bookmarkDatabase, bookmarkPropertiesProvider,
			newBookmarkPositionProvider, remoteBookmarksStoreManager, bookmarksSaver, bookmarkLocationProvider,
			gotoBookmark, numberedBookmarks, pluginBookmarkTypes, bookmarksMarkers, pathPlaceholdersStore,
			bookmarkProblems, eventBroker);
	CheckBookmarkPropertiesOperation checkBookmarkPropertiesOperation = new CheckBookmarkPropertiesOperation(
			bookmarkDatabase, remoteBookmarksStoreManager, pluginBookmarkTypes, bookmarkPropertiesProvider,
			new PathPlaceholderResolver(pathPlaceholdersStore), bookmarkProblems);
	bookmarkProblemsAutoUpdater = new BookmarkProblemsAutoUpdater(eventBroker, bookmarkDatabase, bookmarkProblems,
			new PathPropertiesProvider(pluginBookmarkTypes), checkBookmarkPropertiesOperation);
	bookmarkProblemsAutoUpdater.init();
}
 
开发者ID:cchabanois,项目名称:mesfavoris,代码行数:71,代码来源:BookmarksPlugin.java


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