How to expand a tree at a specific node/item?

Hi,
we have a tree and the nodes/items were binded to context with this code
lo_nd_nvccmp = wd_context->get_child_node( name = wd_this->wdctx_nvccmp ).
lo_nd_tree = lo_nd_nvccmp->get_child_node( name = wd_this->wdctx_tree ).
lo_el_tree = lo_nd_tree->bind_structure( new_item = ls_tree set_initial_elements = abap_false ).
We want that the tree is expanded at a specific node/item?
The structure has the field is_expanded of type WDY_BOOLEAN. I think that if the field of the right structure is 'X' then the tree should expanded. How can we find the right structure in the context and change this field to 'X'?
Code is appreciated.
Thanks, regards
Susanne

Oh, apparently if you try that call right after you create
the Tree, it will throw a null reference exception. That might
count as a bug in the flex api...
If you create a Tree, and give it's dataProvider some xml
data, and then add it to the stage (addChild), and then you call
expandItem or expandChildrenOf() right after, you will get a null
object exception. You have to wait... for something. I don't know
what.
I even tried calling _tree.invalidateList() before the
expandItem, but it will still throw the error...
I wonder what the Tree needs to wait for? Is this a bug for
Adobe to fix?

Similar Messages

  • How to blick tree view few specific nodes

    here i got a code which show how to blink tree view node but i am confuse that how to blink few node.
    Answered by:
    Avatar of Tamer Oz
    20,185
    Points
    Top 0.5
    Tamer Oz
    Partner Joined Sep 2009
    2
    8
    17
    Tamer Oz's threads
    Show activity
    Treeview control - How to make a node blink?
    Visual Studio Languages
    .NET Framework
    >
    Visual C#
    Question
    Alert me
    Question
    Vote as helpful
    0
    Vote
    Hi,
    Is there a "elegant" way to make blink a treeview node?
    I am thinking to use a timer with the collection of nodes that I want to make the blink effect, and update the icon ...
    Friday, November 06, 2009 6:19 PM
    Reply
    |
    Quote
    |
    Report as abuse
    Avatar of Kikeman
    Kikeman
    R. BOSCH
    105 Points
    All replies
    Question
    Vote as helpful
    0
    Vote
    Hi,
    You can develop your custom control for this purpose. The logic you mentioned was correct. Here is a sample control that I developed by the logic you mentioned.
    public class BlinkingTreeView : TreeView
    private Timer t = new Timer();
    private List<TreeNode> blinkingNodes = new List<TreeNode>();
    public BlinkingTreeView()
    t.Interval = 1000;
    t.Tick += new EventHandler(t_Tick);
    bool isNodeBlinked = false;
    void t_Tick(object sender, EventArgs e)
    foreach (TreeNode tn in blinkingNodes)
    if (isNodeBlinked)
    //update Icon
    tn.Text = tn.Text.Substring(0, tn.Text.Length - 1);//to test
    isNodeBlinked = false;
    else
    //update Icon
    tn.Text = tn.Text + "*";//to test
    isNodeBlinked = true;
    public void AddBlinkNode(TreeNode n)
    blinkingNodes.Add(n);
    public void RemoveBlinkNode(TreeNode n)
    blinkingNodes.Remove(n);
    public void ClearBlinkNodes()
    blinkingNodes.Clear();
    public List<TreeNode> BlinkingNodes
    get { return blinkingNodes; }
    public int BlinkInterval
    get { return t.Interval; }
    set { t.Interval = value; }
    public void StartBlinking()
    isNodeBlinked = false;
    t.Enabled = true;
    public void StopBlinking()
    t.Enabled = false;
    just show me how to use BlinkingTreeView class. i will have tree view which will have few node and few nodes may have few child nodes. now how to achieve by this class BlinkingTreeView and show me how to blink few specific node not all. thanks

    better to come with code. first populate tree view with some dummy node this way
    Root
           Child1
                    Child1-sub1
                    Child1-sub2
           Child2
                    Child2-sub1
                    Child2-sub2
    now blink Child1-sub2 & Child2-sub1. please come with code. thanks

  • Ajax memory tree can't expand when searching for a specific node.

    Hi,
    I've just followed the ajax tree example. Everything is working except when the find node windows pop up and a node is selected. the corresponding report is displayed but the ajax tree doesn't expand accordingly.
    Any help would be appreciated.
    Thanks
    Venus

    I too am having this issue with Scott's search ajax tree example listed here..
    http://www.oracle.com/technology/pub/articles/spendolini-tree.html
    The correct node is highlighted if that level of the tree happens to be expanded, but the tree is not automatically expanding to show the correct node. Which part of the code is meant to "automatically expand" the tree? Is it the
    "if tree_rec.id = y.id and tree_rec.id != v('P1_SELECTED_NODE') then..."
    section of "find_node" in
    http://www.oracle.com/technology/pub/listings/spendolini-tree-l1.html
    Any help appreciated.
    Thanks, Penny

  • How to have a tree view for value node..

    Hi all,
    I need to display a tree view for a value node in web ui  just like a model node, for a custom view in a pop up. Please guide me  how to do this or let me know the process steps.
    Thanks in advance.

    Hi All,
    while debugging I found that in class CL_BSP_WD_CONTEXT_NODE_TREE , the method GET_T_TABLE the below code is not triigerring for the child node attributes ( to trigger the get method of attribute for value node).
    this call method is not triggering at all only for first coulmn its triggering ..
      LV_TN ?= ME->NODE_MAPPER->GET_NODE_OBJECT( <LINE>-NODE_KEY ).
        CONCATENATE 'GET_' COMPONENT INTO LV_METHOD.
        TRY.
            CALL METHOD LV_TN->(LV_METHOD)
              EXPORTING
                ATTRIBUTE_PATH = ''
              RECEIVING
                VALUE          = VALUE.
          CATCH CX_ROOT INTO LV_ERROR.
    I created the GETTER method inthe class CN01 and CN02. But those methods are not triggered in CALL METHOD LV_TN->(LV_METHOD). Even that class CN02 is having the  same methods. Those methods are already Implemented. May I know what was the reason Why those methods are not triggered ( getter method ). With out that Method data will not display in the Tree view. Can anybody tell me the reason why it is not happenning?
    .Please find the below .HTM code  as well.
    <chtmlb:configTree
                          actionsMaxInRow       = "5"
                       id             = "Table1"
                       nodeTable      = "<%= ZTREEVIEW->node_tab %>"
                       table          = "//ZTREEVIEW/Table"
                       noFrame        = "FALSE"
                       personalizable = "TRUE"
                       onCollapseNode = "NODECOLLAPSE"
                       selectionMode  = "MULTILINEEDIT"
                       onExpandNode   = "NODEEXPAND"
                       onRowSelection = "select" />
    Only one column was triggered another column did not get any value becasue of the above method call fail.. We are not restricted anywhere to display one column value in the output.   Even in Debugging I checked that LV_METHOD  is having the method name. CN02 class is also having the  same method, But it is not going into the method. It is coming out side. What could be  the reason I could not able to understnad.
    Please provide me some pointers on the issue....
    Thanks in advance..

  • ADF Tree Traversal from one node to its leafs

    Hello,
    after a titanic effort I have been able to add a checkbox next to each node of an adf tree table.
    This checkbox is based on an "helper" entity attribute (not mapped to a column table on the database).
    My next huge problem is to perform an automatic selection of all the checkboxes next to the nodes under the currently selected one.
    For example, if the user checks a checkbox in the second level, then all the checkboxes next to the nodes under that, belonging to level three and four must be checked.
    If this helps, in my case there are at most four levels.
    Up until now I can get all the information from the currently checked node, but I fail to navigate the hierarchy under it for the automatic checking. I think that one problem is to navigate all the rows in the (only) VO the tree is based on. For example, since the tree is not expanded at the beginning, if I iterate on the VO retrieved from the current selected node at the top level, I can't see any rows corresponding to any children. Maybe I just miss something.
    I have followed this example from Frank Nimphius, which only gets the current selected nodes, as I said, but no more. Maybe this is a good starting point, but I need to advance somehow.
    http://www.oracle.com/technetwork/developer-tools/adf/learnmore/32-tree-table-from-single-vo-169174.pdf
    Can anyone help?
    Thanks.

    Hi,
    here is a sample of how to search in trees, which actually shows how to traverse trees from a specific node
    http://www.oracle.com/technetwork/developer-tools/adf/learnmore/61search-in-rendered-trees-177577.pdf
    Given you have a transient attribute defined, each node (and instance of JUCtrHierNode --> getRow will give you access to the attribute for read/access). Note that because the checkbox is stamped in the context of the tree, upon selecting a parent node, you need to refresh the tree to show the selection state change
    Frank

  • How to get a Tree Node Value when a Tree is Expanded

    My reqiurement is when i Expand a Tree i need the Expanded tree Node Value. For Example Consider Parent as a Root Node of a Tree, and Consider its two Children Child1 and Child2.
    When + Parent Expanded
    I will Get the Output as --Parent
    - Child1
    - Child2
    so As when i expand the Tree i must Get the String Value Parent.

    duplicate
    How to get a Tree Node Value when a Tree is Expanded

  • How to scroll to a specific node in the webdynpro tree

    Hi all,
    I'm developing an application where I need to load and expand a tree upon some action in another view.
    Loading the children, expanding nodes and setting a new lead selection (with cl_wd_dynamic_tool=>set_tree_lead_selection) all works fine.
    But I did not find a way to scroll the tree, so that the node is in the currently visible area of the tree. Is there a way to do this?
    Thanks for your answers!
    Best regards,
      Frank

    Tree is a particular structure, you need to realize a recursive function, specially if the tree with is a recursive TreeNode.
    this is a quickly answer, i did this in java.
    The idea is the same everywhere, this is an ABAP-LIKE solution, understand and translate in a good ABAP source.
    FUNCTION FindNode(TypeNode tree_node, TypeNode node_to_find ).
    IF ( tree_node.ELEMENT_ID EQ node_to_find.ELEMENT_ID ).
    """""""    do what you wanna do  """""
    ELSE.
      n = tree_node.GET_NUMBERS_OF_CHILDS;
      """"""""" RECURSION
      FOR i = 0 TO n.
        child_node = tree_node.GET_CHILD(i).
        CALLFUNCTION FindNode(child_node, node_to_find ).
      ENDFOR.
    ENDIF.
    ENDFUNCTION.

  • How to create  a tree in tree?

    how to create a tree in tree?

    Hello Luo Cheng
    Did you mean to have multiple tree control within a tree control?
    I am not understanding what business purpose will this serve to have a tree control inside other? You can always have a specific node and when expanded list all the related nodes.
    To have a tree control inside another tree control is not possible.
    Regards,
    Dinesh

  • How to create a tree structure using forms.

    Hi,
    How do i create a tree structure using oracle forms,i have a table named Functions and a specific column 'Function Name' should be displayed in the tree nodes.Can anyone help me out on how to create a tree structure and populating the nodes??
    thanks in advance
    Regards
    Karthik

    The FTree package provides functions to populate the tree - look for the topic "Manipulating a hierarchical tree at runtime
    " in the online help this point to all the functions and triggers

  • How to expand a JTree depending on a property

    Hi I have a JTree that needs to be expandAll if a property in the ini file is true. Can some tell me how I can do it or give me an example. If needed i can post my code. Here the addtreeDisplays() has to expandAll depending on a string(true ).
    Can some help me out.
    Thanks,
    public class TreeDisplayPanel extends JPanel implements QMRequestListener,
                                                            TopologySelectionListener,
                                                                          PropertyChangeListener
        /** Creates new TreeDisplayPanel */
        //Key to get from property file
        String _treeKey = "tree.display.type";
        //default display
        public final static int TREE_DISPLAY = 0;
        public final static int STAR_DISPLAY = 1;
        public final static int BOTH_DISPLAY =2;
         Properties _displayProp = null;
        //Main panel where everything gets put on to be displayed
        public JPanel _mainDisplayPanel;
        //current default display
        private int treeDisplayPreference = STAR_DISPLAY;
        private MQETabbedPane _treeTabPane;
        private MQETabbedPane _viewTabPane;
        private String treeDisplayTitle;
         static private final String treeviewKey = "tree.view.text";
         static private final String starviewKey = "star.view.text";
         static private final String splitviewKey = "split.view.text";
         static private final String mergeviewKey = "merge.view.text";
         // Default tree displays.
         private HyperbolicTreePanel hyperbolicTreePanel = null;
         private NavigatorTreePanel navigatorTreePanel = null;
         // A store for any queue manager tree displays created
         // by the user. This will enable these trees to be
         // modified whenever the user invokes a expand/collapse
         // all action on a node or whenever the user changes
         // the leaf node expansion preference.
         private Vector<NavigatorTreePanel> qmgrTreeDisplays =
            new Vector<NavigatorTreePanel>();
         //HashMap of indexes correspond to indexes in tabbed paned that are merged, it contains
        //hashtables of components in those merged indexes
        HashMap _qmMergedIndexes = new HashMap();
        //Current listeners to this panel on node selections
        protected Vector<TopologySelectionListener> _tsListeners =
            new Vector<TopologySelectionListener>();
         private TopologyModel m_model = null;
         private TopologyModelNode m_nnode = null;
         private TopologyDisplayPanel tdp = null;
        public TreeDisplayPanel(TopologyModel model, Properties prop, String displayTitle) {
            super(new BorderLayout());
              m_model = model;
              _displayProp = prop;
              treeDisplayTitle = displayTitle;
            initComponent();
            initGui();
        private void initComponent()
              _mainDisplayPanel = ComponentFactory.getInstance().createTitledPanel(treeDisplayTitle);
              _mainDisplayPanel.setLayout(new BorderLayout());
              add(_mainDisplayPanel, BorderLayout.CENTER);
        private void initGui()
            if (_displayProp != null)
                   // Get the current display preference.
                   String defaultDisplay = Integer.toString(STAR_DISPLAY);
                treeDisplayPreference = Integer.parseInt(_displayProp.getProperty(_treeKey, defaultDisplay));
            try
                //Add according to your display property
                _treeTabPane = new MQETabbedPane();
                _viewTabPane = new MQETabbedPane(JTabbedPane.BOTTOM);
                _viewTabPane.addMouseListener(new MouseListener()
                    public void mouseClicked(MouseEvent e)
                        final int tabNum = _viewTabPane.getUI().tabForCoordinate(_viewTabPane,e.getX(),e.getY());
                        //Only if the mouse click is a right mouse and tab number is not on overview pane or doc pane is the popup valid
                        if (SwingUtilities.isRightMouseButton(e) && tabNum > 1)
                            final String tabStr = _viewTabPane.getTitleAt(tabNum);
                            JPopupMenu popup = new JPopupMenu();
                            JMenuItem menuItem1 = new JMenuItem(new AbstractAction("Close " + tabStr)
                                public void actionPerformed(ActionEvent e)
                                    //Remove it from our HashMap of merged panes if it exists
                                    if (_qmMergedIndexes.containsKey(tabStr))
                                        _qmMergedIndexes.remove(tabStr);
                                            // Remove the Qmgr tree display.
                                            NavigatorTreePanel treePanel = (NavigatorTreePanel)_viewTabPane.getComponentAt(tabNum);
                                            ExpandingModelNode model = (ExpandingModelNode)treePanel.getNavigatorTreeModel();
                                            model.getNode().removeTreeModelListener(model);
                                            qmgrTreeDisplays.remove(treePanel);
                                    _viewTabPane.removeTabAt(tabNum);
                                  String mergeview = StringFactory.getString(mergeviewKey);
                            JMenu merge = new JMenu(mergeview);
                            merge.setEnabled(false);
                            int numTabs = _viewTabPane.getTabCount();
                            //System.out.println("Num of tabs " + numTabs);
                            //Only allow merging if you have more then 2 panes (1 - Overview, 2 - Qmgr, 3-Qmgr....
                            //Also if the current pane is not a merge pane already
                            if (numTabs > 3 && !_qmMergedIndexes.containsKey(tabStr))
                                //Do not enable this menu if the number of already merged Indexes - the number of tabs
                                //is greater then two (One Valid pane + Overview pane). The reason is because then there is
                                //no valid pane to merge with
                                if ((numTabs - _qmMergedIndexes.size()) > 3)
                                    merge.setEnabled(true);
                                    for (int i = 2; i<numTabs; i++)
                                        //Add only valid tabs and not already merged tabs
                                        if (i != tabNum && !_qmMergedIndexes.containsKey(_viewTabPane.getTitleAt(i)))
                                            //JMenuItem mergeItem = new JMenuItem(new AbstractAction(_viewTabPane.getTitleAt(i))
                                                      JMenuItem mergeItem = new JMenuItem(new AbstractAction(_viewTabPane.getToolTipTextAt(i))
                                                public void actionPerformed(ActionEvent e)
                                                    try
                                                        //System.out.println("Action Name for " + e.getActionCommand());
                                                        //Work around for java bug in JTabbedPane
                                                        _viewTabPane.setSelectedIndex(0);
                                                        _viewTabPane.validate();
                                                        //End workaround
                                                        //Strip off the fully qualified name to contain only the name of the QM name
                                                                     String mergeTabName = m_model.getQMgrName(e.getActionCommand());
                                                                     JPanel splitPanel = new JPanel(new BorderLayout());
                                                        JSplitPane splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT);
                                                        splitPane.setBorder(null);
                                                        splitPane.setOneTouchExpandable(true);
                                                        int mergeTabIndex =  _viewTabPane.indexOfTab(mergeTabName);
                                                        String mergeTabString = _viewTabPane.getTitleAt(mergeTabIndex);
                                                                     Component mergeComp = _viewTabPane.getComponentAt(mergeTabIndex);
                                                        String mergeCompAddress = _viewTabPane.getToolTipTextAt(mergeTabIndex);
                                                                     splitPane.setLeftComponent(mergeComp);
                                                                     int currentTabIndex =  _viewTabPane.indexOfTab(tabStr);
                                                        Component currentComp = _viewTabPane.getComponentAt(currentTabIndex);
                                                                     String currentCompAddress = _viewTabPane.getToolTipTextAt(currentTabIndex);
                                                        splitPane.setRightComponent(currentComp);
                                                        splitPanel.add(splitPane, BorderLayout.CENTER);
                                                        String mergeName = mergeTabName + "/" + tabStr;
                                                                     String toolTipName = mergeCompAddress + " | " + currentCompAddress;
                                                        //_viewTabPane.addTab(mergeName, splitPanel);
                                                                     addTabToDisplay(mergeName, toolTipName, splitPanel);
                                                        splitPane.setDividerLocation(.5);
                                                        int mergeIndex = _viewTabPane.indexOfTab(mergeName);
                                                                      if (mergeIndex != -1)
                                                            //_viewTabPane.setToolTipTextAt(mergeIndex, mergeName);
                                                                          //_viewTabPane.setSelectedIndex(mergeIndex);
                                                            //Now lets update our ongoing vector/hashmap
                                                            //Create a hash map with the current merged view
                                                            Hashtable mergeViews = new Hashtable();
                                                            mergeViews.put(mergeCompAddress,mergeComp);
                                                            mergeViews.put(currentCompAddress,currentComp);
                                                            _qmMergedIndexes.put(mergeName, mergeViews);
                                                    catch (Exception ex)
                                                        ex.printStackTrace();
                                            merge.add(mergeItem);
                                  String splitKey = StringFactory.getString(splitviewKey);
                            JMenu splitMenu = new JMenu(splitKey);
                            splitMenu.setEnabled(false);
                            //Only allow to split if the current tab has a merged view
                            if (_qmMergedIndexes.containsKey(tabStr))
                                splitMenu.setEnabled(true);
                                Hashtable mergeHash = (Hashtable)_qmMergedIndexes.get(tabStr);
                                Enumeration enumeration = mergeHash.keys();
                                while (enumeration.hasMoreElements())
                                    //Create a new menu item for each QM in View
                                    String node = (String)enumeration.nextElement();
                                    JMenuItem mergeItem = new JMenuItem(new AbstractAction(node)
                                        public void actionPerformed(ActionEvent e)
                                            //Work around for java bug in JTabbedPane
                                            _viewTabPane.setSelectedIndex(0);
                                            _viewTabPane.validate();
                                            //End workaround
                                            String splitTabName = e.getActionCommand();
                                            //Get the merge hash for this tab num
                                            Hashtable splitHash = (Hashtable)_qmMergedIndexes.get(tabStr);
                                            Enumeration enumeration = splitHash.keys();
                                            _viewTabPane.removeTabAt(tabNum);
                                                      int iIndexOfSplit = 0;
                                            while (enumeration.hasMoreElements())
                                                //Add new pane for the views in the hashtable
                                                String nodeAddress = (String)enumeration.nextElement();
                                                           String nodeName = m_model.getQMgrName(nodeAddress);
                                                           NavigatorTreePanel currentComp = (NavigatorTreePanel)splitHash.get(nodeAddress);
                                                addTabToDisplay(nodeName,nodeAddress,currentComp);
                                                           //Now if this tab this we just added is equal to the menu item of the split menu,
                                                           //store this so that we can give focus to it later
                                                           if (splitTabName.equals(nodeAddress))
                                                                iIndexOfSplit = _viewTabPane.getTabCount()-1;
                                            //Also remove it from our vector of merged tabs
                                            _qmMergedIndexes.remove(tabStr);
                                            //int mergeIndex = _viewTabPane.indexOfTab(splitTabName);
                                            //if (mergeIndex != -1)
                                                      if (iIndexOfSplit != -1)
                                                //_viewTabPane.setSelectedIndex(mergeIndex);
                                                           _viewTabPane.setSelectedIndex(iIndexOfSplit);
                                    splitMenu.add(mergeItem);
                            popup.add(menuItem1);
                            popup.add(merge);
                            popup.add(splitMenu);
                            if (popup != null)
                                Point p = e.getPoint();
                                popup.show((Component)e.getSource(), (int)p.getX(), (int)p.getY());
                    public void mouseEntered(MouseEvent e)
                    public void mouseExited(MouseEvent e)
                    public void mousePressed(MouseEvent e)
                    public void mouseReleased(MouseEvent e)
                   //Don't forget to add the tree's
                   addTreeDisplays();
                _viewTabPane.addTab(StringFactory.getString("perspective.display.overview.tab"), _treeTabPane);
                   _viewTabPane.addTab(StringFactory.getString("perspective.display.documentation.tab"), new DocDisplayPanel());
                _mainDisplayPanel.add(_viewTabPane, BorderLayout.CENTER);
            catch(Exception e)
                e.printStackTrace();
         private void addTabToDisplay(String nameStr, String toolStr, JComponent c)
              if (_viewTabPane == null)
                   return;
              _viewTabPane.addTab(nameStr, c);
              int tabNum = _viewTabPane.getTabCount()-1;
              if (toolStr != null)
                   _viewTabPane.setToolTipTextAt(tabNum, toolStr);
              _viewTabPane.setSelectedIndex(tabNum);
         private void addTreeDisplays()
              String starKey = StringFactory.getString(starviewKey);
              String treeKey = StringFactory.getString(treeviewKey);
              //navigatorTreePanel.expandTreePath(this, true);
              String test = MQEPreferencesDialog.getPreferenceValue("expand.leaf.startup");
              System.out.println("test{{{{{{{{{{"+test);
              //System.out.println("test{{{{{{{{{{"+m_nnode.);
              if (treeDisplayPreference == BOTH_DISPLAY)
                   hyperbolicTreePanel = new HyperbolicTreePanel(m_model);
                   hyperbolicTreePanel.addQMRequestListener(this);
                   hyperbolicTreePanel.addTopologySelectionListener(this);
                   //hyperbolicTreePanel.expandTreePath((TopologyModelNode)m_model.getRoot(), true);
                   //hyperbolicTreePanel.expandTreePath(m_nnode, true);
                   _treeTabPane.addTab("", IconFactory.getInstance().getIcon("staricon"), hyperbolicTreePanel, starKey);
                   navigatorTreePanel = new NavigatorTreePanel(m_model);
                   navigatorTreePanel.addQMRequestListener(this);
                   navigatorTreePanel.addTopologySelectionListener(this);
                   _treeTabPane.addTab("", IconFactory.getInstance().getIcon("treeicon"), navigatorTreePanel, treeKey);
              else if (treeDisplayPreference == TREE_DISPLAY)
                   navigatorTreePanel = new NavigatorTreePanel(m_model);
                   navigatorTreePanel.addQMRequestListener(this);
                   navigatorTreePanel.addTopologySelectionListener(this);
                   _treeTabPane.addTab("", IconFactory.getInstance().getIcon("treeicon"), navigatorTreePanel, treeKey);
              else
                   hyperbolicTreePanel = new HyperbolicTreePanel(m_model);
                   hyperbolicTreePanel.addQMRequestListener(this);
                   hyperbolicTreePanel.addTopologySelectionListener(this);
                   _treeTabPane.addTab("", IconFactory.getInstance().getIcon("staricon"), hyperbolicTreePanel, starKey);
        public void addTopologySelectionListener(TopologySelectionListener tsl)
            if (tsl != null)
                _tsListeners.add(tsl);
        public void removeTopologySelectionListener(TopologySelectionListener tsl)
            if (tsl != null)
                _tsListeners.remove(tsl);
        protected void fireTopologySelection(TopologyModelNode node)
            for (TopologySelectionListener tsl : _tsListeners)
                tsl.receiveTopologySelection(node);
       /* TopologySelectionListener methods                                     */
        public void receiveTopologySelection(TopologyModelNode node)
            //Since this panel can have multiple panels in it's current Tabbed display.
            //This class registers to each of the TopologyDisplayPanels as a listener for selections
            //This way no matter who is currently active, they will funnel the event to here and it this
            //panel will send the event on foward
            if (node != null)
                fireTopologySelection(node);
       /* QMRequestListener methods                                             */
        public void receiveQMRequest(TopologyModelNode node)
            //Check to see if this node is already in a Tab already
            System.out.println("Queue Manager request");
              boolean doesExist = false;
            int tabNum =0;
              //Fix for activity 00033248 TAB PANES FOR IDENTICAL QMANAGERS ON DIFF MACHINES
              //The only unique names are in the tooltips so lets just cycle through all the tabs
              //and search for this Queue Manager name.  Using indexOfTab in JTabbedPane will not
              //work here because it will return first location of a matching queue manager name, but
              //we could have multiple tabs open with same queue manager name.
              for (int i = 0; i < _viewTabPane.getTabCount();i++)
                   String toolTipStr = _viewTabPane.getToolTipTextAt(i);
                   //Using the string method for indexOf, covers us when we have a merged tab window
                   if ((toolTipStr != null) && (toolTipStr.indexOf(((ResourceProxy)node).getAddress().trim()) != -1))
                        //We already have existing queue manager tab open
                        doesExist = true;
                        tabNum = i;
                        break;
              if ( !doesExist)
                   //Create the tab
                NavigatorTreePanel treePanel = new NavigatorTreePanel(new ExpandingModelNode(node));
                treePanel.addTopologySelectionListener(this);
                   // Add the tree panel to a container so that it can be accessed
                   // for expand/collapse all and tree refresh actions.
                   qmgrTreeDisplays.add(treePanel);
                   //Fix for activity 00033248 TAB PANES FOR IDENTICAL QMANAGERS ON DIFF MACHINES
                   addTabToDisplay(((ResourceProxy)node).getName().trim(), ((ResourceProxy)node).getAddress().trim(), treePanel);
                node.getModel().expandNode(node);
              else
                   _viewTabPane.setSelectedIndex(tabNum);
       /* PropertyChangeListener methods                                        */
            public void propertyChange(PropertyChangeEvent evt){
              String propertyChanged = evt.getPropertyName();
              if (propertyChanged.equals(MQEDisplayPreferences.treeDisplayProperty)){
                   int newPreference = ((Integer)evt.getNewValue()).intValue();
                   changeTreeDisplays(newPreference);
              else if (propertyChanged.equals(MQEDisplayPreferences.expandLeafProperty)){
                   // The enable leaf node preference has changed so update the MQE
                   // tree displays according to the new preference setting.
                   refreshTreeDisplays();
              else{
                   // Ignore the property change event.
        * Changes the trees displayed by MQE according to
         * the preference set by the current user.
        * @param the new trees display preference.*/
         public void changeTreeDisplays(int preference)
              // Assign the new tree display preference.
              treeDisplayPreference = preference;
              // Recreate the tree display according
              // to the new preference.
              m_model.removeTreeModelListeners();
              _treeTabPane.removeAll();
              addTreeDisplays();
              refreshTreeDisplays();
        * Fully expands the Navigator display trees from the specified node.
        * @param the node from which each tree will be fully expanded.
         public void expandAll(TopologyModelNode node)
              node.expandAll();
              final TopologyModelNode fnode = node;
              Runnable doTask = new Runnable(){
                   public void run(){
                        // Fire a tree structure changed notification for
                        // the StarTree, (1) because it will not display
                        // tree nodes correctly without it and (2) it appears
                        // to be the only tree interested in doing anything
                        // with it!
                        fnode.fireTreeStructureChanged(TopologyModel.STRUCTURE_CHANGE);
                        if (hyperbolicTreePanel != null)
                             hyperbolicTreePanel.expand(fnode);
                        if (navigatorTreePanel != null)
                             navigatorTreePanel.expand(fnode);
                        for (NavigatorTreePanel navTreePanel : qmgrTreeDisplays){
                             navTreePanel.expand(fnode);
              SwingUtilities.invokeLater(doTask);
        * Fully collapses the Navigator display trees from the specified node.
        * @param the node from which each tree will be fully collapsed.
         public void collapseAll(TopologyModelNode node)
              final TopologyModelNode fnode = node;
              Runnable doTask = new Runnable(){
                   public void run(){
                        if (hyperbolicTreePanel != null)
                             hyperbolicTreePanel.collapse(fnode);
                        if (navigatorTreePanel != null)
                             navigatorTreePanel.collapse(fnode);
                        for (NavigatorTreePanel navTreePanel : qmgrTreeDisplays){
                             navTreePanel.collapse(fnode);
              SwingUtilities.invokeLater(doTask);
        * Will ensure that all tree nodes, starting from the root, are correctly displayed.
         public void refreshTreeDisplays()
              if (hyperbolicTreePanel != null){
                   TopologyModel model = hyperbolicTreePanel.getTopologyModel();
                   if (model != null){
                        hyperbolicTreePanel.expandTreePath((TopologyModelNode)model.getRoot(), true);
                        hyperbolicTreePanel.refreshTreeDisplay((TopologyModelNode)model.getRoot());
              if (navigatorTreePanel != null){
                   TopologyModel model = navigatorTreePanel.getTopologyModel();
                   if (model != null){
                        navigatorTreePanel.refreshTreeDisplay((TopologyModelNode)model.getRoot());
                        navigatorTreePanel.repaint();
              for (NavigatorTreePanel navTreePanel : qmgrTreeDisplays){
                   ExpandingModelNode model = (ExpandingModelNode)navTreePanel.getNavigatorTreeModel();
                   if (model != null){
                        navigatorTreePanel.expand((TopologyModelNode)model.getRoot());
                        navTreePanel.refreshTreeDisplay((TopologyModelNode)model.getRoot());
                        navTreePanel.repaint();
    }

    you really don't need to post all that code, few people will read it, or try to compile/run it.
    just a tree in a scrollpane in a frame is all you need, then add the method/problem to the basic,
    and post that so its only 20 to 30 lines long.
    here's your basic tree/scrollpane/frame, with an expandAll()
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    class Testing
      public void buildGUI()
        JTree tree = new JTree();
        expandAll(tree);
        JFrame f = new JFrame();
        f.getContentPane().add(new JScrollPane(tree));
        f.pack();
        f.setLocationRelativeTo(null);
        f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        f.setVisible(true);
      public void expandAll(JTree tree)
        int row = 0;
        while (row < tree.getRowCount())
          tree.expandRow(row);
          row++;
      public static void main(String[] args)
        SwingUtilities.invokeLater(new Runnable(){
          public void run(){
            new Testing().buildGUI();
    }so, is your problem with the expandAll(), or with reading the properties file?

  • How to create  a test plan with specific transactions (or program)

    Hello,
    I'm a new user in Sol Man !
    How to create  a test plan with specific transactions (or program).
    In my Business Blueprint (SOLAR01) I've created in 'transaction tab' the name of my specific transactions and linked it.
    In my test plan (STWB_2) those specific doesn't appear to be selected !
    Thanks in advance.
    Georges HUYNEN

    Hi 
    In solar01 you have defined but you have to assign the test case in solar02 for this test case in the test cases tab.
    When you do so expand the business sceanario node in test plan generation of STWB_2 transaction and now that will appear.
    Also visit my weblog
    /people/community.user/blog/2006/12/07/organize-and-perform-testing-using-solution-manager
    please reward points.

  • How to create dynamic tree based on BAPI

    Hi
    I am able to create dynamic tree based on flat file structure example given in SDN . But how to create the tree from BAPI directly.Also when I will be clicking on any leaf node of the tree some data related to the node will be passed to another view.
    Regards
    Ananda

    What i'm trying to do is create an organizational structure.
    Global>Region>Plant-->Corporation
    The output from the RFC is a structure containing every possible combination for orgazational hierarchy. Basically a flat table with record for every possible combinaton of Region-Plant-Corporation. This data needs to be bound to a tree structure so that we can call BW queries based on that level. For example: Give me aged inventory for the SAP corporation within the plant Berlin that is located in the Europe region.
    Now that you understand the business reason will the nodes that represent Region and Plant and corporation be non-singleton nodes or recursive? I was thinking a hierarchy of non-singleton nodes.
    I can bind these nodes to the Region - Plant - Corporation elements returned from in the flat table structure. I will probably get duplicates as a specific Region will be listed multiple times for every possible combination of the data beneath it. I'm not so concerned about that right now as I want to make sure I understand how in Web Dynpro to bind the data to the tree.
    Hopefully this makes some sense. Can you elaborate on how this may be constructed in context of the view?
    Would i create a model node for region (0..n), model node for plant (0..n), and a model node for Corporation (0..n)?
    Or does this sound totally incorrect?
    julian
    We have 3 regions over 50 plants and probably around 500 corporations.

  • How to re-open tree nodes after a refresh to AdvancedDataGrid's GroupingCollection?

    Hello,
    I have an AdvancedDataGrid, which has as it's dataProvider a
    GroupingCollection. The GroupingCollection's source is bound to an
    ArrayCollection. Items in the ArrayCollection can be edited.
    After a change to the ArrayCollection, I refresh() the
    GroupingCollection so it displays properly. Unfortunately, this
    collapses the tree of the AdvancedDataGrid, that is, the previously
    open nodes are no longer open. I would like to re-open the nodes
    after a refresh.
    In the code provided, I have attempted to save the nodes
    which were open before the refresh, perform the refresh, then
    re-expand the nodes with AdvancedDataGrid.expandItem(). But it
    didn't work, and I am stumped.
    Any ideas on how to expand nodes in the AdvancedDataGrid?
    or
    Any ideas on how to allow the user to modify a data item,
    including fields used as GroupingFields, in an AdvancedDataGrid?

    Yes, I try saving the nodes like this:
    //save the currently opened items
    openArray = new Array();
    for each(var obj:Object in advancedDataGrid.openItems)
    openArray = openArray.concat(obj);
    and then restoring them with the expand function:
    //expands the nodes which are passed in as the argument
    private var expand:Function = function(array:Array):void
    for each(var obj:Object in array)
    advancedDataGrid.expandItem(obj, true);
    Unfortunately, expandItem just seems to return without doing
    anything!

  • How to highlight a tree node programmatically

    Problem
    =====
    Just like a typical management software, I have a navigation tree presenting a list of objects (let's say toasters) on the left panel. The content panel on the right side presents the details of a toaster, when the user selects the toaster on the navigation tree. On the toaster details panel, I would like to have a hyper link referring to another toaster - associated to the selected toaster. On clicking on the hyperlink, I would like to display the details of the associated toaster and the navigation tree node for the associated toaster being highlighted.
    For example, BUI presents the following now:
    + Toasters | Toaster 1 Details [Refresh]
    + <toaster1> |
    + toaster2 | ... toaster3
    + toaster3 |
    toaster1 is selected on the navigation tree. The contents panel displays Toaster 1 details, which has a hyper link for toaster3.
    When the user click on toster3 on the contents panel, I would like to see the following
    + Toasters | Toaster 3 Details [Refresh]
    + toaster1 |
    + toaster2 | ...
    + <toaster3> |
    My Trial
    =====
    ADF Rich Client 11.1.2.3 is used for my development.
    Jspx code for the navigation tree looks like this:
    <af:tree id="navTree" ...>
    <f:facet name="nodeStamp">
    <af:panelGroupLayout id="nodePgl">
    <af:switcher facetName="#{stamp.outcome!=null?'actnode':'noactnode'}" ...>
    <f:facet name="actnode">
    <af:commandLink id="leafLink" text="#{stamp.label}" action="#{stamp.actionOutcome}">
    <af:setActionListener from="#{stamp.key}" to="#{treeHandler.selectedMenuItem}"/>
    </af:commandLink>
    </f:facet>
    <f:facet name="noactnode">
    <af:outputText id="notLeafText" value="#{stamp.label}"/>
    </f:facet>
    </af:switcher>
    </af:panelGroupLayout>
    </f:facet>
    </af:tree>
    The hyper link on the contents panel looks like this:
    <af:iterator var="toaster" value="#{toastData.toasters}">
    <af:commandLink text="#{toaster}" action="#{toasterHandler.goToToaster}">
    <f:param name="toasterId" value="#{toaster}"/>
    <af:setActionListener from="#{toaster}" to="#{treeHandler.selectedToaster}"/>
    </af:commandLink>
    </af:iterator>
    I got some tips from this forum (cannot find thread at the moment) and implemented the treeHandler.selectedToaster method as follows:
    // getSelectionState returns selStat, which is instantiated like the following:
    // RowKeySet selStat = new RowKeySetTreeImpl();
    // TreeModel model = (TreeModel) menuModel.getWrappedData();
    // selStat.setCollectionModel(model);
    // selStat.setContained(true);
    RowKeySet rowKeySet = getSelectionState();
    rowKeySet.removeAll();
    // synthesize the rowKey for the selected toaster
    // if the toaster found in the toaster node list,
    // rowKey should look like [0, <rowIdx of toaster>]
    ArrayList<Integer> rowKey = new ArrayList<Integer>();
    rowKey.add(0);
    rowKey.add(new Integer(rowIdx));
    TreeModel model = (TreeModel) menuModel.getWrappedData();
    model.setRowKey(rowKey);
    model.setRowIndex(rowIdx);
    rowKeySet.add();
    This seems to work most of times except when I refresh the contents details panel using partial page rendering.
    I get NullPointerException on the call to rowKeySet.removeAll().
    Caused by: java.lang.NullPointerException
         at org.apache.myfaces.trinidad.model.RowKeySetTreeImpl._selectAll(RowKeySetTreeImpl.java:459)
         at org.apache.myfaces.trinidad.model.RowKeySetTreeImpl.removeAll(RowKeySetTreeImpl.java:146)
    In my observation, this NPE happens when rowKeySet.size() returns 1 but rowKeySet.iterator() does not return any entries.
    I suspect this is a bug on RowKeySetTreeImpl but not sure.
    Help Need
    =======
    1. What is the reasonably right way to highlight the tree node for my problem?
    2. If my trial is one way to do it, how can I get around the NPE? I cannot change ADF Rich Client library at this point.
    Any help/suggestion/advise would be appreciated.
    Thanks,
    Jeongtae

    I did this, to programmatically expand a tree node, you can try the same and set the row key to highlight.
    private RowKeySet disclosedTreeRowKeySet = new RowKeySetImpl();
    public void rowDisclosureListener(RowDisclosureEvent rowDisclosureEvent)
    Iterator added = rowDisclosureEvent.getAddedSet().iterator();
    if (added!=null)
    while (added.hasNext())
    Object rowKey = added.next();
    //disclosedTreeRowKeySet.clear();
    List path = (List)rowKey;
    for( int i=0; i< path.size(); i++ )
    List<Object> nodePath = new ArrayList<Object>();
    for( int j=0; j<i; j++ )
    nodePath.add( path.get( j ) );
    disclosedTreeRowKeySet.add( nodePath );
    disclosedTreeRowKeySet.add( rowKey );
    System.out.println( "disclosed Keys...... " + disclosedTreeRowKeySet );
    private void expandSelectedNode(RowKeySet addedObj) {
    if (sourceTreeTable != null) {
    Iterator added = (Iterator)addedObj.iterator();
    if (added!=null)
    while (added.hasNext())
    Object rowKey = added.next();
    List path = (List)rowKey;
    for( int i=0; i< path.size(); i++ )
    List<Object> nodePath = new ArrayList<Object>();
    for( int j=0; j<i; j++ )
    nodePath.add( path.get( j ) );
    disclosedTreeRowKeySet.add( nodePath );
    disclosedTreeRowKeySet.add( rowKey );
    sourceTreeTable.setDisclosedRowKeys(disclosedTreeRowKeySet);
    }

  • How to create a tree structure,like I want to create Bill/Payment Tree

    How to create a tree structure , like I want to create a Bill/Payment Tree containing a single node for all A/R related activities for a specific bill period, in reverse chronological order. Basically the tree should look like
    + Bill - Date: 03-17-2010 Complete
    +++++ CR Note - Date: 05-04-2010 Complete
    ++++++++++ Pay - Date: 05-04-2010 Frozen
    + Bill - Date: 03-17-2010 Complete
    +++++ Pay - Date: 05-04-2010 Frozen
    And finally this should be attached as tab on the control central

    The FTree package provides functions to populate the tree - look for the topic "Manipulating a hierarchical tree at runtime
    " in the online help this point to all the functions and triggers

Maybe you are looking for

  • IPod Classic 120gb cannot be synched - unknown error 13014

    While using iTunes 8.0.1 as I usually would, I unintentionally unplugged my ipod 120gb classic from the usb drive briefly. I plugged it back in and went to play a track and got the 'The iPod "ipodname" cannot by synched. An unknown error occurred (13

  • Dimension values display order and record details

    Hi All, I have explicitly ordered my dimension values to be in a logical order instead of alphabetical. Ex: Small, Medium, Large. This works great in the navigation tree but when I view a specific record and it  has those 3 dimvals they are listed in

  • Vectors : Converting to double[ ] array

    Hello, I have a vector which I know consists of double values only. I am trying to create an array of double from this vector but am having some difficulty. Firstly if I try this : double[] high = (double[])datavector.high.toArray(new double[0]);JBui

  • Can i set site page as New/ Edit form of SharePoint list?

    Hello All, Can i set site page as New/ Edit form of SharePoint list. I know this can be done if i create Application page, but can i set site page as SharePoint list form. If yes, then how? Also in any case is it possible to set New/Edit form of alre

  • There was a problem processing my order

    I just tried to order the 18,000 baht creative cloud annual package under name of samornmitr lamsam, here in Thailand.. i was not able to complete and download the programs, but I have been charged 4 times 18,000 baht on my visa account. pls contact