protected ProfileStore createProfileStore(IProfileVersioner versioner) { return new FormatterProfileStore(versioner); }
@Override public List<Profile> readProfiles(IScopeContext scope) throws CoreException { List<Profile> profiles= super.readProfiles(scope); if (profiles == null) { profiles= readOldForCompatibility(scope); } return profiles; }
public static void checkCurrentOptionsVersion() { PreferencesAccess access= PreferencesAccess.getOriginalPreferences(); ProfileVersioner profileVersioner= new ProfileVersioner(); IScopeContext instanceScope= access.getInstanceScope(); IEclipsePreferences uiPreferences= instanceScope.getNode(JavaUI.ID_PLUGIN); int version= uiPreferences.getInt(PREF_FORMATTER_PROFILES + VERSION_KEY_SUFFIX, 0); if (version >= profileVersioner.getCurrentVersion()) { return; // is up to date } try { List<Profile> profiles= (new FormatterProfileStore(profileVersioner)).readProfiles(instanceScope); if (profiles == null) { profiles= new ArrayList<>(); } ProfileManager manager= new FormatterProfileManager(profiles, instanceScope, access, profileVersioner); if (manager.getSelected() instanceof CustomProfile) { manager.commitChanges(instanceScope); // updates JavaCore options } uiPreferences.putInt(PREF_FORMATTER_PROFILES + VERSION_KEY_SUFFIX, profileVersioner.getCurrentVersion()); savePreferences(instanceScope); } catch (CoreException e) { JavaPlugin.log(e); } catch (BackingStoreException e) { JavaPlugin.log(e); } }
List res= readProfilesFromStream(new InputSource(reader)); if (res != null) { for (int i= 0; i < res.size(); i++) { fProfileVersioner.update((CustomProfile) res.get(i)); writeProfiles(res, instanceScope);
fMembersOrderPreferenceCache.install(store); FormatterProfileStore.checkCurrentOptionsVersion();
public static void checkCurrentOptionsVersion() { PreferencesAccess access= PreferencesAccess.getOriginalPreferences(); ProfileVersioner profileVersioner= new ProfileVersioner(); IScopeContext instanceScope= access.getInstanceScope(); IEclipsePreferences uiPreferences= instanceScope.getNode(JavaUI.ID_PLUGIN); int version= uiPreferences.getInt(PREF_FORMATTER_PROFILES + VERSION_KEY_SUFFIX, 0); if (version >= profileVersioner.getCurrentVersion()) { return; // is up to date } try { List<Profile> profiles= (new FormatterProfileStore(profileVersioner)).readProfiles(instanceScope); if (profiles == null) { profiles= new ArrayList<>(); } ProfileManager manager= new FormatterProfileManager(profiles, instanceScope, access, profileVersioner); if (manager.getSelected() instanceof CustomProfile) { manager.commitChanges(instanceScope); // updates JavaCore options } uiPreferences.putInt(PREF_FORMATTER_PROFILES + VERSION_KEY_SUFFIX, profileVersioner.getCurrentVersion()); savePreferences(instanceScope); } catch (CoreException e) { JavaPlugin.log(e); } catch (BackingStoreException e) { JavaPlugin.log(e); } }
List<Profile> res= readProfilesFromStream(new InputSource(reader)); if (res != null) { for (int i= 0; i < res.size(); i++) { fProfileVersioner.update((CustomProfile) res.get(i)); writeProfiles(res, instanceScope);
FormatterProfileStore.checkCurrentOptionsVersion();
List profiles= (new FormatterProfileStore(profileVersioner)).readProfiles(instanceScope); if (profiles == null) { profiles= new ArrayList(); savePreferences(instanceScope); manager= new FormatterProfileManager(profiles, scope, access, profileVersioner); savePreferences(scope);
List<Profile> res= readProfilesFromStream(new InputSource(reader)); if (res != null) { for (int i= 0; i < res.size(); i++) { fProfileVersioner.update((CustomProfile) res.get(i)); writeProfiles(res, instanceScope);
@Override protected ProfileStore createProfileStore(IProfileVersioner versioner) { return new FormatterProfileStore(versioner); }
/** * {@inheritDoc} */ public List readProfiles(IScopeContext scope) throws CoreException { List profiles= super.readProfiles(scope); if (profiles == null) { profiles= readOldForCompatibility(scope); } return profiles; }
FormatterProfileStore.checkCurrentOptionsVersion();
@Override protected ProfileStore createProfileStore(IProfileVersioner versioner) { return new FormatterProfileStore(versioner); }
@Override public List<Profile> readProfiles(IScopeContext scope) throws CoreException { List<Profile> profiles= super.readProfiles(scope); if (profiles == null) { profiles= readOldForCompatibility(scope); } return profiles; }