VdexReload 1.1.3 API

uk.ac.reload.editor.metadata.tableview
Class MetadataTreeTableModel

java.lang.Object
  extended byjavax.swing.tree.DefaultTreeModel
      extended byuk.ac.reload.dweezil.gui.treetable.ReloadTreeTableModel
          extended byuk.ac.reload.editor.metadata.tableview.MetadataTreeTableModel
All Implemented Interfaces:
java.io.Serializable, javax.swing.tree.TreeModel, TreeTableModel

public class MetadataTreeTableModel
extends ReloadTreeTableModel

The Metadata Tree Table Model for the MetadataTreeTable

See Also:
Serialized Form

Field Summary
protected  Metadata _metadata
          The Metadata DOM Document
protected static java.lang.String[] cNames
          The Column Names
protected static java.lang.Class[] cTypes
          The Class types for the Columns - this is important because the tree won't display properly without it.
 
Fields inherited from class javax.swing.tree.DefaultTreeModel
asksAllowsChildren, listenerList, root
 
Constructor Summary
MetadataTreeTableModel(Metadata metadata)
          Constructor
 
Method Summary
 void buildChildren(MetadataTreeNode node)
          Build up child nodes
protected  boolean canAddNode(org.jdom.Element element)
          Decide whether to allow to add an Element on the Tree
protected  boolean canAddNode(ReloadSchemaElement schemaElement)
          Decide whether to allow to add an Element on the Tree
protected  boolean canAddNode(java.lang.String elementName, org.jdom.Namespace ns)
          Decide whether to allow to add an Element on the Tree
protected  boolean doShowNode(org.jdom.Element element)
          Decide whether to display an Element on the Tree
protected  boolean doShowNode(ReloadSchemaElement schemaElement)
          Decide whether to display an Element on the Tree
protected  boolean doShowNode(java.lang.String elementName, org.jdom.Namespace ns)
          Decide whether to display an Element on the Tree
 java.lang.Object getChild(java.lang.Object parent, int index)
          Get the child node at index point
 int getChildCount(java.lang.Object parent)
          Get the Child count in the Model
 java.lang.Class getColumnClass(int column)
          Return the type of class for each column.
 int getColumnCount()
          Get the number of columns in our model.
 java.lang.String getColumnName(int column)
          Get the name for a particular column.
 Metadata getMetadata()
          Get the Metadata document
 java.lang.Object getValueAt(java.lang.Object node, int column)
          Get the value for a given node and column.
 boolean isCellEditable(java.lang.Object node, int column)
          Determine whether a particular cell is editable.
 void setValueAt(java.lang.Object aValue, java.lang.Object node, int column)
          Set the value of a node
 
Methods inherited from class javax.swing.tree.DefaultTreeModel
addTreeModelListener, asksAllowsChildren, fireTreeNodesChanged, fireTreeNodesInserted, fireTreeNodesRemoved, fireTreeStructureChanged, getIndexOfChild, getListeners, getPathToRoot, getPathToRoot, getRoot, getTreeModelListeners, insertNodeInto, isLeaf, nodeChanged, nodesChanged, nodeStructureChanged, nodesWereInserted, nodesWereRemoved, reload, reload, removeNodeFromParent, removeTreeModelListener, setAsksAllowsChildren, setRoot, valueForPathChanged
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.swing.tree.TreeModel
addTreeModelListener, getIndexOfChild, getRoot, isLeaf, removeTreeModelListener, valueForPathChanged
 

Field Detail

cTypes

protected static java.lang.Class[] cTypes
The Class types for the Columns - this is important because the tree won't display properly without it.


cNames

protected static java.lang.String[] cNames
The Column Names


_metadata

protected Metadata _metadata
The Metadata DOM Document

Constructor Detail

MetadataTreeTableModel

public MetadataTreeTableModel(Metadata metadata)
Constructor

Parameters:
metadata - The Metadata DOM Document
Method Detail

buildChildren

public void buildChildren(MetadataTreeNode node)
Build up child nodes

Parameters:
node - The Parent Node

doShowNode

protected boolean doShowNode(org.jdom.Element element)
Decide whether to display an Element on the Tree

Parameters:
element - the JDOM element concerned
Returns:
true if the element has to be displayed, false otherwise

doShowNode

protected boolean doShowNode(ReloadSchemaElement schemaElement)
Decide whether to display an Element on the Tree

Parameters:
schemaElement - the schema element of the JDOM element concerned
Returns:
true if the element has to be displayed, false otherwise

doShowNode

protected boolean doShowNode(java.lang.String elementName,
                             org.jdom.Namespace ns)
Decide whether to display an Element on the Tree

Parameters:
elementName - the name of the JDOM element concerned ns the schema namespace of the element
Returns:
true if the element has to be displayed, false otherwise

canAddNode

protected boolean canAddNode(org.jdom.Element element)
Decide whether to allow to add an Element on the Tree

Parameters:
element - the JDOM element concerned
Returns:
true to allow the element to be added, false otherwise

canAddNode

protected boolean canAddNode(ReloadSchemaElement schemaElement)
Decide whether to allow to add an Element on the Tree

Parameters:
schemaElement - the schema element of the JDOM element concerned
Returns:
true to allow the element to be added, false otherwise

canAddNode

protected boolean canAddNode(java.lang.String elementName,
                             org.jdom.Namespace ns)
Decide whether to allow to add an Element on the Tree

Parameters:
elementName - the name of the JDOM element concerned ns the schema namespace of the element
Returns:
true to allow the element to be added, false otherwise

getMetadata

public Metadata getMetadata()
Get the Metadata document

Returns:
the metadata document

getChildCount

public int getChildCount(java.lang.Object parent)
Get the Child count in the Model

Parameters:
parent - the parent node
Returns:
the Number of children of parent

getChild

public java.lang.Object getChild(java.lang.Object parent,
                                 int index)
Get the child node at index point

Parameters:
parent - The parent node
index - The index of the child
Returns:
The Child node at the index point

setValueAt

public void setValueAt(java.lang.Object aValue,
                       java.lang.Object node,
                       int column)
Set the value of a node

Parameters:
aValue - The value to set
node - The node whose value will be set
column - The column of the node

getValueAt

public java.lang.Object getValueAt(java.lang.Object node,
                                   int column)
Get the value for a given node and column. This asks for the value at column 1 or greater, column 0 is the JTree

Parameters:
node - The Node to get the value for
column - The column
Returns:
The appropriate value.

isCellEditable

public boolean isCellEditable(java.lang.Object node,
                              int column)
Determine whether a particular cell is editable.

Parameters:
node - The node we are asking.
column - The column to query
Returns:
true if the cell is editable, false otherwise

getColumnClass

public java.lang.Class getColumnClass(int column)
Return the type of class for each column. Column 0 has to be of type TreeTableModel.class in order for it to work

Parameters:
column - The column to query
Returns:
The class associated with each column

getColumnCount

public int getColumnCount()
Get the number of columns in our model.

Returns:
The number of columns in our model.

getColumnName

public java.lang.String getColumnName(int column)
Get the name for a particular column.

Parameters:
column - The column to ask.
Returns:
The name of the column.

VdexReload 1.1.3 API