public class OTreeNode extends DefaultMutableTreeNode implements Comparable, Internationalization
Comparable
to allow order the nodes. These ones could be organizational or data nodes.
Organizational nodes creates the tree structure and data nodes are
correspondent with database records. allowsChildren, children, EMPTY_ENUMERATION, parent, userObjectDEBUG_LANGUAGE| Constructor and Description |
|---|
OTreeNode(Hashtable parameters)
This method uses the
Hashtable and creates the tree node. |
| Modifier and Type | Method and Description |
|---|---|
void |
add(MutableTreeNode node)
Overrides the method add to insert a node in a sorted tree.
|
boolean |
canDelete() |
Object |
clone() |
OTreeNode |
cloneNodeAndChildren()
Get a copy of the node and all the children
|
protected OTreeNode |
cloneThisAndChildren() |
int |
compareTo(Object object) |
void |
disableNodeSorting()
Allows to disable sorting in nodes.
|
void |
enableNodeSorting()
Enables sorting in node.
|
protected void |
finalize() |
boolean |
getAscending() |
Hashtable |
getAssociatedDataField() |
Vector |
getAssociatedOrderedDataField() |
String |
getAttr() |
String[] |
getAttributes() |
Vector |
getChildren()
Method to obtain children of a node.
|
int |
getCount() |
DynamicFormManager |
getDynamicFormManager() |
String |
getDynamicFormManagerClass() |
String |
getEntityName() |
String |
getFixAttr() |
Vector |
getFixAttributes() |
String |
getForm() |
String |
getHideAttr() |
ImageIcon |
getIcon()
Returns the icon to use with this node.
|
String |
getIconNoOrg() |
String |
getIconOrg() |
String |
getId() |
Vector |
getKeys() |
String |
getKeysString() |
Hashtable |
getKeysValues()
Returns a
Hashtable where keys are attributes specified in
keysValues, and values are their correspondent values. |
Hashtable |
getNodeData()
Returns node keyvalues.
|
String |
getOrderByAttribute() |
ImageIcon |
getPageableIcon() |
Hashtable |
getParameters() |
String |
getParentKeyNameInParentNode(String parentKey) |
Vector |
getParentKeys() |
Hashtable |
getQueryResult() |
boolean |
getRemark() |
int |
getRowsNumberToQuery() |
String |
getSeparator() |
Vector |
getShownAttributeList() |
String |
getSortAttr() |
String |
getStringAssociatedDataField() |
String |
getText() |
Vector |
getTextsToTranslate()
Returns all the texts in the element suitable for being translated.
|
int |
getTotalCount() |
Object |
getUserObject() |
Object |
getValueForAttribute(Object attribute) |
Vector |
getVisibleAttributes() |
boolean |
isClassifyNode() |
boolean |
isDynamic() |
boolean |
isEmptyNode() |
boolean |
isLeaf() |
boolean |
isOrganizational() |
boolean |
isPageableEnabled() |
void |
setAssociatedDataField(Hashtable associatedFields) |
void |
setAssociatedOrderedDataField(Vector associatedOrderedDataField) |
void |
setAttribute(String attribute,
Object value) |
void |
setAttributes(Vector attributes) |
void |
setAttributeText(String attr,
String equivalence) |
void |
setClassifyNode(boolean classify) |
void |
setComponentLocale(Locale l) |
void |
setCount(int c) |
void |
setDynamic(boolean d) |
void |
setDynamicFormManager(DynamicFormManager dfm) |
void |
setEmptyNode(boolean emptyNode) |
void |
setEntityName(String entityName) |
void |
setForm(String form) |
void |
setKeys(Vector keys) |
void |
setKeysValues(Hashtable keysValues)
Establishes key values and attributes for this node, that is 'attr' and
'keys' specified in xml definition.
|
void |
setKeysValues(Object key,
Object value) |
void |
setOrganizational(boolean o) |
void |
setOverrideLeaf(boolean override,
boolean leaf) |
void |
setPageableIcon(ImageIcon pageableIcon) |
void |
setQueryResult(Hashtable result) |
void |
setRemark(boolean remark)
Indicates when node must show a special icon, for example, when its data
have changed and tree has not been updated yet.
|
void |
setResourceBundle(ResourceBundle resources)
Sets the language resource bundle.
|
void |
setSeparator(String separator) |
void |
setSortAttr(String sortAttr) |
void |
setSortOrder(boolean ascendingSort) |
void |
setText(String textToShow) |
void |
setToString(String s) |
void |
setTotalCount(int totalRecordCount) |
void |
setUserObject(Object value) |
void |
sortNow()
Sorts child nodes with order: ascending or descending.
|
String |
toString() |
protected void |
updateNodeTextCache() |
breadthFirstEnumeration, children, depthFirstEnumeration, getAllowsChildren, getChildAfter, getChildAt, getChildBefore, getChildCount, getDepth, getFirstChild, getFirstLeaf, getIndex, getLastChild, getLastLeaf, getLeafCount, getLevel, getNextLeaf, getNextNode, getNextSibling, getParent, getPath, getPathToRoot, getPreviousLeaf, getPreviousNode, getPreviousSibling, getRoot, getSharedAncestor, getSiblingCount, getUserObjectPath, insert, isNodeAncestor, isNodeChild, isNodeDescendant, isNodeRelated, isNodeSibling, isRoot, pathFromAncestorEnumeration, postorderEnumeration, preorderEnumeration, remove, remove, removeAllChildren, removeFromParent, setAllowsChildren, setParentpublic static final String THERE_ARENT_RESULTS_KEY
public static final String THERE_ARENT_RESULTS_KEY_es_ES
public static final String ENTITY
public static final String KEYS
public static final String KEYS_VALUES
public static final String ATTR
public static final String TEXT
public static final String FORM
public static final String ORG
public static final String PARENT_KEYS
public static final String ICON_ORG
public static final String ICON_NO_ORG
public static final String PAGEABLE_ICON
public static final String ID
public static final String SEPARATOR
public static final String SORTATTR
public static final String SORT
public static final String DESC
public static final String FIX_ATTR
public static final String HIDE_ATTR
public static final String CAN_DELETE
public static final String DYNAMIC_FORM
public static final String DYNAMICFORM
public static final String DYNAMIC
public static final String CLASSIFY_NODE
public static final String QUERY_ROWS
public static boolean defaultPageableEnabled
protected String shownForm
protected String entityName
protected String shownAttribute
protected Object text
protected boolean organization
protected Vector keyList
protected String keysString
protected Hashtable keysValues
protected Hashtable associatedDataField
protected Vector associatedOrderedDataField
protected String associateDataFieldString
protected String stringFixAttr
protected String stringHideAttr
protected Vector hiddenAttributes
protected boolean canDelete
protected String cachedText
protected boolean classifyNode
protected boolean dynamic
protected Hashtable attributeEquivalences
protected Hashtable queryResult
protected String separator
protected boolean ascending
protected Vector shownAttributeList
protected String attrString
protected boolean orderToAdd
protected ImageIcon iconorg
protected ImageIcon iconnoorg
protected ImageIcon pageableIcon
protected String iconorgStr
protected String iconnoorgStr
protected boolean emptyNode
protected boolean remark
protected boolean pageableEnabled
protected String id
protected String orderByAttribute
protected Vector fixAtributtes
protected String dynamicFormClass
protected DynamicFormManager dynamicFormManager
protected ResourceBundle resourceArchive
protected boolean leaf
protected boolean overrideLeaf
protected static Collator comparator
protected static Locale componentLocale
protected List renderTime
protected int rowsNumberToQuery
protected static SimpleDateFormat df
protected static SimpleDateFormat dfH
protected int totalCount
protected Hashtable parameters
protected int count
public OTreeNode(Hashtable parameters)
Hashtable and creates the tree node.
parameters - the Hashtable with parameters
| attribute | values | default | required | meaning |
| attr | attr1;...;attrn | yes | Indicates the field attribute. This fields will be displayed in node text. | |
| entity | yes | Entity where tree data are obtained. | ||
| keys | yes | Primary keys of entity. | ||
| text | no | Text to show in organizational nodes. | ||
| form | no | Form to show when node is clicked. | ||
| parentkeys | parentk1;associparentk1;...;parentkn;associparentkn | no | Parent key and associated key for node. If parent key name and current-node key are the same name, this field will be filled with pairs of fields with the same name. | |
| iconorg | no | Icon for organizational nodes. | ||
| iconnoorg | no | Icon for non-organizational nodes. | ||
| id | no | Identifier for an organizational node and its children placed in the inmediatly level. | ||
| separator | no | Separator character for attributes. | ||
| sortattr | The first attribute indicated in attr | no | Attribute to sort the tree. | |
| fixattr | fixattr1;fixattr2;...;fixattrn | no | List of attributes that will be fixed by tree node in associated form. | |
| hideattr | hideattr1;hideattr2;...;hideattrn | no | Attributes that will be queried, but not showed in node. | |
| candelete | true/false | false | no | Indicates if a node can be deleted. |
| dynamicform | no | Name of class to show dynamic forms. | ||
| rendertime | render1;render2;...;rendern | no | Attribute to be renderized like a hour field. | |
| classifynode | no | |||
| queryrows | positive values | no | For making pageable tree. Number of records that will be downloaded for each page. (since 5.2060EN) | |
| sort | asc/desc | asc | no | Allow to sort current node ascending/descending. Before this version, ascending sort was set for all nodes(since 5.2077EN-0.3) |
public int getRowsNumberToQuery()
public int compareTo(Object object)
compareTo in interface Comparablepublic void setAttributes(Vector attributes)
public void setEntityName(String entityName)
public void setForm(String form)
public void setSeparator(String separator)
public Object clone()
clone in class DefaultMutableTreeNodepublic String toString()
toString in class DefaultMutableTreeNodepublic String getForm()
public void setToString(String s)
public String getEntityName()
public Vector getKeys()
public Vector getParentKeys()
public Hashtable getKeysValues()
Hashtable where keys are attributes specified in
keysValues, and values are their correspondent values.Hashtablepublic Hashtable getNodeData()
Hashtable with keyvaluespublic String getSortAttr()
public String[] getAttributes()
public boolean isOrganizational()
public OTreeNode cloneNodeAndChildren()
protected OTreeNode cloneThisAndChildren()
public void setOverrideLeaf(boolean override,
boolean leaf)
public boolean isLeaf()
isLeaf in interface TreeNodeisLeaf in class DefaultMutableTreeNodepublic Vector getChildren()
Vector with childrenpublic void add(MutableTreeNode node)
add in class DefaultMutableTreeNodepublic Hashtable getAssociatedDataField()
public void setAssociatedDataField(Hashtable associatedFields)
public Vector getAssociatedOrderedDataField()
public void setAssociatedOrderedDataField(Vector associatedOrderedDataField)
public void setKeys(Vector keys)
public String getKeysString()
public String getStringAssociatedDataField()
public String getAttr()
public void setText(String textToShow)
public void setKeysValues(Hashtable keysValues)
keysValues - public void setQueryResult(Hashtable result)
public Hashtable getQueryResult()
public void setResourceBundle(ResourceBundle resources)
InternationalizationsetResourceBundle in interface Internationalizationresources - the new language bundle.public void disableNodeSorting()
public void enableNodeSorting()
public void setSortAttr(String sortAttr)
public void sortNow()
public boolean getAscending()
public void setComponentLocale(Locale l)
setComponentLocale in interface Internationalizationpublic void setSortOrder(boolean ascendingSort)
protected void finalize()
throws Throwable
public ImageIcon getIcon()
TreeCellRenderer.public String getIconOrg()
public String getIconNoOrg()
public void setUserObject(Object value)
setUserObject in interface MutableTreeNodesetUserObject in class DefaultMutableTreeNodepublic Object getUserObject()
getUserObject in class DefaultMutableTreeNodepublic String getId()
public void setEmptyNode(boolean emptyNode)
public boolean isEmptyNode()
public String getSeparator()
public String getOrderByAttribute()
public String getText()
public void setRemark(boolean remark)
remark - the condition of remarkpublic boolean getRemark()
public boolean canDelete()
public Vector getFixAttributes()
public String getFixAttr()
public String getHideAttr()
public void setOrganizational(boolean o)
protected void updateNodeTextCache()
public String getDynamicFormManagerClass()
public DynamicFormManager getDynamicFormManager()
public void setDynamicFormManager(DynamicFormManager dfm)
public Vector getTextsToTranslate()
InternationalizationgetTextsToTranslate in interface Internationalizationpublic Vector getShownAttributeList()
public Vector getVisibleAttributes()
public boolean isClassifyNode()
public void setClassifyNode(boolean classify)
public boolean isDynamic()
public void setDynamic(boolean d)
public void setCount(int c)
public int getCount()
public boolean isPageableEnabled()
public Hashtable getParameters()
public void setTotalCount(int totalRecordCount)
public int getTotalCount()
public ImageIcon getPageableIcon()
public void setPageableIcon(ImageIcon pageableIcon)
Copyright © 2016 Imatia Innovation S.L.. All rights reserved.