Community
Participate
Working Groups
It would be nice to have an easy way to save/restore persistent settings in the Multicore Visualizer.
New Gerrit change created: https://git.eclipse.org/r/42901
New Gerrit change created: https://git.eclipse.org/r/42902
New Gerrit change created: https://git.eclipse.org/r/42907
I think I have come-up with a nice solution. It's almost a drop-in replacement, at the java code level, for (a few supported) types of variables, with the added benefit that any value set will be persisted in the preference store (at the workspace level). Here is an example, inspired by the changes to MulticoreVisualizer.java (adapted for readability): // original variables Boolean m_loadMetersEnabled; int m_loadMeterTimerPeriod; // replacement: PersistentSetting<Boolean> m_loadMetersEnabled; PersistentSetting<Integer> m_loadMeterTimerPeriod; // There is a bit of setup to be done before using the PersistentSetting variables: PersistentSettingsManager m_persistentSettingsManager = new PersistentSettingsManager(ECLIPSE_PLUGIN_ID, visualizerViewInstanceId); boolean appliesToAllMVViews = false; m_loadMetersEnabled = m_persistentSettingsManager.getNewParameter(Boolean.class,"enableLoadMeters", appliesToAllMVViews, false); m_loadMeterTimerPeriod = m_persistentSettingsManager.getNewParameter(Integer.class, "loadMeterTimerPeriod", appliesToAllMVViews, 500); Then the persistent variables use a a setter/getter instead of being accessed directly: if (!m_loadMetersEnabled.value()) return; m_loadMetersEnabled.set(true); if (m_loadMeterTimerPeriod.value() > 5000) m_loadMeterTimerPeriod.set(5000);
Gerrit change https://git.eclipse.org/r/42907 was merged to [master]. Commit: http://git.eclipse.org/c/cdt/org.eclipse.cdt.git/commit/?id=d38aa3229672d7fd2a8cd4a28dae3cf52a77c816
committed to master
New Gerrit change created: https://git.eclipse.org/r/43176
Gerrit change https://git.eclipse.org/r/43176 was merged to [master]. Commit: http://git.eclipse.org/c/cdt/org.eclipse.cdt.git/commit/?id=7a245a252038e51f568e236a137fa6b6262eb735