org.eclipse.datatools.sqltools.plan.treeplan
Class PlanTreeBuilder

java.lang.Object
  extended by org.eclipse.datatools.sqltools.plan.treeplan.PlanTreeBuilder

public class PlanTreeBuilder
extends java.lang.Object

The plan tree builder is useful for constructing a execution plan tree

Author:
Dafan Yang

Constructor Summary
PlanTreeBuilder()
           
PlanTreeBuilder(java.lang.String name, java.lang.String tip, java.lang.String detail, java.lang.Object data, java.lang.String label1, boolean isLabel1Highlighted, java.lang.String label2, boolean isLabel2Highlighted)
           
 
Method Summary
 boolean addChild()
          Adds an empty child node to current node, and the newly added node will become the current node
 boolean addChild(java.lang.String name, java.lang.String tip, java.lang.String detail, java.lang.Object data, java.lang.String label1, boolean isLabel1Highlighted, java.lang.String label2, boolean isLabel2Highlighted)
          Adds an child node with the specified information to current node, and the newly added node will become the current node
 boolean addSibling()
          Adds a sibling node for current node, and the newly added node will become the current node
 boolean addSibling(java.lang.String name, java.lang.String tip, java.lang.String detail, java.lang.Object data, java.lang.String label1, boolean isLabel1Highlighted, java.lang.String label2, boolean isLabel2Highlighted)
          Adds a sibling node with specified information for current node, and the newly added node will become the current node
 boolean addTo(TreePlanNodeComponent parent)
          Adds a child node to the specified node, and the newly added node will become the current node
 boolean addTo(TreePlanNodeComponent parent, java.lang.String name, java.lang.String tip, java.lang.String detail, java.lang.Object data, java.lang.String label1, boolean isLabel1Highlighted, java.lang.String label2, boolean isLabel2Highlighted)
          Adds a child node with specified information to the specified node, and the newly added node will become the current node
 void findNodes(java.lang.String name, java.util.List nodes)
          Finds all the nodes with the given name, this is useful if a node needs to be added to a specific parent node (Not the current node)
 TreePlanNodeComponent getCurrentNode()
           
 TreePlanNodeComponent getRoot()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PlanTreeBuilder

public PlanTreeBuilder()

PlanTreeBuilder

public PlanTreeBuilder(java.lang.String name,
                       java.lang.String tip,
                       java.lang.String detail,
                       java.lang.Object data,
                       java.lang.String label1,
                       boolean isLabel1Highlighted,
                       java.lang.String label2,
                       boolean isLabel2Highlighted)
Method Detail

getCurrentNode

public TreePlanNodeComponent getCurrentNode()

getRoot

public TreePlanNodeComponent getRoot()

addChild

public boolean addChild(java.lang.String name,
                        java.lang.String tip,
                        java.lang.String detail,
                        java.lang.Object data,
                        java.lang.String label1,
                        boolean isLabel1Highlighted,
                        java.lang.String label2,
                        boolean isLabel2Highlighted)
Adds an child node with the specified information to current node, and the newly added node will become the current node

Parameters:
name - name of the node
tip - tooltip of the node
detail - detail information of the node
data - the data object
label1 - label 1
isLabel1Highlighted - is label 1 highlighted
label2 - label 2
isLabel2Highlighted - is label 2 highlighted
Returns:
true if a new child is successfully added

addChild

public boolean addChild()
Adds an empty child node to current node, and the newly added node will become the current node

Returns:
true if a new child is successfully added

addSibling

public boolean addSibling(java.lang.String name,
                          java.lang.String tip,
                          java.lang.String detail,
                          java.lang.Object data,
                          java.lang.String label1,
                          boolean isLabel1Highlighted,
                          java.lang.String label2,
                          boolean isLabel2Highlighted)
Adds a sibling node with specified information for current node, and the newly added node will become the current node

Parameters:
name - name of the node
tip - tooltip of the node
detail - detail information of the node
data - the data object
label1 - label 1
isLabel1Highlighted - is label 1 highlighted
label2 - label 2
isLabel2Highlighted - is label 2 highlighted
Returns:
true if a new child is successfully added

addSibling

public boolean addSibling()
Adds a sibling node for current node, and the newly added node will become the current node

Returns:
true if a new child is successfully added

addTo

public boolean addTo(TreePlanNodeComponent parent,
                     java.lang.String name,
                     java.lang.String tip,
                     java.lang.String detail,
                     java.lang.Object data,
                     java.lang.String label1,
                     boolean isLabel1Highlighted,
                     java.lang.String label2,
                     boolean isLabel2Highlighted)
Adds a child node with specified information to the specified node, and the newly added node will become the current node

Parameters:
name - name of the node
tip - tooltip of the node
detail - detail information of the node
data - the data object
label1 - label 1
isLabel1Highlighted - is label 1 highlighted
label2 - label 2
isLabel2Highlighted - is label 2 highlighted
Returns:
true if a new child is successfully added

addTo

public boolean addTo(TreePlanNodeComponent parent)
Adds a child node to the specified node, and the newly added node will become the current node

Returns:
true if a new child is successfully added

findNodes

public void findNodes(java.lang.String name,
                      java.util.List nodes)
Finds all the nodes with the given name, this is useful if a node needs to be added to a specific parent node (Not the current node)

Parameters:
name - name of the node
nodes - the search result will be stored in the list