|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectca.sqlpower.wabit.AbstractWabitObject
public abstract class AbstractWabitObject
| Constructor Summary | |
|---|---|
AbstractWabitObject()
|
|
AbstractWabitObject(java.lang.String uuid)
The uuid string passed in must be the toString representation of the UUID for this object. |
|
| Method Summary | ||
|---|---|---|
void |
addChild(WabitObject child,
int index)
Adds the given child object to this object. |
|
protected void |
addChildImpl(WabitObject child,
int index)
This is the object specific implementation of #addChild(WabitObject). |
|
void |
addWabitListener(WabitListener l)
Adds a listener that will be notified when children are added to or removed from this object, when properties change, and when a transaction starts and ends. |
|
void |
begin(java.lang.String message)
Starts a transaction that will pool multiple events into a compound event. |
|
void |
beginTransaction(java.lang.String message)
|
|
CleanupExceptions |
cleanup()
Default cleanup method that does nothing. |
|
void |
commit()
Signals the end of a transaction of a compound event. |
|
void |
commitTransaction()
|
|
boolean |
equals(java.lang.Object obj)
|
|
protected WabitChildEvent |
fireChildAdded(java.lang.Class<? extends WabitObject> type,
WabitObject child,
int index)
Fires a child added event to all child listeners. |
|
protected WabitChildEvent |
fireChildRemoved(java.lang.Class<? extends WabitObject> type,
WabitObject child,
int index)
Fires a child removed event to all child listeners. |
|
protected java.beans.PropertyChangeEvent |
firePropertyChange(java.lang.String propertyName,
boolean oldValue,
boolean newValue)
Fires a property change on the foreground thread as defined by the current session being used. |
|
protected java.beans.PropertyChangeEvent |
firePropertyChange(java.lang.String propertyName,
int oldValue,
int newValue)
Fires a property change on the foreground thread as defined by the current session being used. |
|
protected java.beans.PropertyChangeEvent |
firePropertyChange(java.lang.String propertyName,
java.lang.Object oldValue,
java.lang.Object newValue)
Fires a property change on the foreground thread as defined by the current session being used. |
|
protected ca.sqlpower.util.TransactionEvent |
fireTransactionEnded()
Fires a transaction ended event. |
|
protected ca.sqlpower.util.TransactionEvent |
fireTransactionRollback(java.lang.String message)
Fires a transaction rollback event with a message indicating the reason/type of the rollback. |
|
protected ca.sqlpower.util.TransactionEvent |
fireTransactionStarted(java.lang.String message)
Fires a transaction started event with a message indicating the reason/type of the transaction. |
|
void |
generateNewUUID()
Sets the UUID of this object to a newly generated UUID. |
|
|
getChildren(java.lang.Class<T> type)
Returns a list of all children of the given type |
|
java.lang.String |
getName()
Returns the short name for this object. |
|
WabitObject |
getParent()
Returns the parent of this WabitObject. |
|
protected WabitSession |
getSession()
Helper method to find the session of a WabitObject. |
|
java.lang.String |
getUUID()
|
|
protected boolean |
isForegroundThread()
|
|
boolean |
removeChild(WabitObject child)
Removes the given child object from this object. |
|
protected abstract boolean |
removeChildImpl(WabitObject child)
This is the object specific implementation of removeChild. |
|
void |
removeWabitListener(WabitListener l)
Removes a listener that was previously attached to this wabit object. |
|
void |
rollback(java.lang.String message)
Signals the roll back of a transaction. |
|
void |
rollbackTransaction()
|
|
protected void |
runInBackground(java.lang.Runnable runner)
Calls the runInBackground method on the session this object is attached to if it exists. |
|
protected void |
runInForeground(java.lang.Runnable runner)
Calls the runInForeground method on the session this object is attached to if it exists. |
|
void |
setName(java.lang.String name)
Sets the name for this object |
|
void |
setParent(WabitObject parent)
Sets the parent of this object to the given object. |
|
void |
setUUID(java.lang.String uuid)
|
|
java.lang.String |
toString()
|
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface ca.sqlpower.wabit.WabitObject |
|---|
allowsChildren, childPositionOffset, getChildren, getDependencies, removeDependency |
| Constructor Detail |
|---|
public AbstractWabitObject()
public AbstractWabitObject(java.lang.String uuid)
| Method Detail |
|---|
public void setUUID(java.lang.String uuid)
setUUID in interface WabitObjectpublic void generateNewUUID()
WabitObject
generateNewUUID in interface WabitObjectpublic void addWabitListener(WabitListener l)
WabitObject
addWabitListener in interface WabitObjectl - The listener to add.WabitListener,
WabitSession.runInForeground(Runnable)public void removeWabitListener(WabitListener l)
WabitObject
removeWabitListener in interface WabitObjectl - The listener to remove.
protected WabitChildEvent fireChildAdded(java.lang.Class<? extends WabitObject> type,
WabitObject child,
int index)
type - The canonical type of the child being addedchild - The child object that was addedindex - The index of the added child within its own child list (this
will be converted to the overall child position before the
event object is constructed).
protected WabitChildEvent fireChildRemoved(java.lang.Class<? extends WabitObject> type,
WabitObject child,
int index)
type - The canonical type of the child being removedchild - The child object that was removedindex - The index that the removed child was at within its own child
list (this will be converted to the overall child position
before the event object is constructed).
protected java.beans.PropertyChangeEvent firePropertyChange(java.lang.String propertyName,
boolean oldValue,
boolean newValue)
protected java.beans.PropertyChangeEvent firePropertyChange(java.lang.String propertyName,
int oldValue,
int newValue)
protected java.beans.PropertyChangeEvent firePropertyChange(java.lang.String propertyName,
java.lang.Object oldValue,
java.lang.Object newValue)
public void beginTransaction(java.lang.String message)
public void commitTransaction()
public void rollbackTransaction()
protected ca.sqlpower.util.TransactionEvent fireTransactionStarted(java.lang.String message)
protected ca.sqlpower.util.TransactionEvent fireTransactionEnded()
protected ca.sqlpower.util.TransactionEvent fireTransactionRollback(java.lang.String message)
public <T extends WabitObject> java.util.List<T> getChildren(java.lang.Class<T> type)
WabitObject
getChildren in interface WabitObjectpublic WabitObject getParent()
WabitObjectWabitObject
tree.
getParent in interface WabitObjectpublic void setParent(WabitObject parent)
WabitObject
setParent in interface WabitObjectparent - The new parent of this object.public java.lang.String getName()
WabitObject
getName in interface WabitObjectpublic void setName(java.lang.String name)
WabitObject
setName in interface WabitObjectpublic java.lang.String getUUID()
getUUID in interface WabitObject
public final boolean removeChild(WabitObject child)
throws ObjectDependentException
WabitObject
removeChild in interface WabitObjectchild - The object to remove as a child of this object.
ObjectDependentExceptionprotected abstract boolean removeChildImpl(WabitObject child)
removeChild(WabitObject)
public final void addChild(WabitObject child,
int index)
throws java.lang.IllegalArgumentException
WabitObject
addChild in interface WabitObjectchild - The object to add as a child of this object.index - The index to add the child to. This cannot be greater than the
number of children in the object of the given type. This is
the position of the child in the list of children of a
specific type. The position of the child is in respect to
children of its type.
java.lang.IllegalArgumentException - If the given child is not a valid child type of the object.
protected void addChildImpl(WabitObject child,
int index)
#addChild(WabitObject). There are checks in the
#addChild(WabitObject) method to ensure that the object given
here is a valid child type of this object.
This method should be overwritten if children are allowed.
child - The child to add to this object.index - The index to add the child at.public CleanupExceptions cleanup()
cleanup in interface WabitObjectprotected WabitSession getSession()
protected void runInBackground(java.lang.Runnable runner)
WabitSession.runInBackground(Runnable)protected void runInForeground(java.lang.Runnable runner)
WabitSession.runInBackground(Runnable)protected boolean isForegroundThread()
public boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic void begin(java.lang.String message)
WabitObject
begin in interface WabitObjectmessage - Description of the compound event.public void commit()
WabitObject
commit in interface WabitObjectpublic void rollback(java.lang.String message)
WabitObject
rollback in interface WabitObjectmessage - Reason for the roll back.public java.lang.String toString()
toString in class java.lang.Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||