net.refractions.udig.validation
Class ValidationPlugin

java.lang.Object
  extended by AbstractUIPlugin
      extended by net.refractions.udig.validation.ValidationPlugin

public class ValidationPlugin
extends AbstractUIPlugin

The main plugin class to be used in the desktop.


Field Summary
static java.lang.String ICONS_PATH
           
 
Constructor Summary
ValidationPlugin()
          The constructor.
 
Method Summary
static ValidationPlugin getDefault()
          Returns the shared instance.
static ImageDescriptor getImageDescriptor(java.lang.String path)
          Returns an image descriptor for the image file at the given plug-in relative path.
 Images getImages()
          Images instance for use with ImageConstants.
static boolean isDebugging(java.lang.String trace)
          Performs the Platform.getDebugOption true check on the provided trace
static void log(java.lang.String message)
          Writes an info log in the plugin's log.
static void log(java.lang.String message, java.lang.Throwable e)
          Writes an info log 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 traceID, java.lang.String message, java.lang.Throwable e)
          Messages that only engage if getDefault().isDebugging() and the trace option traceID is true.
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

ICONS_PATH

public static final java.lang.String ICONS_PATH
See Also:
Constant Field Values
Constructor Detail

ValidationPlugin

public ValidationPlugin()
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 ValidationPlugin getDefault()
Returns the shared instance.


getImageDescriptor

public static ImageDescriptor getImageDescriptor(java.lang.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

log

public static void log(java.lang.String message)
Writes an info log in the plugin's log.

Parameters:
message -

log

public static void log(java.lang.String message,
                       java.lang.Throwable e)
Writes an info log in the plugin's log.

This should be used for user level messages.


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" );


trace

public static void trace(java.lang.String traceID,
                         java.lang.String message,
                         java.lang.Throwable e)
Messages that only engage if getDefault().isDebugging() and the trace option traceID is true. Available trace options can be found in the Trace class. (They must also be part of the .options file)

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" );


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.

  • Trace.RENDER - trace rendering progress

Parameters:
trace - currently only RENDER is defined

getImages

public Images getImages()
Images instance for use with ImageConstants.

Returns:
Images for use with ImageConstants.