java - globally disable enter/return key in a SWT dialog -


I have created a dialog class which fill some common widgets such as text, combo, and trees.

To prevent this behavior, I have to say that entry / withdrawal is pressed in the form of default behavior (the default 'OK' button is pressed) to dismiss this dialogue. Add a trace listener to filter Trops key for each widget:

  if (SWT :: TRAVERSE_RETURN == event.detail) {event.doit = ​​false}  

Is it somewhat upset that there is such a way in the level of communication at the world level?

I found that Jefs communicate it easy by Adolekit method to disable the default Enter createButtonsForButtonBar .

And the final parameter:

createButton (Guardian, IDialogConstants.OK_ID, IDialogConstants OK_LABEL, false);

should be false:

prefix @ override Protected Zero ButtonsForButtonBar (Composite Parent) {Button Button = Make Button (Guardian, IDialogConstants OK_ID, IDialogConstants OK_LABEL, incorrect); }

Comments

Popular posts from this blog

c++ - Linux and clipboard -

What is expire header and how to achive them in ASP.NET and PHP? -

sql server - How can I determine which of my SQL 2005 statistics are unused? -