classpathhelper.eclipse.ui
Class UIPlugin

java.lang.Object
  extended byAbstractUIPlugin
      extended byclasspathhelper.eclipse.ui.UIPlugin

public class UIPlugin
extends AbstractUIPlugin

The Plugin Class for the UI portion of classpath helper.

Since:
1.0
Author:
bharris
See Also:
Serialized Form

Nested Class Summary
static class UIPlugin.SharedImages
           
 
Constructor Summary
UIPlugin()
          The constructor.
 
Method Summary
static CGClassLoaderFilter getCGClassLoaderFilter()
           
 IClassPathModel getClassPathModel()
          Gets the class path model that views should register themselves with.
static java.lang.String getCurrentModelPreference()
           
static UIPlugin getDefault()
           
static Image getIcon(ContentDetail theDetail)
          Helper method that determins the best image for a content detail object.
static Image getIcon(Location location)
          Helper method for loading the appropriate image for a location object.
static ImageDescriptor getIconImageDescriptor(Location location)
          Helper method that provides the ImageDescriptor for the icon to associate with this tree node.
 int getIndexOfExtension(java.lang.String id)
          Method for find the index from of the model (as ordered in the array from getModelExtensions()).
 ClassPathModelExtension[] getModelExtensions()
          Returns a handle to all the objects that extend the classpathmodels extension point.
 IClassPathModel getNotOnClassPathModel()
          Method that returns the class path model for classes not on the classpath.
 ClassPathModelExtension getPreferredModelExtension()
          The current model that is selected given the current preference settings.
 java.util.ResourceBundle getResourceBundle()
           
static java.lang.String getResourceString(java.lang.String key)
           
static ISharedImages getSharedImages()
          Shared images from this plugin.
static boolean getShouldMonitorFilesPreference()
           
protected  void initializeDefaultPluginPreferences()
           
 void start(BundleContext context)
          This method is called upon plug-in activation
 void stop(BundleContext context)
          This method is called when the plug-in is stopped
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UIPlugin

public UIPlugin()
The constructor.

Since:
1.0
Method Detail

start

public void start(BundleContext context)
           throws java.lang.Exception
This method is called upon plug-in activation

Throws:
java.lang.Exception
Since:
1.0

stop

public void stop(BundleContext context)
          throws java.lang.Exception
This method is called when the plug-in is stopped

Throws:
java.lang.Exception
Since:
1.0

getDefault

public static UIPlugin getDefault()
Returns:
the shared instance.
Since:
1.0

getResourceString

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

getResourceBundle

public java.util.ResourceBundle getResourceBundle()
Returns:
the plugin's resource bundle,
Since:
1.0

getCurrentModelPreference

public static java.lang.String getCurrentModelPreference()
Returns:
The id of the IClassPathModel that is selected as the current source.
Since:
1.0

getShouldMonitorFilesPreference

public static boolean getShouldMonitorFilesPreference()
Returns:
Flag indicating whether or not the classpath models should monitor the files they are reading for changes.
Since:
1.1

getCGClassLoaderFilter

public static CGClassLoaderFilter getCGClassLoaderFilter()
Returns:
Filter that implements the CGClassLoaderFilter.allowsHasBlocked(CGClassLoader, String) method based on the configured patterns.
Since:
1.1

getIcon

public static Image getIcon(ContentDetail theDetail)
Helper method that determins the best image for a content detail object.

Parameters:
theDetail - The detail object (or null).
Returns:
The appropriate image (A class or interface icon). If theDetail is null this method will return the class icon.
Since:
1.0

getIcon

public static Image getIcon(Location location)
Helper method for loading the appropriate image for a location object.

Parameters:
location - The location.
Returns:
The approprite image (typically a folder or jar).
Since:
1.0

getIconImageDescriptor

public static ImageDescriptor getIconImageDescriptor(Location location)
Helper method that provides the ImageDescriptor for the icon to associate with this tree node.

Parameters:
location - The location
Returns:
A Jar or File image.
Since:
1.0

getClassPathModel

public IClassPathModel getClassPathModel()
Gets the class path model that views should register themselves with.

Returns:
The classpath model.
Since:
1.0

getPreferredModelExtension

public ClassPathModelExtension getPreferredModelExtension()
The current model that is selected given the current preference settings.

Returns:
The currently preferred model.
Since:
1.0

getIndexOfExtension

public int getIndexOfExtension(java.lang.String id)
Method for find the index from of the model (as ordered in the array from getModelExtensions()).

Parameters:
id - The id of the model to find the extension for.
Returns:
The index of the model or 0 if the model cannot be found but there's at least one model or -1 if no extensions exist.
Since:
1.0

getModelExtensions

public ClassPathModelExtension[] getModelExtensions()
Returns a handle to all the objects that extend the classpathmodels extension point. Actual extensions are loaded on demand.

Returns:
An array of extensions.
Since:
1.0

getNotOnClassPathModel

public IClassPathModel getNotOnClassPathModel()
                                       throws CoreException
Method that returns the class path model for classes not on the classpath. Although this is loaded via an extension point, at this time there is only expected to be a single plug-in extension here.

Returns:
The classpath model representing jars not on the classpath.
Throws:
CoreException - if there's a problem creating the model.
Since:
1.2

initializeDefaultPluginPreferences

protected void initializeDefaultPluginPreferences()

getSharedImages

public static ISharedImages getSharedImages()
Shared images from this plugin.

Returns:
The shared images from this plugin.
Since:
1.0