• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

What type of listener can i use, instead of FocusListener

 
Ranch Hand
Posts: 111
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.?
 
Bartender
Posts: 11497
19
Android Google Web Toolkit Mac Eclipse IDE Ubuntu Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Inside the actionPerformed for the save menu you can always populate your array list by invoking textField1.getText() etc
 
Bharath Raja
Ranch Hand
Posts: 111
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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.
 
Everyone is a villain in someone else's story. Especially this devious tiny ad:
free, earth-friendly heat - a kickstarter for putting coin in your pocket while saving the earth
https://coderanch.com/t/751654/free-earth-friendly-heat-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic