Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » Events lost focus and get focus are fired two times
Events lost focus and get focus are fired two times [message #1727020] Fri, 18 March 2016 10:11 Go to next message
Nicola Zanaga is currently offline Nicola ZanagaFriend
Messages: 56
Registered: July 2009
Member
When you put a listener on a shell, events lost / get focus on text controls in the shell, are doubled:

I'm using
rap-3.0.2-SR2-20160201-1220

    public static void casetestDoubleEventsRAP() {
        Display display = Display.getDefault();

        Shell s = new Shell();
        s.addFocusListener(new FocusListener() {
            @Override
            public void focusLost(FocusEvent event) {
                System.out.println("shell lost focus");
            }

            @Override
            public void focusGained(FocusEvent event) {
                System.out.println("shell get focus");
            }
        });

        Text txt1 = new Text(s, SWT.BORDER);
        txt1.addFocusListener(new FocusListener() {
            @Override
            public void focusLost(FocusEvent event) {
                System.out.println("txt1 lost focus");
            }

            @Override
            public void focusGained(FocusEvent event) {
                System.out.println("txt1 get focus");
            }
        });

        Text txt2 = new Text(s, SWT.BORDER);
        txt2.addFocusListener(new FocusListener() {
            @Override
            public void focusLost(FocusEvent event) {
                System.out.println("txt2 lost focus");
            }

            @Override
            public void focusGained(FocusEvent event) {
                System.out.println("txt2 get focus");
            }
        });

        s.setLayout(new FillLayout());
        s.setBounds(new Rectangle(0, 0, 600, 600));

        s.open();
        for( ;; ) {
            if( display.isDisposed() || s.isDisposed() )
                return;

            if( !display.readAndDispatch() )
                display.sleep();
        }
    }

[Updated on: Fri, 18 March 2016 10:13]

Report message to a moderator

Re: Events lost focus and get focus are fired two times [message #1727023 is a reply to message #1727020] Fri, 18 March 2016 10:20 Go to previous messageGo to next message
Ivan Furnadjiev is currently offline Ivan FurnadjievFriend
Messages: 2426
Registered: July 2009
Location: Sofia, Bulgaria
Senior Member
Hi Nicola,
is the behavior differs from SWT? If yes, please file a bugzilla and
attach your snippet the reproduce the issue there.
Thanks,
Ivan

--
Ivan Furnadjiev

Twitter: @EclipseRAP
Blog: http://eclipsesource.com/blogs/

Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
Re: Events lost focus and get focus are fired two times [message #1727030 is a reply to message #1727023] Fri, 18 March 2016 11:03 Go to previous message
Nicola Zanaga is currently offline Nicola ZanagaFriend
Messages: 56
Registered: July 2009
Member
Yes, in SWT events are fired one time correctly

Bugzilla bug:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=489922
Previous Topic:Client error when closing an editor.
Next Topic:Need to deploy gradle boot project to azure
Goto Forum:
  


Current Time: Tue Mar 19 11:57:28 GMT 2024

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

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

Back to the top