Oracle Fusion Middleware extensions for Applications Core API Reference
11g Release 1 (11.1.1.6)

E22562-03

oracle.apps.fnd.applcore.globalSearch.ui
Class TreeItem

java.lang.Object
  extended by oracle.apps.fnd.applcore.globalSearch.ui.TreeItem
All Implemented Interfaces:
java.io.Serializable

public class TreeItem
extends java.lang.Object
implements java.io.Serializable

A node in a JSF tree, used in the attributes and topics trees.

Author:
David Groves <david.groves@oracle.com>
See Also:
Serialized Form

Field Summary
static int NO_RESULT_COUNT_AVAILABLE
          No result count is known.
 
Constructor Summary
TreeItem(SearchFilterItem.FilterType filterType, java.lang.String displayValue, java.lang.String value)
          Construct this tree item.
TreeItem(SearchFilterItem.FilterType filterType, java.lang.String displayValue, java.lang.String value, int resultCount, java.util.Map<java.lang.String,java.lang.String> additionalInfo)
          Construct this tree item.
TreeItem(SearchFilterItem.FilterType filterType, java.lang.String displayValue, java.lang.String value, java.lang.String toolTip, boolean leafFI, boolean queriedForChildren, int resultCount, java.util.Map<java.lang.String,java.lang.String> additionalInfo)
          Construct this tree item.
 
Method Summary
 TreeItem addOrderedChild(TreeItem newItem)
          Add the passed newItem as a child in lexographic order per the DisplayValue attribute.
 boolean equals(java.lang.Object obj)
          
 java.lang.String getAdditionalItem(java.lang.String key)
          Get an additional item added to this tree node.
 TreeItem getCategory()
          Get the category for the tree item.
 java.util.List<TreeItem> getChildren()
          Get the children of this TreeItem.
 TreeItem getChildSearchableObject(java.lang.String soName)
          Get the child Searchable Object for this node, which must be a CATEGORY node.
 java.lang.String getDisplayValue()
          Get the text attribute.
 java.lang.String getDisplayValueWithCount()
          Get the display value including count (if available) in brackets.
 TreeItem getFacet()
          Get the Facet value for this subtree.
 SearchFilterItem.FilterType getFilterType()
          Get the type filter for the tree item.
 java.lang.String getIcon()
          Is there an icon for this TreeItem? The icon will be provided by css styleclass fndGlobalSearchRemoveFilterIcon.
static TreeItem getLeafFacetNode(SearchFilterItems filterItems, TreeItem nodeToCheck)
          Get the leaf node of an existing filter given an arbitrary node that may be selected.
 TreeItem getParent()
          Get this nodes parent node.
 int getResultCount()
          Get the result Count for this Tree Item.
 TreeItem getSearchableObject()
          Get the searchable object for the tree item.
 java.lang.String getToolTip()
          Get the toolTip for this item.
 java.lang.String getValue()
          Get the value attribute.
 int hashCode()
          
 boolean hasSameTreePath(TreeItem that)
          Does this TreeItem have the same tree path (all the way to the root of the tree) as that does.
 boolean isBranch()
          Is this a branch node (does it have children)?
 boolean isFolderIcon()
          Should a folder Icon be shown for this node in the tree.
 boolean isImpersonatingMoreLink()
          Is this child to act like a "More ..." node in the tree.
 boolean isLeafFI()
          Is this a leaf Facet Item.
 boolean isQueriedForChildren()
          Have we queried for children? Relevant when this node is of type Searchable Object of Facet Item.
 TreeItem replaceOrAppendChild(TreeItem newItem)
          Add the passed newItem as a child at the end of the list if it does not exist already (based on a comparison of the DisplayValue attribute).
 void setImpersonatingMoreLink(boolean val)
          Flag this child to act like a "More ..." node in the tree.
 void setQueriedForChildren()
          Set flag indicating we have queried for children.
 void setResultCount(int resultCount)
          Set the result count.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NO_RESULT_COUNT_AVAILABLE

public static final int NO_RESULT_COUNT_AVAILABLE
No result count is known. Useful for supplying to resultCount in constructor if the result count is not known

See Also:
Constant Field Values
Constructor Detail

TreeItem

public TreeItem(SearchFilterItem.FilterType filterType,
                java.lang.String displayValue,
                java.lang.String value)
Construct this tree item.

Parameters:
filterType - type of filter.
displayValue - text of node (shown to user).
value - value of node (internal code value).

TreeItem

public TreeItem(SearchFilterItem.FilterType filterType,
                java.lang.String displayValue,
                java.lang.String value,
                int resultCount,
                java.util.Map<java.lang.String,java.lang.String> additionalInfo)
Construct this tree item.

Parameters:
filterType - type of filter.
displayValue - text of node (shown to user).
value - value of node (internal code value).
resultCount - number of results, -1 means not known.
additionalInfo - additional information to be stored on the node.

TreeItem

public TreeItem(SearchFilterItem.FilterType filterType,
                java.lang.String displayValue,
                java.lang.String value,
                java.lang.String toolTip,
                boolean leafFI,
                boolean queriedForChildren,
                int resultCount,
                java.util.Map<java.lang.String,java.lang.String> additionalInfo)
Construct this tree item.

Parameters:
filterType - type of filter.
displayValue - text of node (shown to user).
value - value of node (internal code value).
toolTip - tool tip to show in UI.
leafFI - are we a leaf facet item, as known by ECSF Metadata.
queriedForChildren - in cases where leafFI is false, have we queried for the child facet items.
resultCount - number of results, possibly NO_RESULT_COUNT_AVAILABLE.
additionalInfo - additional information to be stored on the node.
Method Detail

getAdditionalItem

public java.lang.String getAdditionalItem(java.lang.String key)
Get an additional item added to this tree node.

