net.refractions.udig.catalog.cgdi
Class CgdiPlugin

java.lang.Object
  extended by Plugin
      extended by net.refractions.udig.catalog.cgdi.CgdiPlugin

public class CgdiPlugin
extends Plugin

The main plugin class to be used in the desktop.


Field Summary
static java.lang.String ID
          CgdiPlugin ID field
 
Constructor Summary
CgdiPlugin()
          The constructor.
 
Method Summary
static CgdiPlugin getDefault()
          Returns the shared instance.
static ICatalog getDefaultLayerCatalog()
          Returns the shared instance.
static ICatalog getDefaultServiceCatalog()
          Returns the shared instance.
 java.util.ResourceBundle getResourceBundle()
          Returns the plugin's resource bundle,
static java.lang.String getResourceString(java.lang.String key)
          Returns the string from the plugin's resource bundle, or 'key' if not found.
static boolean isDebugging(java.lang.String trace)
          Performs the Platform.getDebugOption true check on the provided trace
static void log(java.lang.String message, java.lang.Throwable t)
          Logs the Throwable in the plugin's log.
 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
static void trace(java.lang.String message, java.lang.Throwable e)
          Messages that only engage if getDefault().isDebugging()
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ID

public static final java.lang.String ID
CgdiPlugin ID field

See Also:
Constant Field Values
Constructor Detail

CgdiPlugin

public CgdiPlugin()
The constructor.

Method Detail

start

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

Throws:
java.lang.Exception

stop

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

Throws:
java.lang.Exception

getDefault

public static CgdiPlugin getDefault()
Returns the shared instance.

Returns:
x

getDefaultServiceCatalog

public static ICatalog getDefaultServiceCatalog()
Returns the shared instance.

Returns:
x

getDefaultLayerCatalog

public static ICatalog getDefaultLayerCatalog()
Returns the shared instance.

Returns:
x

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.

Parameters:
key -
Returns:
x

getResourceBundle

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

Returns:
x

log

public static void log(java.lang.String message,
                       java.lang.Throwable t)
Logs the Throwable in the plugin's log.

This will be a user visable ERROR iff:

Parameters:
message -
t -

trace

public static void trace(java.lang.String message,
                         java.lang.Throwable e)
Messages that only engage if getDefault().isDebugging()

It is much prefered to do this:


 private static final String RENDERING = "net.refractions.udig.project/render/trace";
 if (ProjectUIPlugin.getDefault().isDebugging() && "true".equalsIgnoreCase(RENDERING)) {
     System.out.println("your message here");
 }
 

Parameters:
message -
e -

isDebugging

public static boolean isDebugging(java.lang.String trace)
Performs the Platform.getDebugOption true check on the provided trace

Note: ProjectUIPlugin.getDefault().isDebugging() must also be on.

Parameters:
trace - currently only RENDER is defined
Returns:
true if -debug is on for this plugin