View Javadoc

1   /*
2    * $Id: ViewPlugin.java,v 1.7 2004/09/14 12:50:58 jlerner Exp $
3    * Created on Jun 17, 2004
4    *
5    * Copyright (c) 1999-2004, BBN Technologies, LLC.
6    * All rights reserved.
7    * http://www.daml.org/legal/opensource/bbn_license.html
8    */
9   
10  package com.bbn.swede.view;
11  
12  import org.eclipse.core.runtime.Plugin;
13  
14  /***
15   * Plugin class for com.bbn.swede.view.  Contains convenience methods for
16   * working with SWeDE views.
17   * @author jlerner
18   */
19  public class ViewPlugin extends Plugin
20  {   
21     private static Plugin _plugin;
22  
23     /***
24      * Creates a new View plugin and sets it as the one and only instance.
25      */
26     public ViewPlugin()
27     {
28        super();
29        _plugin = this;
30     }
31  
32     /***
33      * Provides access to the one and only instance of the plugin.
34      * @return The singleton instance
35      */
36     public static Plugin getPlugin()
37     {
38        return _plugin;
39     }
40     
41     /***
42      * Provides access to the one and only instance of ViewPlugin.
43      * @return The singleton instance, cast as a ViewPlugin
44      */
45     public static ViewPlugin getViewPlugin()
46     {
47        return (ViewPlugin) _plugin;
48     }
49  
50     /***
51      * Retrieves the plugin's ID from the resource bundle.
52      * @return The plugin ID
53      */
54     public static String getID()
55     {
56        return ViewPlugin.getPlugin().getBundle().getSymbolicName();
57     }
58  }