com.javapathfinder.vjp
Class VJP

java.lang.Object
  extended by org.eclipse.core.runtime.Plugin
      extended by org.eclipse.ui.plugin.AbstractUIPlugin
          extended by com.javapathfinder.vjp.VJP
All Implemented Interfaces:
org.osgi.framework.BundleActivator

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

VJP serves as the main class for the VJP Project. This class serves as a utility to provide access to the logging and file system for this plugin.

Author:
Sandro Badame

Field Summary
static java.lang.String PLUGIN_ID
          This is a unique id for the VJP plugin.
 
Fields inherited from class org.eclipse.core.runtime.Plugin
PLUGIN_PREFERENCE_SCOPE, PREFERENCES_DEFAULT_OVERRIDE_BASE_NAME, PREFERENCES_DEFAULT_OVERRIDE_FILE_NAME
 
Constructor Summary
VJP()
          The default constructor for this plugin.
 
Method Summary
static VJP getDefault()
          Returns the shared instance
static java.net.URL getResourceURL(java.lang.String path)
          Gives a URL that points to the resource given by the path
static java.lang.String getRootPath()
          Gives an absolute path to the root of the VJP plugin directory
static void log(int severity, java.lang.String message, java.lang.Throwable exception)
          Convenience method to log any type of message.
static void logError(java.lang.String message)
          Convenience method to log errors
static void logError(java.lang.String message, java.lang.Throwable exception)
          Convenience method to log errors
static void logInfo(java.lang.String message)
          Convenience method to log plugin information.
static void logWarning(java.lang.String message)
          Convenience method to log Warnings without an exception This call is exactly equivalent to logWarning(message, null) @param message the message to include with the warning
static void logWarning(java.lang.String message, java.lang.Exception exception)
          Convenience method to log Warnings along with an exception @param message the message to include with the warning @param exception the exception to include with the warning
 void start(org.osgi.framework.BundleContext context)
          Used by Eclipse to start the plugin.
 void stop(org.osgi.framework.BundleContext context)
          Used by Eclipse to stop the plugin.
 
Methods inherited from class org.eclipse.ui.plugin.AbstractUIPlugin
getDialogSettings, getImageRegistry, getPreferenceStore, getWorkbench, imageDescriptorFromPlugin, 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
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

PLUGIN_ID

public static final java.lang.String PLUGIN_ID
This is a unique id for the VJP plugin.

See Also:
AbstractUIPlugin, Constant Field Values
Constructor Detail

VJP

public VJP()
The default constructor for this plugin. This is usually called by Eclipse and need not be called.

Method Detail

getDefault

public static VJP getDefault()
Returns the shared instance

Returns:
the shared instance

log

public static void log(int severity,
                       java.lang.String message,
                       java.lang.Throwable exception)
Convenience method to log any type of message. The code for this log will be Status.OK


logInfo

public static void logInfo(java.lang.String message)
Convenience method to log plugin information.


logWarning

public static void logWarning(java.lang.String message)
Convenience method to log Warnings without an exception This call is exactly equivalent to logWarning(message, null) @param message the message to include with the warning


logWarning

public static void logWarning(java.lang.String message,
                              java.lang.Exception exception)
Convenience method to log Warnings along with an exception @param message the message to include with the warning @param exception the exception to include with the warning


logError

public static void logError(java.lang.String message,
                            java.lang.Throwable exception)
Convenience method to log errors

Parameters:
message - the message to display with this error
exception - the exception to associate with ths error.

logError

public static void logError(java.lang.String message)
Convenience method to log errors

Parameters:
message - the message to display with this error

getRootPath

public static java.lang.String getRootPath()
Gives an absolute path to the root of the VJP plugin directory

Returns:
an absolute path to the root of the VJP plugin directory

getResourceURL

public static java.net.URL getResourceURL(java.lang.String path)
Gives a URL that points to the resource given by the path

Returns:
a URL pointing to the resource specified. null if the resource doesn't exist.

start

public void start(org.osgi.framework.BundleContext context)
           throws java.lang.Exception
Used by Eclipse to start the plugin. VJP does nothing special here.

Specified by:
start in interface org.osgi.framework.BundleActivator
Overrides:
start in class org.eclipse.ui.plugin.AbstractUIPlugin
Throws:
java.lang.Exception
See Also:
AbstractUIPlugin.start(org.osgi.framework.BundleContext)

stop

public void stop(org.osgi.framework.BundleContext context)
          throws java.lang.Exception
Used by Eclipse to stop the plugin. VJP only sets its own reference to this plugin to null. (ie: getDefault() will return null)

Specified by:
stop in interface org.osgi.framework.BundleActivator
Overrides:
stop in class org.eclipse.ui.plugin.AbstractUIPlugin
Throws:
java.lang.Exception
See Also:
AbstractUIPlugin.stop(org.osgi.framework.BundleContext)