]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.event/src/org/simantics/event/Activator.java
Merge "Databoard and SCL enchancements."
[simantics/platform.git] / bundles / org.simantics.event / src / org / simantics / event / Activator.java
1 /*******************************************************************************\r
2  * Copyright (c) 2007, 2011 Association for Decentralized Information Management\r
3  * in Industry THTH ry.\r
4  * All rights reserved. This program and the accompanying materials\r
5  * are made available under the terms of the Eclipse Public License v1.0\r
6  * which accompanies this distribution, and is available at\r
7  * http://www.eclipse.org/legal/epl-v10.html\r
8  *\r
9  * Contributors:\r
10  *     VTT Technical Research Centre of Finland - initial API and implementation\r
11  *******************************************************************************/\r
12 package org.simantics.event;\r
13 \r
14 import org.eclipse.jface.resource.ImageDescriptor;\r
15 import org.eclipse.ui.plugin.AbstractUIPlugin;\r
16 import org.osgi.framework.Bundle;\r
17 import org.osgi.framework.BundleContext;\r
18 import org.simantics.utils.ui.gfx.AlphaAdjustmentImageDescriptor;\r
19 import org.simantics.utils.ui.gfx.HSVAdjustmentImageDescriptor;\r
20 \r
21 /**\r
22  * @author Tuukka Lehtonen\r
23  */\r
24 public class Activator extends AbstractUIPlugin {\r
25 \r
26     public static final String   BUNDLE_ID = "org.simantics.event";\r
27 \r
28     private static BundleContext context;\r
29 \r
30     public static ImageDescriptor HIDE_ICON;\r
31     public static ImageDescriptor UNHIDE_ICON;\r
32     public static ImageDescriptor MILESTONE_ICON;\r
33     public static ImageDescriptor DIAMOND_ICON, DIAMOND2_ICON;\r
34     public static ImageDescriptor MARK_MILESTONE_ICON;\r
35     public static ImageDescriptor UNMARK_MILESTONE_ICON;\r
36     public static ImageDescriptor SET_BASELINE_ICON;\r
37     public static ImageDescriptor REMOVE_BASELINE_ICON;\r
38     public static ImageDescriptor CLIPBOARD_ICON;\r
39 \r
40     static BundleContext getContext() {\r
41         return context;\r
42     }\r
43 \r
44     @Override\r
45     public void start(BundleContext bundleContext) throws Exception {\r
46         Activator.context = bundleContext;\r
47 \r
48         Bundle bundle = bundleContext.getBundle();\r
49 \r
50         HIDE_ICON = ImageDescriptor.createFromURL(bundle.getResource("icons/hide.png"));\r
51         UNHIDE_ICON = AlphaAdjustmentImageDescriptor.adjustAlpha(HSVAdjustmentImageDescriptor.adjust(ImageDescriptor.createFromURL(bundle.getResource("icons/hide.png")), 0f, 0f, 1f), 96);\r
52         MILESTONE_ICON = ImageDescriptor.createFromURL(bundle.getResource("icons/milestone.png"));\r
53         DIAMOND_ICON = ImageDescriptor.createFromURL(bundle.getResource("icons/diamond.png"));\r
54         DIAMOND2_ICON = ImageDescriptor.createFromURL(bundle.getResource("icons/diamond2.png"));\r
55         MARK_MILESTONE_ICON = ImageDescriptor.createFromURL(bundle.getResource("icons/milestone.png"));\r
56         UNMARK_MILESTONE_ICON = AlphaAdjustmentImageDescriptor.adjustAlpha(HSVAdjustmentImageDescriptor.adjust(ImageDescriptor.createFromURL(bundle.getResource("icons/milestone.png")), 0f, 0f, 1f), 96);\r
57         SET_BASELINE_ICON = ImageDescriptor.createFromURL(bundle.getResource("icons/baseline.png"));\r
58         REMOVE_BASELINE_ICON = AlphaAdjustmentImageDescriptor.adjustAlpha(HSVAdjustmentImageDescriptor.adjust(ImageDescriptor.createFromURL(bundle.getResource("icons/baseline.png")), 0f, 0f, 1f), 96);\r
59         CLIPBOARD_ICON = ImageDescriptor.createFromURL(bundle.getResource("icons/clipboard.png"));\r
60     }\r
61 \r
62     @Override\r
63     public void stop(BundleContext bundleContext) throws Exception {\r
64         Activator.context = null;\r
65     }\r
66 \r
67 }\r