RemoteEventService theRemoteEventService = RemoteEventServiceFactory.getInstance().getRemoteEventService();
//add a listener to the SERVER_MESSAGE_DOMAIN
theRemoteEventService.addListener(ServerGeneratedMessageEvent.SERVER_MESSAGE_DOMAIN, new RemoteEventListener() {
public void apply(Event anEvent) {
if(anEvent instanceof ServerGeneratedMessageEvent) {
ServerGeneratedMessageEvent theServerGeneratedMessageEvent = (ServerGeneratedMessageEvent)anEvent;
myEventReceiveBoxUI.addItem(theServerGeneratedMessageEvent.getServerGeneratedMessage());
}
}
});
/* Logic for GWTEventService ends here */