public void notifyChange(Object base, String attr) { checkInit(); if (_log.isDebugEnabled()) { _log.debug("notifyChange base=[{}],attr=[{}]", base, attr); } getEventQueue().publish(new PropertyChangeEvent(_rootComp, base, attr)); }
/** * Post a notify change to corresponding event queue to notify a bean's property changing * @param queueName the queue name, null for default queue name * @param queueScope the queue scope, null for default queue scope (i.e. {@link EventQueues#DESKTOP}) * @param bean the bean instance * @param property the property name of bean */ public static void postNotifyChange(String queueName, String queueScope, Object bean, String property) { final EventQueue<Event> que = EventQueues.lookup(queueName == null ? BinderCtrl.DEFAULT_QUEUE_NAME : queueName, queueScope == null ? BinderCtrl.DEFAULT_QUEUE_SCOPE : queueScope, false); if (Strings.isEmpty(property)) throw new IllegalArgumentException("property is empty"); if (que != null) { que.publish(new PropertyChangeEvent(null, bean, property)); } }
/** * Post a global command to corresponding event queue * @param queueName the queue name, null for default queue name * @param queueScope the queue scope, null for default queue scope (i.e. {@link EventQueues#DESKTOP}) * @param cmdName the global command name * @param args arguments, could get the data in command method by {@link BindingParam} */ public static void postGlobalCommand(String queueName, String queueScope, String cmdName, Map<String, Object> args) { final EventQueue<Event> que = EventQueues.lookup(queueName == null ? BinderCtrl.DEFAULT_QUEUE_NAME : queueName, queueScope == null ? BinderCtrl.DEFAULT_QUEUE_SCOPE : queueScope, false); if (Strings.isEmpty(cmdName)) throw new IllegalArgumentException("cmdName is empty"); if (que != null) { que.publish(new GlobalCommandEvent(null, cmdName, args)); } }
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); } } }
private void postGlobalCommand(Component comp, CommandBinding commandBinding, String command, Event evt, Map<String, Object> args) { if (_log.isDebugEnabled()) { _log.debug("postGlobalCommand command=[{}], args=[{}]", command, args); } final BindingExecutionInfoCollector collector = getBindingExecutionInfoCollector(); try { if (collector != null) { collector.pushStack("POST_GLOBAL_COMMAND"); collector.addInfo(new CommandInfo(CommandInfo.POST_GLOBAL, comp, evt == null ? null : evt.getName(), BindEvaluatorXUtil.getExpressionString(((CommandBindingImpl) commandBinding).getCommand()), command, args, null)); } getEventQueue().publish(new GlobalCommandEvent(_rootComp, command, args)); } finally { if (collector != null) { collector.popStack(); } } }