This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes unable to setFocus in SWT fields in eclipse plugin..plz help Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "unable to setFocus in SWT fields in eclipse plugin..plz help" Watch "unable to setFocus in SWT fields in eclipse plugin..plz help" New topic
Author

unable to setFocus in SWT fields in eclipse plugin..plz help

Nandan DP
Greenhorn

Joined: Nov 14, 2004
Posts: 1
Hi i have created a Eclipse plug-in containing a form-fields based editor
(i.e, a custom editor for my xml made up of comboboxes & textfiedls).

The screen has few mandatory fields,
on save i check for mandatory fields and pop up appropritate error message,
After this i need to set the focus on appropritate field.

I have used .setFocus() method for setting focus on combo box, it returns false,
i debugged through the source code of swt, i found out the reason behind this, field.isEnabled() returns false ,hence not able to setFocus on it.

I tried field.setEnabled(true), also parent.setEnabled(true) before setting focus, nothing works,
any body who knows this solution,
please help me

2)Also keyboard shortcuts like Ctrl+C, Ctrl+V, does not work in these fields
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: unable to setFocus in SWT fields in eclipse plugin..plz help
 
Similar Threads
retain textbox focus
javascript setfocus
Detect AltGr key?
Problem setting focus for a newly added child element in TreeViewer
Struts2 Datetime Picker focus is not set using javascript