/** Returns the available children, or null if no cropping. */ private static Set<? extends Component> getAvailableAtClient(Component comp, Map<Component, Set<? extends Component>> croppingInfos) { final Object xc = ((ComponentCtrl) comp).getExtraCtrl(); if (xc instanceof Cropper) { //we don't need to check isCropper first since its component's job //to ensure the consistency Set<? extends Component> crop = croppingInfos.get(comp); if (crop == EMPTY_CROP) return null; if (crop != null) return crop; crop = ((Cropper) xc).getAvailableAtClient(); croppingInfos.put(comp, crop != null ? crop : EMPTY_CROP); return crop; } return null; }
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()); }
/** Crop attached and moved. */ private void crop(Set coll, Map<Component, Set<? extends Component>> croppingInfos, boolean bResponse) { for (Iterator it = coll.iterator(); it.hasNext();) { final Object o = it.next(); if (!(o instanceof Component)) continue; final Component comp = (Component) o; final Page page = comp.getPage(); if (page == null || !_exec.isAsyncUpdate(page)) { if (!bResponse) it.remove(); //just in case continue; } for (Component p, c = comp; (p = c.getParent()) != null; c = p) { final Set<? extends Component> avail = getAvailableAtClient(p, croppingInfos); if (avail != null) { if (!avail.contains(c)) { it.remove(); break; } p = ((Cropper) ((ComponentCtrl) p).getExtraCtrl()).getCropOwner(); if (p == null) break; } } } }
return; final Object cc = ((ComponentCtrl) comp).getExtraCtrl(); if (!(cc instanceof DynamicMedia)) throw new ServletException(
do { Component next = child.getNextSibling(); if (child instanceof Native || ((ComponentCtrl) child).getExtraCtrl() instanceof DirectContent) { ((ComponentCtrl) child).redraw(out); } else {
/** * Renders the children directly to the given output. Notice it is called only if * {@link #redraw} is going to render the content (HTML tags) directly. If it is about to * generate the JavaScript code {@link #redrawChildren} will be called instead. * <p> * You have to override this method if the deriving class has additional information to render. * * @since 5.0.7 */ protected void redrawChildrenDirectly(TagRenderContext rc, Execution exec, java.io.Writer out) throws java.io.IOException { for (Component child = getFirstChild(); child != null;) { Component next = child.getNextSibling(); if (((ComponentCtrl) child).getExtraCtrl() instanceof DirectContent) { ((ComponentCtrl) child).redraw(out); } else { HtmlPageRenders.setDirectContent(exec, false); rc.renderBegin(child, null, getSpecialRendererOutput(child), true); HtmlPageRenders.outStandalone(exec, child, out); rc.renderEnd(child); HtmlPageRenders.setDirectContent(exec, true); } child = next; } }
final Object xc = ((ComponentCtrl) child).getExtraCtrl(); if (xc instanceof PrologAllowed) ((PrologAllowed) xc).setPrologContent(replaceableText);