protected Preferences getRepositoryPreferenceNode(IAgentLocation agentLocation, IProfile profile, URI location, int type) { String key = type == IRepository.TYPE_METADATA ? METADATA_REPOSITORY : ARTIFACT_REPOSITORY; String profileId = profile == null ? IProfileRegistry.SELF : profile.getProfileId(); return new ProfileScope(agentLocation, profileId).getNode(key + '/' + NODE_REPOSITORIES + '/' + getKey(location)); }
protected Preferences getRepositoryPreferenceNode(IAgentLocation agentLocation, IProfile profile, URI location, int type) { String key = type == IRepository.TYPE_METADATA ? METADATA_REPOSITORY : ARTIFACT_REPOSITORY; String profileId = profile == null ? IProfileRegistry.SELF : profile.getProfileId(); return new ProfileScope(agentLocation, profileId).getNode(key + '/' + NODE_REPOSITORIES + '/' + getKey(location)); }
private Preferences getPreferences() { IAgentLocation location = (IAgentLocation) ProvSDKUIActivator.getDefault().getProvisioningAgent().getService(IAgentLocation.SERVICE_NAME); return new ProfileScope(location, profileId).getNode(ProvSDKUIActivator.PLUGIN_ID); }
public static void migratePreferences() { Preferences pref = new ProfileScope(getDefaultAgentLocation(), IProfileRegistry.SELF).getNode(ProvSDKUIActivator.PLUGIN_ID); try { if (pref.keys().length == 0) { // migrate preferences from instance scope to profile scope Preferences oldPref = new InstanceScope().getNode(ProvSDKUIActivator.PLUGIN_ID); // don't migrate everything. Some of the preferences moved to // another bundle. pref.put(PreferenceConstants.PREF_OPEN_WIZARD_ON_ERROR_PLAN, oldPref.get(PreferenceConstants.PREF_OPEN_WIZARD_ON_ERROR_PLAN, MessageDialogWithToggle.PROMPT)); // if the preference value associated with PREF_SHOW_LATEST_VERSION does not exist do not initialize it String showLatestVersionString = oldPref.get(PreferenceConstants.PREF_SHOW_LATEST_VERSION, null); if (showLatestVersionString != null) { pref.putBoolean(PreferenceConstants.PREF_SHOW_LATEST_VERSION, Boolean.TRUE.toString().equalsIgnoreCase(showLatestVersionString)); } pref.flush(); } } catch (BackingStoreException e) { StatusManager.getManager().handle(new Status(IStatus.ERROR, ProvSDKUIActivator.PLUGIN_ID, 0, ProvSDKMessages.PreferenceInitializer_Error, e), StatusManager.LOG); } }
if (agentLocation == null) return; Preferences pref = new ProfileScope(agentLocation, IProfileRegistry.SELF).getNode(AutomaticUpdatePlugin.PLUGIN_ID); try { if (pref.keys().length == 0) {