How to select a particular node in a tree?-want suggestions urgent

i've to make a tree showing "c:\" folder structure of the system. Initially i'm adding the folders in c:\ only tothe tree. And i'm adding the subfolders when ever i select a particular folder. I'm opening the subfolders and inner subfolders of it and so inside like that. now i'm closing the window . i want the tree to reopen with the previously opened level when ever i again run the program. On closing i'm storing the last selected node using tree.getMaxSelectionPath() . And on reopen i'm setting it as tree.setSelectionPath(tree.getMaxSelectionPath()).
But it is not opening the entire path. it is opening uptop one level only. what to do. Needs suggestion urgently.
Thnaks for suggestons.

Hi again,
I am sorry, I cannot help in another way than looking at the documentation, because I have currently no JDK available here. If expandPath(...) doesn't work, you can try to get all the nodes of that path and expand them from the root node downwards, perhaps that will work.
greetings Marsian

Similar Messages

  • Selecting/highlighting a node in Flex Tree using HierarchicalCollectionView as DataProvider

    Hi,
    I am using GroupingCollection2 as the dataprovider for HierarchicalCollectionView. The GroupingCollection2 takes its data from an ArrayCollection. And finally I have a Tree whose dataprovider is the HierarchicalCollectionView . I want to acheive 2 things:
    1) I want to programatically select/highlight a node in this tree. Using expandItem and passing the Object from the arraycollection is not working.
    2) Refresh the tree if there is a change in the arrayCollection.
    For the second task, I have a Java Layer that gives me the ArrayCollection  (dp for GroupingCollection2) when I fire a CairngormEvent. But the problem is that every node in the tree is duplicated. I can clearly see that say there are 8 items in the array collection but still the tree shows 16 items ( Each item duplicated as the node in the tree.)
    I have been trying to figure this out for many days now without any luck. Any sort of suggestion would be appreciated.
    Thank u in advance.

    I got the refreshing of the tree part by myself. One needs to call the refresh method on the GroupingCollection2 and HierarchicalCollectionView objects when the arraycollection has just arrived from the database.
    But I still havent been able to figure out how to highlight or open a tree node programatically. I am repeating that using (calling / setting) tree.expandItem() and tree.openItems is not helping me. Plz somebody help.

  • Hierachical tree - Highlight particular node's in Tree

    Is there any way to bold or change the colour of particular nodes in a tree?
    We know and use the node icon to distinguish between them but ideally would want to bold some to highlight areas
    I can not see how to do this looking at the documentation but may be wrong.
    Thanks

    Thanks thats what i thought but hoped i was wrong.

  • Select the multiple nodes in a tree

    Hi Experts,
    We need to select the multiple nodes in a tree.Whatever we are selecting,that has to be added in the table as a tree structure itself.
    For ex:
    A
    |--A1
        |--B1
    If We select the A then A,A1 and B1 has to be added in a table.Please help me out for this.
    Regards
    Nutan
    Edited by: Armin Reichert on Jan 29, 2008 2:33 PM

    Hi,
    You have to create a recursive node and use the tree by nesting UI component
    Following tutorial will be of use
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/user-interface-technology/webdynpro/wd%20java/wdjava%20tutorials%20and%20articles%20archive/constructing%20a%20recursive%20and%20loadable%20web%20dynpro%20tree.pdf
    Recursive Node
    http://help.sap.com/saphelp_nw70/helpdata/en/5d/97384162316532e10000000a1550b0/frameset.htm
    TreeByNesting
    http://help.sap.com/saphelp_nw70/helpdata/en/92/12a74046033913e10000000a155106/content.htm
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/webcontent/uuid/28113de9-0601-0010-71a3-c87806865f26?rid=/library/uuid/49f2ea90-0201-0010-ce8e-de18b94aee2d#31 [original link is broken]
    Regards
    Ayyapparaj

  • How to use xpath function to select some particular  nodes

    Dear experts:
    does abap supports  xpath  to sellect particular  nodes  according some node value or condition, i know other  programe language  supports the function selectNode(xpath expression)  , does abap or have the api to support it?
    and i know there is a class support  the xpath but it's not work., the class this:cl_xslt_processor
    to clarify my point. i take a ex.
    the xml doc is follow:
    <?xml version="1.0" encoding="utf-8" ?>
    - <n0:MT_CRM_Req xmlns:n0="http://gome.com/CRM/CRM/Outbound" xmlns:prx="urn:sap.com:proxy:DC0:/1SAI/TAS05C79364B9D0DC5F6738:701:2010/02/19">
    <company name="hp">
    <dep name="gds">
    <empolyeeid>123</empolyeeid>
    </dep>
    <dep name="its">
    <empolyeeid>148</empolyeeid>
    </dep>
    </company>
    <company name="foxconn">
    <dep name="fih">
    <empolyeeid>569</empolyeeid>
    </dep>
    </company>
      </n0:MT_CRM_Req>
    i  want to  select the employee 's company name who empolyee id is 123
    i use the method  ,and the code is :
    l_xslt->set_expression(
    expression = '/n0:MT_CRM_Req/n0:company[n0:dep/n0:empolyeeid=123]'
    nsdeclarations = 'n0 http://gome.com/CRM/CRM/Outbound'
    l_xslt->run('').
    nodes = l_xslt->get_nodes( ).
    LEN = nodes->GET_LENGTH( ) .
    WRITE LEN.
    but no nodes return.
    is anybody knows what's wrong with it? or there is some other api to manipulate the xml dom.
    best regrds!

    Hello Kevin ,
    i think you can get those details , have a look at program BCCIIXMLT1, i think this program will give you some idea to handle * manage xml docs.
    along with that program ...you need to put filter
    *---creating filers.
      filter   = document->create_filter_name( name = 'Company' ).
      iterator = document->create_iterator_filtered( filter ).
      main_node =  document.
    *---processing document.
      perform print_node using main_node p_flag.
    let me know if you need anymore help.
    regards
    Prabhu

  • How to disable a particular node in JTree?

    Hi
    I am working with an application where in which I have a tree component and when a select a node and click a disable button , I want to disable the selected node(that is no further selection of that node possible until I enable it). I am using DefaultTreeCellRenderer for rendering nodes. I tried the following.
    DefaultTreeCellRenderer renderer = (DefaultTreeCellRenderer)tree.getCellRenderer();
    JLabel label = (JLabel) renderer.getTreeCellRendererComponent(tree,selectedNode,true,true,false,row,true);
    label.setEnabled(false);
    But it doesn't work.
    Does any one know how to do this?
    Thank you.

    Its not going to work if you implement the TreeCEllRenderer, cos' all it does is paint your tree.
    What u need to implement is the treeSelectionListener interface,
    and override the addSelectedPath(path), addSelectedPath(paths[]) etc.
    You might want to create a list of all the nodes that the user selectes to diable, and then in these methods decide if the node is that then do not allow its selection.

  • How to select a particular layer in AE?

    Hi,
         I want to select a particular layer in Timeline. Is it possible to select a layer if I have the AEGP_LayerH? I searched in AE_SDK_guide but did not find any function in LayerSuite.
    Any ideas?
    Thanks,
    Dheeraj.

    Thanks Shachar. I checked the collectionSuite but got confused as to how to add items to collection and when to delete the collection. I will try again.

  • How to select a particular row in a JTable?

    I want to select a particular row in a JTable. i.e something like
    table.setSelectedRow(arg)how can i do it.

    You can use
    table.getSelectionModel().setwhateverIsInTheAPI(...)
    depending on your selection mode.Thanx,
    but i don't want to change the selectionMode, i
    want to select a particular row thro program.
    This is like list.setSelected(index) in
    JListThe original poster was pointing you in the right direction. You have to use the SelectionModel when you want to work with the selected indexes of a JTable. It will return a ListSelectionModel, which will be an instance of DefaultListSelectionModel unless you implemented your own. Refer to the API for the appropiate method(s).
    http://java.sun.com/j2se/1.5.0/docs/api/javax/swing/ListSelectionModel.html

  • How to search in particular node

    hi
    kindly tell how can we limit our search to a particular node instaed of the whole content
    thanks in advance

    Since it's all text, why not use a real quick Match Pattern (or Regular Expression, but you don't need that much power here), see attached.
    Cameron
    To err is human, but to really foul it up requires a computer.
    The optimist believes we are in the best of all possible worlds - the pessimist fears this is true.
    Profanity is the one language all programmers know best.
    An expert is someone who has made all the possible mistakes.
    To learn something about LabVIEW at no extra cost, work the online LabVIEW tutorial(s):
    LabVIEW Unit 1 - Getting Started
    Learn to Use LabVIEW with MyDAQ
    Attachments:
    Two-stage match demo.vi ‏8 KB

  • How to select a particular row in grid?

    I am trying to generate a user defined CFL form which should work exactly as system CFL. Using Matrix takes minutes to load the query's output so I m using grid instead and passing the query as a parameter to datatable. is there any way to select a particular row in grid through SDK ? for matrix , it cud be written like 'matrix.selectrow(). doesn't seem to have such property for grid. Any help on this will be appreciated.
    Thank you..

    hi
    oGrid.SelectionMode = SAPbouiCOM.BoMatrixSelect.ms_Single;
                        oGrid.Rows.SelectedRows.Add(pVal.Row);
    i think that will help you
    Regards,
    Rajesh Saini

  • How to rename a particular node in an xml

    Hi All,
    I have a table called xmltable and I have inserted the below row in to the table,
    INSERT INTO XMLTABLE VALUES (4,'<?xml version="1.0"?>
    <Node_1 empID="202" empName="Pro1" oper="Update">
    <Node_2 empID="20" empName="Pro2" oper="Update">
    <Node_3 empID="2" empName="Pro3" oper="Update">
    <Node_4 empID="22" empName="Pro4" oper="Update">
    <Node_5 empID="12" empName="Pro5" oper="Delete"/>
    <Node_6 empID="223" empName="Pro6" oper="Insert"/>
    <Node_7 empID="201" empName="Pro7" oper="All"/>
    </Node_4>
    </Node_3>
    </Node_2>
    </Node_1>');
    I Have created a sequence seq_i
    I want to replace a particular node with next sequence seq_i,
    Ex: - Assume I want to replace only 'Node_2' with 'seq_i.nextval',
    Can any one help me in acheiving this?
    Thanks,

    Sorry for the inconvenience, Below Find detailed explanation of the issue,
    INSERT INTO XMLTABLE VALUES (4,'<?xml version="1.0"?>
    <Node_1 empID="202" empName="Pro1" oper="Update">
    <Node_2 empID="20" empName="Pro2" oper="Update">
    <Bode_3 empID="2" empName="Pro3" oper="Update">
    <Bode_4 empID="22" empName="Pro4" oper="Update">
    <Bode_5 empID="12" empName="Pro5" oper="Delete"/>
    <Bode_6 empID="223" empName="Pro6" oper="Insert"/>
    <Bode_7 empID="201" empName="Pro7" oper="All"/>
    <Node_3 empID="21" empName="Pro71" oper="ll">
    </Bode_4>
    </Bode_3>
    </Node_2>
    </Node_1>');
    I have a sequence seq_i
    seq_i start with 1 increment by 1
    am able to display output as below,
    Node|EMPID|OPER|EMPNAME|MGRID
    Node_1|202|Update|Pro1|Null
    Node_2|20|Update|Pro2|Node_1
    Bode_3|2|Update|Pro3|Node_2
    Bode_4|22|Update|Pro4|Bode_3
    Bode_5|12|Delete|Pro5|Bode_4
    Bode_6|223|Insert|Pro6|Bode_4
    Bode_7|201|All|Pro7|Bode_4
    Node_3|21|ll|Pro71|Bode_4
    Now I want below one as output
    All nodes starting with Bode_, I need to replace that with sequence, seq_i
    so for the seq_i (starting with i and incrementing by 1)
    Node|EMPID|OPER|EMPNAME|MGRID
    Node_1|202|Update|Pro1|Null
    Node_2|20|Update|Pro2|Node_1
    1|2|Update|Pro3|Node_2
    2|22|Update|Pro4|1
    3|12|Delete|Pro5|2
    4|223|Insert|Pro6|2
    5|201|All|Pro7|2
    Node_3|21|ll|Pro71|2
    Thanks,

  • How to get the root node of a tree?

    I wanna get all the leaf node of a tree.But JTree have no method about how to get the root TreeNode of a tree.Then how should I do?

    try this:
    http://javaalmanac.com/egs/javax.swing.tree/GetNodes.html?l=rel

  • To change Font of a Particular Node in a tree structure

    IS there any way to set Visual attribute property to a particular node_lable on Heirachical tree Structure.
    e.g.
    Main Office has Two Branch Offices(Office1 and Office2). and Office1 has Three Sub Branches(sub1,sub2 and sub3).If I am working from Office1, and I want to print Organisation Structure with Office1 with font_weight as Bold.

    Enhancements IF applied they will be available only in new releases of Forms, which probably be 11i. It's not possible to have it in Forms 6i.
    Froms 6i it's already out of support (has minimum support I think).
    Regards,
    Tony

  • How to create multiple root node in a tree

    Hi Experts,
    As per my requirement I have two requirements for  tree creation:
    1) Create a Tree which can display multiple root node.
    2) Cretae a Tree which can display data directy without any folder.
    I am new in Tree development.
    Can any body help me out to get it done.
    If it is not possible then also i need a confirmation from experts.
    Regards,
    Madhu

    use method add_node of the class Cl_gui_alv_tree to add a node to the tree.
    In case of root node the parameter lv_relat_key is passed as blank.In order to create further child nodes pass the node key of the parent as the relat key of the child and use the method again.
    Regards,
    Abhi

  • How to set a particular node selected in a JTree from within the model

    I have an adapter class that provides communication between my JTree and data model. My adapter class implements TreeModel, TreeExpansionListener, TreeSelectionListener and a listener for changes to my data model.
    My data model keeps reference to the currently selected node. It is working quite nicely when I select a tree node with the mouse (the data model is updated accordingly with the node selected), however my problem occurs trying to go the other way (set the selected node in my data model and have it reflected in the tree).
    I know that my selection in the tree is changing correctly as when the selection changes it fires off an event to update the attributes window associated with the currently selected node. I just can't get the node to become highlighted.
    Any ideas would be most welcome.
    Thanks,
    Beck.

    Does your model really have to keep track of the selected item or can the two views (the JTree and the attributes window) not be coupled together in the user interface instead?
    Failing that, you could always consider implementing TreeSelectionModel as well and calling JTree.setSelectionModel since you're keeping track of the tree selection for it already. This is quite a bit of work though.
    If that's too much trouble then if you can work out the TreePath for the node that's been programmatically selected through your model then you could use JTree.getSelectionModel().setSelectionPath. Have a look at tree.getSelectionModel().setSelectedPath(new TreePath(selectedObject)).
    This approach is a bit warped, though, since it implies that your model knows about the view and therefore couples them together.

Maybe you are looking for