KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > visualcontent > extensionpoints > ExtensionpointsPlugin


1 /**
2  * VC Browser - Visualizes the content of a JSR 170 compatible repository
3  * Copyright (C) 2006 Sandro Böhme
4  *
5  *
6  * Licensed under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  */

18 package org.visualcontent.extensionpoints;
19
20 import org.eclipse.jface.resource.ImageDescriptor;
21 import org.eclipse.ui.plugin.AbstractUIPlugin;
22 import org.osgi.framework.BundleContext;
23
24 /**
25  * The main plugin class to be used in the desktop.
26  */

27 public class ExtensionpointsPlugin extends AbstractUIPlugin {
28
29     //The shared instance.
30
private static ExtensionpointsPlugin plugin;
31     
32     /**
33      * The constructor.
34      */

35     public ExtensionpointsPlugin() {
36         plugin = this;
37     }
38
39     /**
40      * This method is called upon plug-in activation
41      */

42     public void start(BundleContext context) throws Exception JavaDoc {
43         super.start(context);
44     }
45
46     /**
47      * This method is called when the plug-in is stopped
48      */

49     public void stop(BundleContext context) throws Exception JavaDoc {
50         super.stop(context);
51         plugin = null;
52     }
53
54     /**
55      * Returns the shared instance.
56      */

57     public static ExtensionpointsPlugin getDefault() {
58         return plugin;
59     }
60
61     /**
62      * Returns an image descriptor for the image file at the given
63      * plug-in relative path.
64      *
65      * @param path the path
66      * @return the image descriptor
67      */

68     public static ImageDescriptor getImageDescriptor(String JavaDoc path) {
69         return AbstractUIPlugin.imageDescriptorFromPlugin("org.visualcontent.extensionpoints", path);
70     }
71 }
72
Popular Tags