Skip to main content



      Home
Home » Eclipse Projects » Remote Application Platform (RAP) » How to use untyped events in RAP
How to use untyped events in RAP [message #777323] Tue, 10 January 2012 04:22 Go to next message
Eclipse UserFriend
I'm developing an application based on RCP.Recently, I have moved it to RAP. Before, I used some untyped events in RCP to pass some necessary data for different purposes. For example, I have a button called "Get Data" to get data from server. I have some tableviewer to hold data that were received from server.When user click this button, I want to raise an event, and in each table will listen that event. I did as following:

//Part 1
Button btgetData=new Button(compositeLabels,SWT.PUSH);
btgetData.setText("Get Data");
btgetData.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
//raise event here
Event event =new Event();
event.detail=12345;
getRoot().getShell().notifyListeners(MYEVENTCONST, event);
}
});

//Part 2:
//In each composite that hold TableViewer , listen event

getShell().addListener(MYEVENTCONST, new Listener()
public void handleEvent(Event event) {
if(event.detail==12345)
doProcessing();
});

In RCP, each TableViewer listen normally that event each time user click button "Get Data". But it didn't work on RAP, I don't know if RAP already supported this kind of untyped events. THe fucntion doProcessing() is never called :(.

I don't want to change the way when passing data. Please let me know if I could keep going in the old way. I greatly appreciate for any comment.
Re: How to use untyped events in RAP [message #778006 is a reply to message #777323] Wed, 11 January 2012 04:25 Go to previous messageGo to next message
Eclipse UserFriend
Hi,

on a glance, it seems that you've run into the problem described in bug
332511 [1]. As stated in this bug, we'll have to rework the event
system in RAP to support code that mixes typed and untyped listeners.
We're going to make this change, but it's unlikely that this will happen
in time for 1.5.

Regards, Ralf


[1] 332511: [Widget] add/removeListener(type, listener) does not mix
with e.g. add/removeVerifyListener
https://bugs.eclipse.org/bugs/show_bug.cgi?id=332511

--
Ralf Sternberg

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

Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
Re: How to use untyped events in RAP [message #778292 is a reply to message #778006] Thu, 12 January 2012 02:53 Go to previous message
Eclipse UserFriend
Hi Ralf,
Thanks for your respond, It's more clear for me now.
It seems I should find out another way to transfer data among widgets.
Previous Topic:How to use untyped events in RAP
Next Topic:shared singleton synchronization
Goto Forum:
  


Current Time: Thu May 15 18:52:01 EDT 2025

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

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

Back to the top