/** * Returns the controller associated with the specified component, if any. * * @param comp The component whose controller is sought. * @param recurse If true, search up the parent chain until a controller is found. * @return The associated controller, or null if none found. */ public static Object getController(BaseComponent comp, boolean recurse) { return recurse ? comp.findAttribute(Constants.ATTR_COMPOSER) : comp.getAttribute(Constants.ATTR_COMPOSER); }
/** * Returns a value for the named object. If the name is "self", the component itself is * returned. If the name is "parent" the component's parent is returned. Otherwise, name * resolution is attempted from several sources in the following order: * <ol> * <li>Tag library prefixes</li> * <li>The argument map passed to the materializer</li> * <li>The component's attribute map</li> * <li>The component's namespace</li> * <li>All ancestor attribute maps</li> * </ol> * * @param name The object name. * @return The value of the named object, or null if not found. */ public Object getValue(String name) { Object result = "self".equals(name) ? component : null; result = result != null ? result : "parent".equals(name) ? parent : null; result = result != null ? result : element.getTagLibrary(name); result = result != null ? result : args == null ? null : args.get(name); result = result != null ? result : component == null ? null : component.getAttribute(name); result = result != null ? result : parent == null ? null : parent.findByName(name); result = result != null ? result : parent == null ? null : parent.findAttribute(name); return result; } }
/** * Initialize the dialog. */ @SuppressWarnings("unchecked") @Override public void afterInitialized(BaseComponent comp) { super.afterInitialized(comp); sessionId = (String) comp.findAttribute("sessionId"); Collection<IPublisherInfo> exclusions = (Collection<IPublisherInfo>) comp.findAttribute("exclusions"); renderer = new ParticipantRenderer(chatService.getSelf(), exclusions); lstSessions.setRenderer(renderer); chkHideActive.setChecked(getAppFramework().getAttribute(ATTR_HIDE) != null); refresh(); }
variables.put("controller", findAttribute(ATTR_CONTROLLER)); variables.put("event", event); script.execute(variables);