org.topbraidcomposer.ui.viewers.trees
Class ResourceTreeNode

java.lang.Object
  extended by org.topbraidcomposer.ui.viewers.trees.ResourceTreeNode
Direct Known Subclasses:
ArbiTreeNode, ImportsTreeNode, InheritanceTreeNode, ResourceTreeRoot, SubClassesTreeNode, SubPropertiesTreeNode

public abstract class ResourceTreeNode
extends java.lang.Object

An object representing a node in a Resource tree. Instances of this class are typically used in conjunction with a TreeContentProvider such as ResourceTreeContentProvider.

Author:
Holger Knublauch

Constructor Summary
protected ResourceTreeNode(ResourceTreeNode parentNode, com.hp.hpl.jena.rdf.model.Resource resource)
           
 
Method Summary
 ResourceTreeNode addChildNode(com.hp.hpl.jena.rdf.model.Resource childResource)
           
abstract  ResourceTreeNode createChildNode(com.hp.hpl.jena.rdf.model.Resource childResource)
          Creates a node for a given resource, with this as parent node.
protected  void createChildren()
           
 ResourceTreeNode createExpandedClone(com.hp.hpl.jena.rdf.model.Model model, ResourceTreeNode clonedParentNode)
           
 void deleteAny(com.hp.hpl.jena.rdf.model.Resource resource, org.eclipse.jface.viewers.TreeViewer treeViewer)
           
 void ensureChildrenExist()
           
 ResourceTreeNode findChildNode(com.hp.hpl.jena.rdf.model.Resource resource)
           
 ResourceTreeNode findChildNode(com.hp.hpl.jena.rdf.model.Resource resource, java.util.Set<com.hp.hpl.jena.rdf.model.Resource> reached)
           
 ResourceTreeNode findCreatedChildNode(com.hp.hpl.jena.rdf.model.Resource resource)
           
 ResourceTreeNode getChildNode(com.hp.hpl.jena.rdf.model.Resource r)
           
 ResourceTreeNode getChildNode(java.lang.String uri)
           
 ResourceTreeNode[] getChildren()
           
 ResourceTreeNode getParentNode()
           
 com.hp.hpl.jena.rdf.model.Resource getResource()
           
 boolean hasChild(com.hp.hpl.jena.rdf.model.Resource resource)
           
 boolean hasChildren()
           
abstract  java.util.Iterator<com.hp.hpl.jena.rdf.model.Resource> listChildResources()
          Finds the Resources that shall be placed as child nodes of this node.
 ResourceTreeNode removeChildNode(com.hp.hpl.jena.rdf.model.Resource childResource)
          Attempts to delete a child node with a given resource.
protected  void replaceResource(com.hp.hpl.jena.rdf.model.Resource resource)
           
 java.lang.String toString()
           
 void visitCreatedNodes(IResourceTreeNodeVisitor visitor)
           
 void visitNodes(IResourceTreeNodeVisitor visitor)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ResourceTreeNode

protected ResourceTreeNode(ResourceTreeNode parentNode,
                           com.hp.hpl.jena.rdf.model.Resource resource)
Method Detail

addChildNode

public ResourceTreeNode addChildNode(com.hp.hpl.jena.rdf.model.Resource childResource)

createChildNode

public abstract ResourceTreeNode createChildNode(com.hp.hpl.jena.rdf.model.Resource childResource)
Creates a node for a given resource, with this as parent node.

Parameters:
childResource - the resource to create a node for
Returns:
typically an instance of the same class

createChildren

protected void createChildren()

createExpandedClone

public ResourceTreeNode createExpandedClone(com.hp.hpl.jena.rdf.model.Model model,
                                            ResourceTreeNode clonedParentNode)

deleteAny

public void deleteAny(com.hp.hpl.jena.rdf.model.Resource resource,
                      org.eclipse.jface.viewers.TreeViewer treeViewer)

ensureChildrenExist

public void ensureChildrenExist()

findChildNode

public ResourceTreeNode findChildNode(com.hp.hpl.jena.rdf.model.Resource resource)

findChildNode

public ResourceTreeNode findChildNode(com.hp.hpl.jena.rdf.model.Resource resource,
                                      java.util.Set<com.hp.hpl.jena.rdf.model.Resource> reached)

findCreatedChildNode

public ResourceTreeNode findCreatedChildNode(com.hp.hpl.jena.rdf.model.Resource resource)

getChildNode

public ResourceTreeNode getChildNode(com.hp.hpl.jena.rdf.model.Resource r)

getChildNode

public ResourceTreeNode getChildNode(java.lang.String uri)

getChildren

public ResourceTreeNode[] getChildren()

getParentNode

public ResourceTreeNode getParentNode()

getResource

public com.hp.hpl.jena.rdf.model.Resource getResource()

hasChild

public boolean hasChild(com.hp.hpl.jena.rdf.model.Resource resource)

hasChildren

public boolean hasChildren()

listChildResources

public abstract java.util.Iterator<com.hp.hpl.jena.rdf.model.Resource> listChildResources()
Finds the Resources that shall be placed as child nodes of this node.

Returns:
an Iterator of Resources

removeChildNode

public ResourceTreeNode removeChildNode(com.hp.hpl.jena.rdf.model.Resource childResource)
Attempts to delete a child node with a given resource.

Parameters:
childResource - the resource on the child node
Returns:
the tree node that was deleted, or none if none was found

replaceResource

protected void replaceResource(com.hp.hpl.jena.rdf.model.Resource resource)

toString

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

visitNodes

public void visitNodes(IResourceTreeNodeVisitor visitor)

visitCreatedNodes

public void visitCreatedNodes(IResourceTreeNodeVisitor visitor)