public void handleEvent(Event evt)
{
ClientDocument clientDoc = ((ItsNatEvent)evt).getClientDocument();
EventListener global = new EventListenerSerial()
{
public void handleEvent(Event evt)
{
ItsNatEvent itsNatEvt = ((ItsNatEvent)evt);
ItsNatEventListenerChain chain = itsNatEvt.getItsNatEventListenerChain();
try
{
chain.continueChain();
}
catch(Exception ex)
{
if (!ex.getMessage().equals("Must be catched"))
throw new RuntimeException("FAILED TEST");
Text text = (Text)link.getFirstChild();
text.setData(text.getData() + " => OK 1-2");
itsNatDoc.removeEventListener(this);
}
}
};
itsNatDoc.addEventListener(global); // Para despu�s, cuando se ejecute el evento continue
EventListener contListener1 = new EventListenerSerial()
{
public void handleEvent(Event evt)
{
throw new RuntimeException("Must be catched");
}
};
clientDoc.addContinueEventListener(null, contListener1);
EventListener contListener2 = new EventListenerSerial()
{
public void handleEvent(Event evt)
{
Text text = (Text)link.getFirstChild();
text.setData(text.getData() + " => OK 2-2");