LPEX
3.6.6

com.ibm.lpex.alef
Class LpexPlugin

java.lang.Object
  extended by AbstractUIPlugin
      extended by com.ibm.lpex.alef.LpexPlugin

public class LpexPlugin
extends AbstractUIPlugin

LPEX Editor plug-in runtime class.


Field Summary
static String PLUGIN_ID
          LPEX Editor plug-in id (value "com.ibm.lpex").
 
Constructor Summary
LpexPlugin()
          Constructs an LPEX plug-in runtime object.
 
Method Summary
static LpexPlugin getDefault()
          Returns an instance of this plug-in.
static ResourceBundle getResourceBundle()
          Returns the resource bundle for this plug-in.
static String getResourceLpexString(String key)
          Returns the string with the specified key from the LpexPlugin resource bundle.
static String getResourceLpexString(String key, String arg)
          Returns the string with the specified key and substitution argument from the LpexPlugin resource bundle.
static String getResourceString(String key)
          Returns a string from the LpexPlugin resource bundle.
 void start(BundleContext context)
          Starts up the LPEX plug-in.
 void stop(BundleContext context)
          Stops the LPEX plug-in.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PLUGIN_ID

public static final String PLUGIN_ID
LPEX Editor plug-in id (value "com.ibm.lpex").

See Also:
Constant Field Values
Constructor Detail

LpexPlugin

public LpexPlugin()
Constructs an LPEX plug-in runtime object. This method is called by the Eclipse workbench runtime when the associated bundle is being activated.

Method Detail

getDefault

public static LpexPlugin getDefault()
Returns an instance of this plug-in. Eclipse-style static convenience method to gain access to a plug-in's runtime object, so code in other parts of the plug-in implementation without direct access to the plug-in runtime object can easily obtain a reference to it, and hence to any plug-in-wide resources recorded on it.

Returns:
the initialized instance of LpexPlugin

getResourceBundle

public static ResourceBundle getResourceBundle()
Returns the resource bundle for this plug-in. The resource file of the LPEX Editor plug-in is com.ibm.lpex.alef.PluginResources.properties.


getResourceString

public static String getResourceString(String key)
Returns a string from the LpexPlugin resource bundle.

Returns:
the key if not found
See Also:
getResourceLpexString(String), getResourceLpexString(String,String)

getResourceLpexString

public static String getResourceLpexString(String key)
Returns the string with the specified key from the LpexPlugin resource bundle. This method uses class LpexResources to retrieve the value, which assumes certain syntax rules for the text in the resource.

Returns:
the key if not found
See Also:
LpexResources, getResourceString(String), getResourceLpexString(String,String)

getResourceLpexString

public static String getResourceLpexString(String key,
                                           String arg)
Returns the string with the specified key and substitution argument from the LpexPlugin resource bundle. This method uses class LpexResources to retrieve the value, which assumes certain syntax rules for the text in the resource.

Returns:
the key if not found
See Also:
LpexResources, getResourceString(String), getResourceLpexString(String)

start

public void start(BundleContext context)
           throws Exception
Starts up the LPEX plug-in. This method is automatically invoked by the platform core the first time any code in the plug-in is executed. It is intended to perform a simple initialization of the plug-in environment. The platform may terminate initializers that do not complete in a timely fashion.

If this method throws an exception, it is taken as an indication that the plug-in initialization has failed; as a result, the plug-in will not be activated; moreover, the plug-in will be marked as disabled and ineligible for activation for the duration.

Plug-in startup code should be robust. In the event of a startup failure, the plug-in's stop() method will be invoked automatically, in an attempt to close open files, etc.

Parameters:
context - the bundle context that represents the plug-in to the OSGi framework; for security reasons, it is strongly recommended that this object should not be divulged
Throws:
Exception - if this plug-in did not start up properly
See Also:
AbstractUIPlugin

stop

public void stop(BundleContext context)
          throws Exception
Stops the LPEX plug-in. The AbstractUIPlugin implementation of this method saves this plug-in's preference and dialog stores and shuts down its image registry (if they are in use).

This method may be re-implemented in subclasses that need to do something when the plug-in is shut down. Implementors should call the super method, and as late as possible to ensure that any system requirements can be met. A try-finally statement should be used where necessary to ensure that super.stop() is always done.

Plug-in shutdown code should be robust. In particular, this method should always make an effort to shut down the plug-in. Furthermore, the code should not assume that the plug-in was started successfully, as this method will be invoked in the event of a failure during startup.

Throws:
Exception
See Also:
AbstractUIPlugin

LPEX
3.6.6

Copyright © 2012 IBM Corp. All Rights Reserved.

Note: This documentation is for part of an interim API that is still under development and expected to change significantly before reaching stability. It is being made available at this early stage to solicit feedback from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken (repeatedly) as the API evolves.