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.grounding.sawsdl.ui;
26
27 import org.eclipse.ui.plugin.*;
28 import java.util.*;
29
30 /***
31 * The main plugin class to be used in the desktop.
32 */
33 public class UiPlugin extends AbstractUIPlugin {
34
35 private static UiPlugin plugin;
36
37 private ResourceBundle resourceBundle;
38
39 private static final String WSDL_1_1_SUPPORT_PROP = "wsdl11support";
40 private static final String LOCAL_IRIS_IN_TREE_PROP = "localnamesintree";
41 /***
42 * The constructor.
43 */
44 public UiPlugin() {
45 super();
46 plugin = this;
47 }
48
49 /***
50 * Returns the shared instance.
51 */
52 public static UiPlugin getDefault() {
53 return plugin;
54 }
55
56 /***
57 * Returns the string from the plugin's resource bundle,
58 * or 'key' if not found.
59 */
60 public static String getResourceString(String key) {
61 ResourceBundle bundle = UiPlugin.getDefault().getResourceBundle();
62 try {
63 return (bundle != null) ? bundle.getString(key) : key;
64 } catch (MissingResourceException e) {
65 return key;
66 }
67 }
68
69 /***
70 * Returns the plugin's resource bundle,
71 */
72 public ResourceBundle getResourceBundle() {
73 try {
74 if (resourceBundle == null)
75 resourceBundle = ResourceBundle.getBundle("org.wsmostudio.grounding.sawsdl.UiPluginResources");
76 } catch (MissingResourceException x) {
77 resourceBundle = null;
78 }
79 return resourceBundle;
80 }
81
82 public static boolean hasWSDL11Support() {
83 return plugin.getPreferenceStore().getBoolean(WSDL_1_1_SUPPORT_PROP);
84 }
85
86 public static void setWSDL11Support(boolean stat) {
87 plugin.getPreferenceStore().setValue(WSDL_1_1_SUPPORT_PROP, stat);
88 }
89
90 public static boolean isShowingLocalNames() {
91 return plugin.getPreferenceStore().getBoolean(LOCAL_IRIS_IN_TREE_PROP);
92 }
93
94 public static void setIsShowingLocalNames(boolean stat) {
95 plugin.getPreferenceStore().setValue(LOCAL_IRIS_IN_TREE_PROP, stat);
96 }
97
98 }
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116