org.eclipse.datatools.enablement.sybase.asa.schemaobjecteditor.examples.tableeditor.pages.constraints
Class SQLConstraintsTreeViewerInput

java.lang.Object
  extended by org.eclipse.datatools.enablement.sybase.asa.schemaobjecteditor.examples.tableeditor.pages.constraints.SQLConstraintsTreeViewerInput
All Implemented Interfaces:
ISchemaObjectEditorModelListener

public class SQLConstraintsTreeViewerInput
extends java.lang.Object
implements ISchemaObjectEditorModelListener

Given a table, this class can generate a tree (The content) for the constraints tree viewer.

   root
   |-- Constraint
        |
        |---Primary Key
        |---Unique Constraints
        |---Foreign Keys
        |---Check Constraints
 

Author:
Idull

Field Summary
static java.lang.String CHECK_CONSTRAINT_NODE
           
static java.lang.String COLUMN_CHECK_CONSTRAINT_NODE
           
static java.lang.String CONSTRAINTS_NODE
           
static java.lang.String FOREIGN_KEY_NODE
           
static java.lang.String PRIMAEY_KEY_NODE
           
static java.lang.String UNIQUE_CONSTRAINT_NODE
           
 
Constructor Summary
SQLConstraintsTreeViewerInput(BaseTable table)
           
 
Method Summary
 FolderNode getCKFolderNode()
          Returns the check constraints folder node
 FolderNode getConstraintsNode()
          Returns the constraints node
 FolderNode getFKFolderNode()
          Returns the fk folder node
 LeafNode getNode(Constraint constraint)
          Searches the tree to find the leaf node
 FolderNode getPKFolderNode()
          Returns the pk folder node
 FolderNode getRoot()
           
 FolderNode getUniqueFolderNode()
          Returns the unique constraints folder node
 void notifyChanged(org.eclipse.emf.common.notify.Notification msg)
          Will be notified when constraint is added or removed
 void resetInput(BaseTable table)
          This should be called when the constraints of the table change.
ATTN: The folder nodes will be kept, all the child nodes will be re-generated.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CONSTRAINTS_NODE

public static final java.lang.String CONSTRAINTS_NODE

PRIMAEY_KEY_NODE

public static final java.lang.String PRIMAEY_KEY_NODE

FOREIGN_KEY_NODE

public static final java.lang.String FOREIGN_KEY_NODE

UNIQUE_CONSTRAINT_NODE

public static final java.lang.String UNIQUE_CONSTRAINT_NODE

CHECK_CONSTRAINT_NODE

public static final java.lang.String CHECK_CONSTRAINT_NODE

COLUMN_CHECK_CONSTRAINT_NODE

public static final java.lang.String COLUMN_CHECK_CONSTRAINT_NODE
Constructor Detail

SQLConstraintsTreeViewerInput

public SQLConstraintsTreeViewerInput(BaseTable table)
Method Detail

resetInput

public void resetInput(BaseTable table)
This should be called when the constraints of the table change.
ATTN: The folder nodes will be kept, all the child nodes will be re-generated.

Parameters:
table -

getRoot

public FolderNode getRoot()

getConstraintsNode

public FolderNode getConstraintsNode()
Returns the constraints node

Returns:

getPKFolderNode

public FolderNode getPKFolderNode()
Returns the pk folder node

Returns:

getFKFolderNode

public FolderNode getFKFolderNode()
Returns the fk folder node

Returns:

getUniqueFolderNode

public FolderNode getUniqueFolderNode()
Returns the unique constraints folder node

Returns:

getCKFolderNode

public FolderNode getCKFolderNode()
Returns the check constraints folder node

Returns:

getNode

public LeafNode getNode(Constraint constraint)
Searches the tree to find the leaf node

Parameters:
constraint -
Returns:

notifyChanged

public void notifyChanged(org.eclipse.emf.common.notify.Notification msg)
Will be notified when constraint is added or removed

Specified by:
notifyChanged in interface ISchemaObjectEditorModelListener
Parameters:
msg - the notification