Parameters:
key - key to obtain it from.
Returns:
value for key, null if not found.

getDisplayValue

public java.lang.String getDisplayValue()
Get the text attribute.

Returns:
text attribute.

getDisplayValueWithCount

public java.lang.String getDisplayValueWithCount()
Get the display value including count (if available) in brackets.

Returns:
display value with count.

getValue

public java.lang.String getValue()
Get the value attribute.

Returns:
value attribute.

getFacet

public TreeItem getFacet()
Get the Facet value for this subtree. This method will navigate up the hierarchy until it finds a FACET.

Returns:
facet, null if cannot find.

getCategory

public TreeItem getCategory()
Get the category for the tree item. A search up the tree will be conducted until a CATEGROY TreeItem is found.

Returns:
parent CATEGROY TreeItem, null if not found.

getSearchableObject

public TreeItem getSearchableObject()
Get the searchable object for the tree item. A search up the tree will be conducted until a SEARCHABLE_OBJECT TreeItem is found.

Returns:
parent SEARCHABLE_OBJECT TreeItem, null if not found.

getChildSearchableObject

public TreeItem getChildSearchableObject(java.lang.String soName)
Get the child Searchable Object for this node, which must be a CATEGORY node. Unlike other getXXX methods in this class, this method searches down the tree from the root, not up towards it.

Parameters:
soName - name of SO.
Returns:
relevant SO node, or null if cannot find for any reason (or if this is not a CATEGORY).

addOrderedChild

public TreeItem addOrderedChild(TreeItem newItem)
Add the passed newItem as a child in lexographic order per the DisplayValue attribute. NewItem will have it's parent set to 'this'. If newItem exists already (same DisplayValue), the existing TreeItem is returned and it is suggested the called use the return value, the idiom

   TreeItem fei = new TreeItem( ... );
   fei = facetTreeItem.addOrderedChild(fei);
   use fei ...
 
is useful.

Parameters:
newItem - potential new item to add.
Returns:
the item added, likey newItem but an existing item if a duplicate.

replaceOrAppendChild

public TreeItem replaceOrAppendChild(TreeItem newItem)
Add the passed newItem as a child at the end of the list if it does not exist already (based on a comparison of the DisplayValue attribute). NewItem will have it's parent set to 'this'. If newItem exists already (same DisplayValue), the existing TreeItem is returned and it is suggested the called use the return value, the idiom

   TreeItem fei = new TreeItem( ... );
   fei = facetTreeItem.replaceOrAppendChild(fei);
   use fei ...
 
is useful.

Parameters:
newItem - potential new item to add.
Returns:
the item added, likey newItem but an existing item if a duplicate.

getChildren

public java.util.List<TreeItem> getChildren()
Get the children of this TreeItem. Usef by the JSF tree via the children property.

Returns:
children list, never null but may be empty.

getLeafFacetNode

public static TreeItem getLeafFacetNode(SearchFilterItems filterItems,
                                        TreeItem nodeToCheck)
Get the leaf node of an existing filter given an arbitrary node that may be selected.

Parameters:
filterItems - the list of filter items in the tree
nodeToCheck - the node to test
Returns:
the leaf node of the filter or null if not found

getIcon

public java.lang.String getIcon()
Is there an icon for this TreeItem? The icon will be provided by css styleclass fndGlobalSearchRemoveFilterIcon. Signiture retained for backwards compatibility.

Returns:
true if there is an icon, null otherwise.

isBranch

public boolean isBranch()
Is this a branch node (does it have children)?

Returns:
true if has children, false otherwise.

isFolderIcon

public boolean isFolderIcon()
Should a folder Icon be shown for this node in the tree. Even leaf nodes sometimes show folders in the case of category nodes.

Returns:
true if we are to show a folder icon.

getParent

public TreeItem getParent()
Get this nodes parent node.

Returns:
parent node, null if at the root.

getFilterType

public SearchFilterItem.FilterType getFilterType()
Get the type filter for the tree item.

Returns:
filter type

hasSameTreePath

public boolean hasSameTreePath(TreeItem that)
Does this TreeItem have the same tree path (all the way to the root of the tree) as that does.

Parameters:
that - another node to check.
Returns:
true if same path, false otherwise.

hashCode

public int hashCode()

Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)

Overrides:
equals in class java.lang.Object

getToolTip

public java.lang.String getToolTip()
Get the toolTip for this item.

Returns:
toolTip for this item.

setResultCount

public void setResultCount(int resultCount)
Set the result count.

Parameters:
resultCount - new result count.

isLeafFI

public boolean isLeafFI()
Is this a leaf Facet Item. Relevant only for facet item nodes. This value may return false negatives, that is it is not a leaf, but may end up having no children, as determined by a LOV query result. If true then there are guarenteed no children.

Returns:
true if is a leaf, as defined by ECSF metadata.

setQueriedForChildren

public void setQueriedForChildren()
Set flag indicating we have queried for children. Once set cannot be unset.


isQueriedForChildren

public boolean isQueriedForChildren()
Have we queried for children? Relevant when this node is of type Searchable Object of Facet Item.

Returns:
true is queried, false otherwise.

getResultCount

public int getResultCount()
Get the result Count for this Tree Item.

Returns:
result Count.

setImpersonatingMoreLink

public void setImpersonatingMoreLink(boolean val)
Flag this child to act like a "More ..." node in the tree.

Parameters:
val - flag.

isImpersonatingMoreLink

public boolean isImpersonatingMoreLink()
Is this child to act like a "More ..." node in the tree.

Returns:
true if acting as a "More..." node, false otherwise.

Oracle Fusion Middleware extensions for Applications Core API Reference
11g Release 1 (11.1.1.6)

E22562-03

Copyright © 2012 Oracle. All Rights Reserved.