Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » JFace » TreeViewer - set a default selection
TreeViewer - set a default selection [message #870061] Sun, 06 May 2012 04:55
Charles Tubbs is currently offline Charles TubbsFriend
Messages: 35
Registered: March 2012
I am having a problem setting a default selection in my createPartControl() function. I tried the following code :

menuModel = new BuildMenuModel();

if (selectedItem == null ) {
menuList = menuModel.getMenulevels();
selectedItem = menuList.get(0);
ISelection sel = new StructuredSelection(selectedItem);
viewer.setExpandedState(selectedItem, false);

I followed the code in the debugger and saw that viewer.setSelection() alters a data item and fires an appropriate looking event, but nothing happens to the control. Similar code works in my addSelectionChangedListener(). It seems to be a timing problem.

Any clues?
Previous Topic:TreeViewer - set a default selection
Next Topic:TreeViewer - set a default selection
Goto Forum:

Current Time: Wed Oct 26 09:45:06 GMT 2016

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

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