]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.message.ui/src/org/simantics/message/ui/Activator.java
2cc795dd09be2b14d137b8d7380fd918d2c3c2ce
[simantics/platform.git] / bundles / org.simantics.message.ui / src / org / simantics / message / ui / Activator.java
1 /*******************************************************************************
2  * Copyright (c) 2007, 2010 Association for Decentralized Information Management
3  * in Industry THTH ry.
4  * All rights reserved. This program and the accompanying materials
5  * are made available under the terms of the Eclipse Public License v1.0
6  * which accompanies this distribution, and is available at
7  * http://www.eclipse.org/legal/epl-v10.html
8  *
9  * Contributors:
10  *     VTT Technical Research Centre of Finland - initial API and implementation
11  *******************************************************************************/
12 package org.simantics.message.ui;
13
14 import org.eclipse.jface.resource.ImageDescriptor;
15 import org.eclipse.jface.resource.ImageRegistry;
16 import org.eclipse.ui.plugin.AbstractUIPlugin;
17 import org.osgi.framework.BundleContext;
18
19 /**
20  * The activator class controls the plug-in life cycle
21  */
22 public class Activator extends AbstractUIPlugin {
23
24         // The plug-in ID
25         public static final String PLUGIN_ID = "org.simantics.message.ui";
26
27         // The shared instance
28         private static Activator plugin;
29         
30         /**
31          * The constructor
32          */
33         public Activator() {
34         }
35
36         /*
37          * (non-Javadoc)
38          * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
39          */
40         public void start(BundleContext context) throws Exception {
41                 super.start(context);
42                 plugin = this;
43         }
44
45         /*
46          * (non-Javadoc)
47          * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
48          */
49         public void stop(BundleContext context) throws Exception {
50                 plugin = null;
51                 super.stop(context);
52         }
53
54         /**
55          * Returns the shared instance
56          *
57          * @return the shared instance
58          */
59         public static Activator getDefault() {
60                 return plugin;
61         }
62
63     protected void initializeImageRegistry(ImageRegistry registry) {
64         registry.put(SharedImages.DESC_PREV_EVENT, createImageDescriptor(SharedImages.DESC_PREV_EVENT));
65         registry.put(SharedImages.DESC_NEXT_EVENT, createImageDescriptor(SharedImages.DESC_NEXT_EVENT));
66
67         registry.put(SharedImages.DESC_DEBUG_ST_OBJ, createImageDescriptor(SharedImages.DESC_DEBUG_ST_OBJ));
68         registry.put(SharedImages.DESC_ERROR_ST_OBJ, createImageDescriptor(SharedImages.DESC_ERROR_ST_OBJ));
69         registry.put(SharedImages.DESC_ERROR_STACK_OBJ, createImageDescriptor(SharedImages.DESC_ERROR_STACK_OBJ));
70         registry.put(SharedImages.DESC_INFO_ST_OBJ, createImageDescriptor(SharedImages.DESC_INFO_ST_OBJ));
71         registry.put(SharedImages.DESC_OK_ST_OBJ, createImageDescriptor(SharedImages.DESC_OK_ST_OBJ));
72         registry.put(SharedImages.DESC_WARNING_ST_OBJ, createImageDescriptor(SharedImages.DESC_WARNING_ST_OBJ));
73         registry.put(SharedImages.DESC_HIERARCHICAL_LAYOUT_OBJ, createImageDescriptor(SharedImages.DESC_HIERARCHICAL_LAYOUT_OBJ));
74
75         registry.put(SharedImages.DESC_CLEAR, createImageDescriptor(SharedImages.DESC_CLEAR));
76         registry.put(SharedImages.DESC_CLEAR_DISABLED, createImageDescriptor(SharedImages.DESC_CLEAR_DISABLED));
77         registry.put(SharedImages.DESC_REMOVE_LOG, createImageDescriptor(SharedImages.DESC_REMOVE_LOG));
78         registry.put(SharedImages.DESC_REMOVE_LOG_DISABLED, createImageDescriptor(SharedImages.DESC_REMOVE_LOG_DISABLED));
79         registry.put(SharedImages.DESC_EXPORT, createImageDescriptor(SharedImages.DESC_EXPORT));
80         registry.put(SharedImages.DESC_EXPORT_DISABLED, createImageDescriptor(SharedImages.DESC_EXPORT_DISABLED));
81         registry.put(SharedImages.DESC_FILTER, createImageDescriptor(SharedImages.DESC_FILTER));
82         registry.put(SharedImages.DESC_FILTER_DISABLED, createImageDescriptor(SharedImages.DESC_FILTER_DISABLED));
83         registry.put(SharedImages.DESC_IMPORT, createImageDescriptor(SharedImages.DESC_IMPORT));
84         registry.put(SharedImages.DESC_IMPORT_DISABLED, createImageDescriptor(SharedImages.DESC_IMPORT_DISABLED));
85         registry.put(SharedImages.DESC_OPEN_LOG, createImageDescriptor(SharedImages.DESC_OPEN_LOG));
86         registry.put(SharedImages.DESC_OPEN_LOG_DISABLED, createImageDescriptor(SharedImages.DESC_OPEN_LOG_DISABLED));
87         registry.put(SharedImages.DESC_PROPERTIES, createImageDescriptor(SharedImages.DESC_PROPERTIES));
88         registry.put(SharedImages.DESC_PROPERTIES_DISABLED, createImageDescriptor(SharedImages.DESC_PROPERTIES_DISABLED));
89         registry.put(SharedImages.DESC_READ_LOG, createImageDescriptor(SharedImages.DESC_READ_LOG));
90         registry.put(SharedImages.DESC_READ_LOG_DISABLED, createImageDescriptor(SharedImages.DESC_READ_LOG_DISABLED));
91     
92         registry.put(SharedImages.DESC_SHOW_TEXT_FILTER, createImageDescriptor(SharedImages.DESC_SHOW_TEXT_FILTER));
93     }
94
95     private ImageDescriptor createImageDescriptor(String id) {
96         return imageDescriptorFromPlugin(PLUGIN_ID, id);
97     }
98         
99 }