|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectca.sqlpower.architect.SQLObject
public abstract class SQLObject
| Field Summary | |
|---|---|
protected java.util.List |
children
The children of this SQLObject (if not applicable, set to Collections.EMPTY_LIST in your constructor). |
protected int |
magicDisableCount
When this counter is > 0, the fireXXX methods will ignore secondary changes. |
protected boolean |
populated
|
protected java.util.LinkedList<UndoCompoundEventListener> |
undoEventListeners
The list of SQLObject property change event listeners used for undo |
| Constructor Summary | |
|---|---|
SQLObject()
|
|
| Method Summary | |
|---|---|
void |
addChild(int index,
SQLObject newChild)
Adds the given SQLObject to this SQLObject at index. |
void |
addChild(SQLObject newChild)
Adds the given SQLObject to this SQLObject at the end of the child list by calling addChild(int,SQLObject). |
protected void |
addChildImpl(int index,
SQLObject newChild)
All other addChild() methods call this one. |
void |
addSQLObjectListener(SQLObjectListener l)
|
void |
addSQLObjectPreEventListener(SQLObjectPreEventListener l)
|
void |
addUndoEventListener(UndoCompoundEventListener l)
|
abstract boolean |
allowsChildren()
Returns true if and only if this object can have child SQLObjects. |
void |
endCompoundEdit(java.lang.String message)
|
protected void |
fireDbChildInserted(int newIndex,
SQLObject newChild)
|
protected boolean |
fireDbChildPreRemove(int oldIndex,
SQLObject oldChild)
Convenience method for fireDbChildrenPreRemove(int[], List) when there
is only one child being removed. |
protected void |
fireDbChildRemoved(int oldIndex,
SQLObject oldChild)
|
protected void |
fireDbChildrenInserted(int[] newIndices,
java.util.List newChildren)
|
protected boolean |
fireDbChildrenPreRemove(int[] oldIndices,
java.util.List oldChildren)
Fires a pre-remove event, and returns the status of whether or not the operation should proceed. |
protected void |
fireDbChildrenRemoved(int[] oldIndices,
java.util.List oldChildren)
|
protected void |
fireDbObjectChanged(java.lang.String propertyName,
java.lang.Object oldValue,
java.lang.Object newValue)
|
void |
fireDbStructureChanged()
Notifies listeners that a major change has occurred at or under this node. |
SQLObject |
getChild(int index)
|
SQLObject |
getChildByName(java.lang.String name)
Returns the first child (in the sequence of the getChildren() list) which has the given name (case sensitive). |
SQLObject |
getChildByNameIgnoreCase(java.lang.String name)
Returns the first child (in the sequence of the getChildren() list) which has the given name (case insensitive). |
int |
getChildCount()
|
java.util.List |
getChildren()
Returns an unmodifiable view of the child list. |
abstract java.lang.Class<? extends SQLObject> |
getChildType()
|
int |
getIndexOfChildByName(java.lang.String name)
Returns the index of the named child, or -1 if there is no child with that name. |
java.lang.String |
getName()
This is the name of the object. |
abstract SQLObject |
getParent()
Returns the parent of this SQLObject or null if it
is a root object such as SQLDatabase. |
java.lang.String |
getPhysicalName()
when the logical name is an illegal identifier in the target database, generate a legal name store it here. |
abstract java.lang.String |
getShortDisplayName()
Returns a short string that should be displayed to the user for representing this SQLObject as a label. |
java.util.List<SQLObjectListener> |
getSQLObjectListeners()
|
java.util.List<SQLObjectPreEventListener> |
getSQLObjectPreEventListeners()
|
java.util.LinkedList<UndoCompoundEventListener> |
getUndoEventListeners()
|
boolean |
isMagicEnabled()
|
boolean |
isPopulated()
Tells if this object has already been filled with children, or if that operation is still pending. |
protected abstract void |
populate()
Causes this SQLObject to load its children (if any exist). |
SQLObject |
removeChild(int index)
This implementation calls . |
boolean |
removeChild(SQLObject child)
This method is implemented in terms of removeImpl(int). |
protected SQLObject |
removeImpl(int index)
The implementation that all remove methods delegate to. |
void |
removeSQLObjectListener(SQLObjectListener l)
|
void |
removeSQLObjectPreEventListener(SQLObjectPreEventListener l)
|
void |
removeUndoEventListener(UndoCompoundEventListener l)
|
void |
setMagicEnabled(boolean enable)
|
void |
setName(java.lang.String argName)
Sets the value of sql object name |
protected abstract void |
setParent(SQLObject parent)
Parents call this on their children to update parent pointers during addChild and removeChild requests. |
void |
setPhysicalName(java.lang.String argName)
|
void |
setPopulated(boolean v)
Lets outside users modify the internal flag that says whether or not the list of child objects has already been loaded from the source database. |
void |
startCompoundEdit(java.lang.String message)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected boolean populated
protected java.util.List children
protected int magicDisableCount
protected java.util.LinkedList<UndoCompoundEventListener> undoEventListeners
| Constructor Detail |
|---|
public SQLObject()
| Method Detail |
|---|
public void setMagicEnabled(boolean enable)
public boolean isMagicEnabled()
public java.lang.String getName()
public void setName(java.lang.String argName)
argName - Value to assign to this.namepublic final java.lang.String getPhysicalName()
there is no good reason why this is final, but there is no good reason to override it at this time.
public final void setPhysicalName(java.lang.String argName)
public abstract SQLObject getParent()
null if it
is a root object such as SQLDatabase.
protected abstract void setParent(SQLObject parent)
protected abstract void populate()
throws ArchitectException
ArchitectExceptionpublic abstract java.lang.String getShortDisplayName()
public boolean isPopulated()
public void setPopulated(boolean v)
public abstract boolean allowsChildren()
return true" or
"return false" depending on object type.
public java.util.List getChildren()
throws ArchitectException
ArchitectException
public SQLObject getChild(int index)
throws ArchitectException
ArchitectException
public int getChildCount()
throws ArchitectException
ArchitectException
protected void addChildImpl(int index,
SQLObject newChild)
throws ArchitectException
index - The index that the new child will havenewChild - The new child to add (must be same type as all other children)
ArchitectException - If you try to add a child of a different type than the existing children.
public void addChild(int index,
SQLObject newChild)
throws ArchitectException
ArchitectException
ArchitectException
public void addChild(SQLObject newChild)
throws ArchitectException
addChild(int,SQLObject). Causes
a DBChildrenInserted event. If you want to override the
behaviour of addChild, do not override this method.
ArchitectException
ArchitectException
java.lang.Exceptionpublic SQLObject removeChild(int index)
public boolean removeChild(SQLObject child)
removeImpl(int).
protected SQLObject removeImpl(int index)
public java.util.List<SQLObjectListener> getSQLObjectListeners()
public void addSQLObjectListener(SQLObjectListener l)
public void removeSQLObjectListener(SQLObjectListener l)
protected void fireDbChildrenInserted(int[] newIndices,
java.util.List newChildren)
protected void fireDbChildInserted(int newIndex,
SQLObject newChild)
protected void fireDbChildrenRemoved(int[] oldIndices,
java.util.List oldChildren)
protected void fireDbChildRemoved(int oldIndex,
SQLObject oldChild)
protected void fireDbObjectChanged(java.lang.String propertyName,
java.lang.Object oldValue,
java.lang.Object newValue)
public void fireDbStructureChanged()
Note: This method is public because the PlayPen's Objects-Adder cleanup method needs to generate these notifications. That kind of code should be in this package instead.
public java.util.List<SQLObjectPreEventListener> getSQLObjectPreEventListeners()
public void addSQLObjectPreEventListener(SQLObjectPreEventListener l)
public void removeSQLObjectPreEventListener(SQLObjectPreEventListener l)
protected boolean fireDbChildrenPreRemove(int[] oldIndices,
java.util.List oldChildren)
oldIndices - The child indices that might be removedoldChildren - The children that might be removed
protected boolean fireDbChildPreRemove(int oldIndex,
SQLObject oldChild)
fireDbChildrenPreRemove(int[], List) when there
is only one child being removed.
oldIndex - The index of the child to be removedoldChild - The child to be removedpublic abstract java.lang.Class<? extends SQLObject> getChildType()
public void addUndoEventListener(UndoCompoundEventListener l)
public void removeUndoEventListener(UndoCompoundEventListener l)
public void startCompoundEdit(java.lang.String message)
public void endCompoundEdit(java.lang.String message)
public java.util.LinkedList<UndoCompoundEventListener> getUndoEventListeners()
public SQLObject getChildByName(java.lang.String name)
throws ArchitectException
name - The name of the child to look for (case sensitive).
ArchitectException - If the moon is waxing gibbous.
public SQLObject getChildByNameIgnoreCase(java.lang.String name)
throws ArchitectException
name - The name of the child to look for (case insensitive).
ArchitectException - If the moon is waxing gibbous.
public int getIndexOfChildByName(java.lang.String name)
throws ArchitectException
name - The name of the child to look for (case sensitive)
ArchitectException - if the child list can't be populated
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||