|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectca.sqlpower.wabit.AbstractWabitObject
ca.sqlpower.wabit.WabitContainer<T>
public abstract class WabitContainer<T extends WabitItem>
This container wraps any other kind of Container to allow attaching
WabitListeners that will be notified appropriately when events happen
on the container.
| Field Summary | |
|---|---|
protected java.util.List<T> |
children
This is a list of WabitItems that mimics the items in the delegate. |
| Constructor Summary | |
|---|---|
WabitContainer(ca.sqlpower.query.Container delegate)
|
|
WabitContainer(ca.sqlpower.query.Container delegate,
boolean createItemWrappers)
Creates a WabitObject that wraps any Container object. |
|
| Method Summary | |
|---|---|
protected void |
addChildImpl(WabitObject child,
int index)
This is the object specific implementation of #addChild(WabitObject). |
boolean |
allowsChildren()
Returns true if this object may contain children. |
int |
childPositionOffset(java.lang.Class<? extends WabitObject> childType)
Returns the position in the list that would be returned by getChildren() that the first object of type childClass is, or where it would be if there were any children of that type. |
CleanupExceptions |
cleanup()
Default cleanup method that does nothing. |
protected abstract T |
createWabitItemChild(ca.sqlpower.query.Item item)
Creates a child of the type this class contains |
java.lang.String |
getAlias()
|
protected abstract java.lang.Class<T> |
getChildClass()
Returns the class type of the children this container contains. |
java.util.List<? extends WabitObject> |
getChildren()
Returns an unmodifiable list of the children in this WabitObject. |
ca.sqlpower.query.Container |
getDelegate()
|
java.util.List<WabitObject> |
getDependencies()
Returns a list of all WabitObjects that this Wabit object is
dependent on. |
java.awt.geom.Point2D |
getPosition()
|
protected boolean |
removeChildImpl(WabitObject child)
This is the object specific implementation of removeChild. |
void |
removeDependency(WabitObject dependency)
Removes the given object as a dependency of this object. |
void |
setAlias(java.lang.String alias)
|
void |
setPosition(java.awt.geom.Point2D position)
|
| Methods inherited from class ca.sqlpower.wabit.AbstractWabitObject |
|---|
addChild, addWabitListener, begin, beginTransaction, commit, commitTransaction, equals, fireChildAdded, fireChildRemoved, firePropertyChange, firePropertyChange, firePropertyChange, fireTransactionEnded, fireTransactionRollback, fireTransactionStarted, generateNewUUID, getChildren, getName, getParent, getSession, getUUID, isForegroundThread, removeChild, removeWabitListener, rollback, rollbackTransaction, runInBackground, runInForeground, setName, setParent, setUUID, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected final java.util.List<T extends WabitItem> children
WabitItems that mimics the items in the delegate.
Items should be added to and removed from this list as they are added
to and removed from the delegate. These children will also be returned
instead of the delegate's children when they are requested. The children
of the delegate contain a parent pointer to the delegate and the WabitItems
point to this container instead.
| Constructor Detail |
|---|
public WabitContainer(ca.sqlpower.query.Container delegate)
public WabitContainer(ca.sqlpower.query.Container delegate,
boolean createItemWrappers)
Container object.
delegate - The Container to wrap.createItemWrappers - If true the children of the container will be wrapped to
start. If false there will be no WabitObject children
to this container.| Method Detail |
|---|
protected abstract T createWabitItemChild(ca.sqlpower.query.Item item)
item - The item to wrap in a WabitItem.
protected abstract java.lang.Class<T> getChildClass()
public CleanupExceptions cleanup()
AbstractWabitObject
cleanup in interface WabitObjectcleanup in class AbstractWabitObjectpublic ca.sqlpower.query.Container getDelegate()
protected boolean removeChildImpl(WabitObject child)
AbstractWabitObject
removeChildImpl in class AbstractWabitObjectAbstractWabitObject.removeChild(WabitObject)
protected void addChildImpl(WabitObject child,
int index)
AbstractWabitObject#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.
addChildImpl in class AbstractWabitObjectchild - The child to add to this object.index - The index to add the child at.public boolean allowsChildren()
WabitObject
WabitObject.childPositionOffset(Class)public int childPositionOffset(java.lang.Class<? extends WabitObject> childType)
WabitObject
public java.util.List<? extends WabitObject> getChildren()
WabitObject
public java.util.List<WabitObject> getDependencies()
WabitObjectWabitObjects that this Wabit object is
dependent on. Children of a WabitObject are not dependencies and will not
be returned in this list. If there are no objects this Wabit object is
dependent on an empty list should be returned. These are only the
immediate dependencies of this object. If you want to find the
dependencies of this object's dependencies as well it may be useful to
look at WorkspaceGraphModel to make a full graph of all of the
dependencies.
public void removeDependency(WabitObject dependency)
WabitObject
public java.lang.String getAlias()
public void setAlias(java.lang.String alias)
public java.awt.geom.Point2D getPosition()
public void setPosition(java.awt.geom.Point2D position)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||