View Javadoc

1   /*
2    WSMO Studio - a Semantic Web Service Editor
3    Copyright (c) 2004-2006, OntoText Lab. / SIRMA Group
4    
5    This library is free software; you can redistribute it and/or modify it under
6    the terms of the GNU Lesser General Public License as published by the Free
7    Software Foundation; either version 2.1 of the License, or (at your option)
8    any later version.
9    This library is distributed in the hope that it will be useful, but WITHOUT
10   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11   FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
12   details.
13   You should have received a copy of the GNU Lesser General Public License along
14   with this library; if not, write to the Free Software Foundation, Inc.,
15   59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
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  	//The shared instance.
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  * $Log$
105  * Revision 1.5  2006/01/09 12:51:11  alex_simov
106  * Copyright message in header updated
107  *
108  * Revision 1.4  2005/12/16 12:44:02  alex_simov
109  * Plugin activator contains a shared ChoreographyFactory instance
110  *
111  * Revision 1.3  2005/11/16 16:19:26  alex_simov
112  * new icon support
113  *
114  * Revision 1.2  2005/11/02 08:43:11  alex_simov
115  * update
116  *
117  * Revision 1.1  2005/10/27 11:15:08  alex_simov
118  * initial plugin commit
119  *
120  *
121  */