]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.event/src/org/simantics/event/Activator.java
Migrated source code from Simantics SVN
[simantics/platform.git] / bundles / org.simantics.event / src / org / simantics / event / Activator.java
diff --git a/bundles/org.simantics.event/src/org/simantics/event/Activator.java b/bundles/org.simantics.event/src/org/simantics/event/Activator.java
new file mode 100644 (file)
index 0000000..e8e6e2f
--- /dev/null
@@ -0,0 +1,67 @@
+/*******************************************************************************\r
+ * Copyright (c) 2007, 2011 Association for Decentralized Information Management\r
+ * in Industry THTH ry.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ *     VTT Technical Research Centre of Finland - initial API and implementation\r
+ *******************************************************************************/\r
+package org.simantics.event;\r
+\r
+import org.eclipse.jface.resource.ImageDescriptor;\r
+import org.eclipse.ui.plugin.AbstractUIPlugin;\r
+import org.osgi.framework.Bundle;\r
+import org.osgi.framework.BundleContext;\r
+import org.simantics.utils.ui.gfx.AlphaAdjustmentImageDescriptor;\r
+import org.simantics.utils.ui.gfx.HSVAdjustmentImageDescriptor;\r
+\r
+/**\r
+ * @author Tuukka Lehtonen\r
+ */\r
+public class Activator extends AbstractUIPlugin {\r
+\r
+    public static final String   BUNDLE_ID = "org.simantics.event";\r
+\r
+    private static BundleContext context;\r
+\r
+    public static ImageDescriptor HIDE_ICON;\r
+    public static ImageDescriptor UNHIDE_ICON;\r
+    public static ImageDescriptor MILESTONE_ICON;\r
+    public static ImageDescriptor DIAMOND_ICON, DIAMOND2_ICON;\r
+    public static ImageDescriptor MARK_MILESTONE_ICON;\r
+    public static ImageDescriptor UNMARK_MILESTONE_ICON;\r
+    public static ImageDescriptor SET_BASELINE_ICON;\r
+    public static ImageDescriptor REMOVE_BASELINE_ICON;\r
+    public static ImageDescriptor CLIPBOARD_ICON;\r
+\r
+    static BundleContext getContext() {\r
+        return context;\r
+    }\r
+\r
+    @Override\r
+    public void start(BundleContext bundleContext) throws Exception {\r
+        Activator.context = bundleContext;\r
+\r
+        Bundle bundle = bundleContext.getBundle();\r
+\r
+        HIDE_ICON = ImageDescriptor.createFromURL(bundle.getResource("icons/hide.png"));\r
+        UNHIDE_ICON = AlphaAdjustmentImageDescriptor.adjustAlpha(HSVAdjustmentImageDescriptor.adjust(ImageDescriptor.createFromURL(bundle.getResource("icons/hide.png")), 0f, 0f, 1f), 96);\r
+        MILESTONE_ICON = ImageDescriptor.createFromURL(bundle.getResource("icons/milestone.png"));\r
+        DIAMOND_ICON = ImageDescriptor.createFromURL(bundle.getResource("icons/diamond.png"));\r
+        DIAMOND2_ICON = ImageDescriptor.createFromURL(bundle.getResource("icons/diamond2.png"));\r
+        MARK_MILESTONE_ICON = ImageDescriptor.createFromURL(bundle.getResource("icons/milestone.png"));\r
+        UNMARK_MILESTONE_ICON = AlphaAdjustmentImageDescriptor.adjustAlpha(HSVAdjustmentImageDescriptor.adjust(ImageDescriptor.createFromURL(bundle.getResource("icons/milestone.png")), 0f, 0f, 1f), 96);\r
+        SET_BASELINE_ICON = ImageDescriptor.createFromURL(bundle.getResource("icons/baseline.png"));\r
+        REMOVE_BASELINE_ICON = AlphaAdjustmentImageDescriptor.adjustAlpha(HSVAdjustmentImageDescriptor.adjust(ImageDescriptor.createFromURL(bundle.getResource("icons/baseline.png")), 0f, 0f, 1f), 96);\r
+        CLIPBOARD_ICON = ImageDescriptor.createFromURL(bundle.getResource("icons/clipboard.png"));\r
+    }\r
+\r
+    @Override\r
+    public void stop(BundleContext bundleContext) throws Exception {\r
+        Activator.context = null;\r
+    }\r
+\r
+}\r