Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » Toogle Button NO_FOCUS
Toogle Button NO_FOCUS [message #890170] Thu, 21 June 2012 07:11 Go to next message
David Casas is currently offline David Casas
Messages: 58
Registered: November 2011
Location: Barcelona
Member


I have a problem with Focusable Buttons on Eclipse Rap. I have defined some Toogle buttons with some css style when your mouse is over it, with it is selected and when it is not. The thing is the focus on the button is making it look odd.

I have tried
btnAnimals = new Button(panel, SWT.TOGGLE | SWT.NO_FOCUS);

with no exit. And finally I decided to implement a FocusAdapter for the buttons:

FocusListener focusListener = new FocusAdapter() {
        @Override
        public void focusGained(FocusEvent event) {
            txtStreet.setFocus();
        }
    };
    btnAnimals.addFocusListener(focusListener);


The strange issue that this listener is only called ONCE. Do you know what I am doing wrong? Is it a bug?

Thanks in advance
Re: Toogle Button NO_FOCUS [message #891508 is a reply to message #890170] Mon, 25 June 2012 02:19 Go to previous messageGo to next message
Ivan Furnadjiev is currently offline Ivan Furnadjiev
Messages: 1793
Registered: July 2009
Senior Member
Hi,
according to the documentation SWT.NO_FOCUS is not available for Button.
Ofcourse, you could remove the focus related styling by overriding the
Button-FocusIndicator definitions.
HTH,
Ivan


On 6/21/2012 2:11 PM, David Casas wrote:
>
> I have a problem with Focusable Buttons on Eclipse Rap. I have defined
> some Toogle buttons with some css style when your mouse is over it,
> with it is selected and when it is not. The thing is the focus on the
> button is making it look odd.
>
> I have tried
>
> btnAnimals = new Button(panel, SWT.TOGGLE | SWT.NO_FOCUS);
>
> with no exit. And finally I decided to implement a FocusAdapter for
> the buttons:
>
>
> FocusListener focusListener = new FocusAdapter() {
> @Override
> public void focusGained(FocusEvent event) {
> txtStreet.setFocus();
> }
> };
> btnAnimals.addFocusListener(focusListener);
>
>
> The strange issue that this listener is only called ONCE. Do you know
> what I am doing wrong? Is it a bug?
>
> Thanks in advance
>

--
Ivan Furnadjiev

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

Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
Re: Toogle Button NO_FOCUS [message #891554 is a reply to message #891508] Mon, 25 June 2012 04:29 Go to previous message
David Casas is currently offline David Casas
Messages: 58
Registered: November 2011
Location: Barcelona
Member

Thank you so much Ivan, I did'nt realised that. You help me a lot Smile
Previous Topic:Scrolling in Firefox broken?
Next Topic:RAP 1.5 M3 RWT-OSGi integration bundle
Goto Forum:
  


Current Time: Wed Aug 20 16:40:44 EDT 2014

Powered by FUDForum. Page generated in 0.10630 seconds