View Javadoc

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