View Javadoc

1   /*
2    WSMO Studio - a Semantic Web Service Editor
3    Copyright (c) 2004-2007, 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-2007</p>
22   * <p>Company: Ontotext Lab. / SIRMA </p>
23   */
24  
25  package org.semanticgov.ui;
26  
27  import org.eclipse.jface.resource.ImageDescriptor;
28  import org.eclipse.swt.graphics.Image;
29  import org.eclipse.ui.plugin.AbstractUIPlugin;
30  import org.osgi.framework.BundleContext;
31  
32  /***
33   * The activator class controls the plug-in life cycle
34   */
35  public class Activator extends AbstractUIPlugin {
36  
37  	// The plug-in ID
38  	public static final String PLUGIN_ID = "org.semanticgov.ui";
39  
40  	// The shared instance
41  	private static Activator plugin;
42      private static ImageDescriptor logo;
43      private static Image wsdlIcon, clearIcon, repoIcon, reloadIcon, propsIcon;
44  	
45  	/***
46  	 * The constructor
47  	 */
48  	public Activator() {
49  		plugin = this;
50          logo = imageDescriptorFromPlugin(PLUGIN_ID, "img/logo.gif");
51          ImageDescriptor wsdlIDescr = imageDescriptorFromPlugin(PLUGIN_ID, "icons/wsdl16.gif"); 
52          if (wsdlIDescr != null) {
53              wsdlIcon = wsdlIDescr.createImage();
54          }
55          wsdlIDescr = imageDescriptorFromPlugin(PLUGIN_ID, "icons/clear.png"); 
56          if (wsdlIDescr != null) {
57          	clearIcon = wsdlIDescr.createImage();
58          }
59          wsdlIDescr = imageDescriptorFromPlugin(PLUGIN_ID, "icons/rep.gif"); 
60          if (wsdlIDescr != null) {
61          	repoIcon = wsdlIDescr.createImage();
62          }
63          wsdlIDescr = imageDescriptorFromPlugin(PLUGIN_ID, "icons/reload.png"); 
64          if (wsdlIDescr != null) {
65              reloadIcon = wsdlIDescr.createImage();
66          }
67          wsdlIDescr = imageDescriptorFromPlugin(PLUGIN_ID, "icons/properties.gif"); 
68          if (wsdlIDescr != null) {
69              propsIcon = wsdlIDescr.createImage();
70          }
71  	}
72  
73  	/*
74  	 * (non-Javadoc)
75  	 * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
76  	 */
77  	public void start(BundleContext context) throws Exception {
78  		super.start(context);
79  	}
80  
81  	/*
82  	 * (non-Javadoc)
83  	 * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
84  	 */
85  	public void stop(BundleContext context) throws Exception {
86  		plugin = null;
87  		super.stop(context);
88  	}
89  
90  	/***
91  	 * Returns the shared instance
92  	 *
93  	 * @return the shared instance
94  	 */
95  	public static Activator getDefault() {
96  		return plugin;
97  	}
98      
99      public static ImageDescriptor getSGLogo() {
100         return logo;
101     }
102 
103     public static Image getWSDLLogo() {
104         return wsdlIcon;
105     }
106 
107     public static Image getClearIcon() {
108         return clearIcon;
109     }
110     public static Image getRepositoryIcon() {
111         return repoIcon;
112     }
113     public static Image getReloadIcon() {
114         return reloadIcon;
115     }
116     public static Image getPropertiesIcon() {
117         return propsIcon;
118     }
119 
120 }
121 
122 /*
123  * $Log: Activator.java,v $
124  * Revision 1.1  2007/01/12 16:30:28  alex_simov
125  * PA Service editor initial version
126  *
127  */