Package org.compiere.model
Class MTreeNode
java.lang.Object
javax.swing.tree.DefaultMutableTreeNode
org.compiere.model.MTreeNode
- All Implemented Interfaces:
Serializable
,Cloneable
,MutableTreeNode
,TreeNode
Mutable Tree Node (not a PO).
- Version:
- $Id: MTreeNode.java,v 1.3 2006/07/30 00:51:05 jjanke Exp $
- Author:
- Jorg Janke
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionstatic Icon[]
16* 16 Icons for each node type (TYPE_*)static String[]
Image path for each node type (TYPE_*)static int
Action - 8static int
Info - 9static int
Process - 3static int
Report - 2static int
Variable - 6static int
Choice - 7static int
Window - 1static int
Workbench - 5static int
Workflow - 4Fields inherited from class javax.swing.tree.DefaultMutableTreeNode
allowsChildren, children, EMPTY_ENUMERATION, parent, userObject
-
Constructor Summary
ConstructorDescriptionMTreeNode
(int node_ID, int seqNo, String name, String description, int parent_ID, boolean isSummary, String imageIndicator, boolean onBar, Color color) Construct Model TreeNodeMTreeNode
(int node_ID, int seqNo, String name, String description, int parent_ID, int menu_ID, String img, boolean isSummary, boolean isCollapsible, boolean isFavourite) Construct Model TreeNode [Used MTreeFavorite] -
Method Summary
Modifier and TypeMethodDescriptionfindNode
(int ID) Find Node with ID in list of childrengetColor()
Get ColorGet DescriptiongetIcon()
Get Image Iconstatic Icon
getIcon
(int index) Get Image Iconstatic int
getImageIndex
(String imageIndicator) Get Image Indicator/IndexGet Image IndicatorGet Image Pathint
getName()
Get Nameint
Get Node IDint
Return parentgetSeqNo()
Get SeqNo (Index) as formatted String 0000 for sortingboolean
boolean
isForm()
Is Formboolean
isInfo()
Is Infoboolean
isOnBar()
Is node on favorite barboolean
Is Processboolean
isReport()
Is Reportboolean
Allow children to be added to this nodeboolean
isTask()
Is Taskboolean
isWindow()
Is Windowboolean
Deprecated.boolean
Is Workflowvoid
setAllowsChildren
(boolean isSummary) Set Summary (allow children)void
setCollapsible
(boolean m_iscollapsible) void
setDescription
(String description) Set Descriptionvoid
setImageIndicator
(String imageIndicator) Set Image Indicator and Indexvoid
setMenu_ID
(int m_menu_ID) void
Set Namevoid
setParent_ID
(int parent_ID) void
setSummary
(boolean isSummary) Set Summary (allow children)toString()
Print NameMethods inherited from class javax.swing.tree.DefaultMutableTreeNode
add, breadthFirstEnumeration, children, clone, 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, getUserObject, getUserObjectPath, insert, isLeaf, isNodeAncestor, isNodeChild, isNodeDescendant, isNodeRelated, isNodeSibling, isRoot, pathFromAncestorEnumeration, postorderEnumeration, preorderEnumeration, remove, remove, removeAllChildren, removeFromParent, setParent, setUserObject
-
Field Details
-
TYPE_WINDOW
public static int TYPE_WINDOWWindow - 1 -
TYPE_REPORT
public static int TYPE_REPORTReport - 2 -
TYPE_PROCESS
public static int TYPE_PROCESSProcess - 3 -
TYPE_WORKFLOW
public static int TYPE_WORKFLOWWorkflow - 4 -
TYPE_WORKBENCH
public static int TYPE_WORKBENCHWorkbench - 5 -
TYPE_SETVARIABLE
public static int TYPE_SETVARIABLEVariable - 6 -
TYPE_USERCHOICE
public static int TYPE_USERCHOICEChoice - 7 -
TYPE_DOCACTION
public static int TYPE_DOCACTIONAction - 8 -
TYPE_INFO
public static int TYPE_INFOInfo - 9 -
PATHS
Image path for each node type (TYPE_*) -
IMAGES
16* 16 Icons for each node type (TYPE_*)
-
-
Constructor Details
-
MTreeNode
public MTreeNode(int node_ID, int seqNo, String name, String description, int parent_ID, boolean isSummary, String imageIndicator, boolean onBar, Color color) Construct Model TreeNode- Parameters:
node_ID
- nodeseqNo
- sequencename
- namedescription
- descriptionparent_ID
- parentisSummary
- summaryimageIndicator
- image indicatoronBar
- on barcolor
- color
-
MTreeNode
public MTreeNode(int node_ID, int seqNo, String name, String description, int parent_ID, int menu_ID, String img, boolean isSummary, boolean isCollapsible, boolean isFavourite) Construct Model TreeNode [Used MTreeFavorite]- Parameters:
node_ID
-seqNo
-name
-description
-parent_ID
-menu_ID
-img
-isSummary
-isCollapsible
-isFavourite
-
-
-
Method Details
-
getNode_ID
public int getNode_ID()Get Node ID- Returns:
- node id (e.g. AD_Menu_ID)
-
setName
Set Name- Parameters:
name
- name
-
getName
Get Name- Returns:
- name
-
getSeqNo
Get SeqNo (Index) as formatted String 0000 for sorting- Returns:
- SeqNo as String
-
getParent_ID
public int getParent_ID()Return parent- Returns:
- Parent_ID (e.g. AD_Menu_ID)
-
setParent_ID
public void setParent_ID(int parent_ID) - Parameters:
parent_ID
- the m_parent_ID to set
-
toString
Print Name- Overrides:
toString
in classDefaultMutableTreeNode
- Returns:
- info
-
getDescription
Get Description- Returns:
- description
-
setDescription
Set Description- Parameters:
description
-
-
setSummary
public void setSummary(boolean isSummary) Set Summary (allow children)- Parameters:
isSummary
- summary node
-
setAllowsChildren
public void setAllowsChildren(boolean isSummary) Set Summary (allow children)- Overrides:
setAllowsChildren
in classDefaultMutableTreeNode
- Parameters:
isSummary
- true if summary
-
isSummary
public boolean isSummary()Allow children to be added to this node- Returns:
- true if summary node
-
getMenu_ID
public int getMenu_ID() -
setMenu_ID
public void setMenu_ID(int m_menu_ID) -
isCollapsible
public boolean isCollapsible() -
setCollapsible
public void setCollapsible(boolean m_iscollapsible) -
getImageIndex
Get Image Indicator/Index- Parameters:
imageIndicator
- image indicator (W/X/R/P/F/T/B) MWFNode.ACTION_- Returns:
- index of image
-
setImageIndicator
Set Image Indicator and Index- Parameters:
imageIndicator
- image indicator (W/X/R/P/F/T/B) MWFNode.ACTION_
-
getImageIndiactor
Get Image Indicator- Returns:
- image indicator
-
getImagePath
Get Image Path- Returns:
- image path
-
getIcon
Get Image Icon- Parameters:
index
- image index- Returns:
- Icon
-
getIcon
Get Image Icon- Returns:
- Icon
-
isOnBar
public boolean isOnBar()Is node on favorite bar- Returns:
- true if node on bar
-
isProcess
public boolean isProcess()Is Process- Returns:
- true if Process
-
isReport
public boolean isReport()Is Report- Returns:
- true if report
-
isWindow
public boolean isWindow()Is Window- Returns:
- true if Window
-
isWorkbench
Deprecated.Is Workbench- Returns:
- true if Workbench
-
isWorkFlow
public boolean isWorkFlow()Is Workflow- Returns:
- true if Workflow
-
isForm
public boolean isForm()Is Form- Returns:
- true if Form
-
isTask
public boolean isTask()Is Task- Returns:
- true if Task
-
isInfo
public boolean isInfo()Is Info- Returns:
- true if Info
-
getColor
Get Color- Returns:
- color or black if not set
-
findNode
Find Node with ID in list of children- Parameters:
ID
- id- Returns:
- MTreeNode with ID or null
-