|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object bluej.extensions.BlueJ
public final class BlueJ
A proxy object which provides services to BlueJ extensions. From this class an extension can obtain the projects and packages which BlueJ is currently displayng and the classes and objects they contain. Fields and methods of these objects can be inspected and invoked using an API based on Java's reflection API. Every effort has been made to retain the logic of the Reflection API and to provide methods that behave in a very similar way.
BlueJ | +---- BProject | +---- BPackage | +--------- BClass | | +- BObject + BConstructor | | | +- BObject | +---- BMethod | | | +- BObject | +---- BFieldAttempts to invoke methods on a BlueJ object made by an extension after its
terminate()
method has been called will result
in an (unchecked) ExtensionUnloadedException
being thrown.
Field Summary | |
---|---|
static int |
ME_PROJECT
|
static int |
SE_PROJECT
|
Method Summary | |
---|---|
void |
addApplicationListener(ApplicationListener listener)
Registers a listener for application events. |
void |
addClassListener(ClassListener listener)
Register a listener for class events. |
void |
addCompileListener(CompileListener listener)
Registers a listener for compile events. |
void |
addExtensionEventListener(ExtensionEventListener listener)
Registers a listener for all the events generated by BlueJ. |
void |
addInvocationListener(InvocationListener listener)
Registers a listener for invocation events. |
void |
addPackageListener(PackageListener listener)
Registers a listener for package events. |
java.lang.String |
getBlueJPropertyString(java.lang.String property,
java.lang.String def)
Returns a property from BlueJ's properties, or the given default value if the property is not currently set. |
java.awt.Frame |
getCurrentFrame()
Returns the current frame being displayed. |
BPackage |
getCurrentPackage()
Returns the currently selected package. |
java.lang.String |
getExtensionPropertyString(java.lang.String property,
java.lang.String def)
Return a property associated with this extension from the standard BlueJ property repository. |
java.lang.String |
getLabel(java.lang.String key)
Returns the language-dependent label with the given key. |
MenuGenerator |
getMenuGenerator()
Returns the currently registered menu generator |
BProject[] |
getOpenProjects()
Returns all currently open projects. |
PreferenceGenerator |
getPreferenceGenerator()
Returns the currently registered preference generator. |
java.io.File |
getSystemLibDir()
Returns the path of the <BLUEJ_HOME>/lib system directory. |
java.io.File |
getUserConfigDir()
Returns the path of the user configuration directory. |
BProject |
newProject(java.io.File directory)
Creates a new BlueJ project. |
BProject |
newProject(java.io.File directory,
int projectType)
Creates a new BlueJ project. |
BProject |
openProject(java.io.File directory)
Opens a project. |
void |
removeApplicationListener(ApplicationListener listener)
Removes the specified listener so that it no longer receives events. |
void |
removeClassListener(ClassListener listener)
Removes the specified class listener so no that it no longer receives class events. |
void |
removeCompileListener(CompileListener listener)
Removes the specified listener so that it no longer receives events. |
void |
removeExtensionEventListener(ExtensionEventListener listener)
Removes the specified listener so that it no longer receives events. |
void |
removeInvocationListener(InvocationListener listener)
Removes the specified listener so no that it no longer receives events. |
void |
removePackageListener(PackageListener listener)
Removes the specified listener so that it no longer receives events. |
void |
setExtensionPropertyString(java.lang.String property,
java.lang.String value)
Sets a property associated with this extension into the standard BlueJ property repository. |
void |
setMenuGenerator(MenuGenerator menuGen)
Install a new menu generator for this extension. |
void |
setPreferenceGenerator(PreferenceGenerator prefGen)
Install a new preference panel for this extension. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int SE_PROJECT
public static final int ME_PROJECT
Method Detail |
---|
public final BProject openProject(java.io.File directory)
directory
- Where the project is stored.
public BProject newProject(java.io.File directory, int projectType)
directory
- where you want the project be placed, it must be writable.projectType
- the type of project, such as ME or SE.
public BProject newProject(java.io.File directory)
directory
- where you want the project be placed, it must be writable.
public BProject[] getOpenProjects()
public BPackage getCurrentPackage()
public java.awt.Frame getCurrentFrame()
getFrame()
method to provide better placement.
public void setMenuGenerator(MenuGenerator menuGen)
menuGen
- The new menuGenerator valuepublic MenuGenerator getMenuGenerator()
public void setPreferenceGenerator(PreferenceGenerator prefGen)
prefGen
- a class instance that implements the PreferenceGenerator interface.public PreferenceGenerator getPreferenceGenerator()
public java.io.File getSystemLibDir()
<BLUEJ_HOME>/lib
system directory.
This can be used to locate systemwide configuration files.
Having the directory you can then locate a file within it.
public java.io.File getUserConfigDir()
public java.lang.String getBlueJPropertyString(java.lang.String property, java.lang.String def)
property
- The name of the required global propertydef
- The default value to use if the property cannot be found.
public java.lang.String getExtensionPropertyString(java.lang.String property, java.lang.String def)
property
- The name of the required global property.def
- The default value to use if the property cannot be found.
public void setExtensionPropertyString(java.lang.String property, java.lang.String value)
property
- The name of the required global propertyvalue
- the required value of that property.public java.lang.String getLabel(java.lang.String key)
label
files and
if the requested label is not found in the BlueJ system label
files.
Extensions' labels are stored in a Property format and must be jarred together
with the extension. The path searched is equivalent to the bluej/lib/[language]
style used for the BlueJ system labels. E.g. to create a set of labels which can be used
by English, Italian and German users of an extension, the following files would need to
be present in the extension's Jar file:
lib/english/label lib/italian/label lib/german/labelThe files named
label
would contain the actual label key/value pairs.
key
- Description of the Parameter
public void addExtensionEventListener(ExtensionEventListener listener)
public void removeExtensionEventListener(ExtensionEventListener listener)
public void addApplicationListener(ApplicationListener listener)
public void removeApplicationListener(ApplicationListener listener)
public void addPackageListener(PackageListener listener)
public void removePackageListener(PackageListener listener)
public void addCompileListener(CompileListener listener)
public void removeCompileListener(CompileListener listener)
public void addInvocationListener(InvocationListener listener)
public void removeInvocationListener(InvocationListener listener)
public void addClassListener(ClassListener listener)
listener
- public void removeClassListener(ClassListener listener)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |