ca.sqlpower.architect
Class SQLExceptionNode

java.lang.Object
  extended by ca.sqlpower.architect.SQLObject
      extended by ca.sqlpower.architect.SQLExceptionNode
All Implemented Interfaces:
java.io.Serializable

public class SQLExceptionNode
extends SQLObject

A SQLExceptionNode exists for reporting failures in the SQLObject hierarchy. For example, when the DBTree tries to expand a node and that results in failure, it adds one of these at the failure point.

See Also:
Serialized Form

Field Summary
protected  java.lang.Throwable exception
           
protected  java.lang.String message
           
protected  SQLObject parent
           
 
Fields inherited from class ca.sqlpower.architect.SQLObject
children, magicDisableCount, populated, undoEventListeners
 
Constructor Summary
SQLExceptionNode(java.lang.Throwable exception, java.lang.String message)
           
 
Method Summary
protected  void addChildImpl(int index, SQLObject child)
          All other addChild() methods call this one.
 boolean allowsChildren()
          Returns true if and only if this object can have child SQLObjects.
 java.lang.Class<? extends SQLObject> getChildType()
           
 java.lang.Throwable getException()
          If you wanna show the exception to the user later on, get it here.
 java.lang.String getMessage()
           
 java.lang.String getName()
          Returns the message.
 SQLObject getParent()
          Returns the parent of this SQLObject or null if it is a root object such as SQLDatabase.
 java.lang.String getShortDisplayName()
          Returns a short string that should be displayed to the user for representing this SQLObject as a label.
 boolean isPopulated()
          Tells if this object has already been filled with children, or if that operation is still pending.
 void populate()
          Causes this SQLObject to load its children (if any exist).
 void setMessage(java.lang.String v)
           
 void setParent(SQLObject parent)
          Because these nodes get added just as they are needed, it is sometimes necessary for users of the class (DBTreeModel) to set the parent directly.
 java.lang.String toString()
           
 
Methods inherited from class ca.sqlpower.architect.SQLObject
addChild, addChild, addSQLObjectListener, addSQLObjectPreEventListener, addUndoEventListener, endCompoundEdit, fireDbChildInserted, fireDbChildPreRemove, fireDbChildRemoved, fireDbChildrenInserted, fireDbChildrenPreRemove, fireDbChildrenRemoved, fireDbObjectChanged, fireDbStructureChanged, getChild, getChildByName, getChildByNameIgnoreCase, getChildCount, getChildren, getIndexOfChildByName, getPhysicalName, getSQLObjectListeners, getSQLObjectPreEventListeners, getUndoEventListeners, isMagicEnabled, removeChild, removeChild, removeImpl, removeSQLObjectListener, removeSQLObjectPreEventListener, removeUndoEventListener, setMagicEnabled, setName, setPhysicalName, setPopulated, startCompoundEdit
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

exception

protected java.lang.Throwable exception

message

protected java.lang.String message

parent

protected SQLObject parent
Constructor Detail

SQLExceptionNode

public SQLExceptionNode(java.lang.Throwable exception,
                        java.lang.String message)
Method Detail

getException

public java.lang.Throwable getException()
If you wanna show the exception to the user later on, get it here. But don't kid yourself: users don't read error messages.


getName

public java.lang.String getName()
Returns the message.

Overrides:
getName in class SQLObject

getParent

public SQLObject getParent()
Description copied from class: SQLObject
Returns the parent of this SQLObject or null if it is a root object such as SQLDatabase.

Specified by:
getParent in class SQLObject

setParent

public void setParent(SQLObject parent)
Because these nodes get added just as they are needed, it is sometimes necessary for users of the class (DBTreeModel) to set the parent directly.

Specified by:
setParent in class SQLObject

populate

public void populate()
Description copied from class: SQLObject
Causes this SQLObject to load its children (if any exist). This method will be called lots of times, so track whether or not you need to do anything and return right away whenever possible.

Specified by:
populate in class SQLObject

addChildImpl

protected void addChildImpl(int index,
                            SQLObject child)
Description copied from class: SQLObject
All other addChild() methods call this one. If you want to override the addChild behaviour, override this method only.

Overrides:
addChildImpl in class SQLObject
Parameters:
index - The index that the new child will have
child - The new child to add (must be same type as all other children)

isPopulated

public boolean isPopulated()
Description copied from class: SQLObject
Tells if this object has already been filled with children, or if that operation is still pending.

Overrides:
isPopulated in class SQLObject

getShortDisplayName

public java.lang.String getShortDisplayName()
Description copied from class: SQLObject
Returns a short string that should be displayed to the user for representing this SQLObject as a label.

Specified by:
getShortDisplayName in class SQLObject

allowsChildren

public boolean allowsChildren()
Description copied from class: SQLObject
Returns true if and only if this object can have child SQLObjects. Your implementation of this method must not cause JDBC activity, or the lazy loading properties of your SQLObjects will be wasted! Typically, you will implement this with a hardcoded "return true" or "return false" depending on object type.

Specified by:
allowsChildren in class SQLObject

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getMessage

public java.lang.String getMessage()

setMessage

public void setMessage(java.lang.String v)

getChildType

public java.lang.Class<? extends SQLObject> getChildType()
Specified by:
getChildType in class SQLObject


Copyright © 2003-2007 SQL Power Group Inc. www.sqlpower.ca