Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » JFace » TreeViewer - set a default selection(Having problem selecting an initial selection)
TreeViewer - set a default selection [message #870052] Sun, 06 May 2012 04:27
Charles Tubbs is currently offline Charles TubbsFriend
Messages: 35
Registered: March 2012
Hi All,

I am trying to create a default selection in my tree viewer. I inserted the following code in my createPartControl() function :

menuModel = new BuildMenuModel();

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

I have followed the code in the debugger and verified that setSelection sets a data item and fires an event but nothing happens. It probably has something to do with timing as similar code works works just fine in my addSelectionChangedListener().

Any clues?

Previous Topic:Model to Treeviewer databinding problem
Next Topic:TreeViewer - set a default selection
Goto Forum:

Current Time: Fri Jun 22 01:50:36 GMT 2018

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

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

Back to the top