de.tu_berlin.cs.tfs.muvitorkit.ui
Class MuvitorActivator

java.lang.Object
  extended by org.eclipse.core.runtime.Plugin
      extended by org.eclipse.ui.plugin.AbstractUIPlugin
          extended by de.tu_berlin.cs.tfs.muvitorkit.ui.MuvitorActivator
All Implemented Interfaces:
org.osgi.framework.BundleActivator

public class MuvitorActivator
extends AbstractUIPlugin

The activator class controls the plug-in's life cycle. It allows the editor to access this plug-in's properties (defined in the plugin.xml), e.g. the perspective and editor file extension. Also, the editor can store preference values or use the plugin's image registry to cache images. For this, a utility class, like IconUtilTemplate demonstrates, can be built to conveniently manage images located in this plugin's "icons" folder.

Rating red

Field Summary
 
Fields inherited from class org.eclipse.core.runtime.Plugin
PLUGIN_PREFERENCE_SCOPE, PREFERENCES_DEFAULT_OVERRIDE_BASE_NAME, PREFERENCES_DEFAULT_OVERRIDE_FILE_NAME
 
Constructor Summary
MuvitorActivator()
          The constructor
 
Method Summary
static MuvitorActivator getDefault()
          Returns the shared instance
static ImageDescriptor getImageDescriptor(String path)
          Returns an image descriptor for the image file at the given plugin-relative path.
static String getUniqueExtensionAttributeValue(String exPointID, String attribID)
          Convenience method to access the extension defined in plugin.xml.
static void logError(String message, Exception e)
          Convenience method for logging an error with this plugin
 void start(org.osgi.framework.BundleContext context)
           
 void stop(org.osgi.framework.BundleContext context)
           
 
Methods inherited from class org.eclipse.ui.plugin.AbstractUIPlugin
createImageRegistry, getDialogSettings, getImageRegistry, getPreferenceStore, getWorkbench, imageDescriptorFromPlugin, initializeDefaultPluginPreferences, initializeDefaultPreferences, initializeImageRegistry, loadDialogSettings, loadPreferenceStore, refreshPluginActions, saveDialogSettings, savePreferenceStore, shutdown, startup
 
Methods inherited from class org.eclipse.core.runtime.Plugin
find, find, getBundle, getDescriptor, getLog, getPluginPreferences, getStateLocation, internalInitializeDefaultPluginPreferences, isDebugging, openStream, openStream, savePluginPreferences, setDebugging, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MuvitorActivator

public MuvitorActivator()
The constructor

Method Detail

start

public void start(org.osgi.framework.BundleContext context)
           throws Exception
Specified by:
start in interface org.osgi.framework.BundleActivator
Overrides:
start in class AbstractUIPlugin
Throws:
Exception
See Also:
AbstractUIPlugin.start(org.osgi.framework.BundleContext)

stop

public void stop(org.osgi.framework.BundleContext context)
          throws Exception
Specified by:
stop in interface org.osgi.framework.BundleActivator
Overrides:
stop in class AbstractUIPlugin
Throws:
Exception
See Also:
AbstractUIPlugin.stop(org.osgi.framework.BundleContext)

getDefault

public static MuvitorActivator getDefault()
Returns the shared instance

Returns:
the shared instance

getImageDescriptor

public static ImageDescriptor getImageDescriptor(String path)
Returns an image descriptor for the image file at the given plugin-relative path.

Parameters:
path - the path
Returns:
the image descriptor

logError

public static void logError(String message,
                            Exception e)
Convenience method for logging an error with this plugin

Parameters:
message - The message for the IStatus to be logged for the plugin via MuvitorActivator.
e - An optional Exception to be reported.

getUniqueExtensionAttributeValue

public static String getUniqueExtensionAttributeValue(String exPointID,
                                                      String attribID)
Convenience method to access the extension defined in plugin.xml.

Parameters:
exPointID - The extension to be looked at.
attribID - The unique attribute whose value is requested.
Returns:
The value of the specified attribute.