aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes What type of listener can i use, instead of FocusListener Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "What type of listener can i use, instead of FocusListener" Watch "What type of listener can i use, instead of FocusListener" New topic
Author

What type of listener can i use, instead of FocusListener

Bharath Raja
Ranch Hand

Joined: Jan 21, 2009
Posts: 111
I have a 3 text boxes (org.eclipse.swt.widgets.Text) in a eclipse view (customized), and I've one action set menu named as "save" which responsible for get hold of the 3 text boxes values in to TableViewer. For this scenario, I've added the focus listener to each text boxes and focus lost event of focus listener. Within the focus lost event I've added the text box values in an array list and when the user clicked the action set menu "save" using that array list I can show the values in a TableViewer.

Now the problem is with my focus listener. Because of I've done my logic within the focus lost event, if the user enter a value in a first text box and directly go to the action set "save" and click it (please note : still the key cursor is in first text box only). Since this now the array list doesn't contain any thing.

My primary requirement is I've to get hold of the value even the user doesn't move to any other text box exclude where his cursor right now. For this can i use any other listeners?

Can we do programmatically push to get lost the focus of text boxes. Any Idea.?


Life is either daring something or nothing - Helen Keller
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 10523
    
    9

Inside the actionPerformed for the save menu you can always populate your array list by invoking textField1.getText() etc

[How to ask questions] [Donate a pint, save a life!] [Onff-turn it on!]
Bharath Raja
Ranch Hand

Joined: Jan 21, 2009
Posts: 111
Maneesh Godbole wrote:Inside the actionPerformed for the save menu you can always populate your array list by invoking textField1.getText() etc


sorry maneesh, I don't think we have method as actionPerformed in action set. Let say clear, I'm talking about SWT/JFace in Eclipse Plug-in Development Environment. Anyway, thanks for your concern.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: What type of listener can i use, instead of FocusListener