Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » Focus jump when setting text in focusLost event
Focus jump when setting text in focusLost event [message #119934] Wed, 28 January 2009 16:13 Go to next message
Enrico Zanaga is currently offline Enrico ZanagaFriend
Messages: 50
Registered: July 2009
Member
Hi,

with RAP 1.2M4, in IE7, Chrome, and Safari (Windows) I've a problem with
Text widgets.
The Texts have a FocusListener that in focusLost event sets the text to
upper case.
When I type some chars and exit the first Text, even with tab key or
mouse, the text exactly turns to upper case, but the focus return to the
first Text.
Also, if I press tab another time the focus goes to the last Text,
skipping the second Text.

In Firefox and Opera the focus behaves exactly as in SWT.

I haven't found similar bugs...

Thanks!


Here is the snippet:

public class RapTest implements IEntryPoint {
private Display d;
private Shell s;

@Override
public int createUI() {
d = new Display();
s = new Shell(d);
s.setBounds(0, 0, 800, 600);

Text t1 = new Text(s, SWT.BORDER);
Text t2 = new Text(s, SWT.BORDER);
Text t3 = new Text(s, SWT.BORDER);

t1.setBounds(020, 20, 80, 20);
t2.setBounds(120, 20, 80, 20);
t3.setBounds(220, 20, 80, 20);

FocusAdapter fa = new FocusAdapter() {
@Override
public void focusLost(FocusEvent event) {
Text t = (Text) event.widget;
String s = t.getText();
if( s != null && s.length() > 0 )
t.setText( s.toUpperCase() );
}
};

t1.addFocusListener(fa);
t2.addFocusListener(fa);
t3.addFocusListener(fa);

s.open();

while( !s.isDisposed() )
if( !d.readAndDispatch() )
d.sleep();
d.dispose();
return 0;
}
}
Re: Focus jump when setting text in focusLost event [message #120001 is a reply to message #119934] Thu, 29 January 2009 10:41 Go to previous message
Ralf Sternberg is currently offline Ralf SternbergFriend
Messages: 1313
Registered: July 2009
Senior Member

Hi Enrico,

would you mind opening a bug in our bugzilla?
See http://wiki.eclipse.org/RAP_Bug_Reporting_Howto

Thanks,
Ralf

Enrico Zanaga wrote:
> with RAP 1.2M4, in IE7, Chrome, and Safari (Windows) I've a problem with
> Text widgets.
> The Texts have a FocusListener that in focusLost event sets the text to
> upper case.
> When I type some chars and exit the first Text, even with tab key or
> mouse, the text exactly turns to upper case, but the focus return to the
> first Text.
> Also, if I press tab another time the focus goes to the last Text,
> skipping the second Text.
>
> In Firefox and Opera the focus behaves exactly as in SWT.
>
> I haven't found similar bugs...
>
> Thanks!
>
>
> Here is the snippet:
>
> public class RapTest implements IEntryPoint {
> private Display d;
> private Shell s;
>
> @Override
> public int createUI() {
> d = new Display();
> s = new Shell(d);
> s.setBounds(0, 0, 800, 600);
>
> Text t1 = new Text(s, SWT.BORDER);
> Text t2 = new Text(s, SWT.BORDER);
> Text t3 = new Text(s, SWT.BORDER);
>
> t1.setBounds(020, 20, 80, 20);
> t2.setBounds(120, 20, 80, 20);
> t3.setBounds(220, 20, 80, 20);
>
> FocusAdapter fa = new FocusAdapter() {
> @Override
> public void focusLost(FocusEvent event) {
> Text t = (Text) event.widget;
> String s = t.getText();
> if( s != null && s.length() > 0 )
> t.setText( s.toUpperCase() );
> }
> };
>
> t1.addFocusListener(fa);
> t2.addFocusListener(fa);
> t3.addFocusListener(fa);
>
> s.open();
>
> while( !s.isDisposed() )
> if( !d.readAndDispatch() )
> d.sleep();
> d.dispose();
> return 0;
> }
> }
Previous Topic:Clipboard workaround
Next Topic:Tutorials and text books
Goto Forum:
  


Current Time: Sun Jan 29 06:55:32 GMT 2023

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

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

Back to the top