edu.rice.cs.drjava.plugins.eclipse
Class EclipsePlugin

java.lang.Object
  extended by org.eclipse.core.runtime.Plugin
      extended by org.eclipse.ui.plugin.AbstractUIPlugin
          extended by edu.rice.cs.drjava.plugins.eclipse.EclipsePlugin
All Implemented Interfaces:
org.osgi.framework.BundleActivator

public class EclipsePlugin
extends org.eclipse.ui.plugin.AbstractUIPlugin

The main plugin class to be used in the desktop. This was partially generated using Eclipse's plugin wizard. It appears to partly follow the singleton pattern, but the constructor is still public. Perhaps this is one of their own conventions?

Version:
$Id: EclipsePlugin.java 4698 2008-12-09 15:25:10Z dlsmith $

Field Summary
static String PLUGIN_ID
           
 
Fields inherited from class org.eclipse.core.runtime.Plugin
PLUGIN_PREFERENCE_SCOPE, PREFERENCES_DEFAULT_OVERRIDE_BASE_NAME, PREFERENCES_DEFAULT_OVERRIDE_FILE_NAME
 
Constructor Summary
EclipsePlugin()
          Constructs a new EclipsePlugin.
 
Method Summary
static EclipsePlugin getDefault()
          Returns the shared instance of the plugin.
static org.eclipse.jface.resource.ImageDescriptor getImageDescriptor(String path)
          Returns an image descriptor for the image file at the given plug-in relative path
 String getPluginClasspath()
          Make a best attempt to return the classpath containing all plugin libraries.
 ResourceBundle getResourceBundle()
          Returns the plugin's resource bundle,
static String getResourceString(String key)
          Returns the string from the plugin's resource bundle, or 'key' if not found.
static org.eclipse.core.resources.IWorkspace getWorkspace()
          Returns the workspace instance.
protected  void initializeDefaultPreferences(org.eclipse.jface.preference.IPreferenceStore store)
          Sets default preference values.
 void log(String msg)
           
 void log(String msg, Exception e)
           
 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, 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
 

Field Detail

PLUGIN_ID

public static final String PLUGIN_ID
See Also:
Constant Field Values
Constructor Detail

EclipsePlugin

public EclipsePlugin()
Constructs a new EclipsePlugin.

Parameters:
descriptor - PluginDescriptor used by Eclipse
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 org.eclipse.ui.plugin.AbstractUIPlugin
Throws:
Exception

log

public void log(String msg)

log

public void log(String msg,
                Exception e)

stop

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

getDefault

public static EclipsePlugin getDefault()
Returns the shared instance of the plugin.


getWorkspace

public static org.eclipse.core.resources.IWorkspace getWorkspace()
Returns the workspace instance.


getImageDescriptor

public static org.eclipse.jface.resource.ImageDescriptor getImageDescriptor(String path)
Returns an image descriptor for the image file at the given plug-in relative path

Parameters:
path - the path
Returns:
the image descriptor

getResourceString

public static String getResourceString(String key)
Returns the string from the plugin's resource bundle, or 'key' if not found.


getResourceBundle

public ResourceBundle getResourceBundle()
Returns the plugin's resource bundle,


getPluginClasspath

public String getPluginClasspath()
Make a best attempt to return the classpath containing all plugin libraries. May fail if the bundle URL can't be interpreted as a local file, or if some IO error occurs. In that case, returns an empty string.


initializeDefaultPreferences

protected void initializeDefaultPreferences(org.eclipse.jface.preference.IPreferenceStore store)
Sets default preference values. These values will be used until some preferences are actually set using Preference dialog.

Overrides:
initializeDefaultPreferences in class org.eclipse.ui.plugin.AbstractUIPlugin