]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.team.ui/src/org/simantics/team/Activator.java
Fixed all line endings of the repository
[simantics/platform.git] / bundles / org.simantics.team.ui / src / org / simantics / team / 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.team;
13
14 import java.net.URL;
15
16 import org.eclipse.jface.resource.ImageDescriptor;
17 import org.eclipse.ui.plugin.AbstractUIPlugin;
18 import org.osgi.framework.BundleContext;
19 import org.simantics.team.internal.Images;
20 import org.simantics.utils.ui.BundleUtils;
21
22 /**
23  * The activator class controls the plug-in life cycle
24  */
25 public class Activator extends AbstractUIPlugin {
26
27     // The plug-in ID
28     public static final String PLUGIN_ID = "org.simantics.team.ui";
29
30     // The shared instance
31     private static Activator plugin;
32
33     /**
34      * The constructor
35      */
36     public Activator() {
37     }
38
39     /*
40      * (non-Javadoc)
41      * 
42      * @see
43      * org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext
44      * )
45      */
46     public static ImageDescriptor DOOR_IN_ICON;
47     public static ImageDescriptor DOOR_OUT_ICON;
48     public static ImageDescriptor BIN_ICON;
49     public static ImageDescriptor BIN_CLOSED_ICON;
50     public static ImageDescriptor BIN_EMPTY_ICON;
51     public static ImageDescriptor REFRESH_ICON;
52     public static ImageDescriptor CHANGE_SET_ICON;
53     public static ImageDescriptor DISPLAY_ICON;
54     public static ImageDescriptor RESOURCE_ICON;
55     public static ImageDescriptor STRING_ICON;
56     public static ImageDescriptor COMBINED_ICON;
57     public static ImageDescriptor UNDO_ICON;
58     public static ImageDescriptor REDO_ICON;
59     public static ImageDescriptor OTHER_ICON;
60     public static ImageDescriptor REMOVE_ALL_ICON;
61     public static ImageDescriptor NEXT_ICON;
62     public static ImageDescriptor PREVIOUS_ICON;
63     public static ImageDescriptor DEBUG_ICON;
64     public static ImageDescriptor EXIT_ICON;
65
66     public void start(BundleContext context) throws Exception {
67         super.start(context);
68         plugin = this;
69         DOOR_IN_ICON = ImageDescriptor.createFromURL(new URL("platform:/plugin/com.famfamfam.silk/icons/door_out.png"));
70         DOOR_OUT_ICON = ImageDescriptor.createFromURL(new URL("platform:/plugin/com.famfamfam.silk/icons/door_in.png"));
71         BIN_ICON = ImageDescriptor.createFromURL(new URL("platform:/plugin/com.famfamfam.silk/icons/bin.png"));
72         BIN_CLOSED_ICON = ImageDescriptor.createFromURL(new URL("platform:/plugin/com.famfamfam.silk/icons/bin_closed.png"));
73         BIN_EMPTY_ICON = ImageDescriptor.createFromURL(new URL("platform:/plugin/com.famfamfam.silk/icons/bin_empty.png"));
74         REFRESH_ICON = ImageDescriptor.createFromURL(new URL("platform:/plugin/com.famfamfam.silk/icons/arrow_refresh.png"));
75         CHANGE_SET_ICON = BundleUtils.getImageDescriptorFromPlugin("com.famfamfam.silk", "icons/book.png");
76         DISPLAY_ICON = BundleUtils.getImageDescriptorFromPlugin("com.famfamfam.silk", "icons/anchor.png");
77         RESOURCE_ICON = BundleUtils.getImageDescriptorFromPlugin("com.famfamfam.silk", "icons/application.png");
78         STRING_ICON = BundleUtils.getImageDescriptorFromPlugin("com.famfamfam.silk", "icons/star.png");
79         COMBINED_ICON = BundleUtils.getImageDescriptorFromPlugin("com.famfamfam.silk", "icons/basket.png");
80         REDO_ICON = BundleUtils.getImageDescriptorFromPlugin("com.famfamfam.silk", "icons/arrow_redo.png");
81         UNDO_ICON = BundleUtils.getImageDescriptorFromPlugin("com.famfamfam.silk", "icons/arrow_undo.png");
82         OTHER_ICON = BundleUtils.getImageDescriptorFromPlugin("com.famfamfam.silk", "icons/bell.png");
83         REMOVE_ALL_ICON = BundleUtils.getImageDescriptorFromPlugin("com.famfamfam.silk", "icons/cross.png");
84         NEXT_ICON = BundleUtils.getImageDescriptorFromPlugin("com.famfamfam.silk", "icons/book_next.png");
85         PREVIOUS_ICON = BundleUtils.getImageDescriptorFromPlugin("com.famfamfam.silk", "icons/book_previous.png");
86         DEBUG_ICON = ImageDescriptor.createFromURL(new URL("platform:/plugin/com.famfamfam.silk/icons/bomb.png"));
87         EXIT_ICON = ImageDescriptor.createFromURL(new URL("platform:/plugin/com.famfamfam.silk/icons/hourglass.png"));
88     }
89
90     /*
91      * (non-Javadoc)
92      * 
93      * @see
94      * org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext
95      * )
96      */
97     public void stop(BundleContext context) throws Exception {
98         Images.disposeInstance();
99         plugin = null;
100         super.stop(context);
101     }
102
103     /**
104      * Returns the shared instance
105      * 
106      * @return the shared instance
107      */
108     public static Activator getDefault() {
109         return plugin;
110     }
111
112 }