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.repository;
26
27 import org.eclipse.ui.plugin.*;
28 import org.osgi.framework.BundleContext;
29 import java.util.*;
30
31 /***
32 * The main Repository plugin class to be used in the WSMO Studio.
33 *
34 * @author not attributable
35 * @version $Revision: 469 $ $Date: 2006-01-09 14:51:14 +0200 $
36 */
37
38 public class RepositoryPlugin extends AbstractUIPlugin {
39
40 private static RepositoryPlugin plugin;
41
42 private ResourceBundle resourceBundle;
43
44 /***
45 * The constructor.
46 */
47 public RepositoryPlugin() {
48 super();
49 plugin = this;
50 try {
51 resourceBundle = ResourceBundle.getBundle("org.wsmostudio.repository.RepositoryPluginResources");
52 } catch (MissingResourceException x) {
53 resourceBundle = null;
54 }
55 }
56
57 /***
58 * This method is called upon plug-in activation
59 */
60 public void start(BundleContext context) throws Exception {
61 super.start(context);
62 }
63
64 /***
65 * This method is called when the plug-in is stopped
66 */
67 public void stop(BundleContext context) throws Exception {
68 super.stop(context);
69 }
70
71 /***
72 * Returns the shared instance.
73 */
74 public static RepositoryPlugin getDefault() {
75 return plugin;
76 }
77
78 /***
79 * Returns the string from the plugin's resource bundle,
80 * or 'key' if not found.
81 */
82 public static String getResourceString(String key) {
83 ResourceBundle bundle = RepositoryPlugin.getDefault().getResourceBundle();
84 try {
85 return (bundle != null) ? bundle.getString(key) : key;
86 } catch (MissingResourceException e) {
87 return key;
88 }
89 }
90
91 /***
92 * Returns the plugin's resource bundle,
93 */
94 public ResourceBundle getResourceBundle() {
95 return resourceBundle;
96 }
97 }
98
99
100
101
102
103
104
105
106
107