X-Git-Url: https://mograsim.net/gitweb/?a=blobdiff_plain;f=plugins%2Fnet.mograsim.plugin.core%2Fsrc%2Fnet%2Fmograsim%2Fplugin%2FMograsimActivator.java;h=64586b07363e85b370171b6f60f489b2b47b0290;hb=161ecd36b6dcfe0e38cee3fd6ea8ad42d0705777;hp=9311ddd5ae13bc00261d87aa326b3c2c9fde9c41;hpb=ea2cf52020e48cbb854410c51d779456e6eca4ae;p=Mograsim.git diff --git a/plugins/net.mograsim.plugin.core/src/net/mograsim/plugin/MograsimActivator.java b/plugins/net.mograsim.plugin.core/src/net/mograsim/plugin/MograsimActivator.java index 9311ddd5..64586b07 100644 --- a/plugins/net.mograsim.plugin.core/src/net/mograsim/plugin/MograsimActivator.java +++ b/plugins/net.mograsim.plugin.core/src/net/mograsim/plugin/MograsimActivator.java @@ -1,29 +1,53 @@ package net.mograsim.plugin; +import org.eclipse.jface.preference.IPreferenceStore; import org.eclipse.ui.PlatformUI; import org.eclipse.ui.plugin.AbstractUIPlugin; +import org.eclipse.ui.themes.ITheme; +import net.mograsim.logic.model.preferences.RenderPreferences; import net.mograsim.machine.MachineRegistry; +import net.mograsim.plugin.preferences.EclipsePluginPreferences; +import net.mograsim.plugin.preferences.EclipseRenderPreferences; +import net.mograsim.plugin.preferences.PluginPreferences; import net.mograsim.preferences.Preferences; public final class MograsimActivator extends AbstractUIPlugin { + public static final String PLUGIN_ID = "net.mograsim.plugin.core"; + private static MograsimActivator instance; + public static MograsimActivator instance() + { + if (instance == null) + throw new IllegalStateException("MograsimActivator not yet created!"); + return instance; + } + + private final RenderPreferences renderPrefs; + private final PluginPreferences pluginPrefs; + public MograsimActivator() { if (instance != null) throw new IllegalStateException("MograsimActivator already created!"); instance = this; + MachineRegistry.initialize(); - Preferences.setPreferences(new EclipsePreferences(PlatformUI.getWorkbench().getThemeManager().getCurrentTheme(), - MograsimActivator.instance().getPreferenceStore())); + ITheme currentTheme = PlatformUI.getWorkbench().getThemeManager().getCurrentTheme(); + IPreferenceStore preferenceStore = getPreferenceStore(); + renderPrefs = new EclipseRenderPreferences(currentTheme, preferenceStore); + pluginPrefs = new EclipsePluginPreferences(currentTheme, preferenceStore); } - public static MograsimActivator instance() + public RenderPreferences getRenderPrefs() { - if (instance == null) - throw new IllegalStateException("MograsimActivator not yet created!"); - return instance; + return renderPrefs; + } + + public Preferences getPluginPrefs() + { + return pluginPrefs; } } \ No newline at end of file