1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 /***
19 * <p>Title: WSMO Studio</p>
20 * <p>Description: Semantic Web Service Editor</p>
21 * <p>Copyright: Copyright (c) 2004-2006</p>
22 * <p>Company: OntoText Lab. / SIRMA </p>
23 */
24
25 package org.wsmostudio.ui;
26
27 import org.eclipse.ui.plugin.*;
28 import org.osgi.framework.BundleContext;
29 import org.wsmostudio.ui.editors.extension.ExtensionManager;
30
31 import java.util.*;
32
33 /***
34 * The main WSMO plugin class to be used in the studio.
35 */
36 public class WsmoUIPlugin extends AbstractUIPlugin {
37
38 private static WsmoUIPlugin plugin;
39
40 private ResourceBundle resourceBundle;
41
42 private ExtensionManager extManager;
43
44 /***
45 * The constructor.
46 */
47 public WsmoUIPlugin() {
48 super();
49 plugin = this;
50 try {
51 resourceBundle = ResourceBundle.getBundle("org.wsmostudio.ui.WsmoUIPluginResources");
52 }
53 catch (MissingResourceException x) {
54 resourceBundle = null;
55 }
56 }
57
58 /***
59 * This method is called upon plug-in activation
60 */
61 public void start(BundleContext context) throws Exception {
62 extManager = new ExtensionManager();
63 super.start(context);
64 }
65
66 /***
67 * This method is called when the plug-in is stopped
68 */
69 public void stop(BundleContext context) throws Exception {
70 super.stop(context);
71 }
72
73 /***
74 * Returns the shared instance.
75 */
76 public static WsmoUIPlugin getDefault() {
77 return plugin;
78 }
79
80 /***
81 * Returns the string from the plugin's resource bundle,
82 * or 'key' if not found.
83 */
84 public static String getResourceString(String key) {
85 ResourceBundle bundle = WsmoUIPlugin.getDefault().getResourceBundle();
86 try {
87 return (bundle != null) ? bundle.getString(key) : key;
88 } catch (MissingResourceException e) {
89 return key;
90 }
91 }
92
93 /***
94 * Returns the plugin's resource bundle,
95 */
96 public ResourceBundle getResourceBundle() {
97 return resourceBundle;
98 }
99
100 public ExtensionManager getExtensionManager() {
101 return extManager;
102 }
103 }
104
105
106
107
108
109
110
111
112
113