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=648fc6e69e09fe4467cb6bac47934be1a7dcf0d6;hp=b3340dad7be3dfd3e84bd8d754d6d106f853fc88;hpb=363c9377b3c542c87fc5e7f57674751439246dbd;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 b3340dad..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,25 +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(); + 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