| selection on focus problem [message #41455] | 
Wed, 08 August 2007 08:31  | 
 
Eclipse User  | 
 | 
 | 
   | 
 
Hi, 
 
I have a problem with selections in a ViewPart. The View Part  - I call it 
ServiceView contains a TreeViewer which provides selection events with 
 
viewer.setContentProvider(new TreeViewerContentProvider()); 
 
This control is a tree which contains i.e. a menu structure. When I click on  
an item 
in the tree viewer a view should be activated. I did this with 
 
page.showView("anotherView") in the selectionChanged method and it works  
fine. 
 
Now the new view "anotherView" which I selected in the tree viewer got the  
focus. I go back to 
the "ServiceView" and click directly another tree item but the ViewPart  
(ServiceView) which surrounds the 
TreeViewer is not activated.The tree item i clicked is activated but the  
selection is not fired. 
 
The selection is fired when I first click on the "ServiceView" Tab an then  
click 
on another item or when I click anywhere in the newly opened view  
"anotherView" an then 
come back to my "ServiceView" and click another Item. 
 
I work around the problem with the following code in the selectionChanged  
method: 
 
page.showView("anotherView"); 
page.showView("ServiceView"); 
 
Now the ServiceView got the focus back again after opening "anotherView" and  
the selection event in 
the underlaying treeViewer will be fired on next click. 
 
I am working with HEAD from SVN. 
 
Is this the right behavior ? 
 
Any hints would be fine. 
 
Regards, 
Thomas
 |  
 |  
  | 
Powered by 
FUDForum. Page generated in 0.05514 seconds