PROCEDURE collapse_tree IS
vnode ftree.node;vhtree ITEM;
vstate varchar2(30);
BEGIN
-- Search the tree identifiant --
vhtree := Find_Item('MENU.TREE4');
-- Search the root --
vnode := Ftree.Find_Tree_Node(vhtree, '');
-- Collapse all nodes --
WHILE NOT ftree.ID_NULL(vnode) LOOP
vstate := Ftree.Get_Tree_Node_Property(vhtree, vnode, Ftree.NODE_STATE);
IF vstate = Ftree.EXPANDED_NODE THEN
Ftree.Set_Tree_Node_Property(vhtree, vnode, Ftree.NODE_STATE, Ftree.COLLAPSED_NODE);
END IF;
vnode := Ftree.Find_Tree_Node(vhtree, '', Ftree.FIND_NEXT,Ftree.NODE_LABEL, '', vnode);
END LOOP;
END;
PROCEDURE EXPAND_tree IS
node ftree.node;
htree ITEM;
state varchar2(30);
BEGIN
-- Search the tree identifiant --
htree := Find_Item('MENU.TREE4');
-- Search the root --
node := Ftree.Find_Tree_Node(htree, '');
-- Expand all nodes --
WHILE NOT Ftree.ID_NULL(node) LOOP
state := Ftree.Get_Tree_Node_Property(htree, node, Ftree.NODE_STATE);
IF state = Ftree.COLLAPSED_NODE THEN
Ftree.Set_Tree_Node_Property(htree, node, Ftree.NODE_STATE, Ftree.EXPANDED_NODE);
END IF;
node := Ftree.Find_Tree_Node(htree, '', ftree.find_NEXT,Ftree.NODE_LABEL,'', node);
END LOOP;
END;
Tags:
Oracle Developer