## org.eclipse.datatools.sqltools.plan.treeplan
Class TreePlanNodeComponent

    java.lang.Object
      org.eclipse.datatools.sqltools.plan.treeplan.TreePlanNodeComponent

Direct Known Subclasses:
  TreePlanNodeComposite, TreePlanNodeLeaf

    public abstract class TreePlanNodeComponent

extends java.lang.Object

Use composite pattern to store the tree. Instance of this class renders a node in a tree --- either composite node or a leaf. Consumer can put any data in this node using `_data` field, meanwhile, some necessary informations are defined:

- Name: This will be displayed at the top of this node
- Tooltip: When the mouse is hovered on this node, the tooltip will be displayed
- Detail: The detail information will be displayed on the detail panel, it is expected to be a HTML document
- Label1: If it is not null, it will be displayed using the first label of this node, consumer can set what they need
- Label2: If it is not null, it will be displayed using the second label of this node, consumer can set what they need
- Two boolean fields: To indicate if the label should be highlighted or not

Author:
  Dafan Yang

Constructor Summary
`TreePlanNodeComponent()` Empty constructor, the consumer should call setXXX methods after constructing the node
`TreePlanNodeComponent(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, TreePlanNodeComponent parent)` Constructor

Method Summary
`abstract void` `addChild(TreePlanNodeComponent child)` Adds child to this node, simply return if this node is a leaf
`abstract TreePlanNodeComponent` `getChild(int index)` Returns the child at the given index (the index is based on 0)
`abstract java.util.ArrayList` `getChildren()` Returns the children of this node, return `null` if this node is a leaf
`abstract int` `getChildrenCount()` Returns the number of children
`java.lang.Object` `getData()` Returns the data of this node
`java.lang.String` `getDetail()` Returns the detail information of this node
`java.lang.String` `getLabel1()` Returns the first label of this node
`java.lang.String` `getLabel2()` Returns the second label of this node
`java.lang.String` `getName()` Returns the name of this node
`TreePlanNodeComponent` `getParent()` Returns the parent of this node
`java.lang.String` `getToolTip()` Returns the tool tip of this node
`boolean` `isLabel1Highlighted()` Checks if should highlight label 1
`boolean` `isLabel2Highlighted()` Checks if should highlight label 2
`void` `setData(java.lang.Object data)` Sets the data of this node
`void` `setDetail(java.lang.String detail)` Sets the detail information of this node
`void` `setLabel1(java.lang.String label1)` Sets the first label of this node
`void` `setLabel1Highlighted(boolean label1Highlighted)` Sets _isLabel1Highlighted
`void` `setLabel2(java.lang.String label2)` Sets the second label of this node
`void` `setLabel2Highlighted(boolean label2Highlighted)` Sets _isLabel2Highlighted
`void` `setName(java.lang.String name)` Sets the name of this node
`void` `setParent(TreePlanNodeComponent parent)` Sets the parent of this node
`void` `setToolTip(java.lang.String tip)` Sets the tool tip of this node

Methods inherited from class java.lang.Object
`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### TreePlanNodeComponent

    public TreePlanNodeComponent(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,
                                 TreePlanNodeComponent parent)

  Constructor

  Parameters:
    `name` - name of this node
    `tip` - tooltip of this node
    `detail` - detail information of this node
    `data` - data of this node, consumer can put anything
    `label1` - first label
    `isLabel1Highlighted` - used to control if label 1 should be highlighted
    `label2` - second label
    `isLabel2Highlighted` - used to control if label 2 should be highlighted
    `parent` - parent node of this node

### TreePlanNodeComponent

    public TreePlanNodeComponent()

  Empty constructor, the consumer should call setXXX methods after constructing the node

Method Detail

### getChildren

    public abstract java.util.ArrayList getChildren()

  Returns the children of this node, return `null` if this node is a leaf

  Returns:
    the children of this node

### getChildrenCount

    public abstract int getChildrenCount()

  Returns the number of children

  Returns:
    the number of children

### getChild

    public abstract TreePlanNodeComponent getChild(int index)

  Returns the child at the given index (the index is based on 0)

  Parameters:
    `index` - the index
  Returns:
    the child at the given index

### addChild

    public abstract void addChild(TreePlanNodeComponent child)

  Adds child to this node, simply return if this node is a leaf

  Parameters:
    `child` - the child

### getDetail

    public java.lang.String getDetail()

  Returns the detail information of this node

  Returns:
    the detail information

### setDetail

    public void setDetail(java.lang.String detail)

  Sets the detail information of this node

  Parameters:
    `detail` - the detail information

### getName

    public java.lang.String getName()

  Returns the name of this node

  Returns:
    the name of this node

### setName

    public void setName(java.lang.String name)

  Sets the name of this node

  Parameters:
    `name` - the name

### getParent

    public TreePlanNodeComponent getParent()

  Returns the parent of this node

  Returns:
    the parent of this node

### setParent

    public void setParent(TreePlanNodeComponent parent)

  Sets the parent of this node

  Parameters:
    `parent` - the new parent

### getToolTip

    public java.lang.String getToolTip()

  Returns the tool tip of this node

  Returns:
    the tool tip

### setToolTip

    public void setToolTip(java.lang.String tip)

  Sets the tool tip of this node

  Parameters:
    `tip` - the tool tip

### getData

    public java.lang.Object getData()

  Returns the data of this node

  Returns:
    the data of this node

### setData

    public void setData(java.lang.Object data)

  Sets the data of this node

  Parameters:
    `data` - the data

### getLabel1

    public java.lang.String getLabel1()

  Returns the first label of this node

  Returns:
    the first label of this node

### setLabel1

    public void setLabel1(java.lang.String label1)

  Sets the first label of this node

  Parameters:
    `label1` - the label

### getLabel2

    public java.lang.String getLabel2()

  Returns the second label of this node

  Returns:
    the second label of this node

### setLabel2

    public void setLabel2(java.lang.String label2)

  Sets the second label of this node

  Parameters:
    `label2` - the label

### isLabel1Highlighted

    public boolean isLabel1Highlighted()

  Checks if should highlight label 1

  Returns:
    `true` if label 1 should be highlighted

### setLabel1Highlighted

    public void setLabel1Highlighted(boolean label1Highlighted)

  Sets _isLabel1Highlighted

  Parameters:
    `label1Highlighted` - the new value

### isLabel2Highlighted

    public boolean isLabel2Highlighted()

  Checks if should highlight label 2

  Returns:
    `true` if label 2 should be highlighted

### setLabel2Highlighted

    public void setLabel2Highlighted(boolean label2Highlighted)

  Sets _isLabel2Highlighted

  Parameters:
    `label2Highlighted` - the new value