bluej.extensions.event
Class ClassEvent

java.lang.Object
  extended by bluej.extensions.event.ClassEvent
All Implemented Interfaces:
ExtensionEvent

public class ClassEvent
extends java.lang.Object
implements ExtensionEvent

This class encapsulates events which occur on BlueJ classes.

The following events can occur:

STATE_CHANGED: The compile state changed (either from uncompiled to compiled, or from compiled to uncompiled)

CHANGED_NAME: The class has changed name.

Version:
$Id: ClassEvent.java 6215 2009-03-30 13:28:25Z polle $
Author:
Davin McCall

Field Summary
static int CHANGED_NAME
           
static int STATE_CHANGED
           
 
Constructor Summary
ClassEvent(int eventId, BClass bClass, boolean isCompiled)
          Construct a new ClassEvent object for a STATE_CHANGED event.
ClassEvent(int eventId, BClass bClass, java.lang.String oldName)
          Construct a new ClassEvent object for a CHANGED_NAME event.
 
Method Summary
 BClass getBClass()
          Get the BClass object identifying the class on which the event occurred.
 int getEventId()
          Get the event Id (one of STATE_CHANGED, CHANGED_NAME).
 java.lang.String getOldName()
          Get the new class name.
 boolean isClassCompiled()
          Check whether the class for which the event occurred is compiled.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

STATE_CHANGED

public static final int STATE_CHANGED
See Also:
Constant Field Values

CHANGED_NAME

public static final int CHANGED_NAME
See Also:
Constant Field Values
Constructor Detail

ClassEvent

public ClassEvent(int eventId,
                  BClass bClass,
                  boolean isCompiled)
Construct a new ClassEvent object for a STATE_CHANGED event.

Parameters:
eventId - The event identifier (STATE_CHANGED)
isCompiled - Whether the class is compiled or not

ClassEvent

public ClassEvent(int eventId,
                  BClass bClass,
                  java.lang.String oldName)
Construct a new ClassEvent object for a CHANGED_NAME event.

Parameters:
eventId - The event identifier (CHANGED_NAME)
bClass - The class which was renamed (refers to the new name)
Method Detail

getEventId

public int getEventId()
Get the event Id (one of STATE_CHANGED, CHANGED_NAME).


isClassCompiled

public boolean isClassCompiled()
Check whether the class for which the event occurred is compiled. Valid for STATE_CHANGED event.


getBClass

public BClass getBClass()
Get the BClass object identifying the class on which the event occurred.


getOldName

public java.lang.String getOldName()
Get the new class name. Valid for CHANGED_NAME event.



BlueJ homepage