]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.message.ui/src/org/simantics/message/ui/Activator.java
Migrated source code from Simantics SVN
[simantics/platform.git] / bundles / org.simantics.message.ui / src / org / simantics / message / ui / Activator.java
1 /*******************************************************************************\r
2  * Copyright (c) 2007, 2010 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.message.ui;\r
13 \r
14 import org.eclipse.jface.resource.ImageDescriptor;\r
15 import org.eclipse.jface.resource.ImageRegistry;\r
16 import org.eclipse.ui.plugin.AbstractUIPlugin;\r
17 import org.osgi.framework.BundleContext;\r
18 \r
19 /**\r
20  * The activator class controls the plug-in life cycle\r
21  */\r
22 public class Activator extends AbstractUIPlugin {\r
23 \r
24         // The plug-in ID\r
25         public static final String PLUGIN_ID = "org.simantics.message.ui";\r
26 \r
27         // The shared instance\r
28         private static Activator plugin;\r
29         \r
30         /**\r
31          * The constructor\r
32          */\r
33         public Activator() {\r
34         }\r
35 \r
36         /*\r
37          * (non-Javadoc)\r
38          * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)\r
39          */\r
40         public void start(BundleContext context) throws Exception {\r
41                 super.start(context);\r
42                 plugin = this;\r
43         }\r
44 \r
45         /*\r
46          * (non-Javadoc)\r
47          * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)\r
48          */\r
49         public void stop(BundleContext context) throws Exception {\r
50                 plugin = null;\r
51                 super.stop(context);\r
52         }\r
53 \r
54         /**\r
55          * Returns the shared instance\r
56          *\r
57          * @return the shared instance\r
58          */\r
59         public static Activator getDefault() {\r
60                 return plugin;\r
61         }\r
62 \r
63     protected void initializeImageRegistry(ImageRegistry registry) {\r
64         registry.put(SharedImages.DESC_PREV_EVENT, createImageDescriptor(SharedImages.DESC_PREV_EVENT));\r
65         registry.put(SharedImages.DESC_NEXT_EVENT, createImageDescriptor(SharedImages.DESC_NEXT_EVENT));\r
66 \r
67         registry.put(SharedImages.DESC_DEBUG_ST_OBJ, createImageDescriptor(SharedImages.DESC_DEBUG_ST_OBJ));\r
68         registry.put(SharedImages.DESC_ERROR_ST_OBJ, createImageDescriptor(SharedImages.DESC_ERROR_ST_OBJ));\r
69         registry.put(SharedImages.DESC_ERROR_STACK_OBJ, createImageDescriptor(SharedImages.DESC_ERROR_STACK_OBJ));\r
70         registry.put(SharedImages.DESC_INFO_ST_OBJ, createImageDescriptor(SharedImages.DESC_INFO_ST_OBJ));\r
71         registry.put(SharedImages.DESC_OK_ST_OBJ, createImageDescriptor(SharedImages.DESC_OK_ST_OBJ));\r
72         registry.put(SharedImages.DESC_WARNING_ST_OBJ, createImageDescriptor(SharedImages.DESC_WARNING_ST_OBJ));\r
73         registry.put(SharedImages.DESC_HIERARCHICAL_LAYOUT_OBJ, createImageDescriptor(SharedImages.DESC_HIERARCHICAL_LAYOUT_OBJ));\r
74 \r
75         registry.put(SharedImages.DESC_CLEAR, createImageDescriptor(SharedImages.DESC_CLEAR));\r
76         registry.put(SharedImages.DESC_CLEAR_DISABLED, createImageDescriptor(SharedImages.DESC_CLEAR_DISABLED));\r
77         registry.put(SharedImages.DESC_REMOVE_LOG, createImageDescriptor(SharedImages.DESC_REMOVE_LOG));\r
78         registry.put(SharedImages.DESC_REMOVE_LOG_DISABLED, createImageDescriptor(SharedImages.DESC_REMOVE_LOG_DISABLED));\r
79         registry.put(SharedImages.DESC_EXPORT, createImageDescriptor(SharedImages.DESC_EXPORT));\r
80         registry.put(SharedImages.DESC_EXPORT_DISABLED, createImageDescriptor(SharedImages.DESC_EXPORT_DISABLED));\r
81         registry.put(SharedImages.DESC_FILTER, createImageDescriptor(SharedImages.DESC_FILTER));\r
82         registry.put(SharedImages.DESC_FILTER_DISABLED, createImageDescriptor(SharedImages.DESC_FILTER_DISABLED));\r
83         registry.put(SharedImages.DESC_IMPORT, createImageDescriptor(SharedImages.DESC_IMPORT));\r
84         registry.put(SharedImages.DESC_IMPORT_DISABLED, createImageDescriptor(SharedImages.DESC_IMPORT_DISABLED));\r
85         registry.put(SharedImages.DESC_OPEN_LOG, createImageDescriptor(SharedImages.DESC_OPEN_LOG));\r
86         registry.put(SharedImages.DESC_OPEN_LOG_DISABLED, createImageDescriptor(SharedImages.DESC_OPEN_LOG_DISABLED));\r
87         registry.put(SharedImages.DESC_PROPERTIES, createImageDescriptor(SharedImages.DESC_PROPERTIES));\r
88         registry.put(SharedImages.DESC_PROPERTIES_DISABLED, createImageDescriptor(SharedImages.DESC_PROPERTIES_DISABLED));\r
89         registry.put(SharedImages.DESC_READ_LOG, createImageDescriptor(SharedImages.DESC_READ_LOG));\r
90         registry.put(SharedImages.DESC_READ_LOG_DISABLED, createImageDescriptor(SharedImages.DESC_READ_LOG_DISABLED));\r
91     \r
92         registry.put(SharedImages.DESC_SHOW_TEXT_FILTER, createImageDescriptor(SharedImages.DESC_SHOW_TEXT_FILTER));\r
93     }\r
94 \r
95     private ImageDescriptor createImageDescriptor(String id) {\r
96         return imageDescriptorFromPlugin(PLUGIN_ID, id);\r
97     }\r
98         \r
99 }\r