1 package net.mograsim.plugin;
3 import org.eclipse.jface.preference.IPreferenceStore;
4 import org.eclipse.ui.PlatformUI;
5 import org.eclipse.ui.plugin.AbstractUIPlugin;
6 import org.eclipse.ui.themes.ITheme;
8 import net.mograsim.logic.model.preferences.RenderPreferences;
9 import net.mograsim.machine.MachineRegistry;
10 import net.mograsim.plugin.preferences.EclipsePluginPreferences;
11 import net.mograsim.plugin.preferences.EclipseRenderPreferences;
12 import net.mograsim.plugin.preferences.PluginPreferences;
13 import net.mograsim.preferences.Preferences;
15 public final class MograsimActivator extends AbstractUIPlugin
17 public static final String PLUGIN_ID = "net.mograsim.plugin.core";
19 private static MograsimActivator instance;
21 public static MograsimActivator instance()
24 throw new IllegalStateException("MograsimActivator not yet created!");
28 private final RenderPreferences renderPrefs;
29 private final PluginPreferences pluginPrefs;
31 public MograsimActivator()
34 throw new IllegalStateException("MograsimActivator already created!");
37 MachineRegistry.initialize();
38 ITheme currentTheme = PlatformUI.getWorkbench().getThemeManager().getCurrentTheme();
39 IPreferenceStore preferenceStore = getPreferenceStore();
40 renderPrefs = new EclipseRenderPreferences(currentTheme, preferenceStore);
41 pluginPrefs = new EclipsePluginPreferences(currentTheme, preferenceStore);
44 public RenderPreferences getRenderPrefs()
49 public Preferences getPluginPrefs()