Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » JFace » TableViewer: 'Enter' key default behaviour?
icon5.gif  TableViewer: 'Enter' key default behaviour? [message #632426] Tue, 12 October 2010 20:36 Go to next message
Craig Foote is currently offline Craig FooteFriend
Messages: 195
Registered: July 2009
Senior Member
What is (and determines) the default behaviour when the user selects a row in a TableViewer and then presses the 'Enter' key? How can this be changed?

Craig
Re: TableViewer: 'Enter' key default behaviour? [message #637892 is a reply to message #632426] Tue, 09 November 2010 09:40 Go to previous messageGo to next message
T. Wilhelm is currently offline T. WilhelmFriend
Messages: 129
Registered: July 2009
Senior Member
Hi Craig,

i´m not sure if i got your problem, why don´t you simply add a KeyListener to the tree and then implement your own behavior (i.e. edit the first element in the row) ?

Greetz
Thomas
Re: TableViewer: 'Enter' key default behaviour? [message #637928 is a reply to message #637892] Tue, 09 November 2010 11:42 Go to previous messageGo to next message
Devi Vara Prasad Bandaru is currently offline Devi Vara Prasad BandaruFriend
Messages: 98
Registered: March 2010
Location: Hyderabad
Member

Even by adding a double click listener to the viewer you can do the same thing.
A double click event will be fired when enter key is pressed .
See this method and its usages for reference org.eclipse.jface.viewers.StructuredViewer.handleDoubleSelec t(SelectionEvent)


Re: TableViewer: 'Enter' key default behaviour? [message #638117 is a reply to message #637928] Wed, 10 November 2010 00:39 Go to previous message
Craig Foote is currently offline Craig FooteFriend
Messages: 195
Registered: July 2009
Senior Member
Sorry, I probably should have provided more info. We do have a double-click listener on the table - I didn't realize it was being fired when the Enter key was pressed. Mystery solved, thanks.

Craig
Previous Topic:how to change and add TableViewer's columns dynamically
Next Topic:how to get latest UI data after sorting the tableViewer or moving one column
Goto Forum:
  


Current Time: Sun Nov 23 06:20:18 GMT 2014

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

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