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.choreography;
26
27 import org.deri.wsmo4j.choreography.ChoreographyFactoryRI;
28 import org.eclipse.ui.plugin.*;
29 import org.osgi.framework.BundleContext;
30 import org.wsmo.factory.ChoreographyFactory;
31 import org.wsmostudio.runtime.WsmoImageRegistry;
32
33 /***
34 * The main Choreography plugin configurator class
35 */
36 public class ChoreographyPlugin extends AbstractUIPlugin {
37
38
39 private static ChoreographyPlugin plugin;
40 private static ChoreographyFactory factory;;
41 private static final String pliginID = "org.wsmostudio.choreography";
42
43 public static final String IN_MODE_ICON = "icons/conceptin.gif";
44 public static final String OUT_MODE_ICON = "icons/conceptout.gif";
45 public static final String SHARED_MODE_ICON = "icons/conceptsh.gif";
46 public static final String STATIC_MODE_ICON = "icons/conceptstat.gif";
47 public static final String CONTROLLED_MODE_ICON = "icons/conceptctrl.gif";
48
49 public static final String ADD_RULE_ICON = "icons/add.gif";
50 public static final String DELETE_RULE_ICON = "icons/delete.gif";
51 public static final String UPDATE_RULE_ICON = "icons/update.gif";
52 public static final String IF_RULE_ICON = "icons/if.gif";
53 public static final String ALL_RULE_ICON = "icons/all.gif";
54 public static final String CHOOSE_RULE_ICON = "icons/choose.gif";
55
56 /***
57 * The constructor.
58 */
59 public ChoreographyPlugin() {
60 plugin = this;
61 }
62
63 /***
64 * This method is called upon plug-in activation
65 */
66 public void start(BundleContext context) throws Exception {
67 WsmoImageRegistry.declareStudioImage(pliginID, IN_MODE_ICON, IN_MODE_ICON);
68 WsmoImageRegistry.declareStudioImage(pliginID, OUT_MODE_ICON, OUT_MODE_ICON);
69 WsmoImageRegistry.declareStudioImage(pliginID, SHARED_MODE_ICON, SHARED_MODE_ICON);
70 WsmoImageRegistry.declareStudioImage(pliginID, STATIC_MODE_ICON, STATIC_MODE_ICON);
71 WsmoImageRegistry.declareStudioImage(pliginID, CONTROLLED_MODE_ICON, CONTROLLED_MODE_ICON);
72
73 WsmoImageRegistry.declareStudioImage(pliginID, ADD_RULE_ICON, ADD_RULE_ICON);
74 WsmoImageRegistry.declareStudioImage(pliginID, DELETE_RULE_ICON, DELETE_RULE_ICON);
75 WsmoImageRegistry.declareStudioImage(pliginID, UPDATE_RULE_ICON, UPDATE_RULE_ICON);
76 WsmoImageRegistry.declareStudioImage(pliginID, IF_RULE_ICON, IF_RULE_ICON);
77 WsmoImageRegistry.declareStudioImage(pliginID, ALL_RULE_ICON, ALL_RULE_ICON);
78 WsmoImageRegistry.declareStudioImage(pliginID, CHOOSE_RULE_ICON, CHOOSE_RULE_ICON);
79 factory = new ChoreographyFactoryRI();
80 super.start(context);
81 }
82
83 /***
84 * This method is called when the plug-in is stopped
85 */
86 public void stop(BundleContext context) throws Exception {
87 super.stop(context);
88 plugin = null;
89 }
90
91 /***
92 * Returns the shared instance.
93 */
94 public static ChoreographyPlugin getDefault() {
95 return plugin;
96 }
97
98 public static ChoreographyFactory getFactory() {
99 return factory;
100 }
101 }
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121