Skip to main content



      Home
Home » Eclipse Projects » Remote Application Platform (RAP) » [SingleSourcing] Click Button programmatically - also in RCP
[SingleSourcing] Click Button programmatically - also in RCP [message #141371] Fri, 24 July 2009 03:36 Go to next message
Eclipse UserFriend
Originally posted by: bjoern.bjoernfischer.de

Hello everybody,
in my RAP application I do a Button-click programmatically via these lines:

SelectionEvent evt = new SelectionEvent(button, null,
SelectionEvent.WIDGET_SELECTED);
evt.processEvent();

Unfortionately the used SelectionEvent constructor is not present in
SWT. Does anybody know a SingleSourcable solution for the programmatic
button-click problem?

Regards,
Björn
Re: [SingleSourcing] Click Button programmatically - also in RCP [message #141380 is a reply to message #141371] Fri, 24 July 2009 04:27 Go to previous messageGo to next message
Eclipse UserFriend
Hi Björn,

they are not part of the API of SWT. Take a look at the JavaDoc of
SelectionEvent:

IMPORTANT: All public static members of this class are not part of the
RWT public API. They are marked public only so that they can be shared
within the packages provided by RWT. They should never be accessed from
application code.

To answer your question: take a look at Widget#notifyListeners.
Something like this should do the trick:

widget.notifyListeners(SWT.Selection, new Event());

Greets
Ben

Björn Fischer wrote:
> Hello everybody,
> in my RAP application I do a Button-click programmatically via these lines:
>
> SelectionEvent evt = new SelectionEvent(button, null,
> SelectionEvent.WIDGET_SELECTED);
> evt.processEvent();
>
> Unfortionately the used SelectionEvent constructor is not present in
> SWT. Does anybody know a SingleSourcable solution for the programmatic
> button-click problem?
>
> Regards,
> Björn


--
Benjamin Muskalla | EclipseSource Karlsruhe
http://www.eclipsesource.com | http://twitter.com/eclipsesource
Re: [SingleSourcing] Click Button programmatically - also in RCP [message #141411 is a reply to message #141380] Fri, 24 July 2009 07:26 Go to previous message
Eclipse UserFriend
Originally posted by: bjoern.bjoernfischer.de

Hi Benny,

Benjamin Muskalla schrieb:
> Hi Björn,
>
> they are not part of the API of SWT. Take a look at the JavaDoc of
> SelectionEvent:
>
> IMPORTANT: All public static members of this class are not part of the
> RWT public API. They are marked public only so that they can be shared
> within the packages provided by RWT. They should never be accessed from
> application code.

Ooops, I took the code from a LCA Snippet Rüdiger once provided us... :-)

> To answer your question: take a look at Widget#notifyListeners.
> Something like this should do the trick:
>
> widget.notifyListeners(SWT.Selection, new Event());

Yes, that works in both worlds, thanks. Somehow I must have missed
notifyListeners when looking through the Button's methods...

Greetings,
Björn
Previous Topic:Business Theme to new RAP Project
Next Topic:Long running background Job needs UIThread when finished
Goto Forum:
  


Current Time: Thu Jul 03 13:18:00 EDT 2025

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

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

Back to the top