]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.document.ui/src/org/simantics/document/ui/Activator.java
ListIndexRoots request
[simantics/platform.git] / bundles / org.simantics.document.ui / src / org / simantics / document / ui / Activator.java
1 /*******************************************************************************
2  * Copyright (c) 2012 Association for Decentralized Information Management in
3  * 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.document.ui;
13
14 import org.eclipse.jface.resource.ImageDescriptor;
15 import org.eclipse.ui.plugin.AbstractUIPlugin;
16 import org.osgi.framework.Bundle;
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.document.ui"; //$NON-NLS-1$
26
27         // The shared instance
28         private static Activator plugin;
29         
30     public ImageDescriptor DOCUMENT_DECORATION_ICON;
31     
32         public ImageDescriptor cross;
33         public ImageDescriptor clock_red;
34         
35         /**
36          * The constructor
37          */
38         public Activator() {
39         }
40
41         /*
42          * (non-Javadoc)
43          * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
44          */
45         public void start(BundleContext context) throws Exception {
46                 
47                 super.start(context);
48                 
49                 plugin = this;
50
51                 Bundle bundle = context.getBundle();
52                 
53                 DOCUMENT_DECORATION_ICON = ImageDescriptor.createFromURL(bundle.getResource("icons/document_decoration.png"));
54                 cross = ImageDescriptor.createFromURL(bundle.getResource("icons/silk_small/cross.png"));
55                 clock_red = ImageDescriptor.createFromURL(bundle.getResource("icons/silk_small/clock_red.png"));
56                 
57         }
58
59         /*
60          * (non-Javadoc)
61          * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
62          */
63         public void stop(BundleContext context) throws Exception {
64                 plugin = null;
65                 super.stop(context);
66         }
67
68         /**
69          * Returns the shared instance
70          *
71          * @return the shared instance
72          */
73         public static Activator getDefault() {
74                 return plugin;
75         }
76
77 }