org.eclipse.core.runtime.preferences.ConfigurationScope#getNode ( )源码实例Demo

下面列出了org.eclipse.core.runtime.preferences.ConfigurationScope#getNode ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: APICloud-Studio   文件: SendPingJob.java
private boolean enroll()
{
	ConfigurationScope scope = EclipseUtil.configurationScope();
	boolean hasEnrolled = Platform.getPreferencesService().getBoolean(UsagePlugin.PLUGIN_ID,
			IPreferenceConstants.HAS_ENROLLED, false, new IScopeContext[] { scope });
	if (!hasEnrolled)
	{
		AnalyticsInfo info = UsagePlugin.getDefault().getAnalyticsInfoManager()
				.getInfo("com.aptana.usage.analytics"); //$NON-NLS-1$
		String guid = info.getAppGuid();
		// only sends the enroll ping if it's Aptana Studio
		if ((new DefaultAnalyticsInfo()).getAppGuid().equals(guid))
		{
			// @formatter:off
			Map<String, String> payload = CollectionsUtil.newInOrderMap(
				"guid", guid, //$NON-NLS-1$
				"mid", CorePlugin.getMID()); //$NON-NLS-1$
			// @formatter:on

			StudioAnalytics.getInstance().sendEvent(new AnalyticsEvent(STUDIO_ENROLL, STUDIO_ENROLL, payload));
		}

		IEclipsePreferences store = scope.getNode(UsagePlugin.PLUGIN_ID);
		store.putBoolean(IPreferenceConstants.HAS_ENROLLED, true);
		try
		{
			store.flush();
			return true;
		}
		catch (BackingStoreException e)
		{
			UsagePlugin.logError(e);
		}
	}
	return false;
}
 
源代码2 项目: APICloud-Studio   文件: SendPingJob.java
private boolean sendFirstRunEvent()
{
	ConfigurationScope scope = EclipseUtil.configurationScope();
	boolean hasRun = Platform.getPreferencesService().getBoolean(UsagePlugin.PLUGIN_ID,
			IPreferenceConstants.P_IDE_HAS_RUN, false, new IScopeContext[] { scope });
	if (!hasRun)
	{
		// checks with the previous plugin id
		hasRun = Platform.getPreferencesService().getBoolean(UsagePlugin.OLD_PLUGIN_ID,
				IPreferenceConstants.P_IDE_HAS_RUN, false, new IScopeContext[] { scope });
		if (!hasRun)
		{
			StudioAnalytics.getInstance().sendEvent(new AnalyticsEvent(STUDIO_FIRST_RUN, STUDIO_FIRST_RUN, null));

			IEclipsePreferences store = scope.getNode(UsagePlugin.PLUGIN_ID);
			store.putBoolean(IPreferenceConstants.P_IDE_HAS_RUN, true);
			try
			{
				store.flush();
				return true;
			}
			catch (BackingStoreException e)
			{
				UsagePlugin.logError(e);
			}
		}
	}
	return false;
}
 
源代码3 项目: gwt-eclipse-plugin   文件: GdtPreferences.java
private static IEclipsePreferences getConfigurationPreferences() {
  ConfigurationScope scope = new ConfigurationScope();
  IEclipsePreferences configurationPrefs = scope.getNode(GdtPlugin.PLUGIN_ID);
  return configurationPrefs;
}