Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse 4 » Where does TableViewer select an entry?
Where does TableViewer select an entry? [message #576937] Tue, 01 June 2010 16:47 Go to next message
David Wynter is currently offline David Wynter
Messages: 4552
Registered: July 2009
Senior Member
Hi,

Having fun with e4 at the moment. Getting used to the event handling model is difficult as most of it is hidden from you.

The problem I have is that my equivalent of the ListView class in Contact demo does not re-select the current item in the list whenever one of my EventHandlers fires. I cannot see where in the Contacts demo it does this either. I always end up with no item selected in the list (TableViewer) after any EventHandler fires. Can someone point me where to intecept and restore the current selection in TableViewer?

Thx.

David
Re: Where does TableViewer select an entry? [message #576966 is a reply to message #576937] Wed, 02 June 2010 11:24 Go to previous messageGo to next message
David Wynter is currently offline David Wynter
Messages: 4552
Registered: July 2009
Senior Member
I have also noticed that with my app based on the Contact demo code when I click in the detail view on the right hand side the highlight is removed from the selected element in the TableViewer on the left hand side.

In contacts demo app the focus moves when you click in the detail view, but the highlight on the selected element in the ListView remains, although it does change. How is this done, not obvious from the Contacts demo code.

Thx.

David
Re: Where does TableViewer select an entry? [message #576986 is a reply to message #576937] Wed, 02 June 2010 12:45 Go to previous message
Paul Webster is currently offline Paul Webster
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

David Wynter wrote:
> Hi,
>
> Having fun with e4 at the moment. Getting used to the event handling
> model is difficult as most of it is hidden from you.

In the contacts demo, what event handling? The ListView has code that
posts its selection:

contactsViewer
.addSelectionChangedListener(new ISelectionChangedListener() {
public void selectionChanged(SelectionChangedEvent event) {
IStructuredSelection selection = (IStructuredSelection) event
.getSelection();
context.modify(IServiceConstants.SELECTION,
selection.getFirstElement());
}
});

the details view listens for a selection change:
@Inject
public void setSelection(@Optional @Named(IServiceConstants.SELECTION)
Contact contact) {...}




What event are you trying to feed back into the ListView? Where is it
coming from? What handling code did you write?

PW


--
Paul Webster
http://wiki.eclipse.org/Platform_Command_Framework
http://wiki.eclipse.org/Command_Core_Expressions
http://wiki.eclipse.org/Menu_Contributions
http://wiki.eclipse.org/Menus_Extension_Mapping
http://help.eclipse.org/galileo/index.jsp?topic=/org.eclipse .platform.doc.isv/guide/workbench.htm


Previous Topic:hibernate in e4
Next Topic:[XWT] XSD or Ecore ?
Goto Forum:
  


Current Time: Thu Sep 18 14:01:39 GMT 2014

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

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