org.patterncoder
Class BlueJHandler

java.lang.Object
  extended by org.patterncoder.BlueJHandler

public class BlueJHandler
extends java.lang.Object

Handles the BlueJ proxy object. All classes using the proxy should register an instance of this class using the getInstance method.


Field Summary
static bluej.extensions.BlueJ thisBlueJ
           
 
Method Summary
 void addClass(java.lang.String className)
          Adds a class to the current BlueJ project/package.
 java.io.File getBlueJDir()
          Returns the BlueJ directory.
 java.io.File getCurrentPackageDir()
          Returns the directory of the currently opened package.
 java.lang.String getCurrentPackageName()
          Returns the name of the currently opened package in the BlueJ environment.
static BlueJHandler getInstance()
          Controls the creation and management of the singleton object.
 java.io.File getProjectDir()
          Returns the directory of the currently opened project.
 java.io.File getUserConfigDir()
          Returns the current users BlueJ configuration directory.
 void reload()
          Reloads the current BlueJ package.
 void setBlueJ(bluej.extensions.BlueJ thisBlueJ)
          Sets the BlueJ proxy currently in use.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

thisBlueJ

public static bluej.extensions.BlueJ thisBlueJ
Method Detail

getInstance

public static BlueJHandler getInstance()
Controls the creation and management of the singleton object.

Returns:
the single instance of the BlueJHandler object.

setBlueJ

public void setBlueJ(bluej.extensions.BlueJ thisBlueJ)
Sets the BlueJ proxy currently in use.

Parameters:
thisBlueJ - The proxy object currently being used.

getUserConfigDir

public java.io.File getUserConfigDir()
Returns the current users BlueJ configuration directory.

C:\Documents and Settings\.....\BlueJ

Returns:
the current users BlueJ configuration directory.

getBlueJDir

public java.io.File getBlueJDir()
Returns the BlueJ directory.

C:\BlueJ

Returns:
the BlueJ directory.

getProjectDir

public java.io.File getProjectDir()
                           throws bluej.extensions.ProjectNotOpenException
Returns the directory of the currently opened project.

Returns:
the Project directory.
Throws:
bluej.extensions.ProjectNotOpenException - thrown if project not open.

getCurrentPackageDir

public java.io.File getCurrentPackageDir()
                                  throws bluej.extensions.ProjectNotOpenException,
                                         bluej.extensions.PackageNotFoundException
Returns the directory of the currently opened package.

Returns:
the package directory.
Throws:
bluej.extensions.ProjectNotOpenException - thrown if project not open.
bluej.extensions.PackageNotFoundException - thrown if package not found.

getCurrentPackageName

public java.lang.String getCurrentPackageName()
                                       throws bluej.extensions.ProjectNotOpenException,
                                              bluej.extensions.PackageNotFoundException
Returns the name of the currently opened package in the BlueJ environment.

Returns:
the name of the package.
Throws:
bluej.extensions.ProjectNotOpenException - thrown if project not open.
bluej.extensions.PackageNotFoundException - thrown if package not found.

addClass

public void addClass(java.lang.String className)
Adds a class to the current BlueJ project/package.

Parameters:
className - the name of the class to add.

reload

public void reload()
Reloads the current BlueJ package.