@SuppressWarnings("unchecked") private static void onEvent(EventListener listener, Event event) throws Exception { listener.onEvent(event); }
private void invoke() throws Exception { if (log.isDebugEnabled()) { log.debug("Handling schedule info, the event is [{}]", _event); } _listener.onEvent(_event); } }
public void onEvent(Event event) throws Exception { final Event evt = (Event)event.getData(); for (Iterator it = _listeners.iterator(); it.hasNext();) ((EventListener)it.next()).onEvent(evt); } });
public void fire() throws Exception { task.onEvent(event); } }
public void run() { try { _inf.listener.onEvent(_event); if (_inf.callback != null || _pendingEvents != null) { Executions.activate(_desktop); try { if (_pendingEvents != null) for (T evt : _pendingEvents) _que.publish(evt); if (_inf.callback != null) _inf.callback.onEvent(_event); } finally { Executions.deactivate(_desktop); } } } catch (DesktopUnavailableException ex) { log.warn("", ex); //ignore } catch (Throwable ex) { log.error("", ex); throw UiException.Aide.wrap(ex); } } }
/** Called only internally. */ public void endModal(Messagebox.Button button) throws Exception { _result = button; if (_listener != null) { final ClickEvent evt = new ClickEvent(button.event, this, button); _listener.onEvent(evt); if (!evt.isPropagatable()) return; //no more processing } detach(); }
/** * Forward the action to the listener. * * @param action Action to forward. */ protected void onAction(Action action) { root.setVisible(action == Action.VIEW); if (action != null && actionListener != null) { try { actionListener.onEvent(new ActionEvent(notification, action)); } catch (Exception e) { throw MiscUtil.toUnchecked(e); } } } }
public void onEvent(ClickEvent event) throws Exception { final Button btn = event.getButton(); _listener.onEvent(new Event(event.getName(), event.getTarget(), btn != null ? btn.id : -1)); }
public void onClose() { if (_listener != null) { final ClickEvent evt = new ClickEvent(Events.ON_CLOSE, this, null); try { _listener.onEvent(evt); if (!evt.isPropagatable()) return; //no more processing } catch (Exception ex) { throw UiException.Aide.wrap(ex); } } super.onClose(); }
public void onClose(Event evt) { if (evt.getData() == null) _result.clear(); else { final Desktop desktop = Executions.getCurrent().getDesktop(); final Configuration config = desktop.getWebApp().getConfiguration(); if (!config.isEventThreadEnabled()) { if (_listener != null) try { _listener.onEvent(new UploadEvent(Events.ON_UPLOAD, null, getResult())); } catch (Exception e) { throw new UiException(e); } else Events.postEvent(new UploadEvent(Events.ON_UPLOAD, (Component) desktop.getAttribute(ATTR_FILEUPLOAD_TARGET), getResult())); } } detach(); }