Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » [Common Navigator View] How to restore expanded nodes?
[Common Navigator View] How to restore expanded nodes? [message #870494] Tue, 08 May 2012 12:25
David BY Chan is currently offline David BY ChanFriend
Messages: 40
Registered: July 2009
Member
Hi, I created a CNF viewer to display filtered resources which contains
structured information that can be display in a tree-like style.

I can use method "saveState" to save all expanded nodes as path string,
but I feel frustrated in the method "restoreState". You know, CNF
dynamically create children when people click expansion arrow, so only
these nodes on the first level were created when initializing. If I
restore view at that time, I can't find more nodes except the first
level ones, and I can't use method "setExpandedElements(Object[])" to
show last saved expanded states.

For example.

saveState()
{
Object[] expanded = batisViewer.getVisibleExpandedElements();
save each expanded nodes as string, here the string will be the Primary
Key of saved node.
}
restoreState()
{
String[] all_node_pk = .....
Object[] all_expanded_nodes;
for (String pk : all_node_pk)
{
Object view_node = queryNodeByPk(pk);
addToExpandedNode(view_node);
}
}

I can't do further when accoutered method "queryNodebyPK", because some
nodes that matched PK is not available now.

Or how to call CNF functions to create view node dynamically?

Thanks for your great help!!!
Previous Topic:OutOfMemoryError: Java heap space (vmargs does not work)
Next Topic:Problem adding a vertical ruler listener
Goto Forum:
  


Current Time: Thu Apr 25 03:48:33 GMT 2024

Powered by FUDForum. Page generated in 0.02974 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top