|
IBM DB2 UDB Plugin Interface for Extending the Control Center |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.util.EventObject
com.ibm.db2.tools.cc.navigator.CCObjectCollectionEvent
Instances of this class represent one of three types of events that may be triggered by a plugin: Add, Remove and Alter. In addition to the source Object that the EventObject's constructor takes, the CCObjectCollectionEvent takes two extra parameters: an event type and a second Object to serve as what the source is replaced with in the Alter scenario.
To use this class, make
the CCObject implementation that represents a folder in the tree extend
java.util.Observable. When you wish to add a child to the folder,
call notifyObservers
with an instance of this class as the argument.
This will notify the Control Center of the event since the Control Center automatically registers itself as an Observer of any CCTableObject that extends Observable. The Control Center will respond to the event by updating the tree and details view.
For example:
public class Example3Folder extends Observable implements CCTreeObject { ... public void addChild(Example3Child child) { childVector.addElement(child); setChanged(); notifyObservers(new CCObjectCollectionEvent(this, CCObjectCollectionEvent.OBJECT_ADDED, child)); } ... }
Observable
,
Serialized FormField Summary | |
---|---|
static int |
OBJECT_ADDED
An event in which an object was added to a folder in the Control Center tree. |
static int |
OBJECT_ALTERED
An event in which an object in the Control Center tree had one of its visible attributes changed and the Control Center needs to reflect this. |
static int |
OBJECT_REMOVED
An event in which an object was removed from a folder in the Control Center tree. |
Fields inherited from class java.util.EventObject |
---|
source |
Constructor Summary | |
---|---|
CCObjectCollectionEvent(java.lang.Object source,
int eventType,
java.lang.Object arg)
Constructs an event that represents a change in a collection of CCObjects, such as a folder in the Control Center tree. |
Method Summary | |
---|---|
java.lang.Object |
getArg()
This method returns the argument that was passed in when the event was constructed. |
int |
getEventType()
This method returns what type of event this is: an OBJECT_ADDED ,
OBJECT_REMOVED or
OBJECT_ALTERED event. |
Methods inherited from class java.util.EventObject |
---|
getSource, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final int OBJECT_ADDED
public static final int OBJECT_REMOVED
public static final int OBJECT_ALTERED
Constructor Detail |
public CCObjectCollectionEvent(java.lang.Object source, int eventType, java.lang.Object arg)
source
- The source of the event, such as the folder for add and remove eventseventType
- Whether the event is due to an object being added, removed or alteredarg
- An argument that may be used to specify what object has been added, removed
or alteredMethod Detail |
public java.lang.Object getArg()
public int getEventType()
OBJECT_ADDED
,
OBJECT_REMOVED
or
OBJECT_ALTERED
event.
|
IBM DB2 UDB Plugin Interface for Extending the Control Center |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
(C)Copyright IBM Corp. 2002, 2004. All rights reserved.
Links on this page are made available for your convenience and may take you to non-IBM sites. IBM does not warrant any sample code provided on these sites.