[SingleSourcing] Click Button programmatically - also in RCP [message #141371] |
Fri, 24 July 2009 07:36 |
Eclipse User |
|
|
|
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 #141411 is a reply to message #141380] |
Fri, 24 July 2009 11:26 |
Eclipse User |
|
|
|
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
|
|
|
Powered by
FUDForum. Page generated in 0.03168 seconds