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 com.ontotext.wsmo4j;
26
27 import org.eclipse.ui.plugin.*;
28 import org.osgi.framework.BundleContext;
29 import java.util.*;
30
31 /***
32 * The main plugin class to be used in the desktop.
33 */
34 public class Wsmo4jPlugin extends AbstractUIPlugin {
35
36 private static Wsmo4jPlugin plugin;
37
38 private ResourceBundle resourceBundle;
39
40 /***
41 * The constructor.
42 */
43 public Wsmo4jPlugin() {
44 super();
45 plugin = this;
46 try {
47 resourceBundle = ResourceBundle.getBundle("com.ontotext.wsmo4j.Wsmo4jPluginResources");
48 } catch (MissingResourceException x) {
49 resourceBundle = null;
50 }
51 }
52
53 /***
54 * This method is called upon plug-in activation
55 */
56 public void start(BundleContext context) throws Exception {
57 super.start(context);
58 }
59
60 /***
61 * This method is called when the plug-in is stopped
62 */
63 public void stop(BundleContext context) throws Exception {
64 super.stop(context);
65 }
66
67 /***
68 * Returns the shared instance.
69 */
70 public static Wsmo4jPlugin getDefault() {
71 return plugin;
72 }
73
74 /***
75 * Returns the string from the plugin's resource bundle,
76 * or 'key' if not found.
77 */
78 public static String getResourceString(String key) {
79 ResourceBundle bundle = Wsmo4jPlugin.getDefault().getResourceBundle();
80 try {
81 return (bundle != null) ? bundle.getString(key) : key;
82 } catch (MissingResourceException e) {
83 return key;
84 }
85 }
86
87 /***
88 * Returns the plugin's resource bundle,
89 */
90 public ResourceBundle getResourceBundle() {
91 return resourceBundle;
92 }
93 }