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.repository;
26  
27  import org.eclipse.ui.plugin.*;
28  import org.osgi.framework.BundleContext;
29  import java.util.*;
30  
31  /***
32   * The main Repository plugin class to be used in the WSMO Studio.
33   *
34   * @author not attributable
35   * @version $Revision: 469 $ $Date: 2006-01-09 14:51:14 +0200 $
36   */
37  
38  public class RepositoryPlugin extends AbstractUIPlugin {
39  	//The shared instance.
40  	private static RepositoryPlugin plugin;
41  	//Resource bundle.
42  	private ResourceBundle resourceBundle;
43  	
44  	/***
45  	 * The constructor.
46  	 */
47  	public RepositoryPlugin() {
48  		super();
49  		plugin = this;
50  		try {
51  			resourceBundle = ResourceBundle.getBundle("org.wsmostudio.repository.RepositoryPluginResources");
52  		} catch (MissingResourceException x) {
53  			resourceBundle = null;
54  		}
55  	}
56  
57  	/***
58  	 * This method is called upon plug-in activation
59  	 */
60  	public void start(BundleContext context) throws Exception {
61  		super.start(context);
62  	}
63  
64  	/***
65  	 * This method is called when the plug-in is stopped
66  	 */
67  	public void stop(BundleContext context) throws Exception {
68  		super.stop(context);
69  	}
70  
71  	/***
72  	 * Returns the shared instance.
73  	 */
74  	public static RepositoryPlugin getDefault() {
75  		return plugin;
76  	}
77  
78  	/***
79  	 * Returns the string from the plugin's resource bundle,
80  	 * or 'key' if not found.
81  	 */
82  	public static String getResourceString(String key) {
83  		ResourceBundle bundle = RepositoryPlugin.getDefault().getResourceBundle();
84  		try {
85  			return (bundle != null) ? bundle.getString(key) : key;
86  		} catch (MissingResourceException e) {
87  			return key;
88  		}
89  	}
90  
91  	/***
92  	 * Returns the plugin's resource bundle,
93  	 */
94  	public ResourceBundle getResourceBundle() {
95  		return resourceBundle;
96  	}
97  }
98  
99  /*
100  * $Log$
101  * Revision 1.3  2006/01/09 12:51:11  alex_simov
102  * Copyright message in header updated
103  *
104  * Revision 1.2  2005/07/21 11:46:31  alex_simov
105  * added javadoc: class description, footer
106  *
107  */