/** @deprecated As of release 6.0.0, replaced with {@link #AuRemove(String)}. */ public AuRemove(Component comp) { this(comp.getUuid()); }
/** * @param comp the component whose UUID has been changed. * @param oldid the old UUID. */ public AuUuid(Component comp, String oldid) { super("uuid", comp, new String[] { oldid, comp.getUuid() }); } }
/** Returns the original UUID of the specified component. */ private String uuid(Component comp) { final String uuid = _uuids.get(comp); return uuid != null ? uuid : comp.getUuid(); }
/** Stores the original UUID of the specified component. */ private void snapshotUuid(Component comp) { if (!_uuids.containsKey(comp)) _uuids.put(comp, comp.getUuid()); }
/** * Registers onXxx events to the supervised component; a subclass that override * this method should remember to call super.doAfterCompose(comp) or it will not * work. */ public void doAfterCompose(T comp) throws Exception { //bind this GenericEventListener to the supervised component _applied = comp.getUuid(); bindComponent(comp); }
private void renderValue(Component value) { if (value == null || value.getPage() == null) _buf.append((String) null); else _buf.append("{$u:'").append(value.getUuid()).append("'}"); }
public String toJSONString() { return _comp.getPage() == null ? "null" : "{$u:'" + _comp.getUuid() + "'}"; } }
/** Submits the form with the specified form. * It assumes the form component is a HTML form. */ public static final void submitForm(Component form) { submitForm(form.getUuid()); }
private String renderValue(Component value) { if (value == null || value.getPage() == null) return null; else return new StringBuilder().append("{$u:'").append(value.getUuid()).append("'}").toString(); }
/** * @param contents a collection of contents (in String objects). * Each content is the output of a component. * @since 5.0.7 */ public AuAppendChild(Component comp, Collection<String> contents) { super("addChd", comp, toArray(comp.getUuid(), contents)); }
public String getDynamicMediaURI(Component comp, String pathInfo) { if (!(((ComponentCtrl) comp).getExtraCtrl() instanceof DynamicMedia)) throw new UiException(DynamicMedia.class + " not implemented by getExtraCtrl() of " + comp); final StringBuffer sb = new StringBuffer(64).append("/view/").append(getId()).append('/').append(comp.getUuid()) .append('/'); Strings.encode(sb, System.identityHashCode(comp) & 0xffff); if (pathInfo != null && pathInfo.length() > 0) { if (pathInfo.charAt(0) != '/') sb.append('/'); sb.append(pathInfo); } return getUpdateURI(sb.toString()); }
private static Object[] toArray(Component anchor, Collection<String> contents) { if (anchor instanceof Native || anchor instanceof StubsComponent) throw new UiException("Adding a component after native or stubs not allowed: " + anchor); return AuAppendChild.toArray(anchor.getUuid(), contents); } }
private static Object[] toArray(Component anchor, Collection<String> contents) { if (anchor instanceof Native || anchor instanceof StubsComponent) throw new UiException("Adding a component before native or stubs not allowed: " + anchor); return AuAppendChild.toArray(anchor.getUuid(), contents); } }
public void didActivate(Component comp) { //wire variables to reference fields (include implicit objects) //Note: we have to check _applied because application might store //the composer somewhere other than the original component if (comp != null && Objects.equals(comp.getUuid(), _applied)) { if (self == null) { //Bug #2873310. didActivate only once ConventionWires.wireImplicit(comp, this); //Bug ZK-546. Shall re-wire transient implicit variables only } } //feature #ZK-2822 ConventionWires.wireServiceCommand(comp, this); }
private String getUuid(AuRequest request) { final Component comp = request.getComponent(); if (comp != null) return comp.getUuid(); final Page page = request.getPage(); if (page != null) return page.getUuid(); return null; } }
public void onChildAdded(Component child) { smartUpdate("z.cid", child.getUuid()); super.onChildAdded(child); if (child instanceof Borderlayout) { setFlex(true); addSclass(getZclass() + "-nested"); } }
private void postUpdate(Component component, Set<String> selected) { String desktopId = target.getDesktop().getId(); Event event = new SelectEvent(Events.ON_SELECT, component, selected, (Component)target.getDelegatee()); Map<String, Object> data = EventDataManager.getInstance().build(event); ClientCtrl ctrl = (ClientCtrl) target.getClient(); ctrl.postUpdate(desktopId, component.getUuid(), event.getName(), data, false); ctrl.flush(desktopId); }
public Map<String, Object> build(ColSizeEvent e, Map<String, Object> data) { AuUtility.setEssential(data, "column", e.getColumn().getUuid()); AuUtility.setEssential(data, "index", e.getColIndex()); AuUtility.setEssential(data, "width", e.getWidth()); AuUtility.setEssential(data, "widths", new String[] { e.getWidth() }); AuUtility.setOptional(data, "which", e.getKeys()); return data; }
/** * For Column, it always send AU in spite of current sorted order. */ public void sort(boolean ascending) { String desktopId = target.getDesktop().getId(); String cmd = Events.ON_SORT; Component header= ((Component)target.getDelegatee()); Map<String, Object> data = null; data = EventDataManager.getInstance().build(new SortEvent(cmd, header, ascending)); ((ClientCtrl) getClient()).postUpdate(desktopId, header.getUuid(), cmd, data, false); ((ClientCtrl) getClient()).flush(desktopId); } }
public Map<String, Object> build(DropEvent evt, Map<String, Object> data) { AuUtility.setEssential(data, "dragged", evt.getDragged().getUuid()); AuUtility.setEssential(data, "pageX", evt.getPageX()); AuUtility.setEssential(data, "pageY", evt.getPageY()); AuUtility.setEssential(data, "which", 1); AuUtility.setEssential(data, "x", evt.getX()); AuUtility.setEssential(data, "y", evt.getY()); return data; } public Class<DropEvent> getEventClass(){