public List<ComponentAgent> getRoots() { List<ComponentAgent> agents = new ArrayList<ComponentAgent>(); Iterator<?> iterator = page.getRoots().iterator(); while (iterator.hasNext()) agents.add(new DefaultComponentAgent(this, (Component) iterator .next())); return agents; }
public void afterPageDetached(Page page, Desktop prevdesktop) { final Collection<Component> comps = page.getRoots(); for (final Iterator<Component> it = comps.iterator(); it.hasNext();) { final Component comp = it.next(); removeBindings(comp); } }
/** * Initialization that read all binding annotations of the components inside the specified page. * @param page the ZUML page. * @param defaultConfig whether load default binding configuration defined in lang-addon.xml * @since 3.6.2 */ public void init(Page page, boolean defaultConfig) { setDefaultConfig(defaultConfig); for (final Iterator it = page.getRoots().iterator(); it.hasNext();) { loadAnnotations((Component) it.next()); } }
/** * Renders the page if {@link Page#isComplete} is true. In other words, the page content * contains HTML/BODY tags. */ protected void renderComplete(Execution exec, Page page, Writer out) throws IOException { final Object ret = beforeRenderHtml(exec, page, out); for (Iterator it = page.getRoots().iterator(); it.hasNext();) ((ComponentCtrl) it.next()).redraw(out); afterRenderHtml(exec, page, out, ret); }
/** * Return the count of total siblings of the component, including itself. */ public int getComponentSiblingSize() { Component parent = _comp.getParent(); return parent == null ? _comp.getPage().getRoots().size() : parent.getChildren().size(); }
/** * Return the count of total siblings of the component, including itself. */ public int getComponentSiblingSize() { Component parent = _comp.getParent(); return parent == null ? _comp.getPage().getRoots().size() : parent.getChildren().size(); }
public void removePage(Page page) { synchronized (_pages) { if (!_pages.remove(page)) return; //Both UiVisualizer.getResponses and Include.setChildPage //might call removePage if (log.isDebugEnabled()) log.debug("After removed, pages: {}", _pages); } removeComponents(page.getRoots()); afterPageDetached(page, this); ((PageCtrl) page).destroy(); _wapp.getConfiguration().afterPageDetached(page, this); }
for (Iterator it = page.getRoots().iterator(); it.hasNext();) { final Component comp = (Component)it.next(); if (!(comp instanceof Inline)) {
public void doAfterCompose(Page page, Component[] comps) throws Exception { final Execution exec = Executions.getCurrent(); //resolve only once in the last page if (exec.getAttribute(RESOLVE_COMPOSITION) != this) { return; } exec.removeAttribute(RESOLVE_COMPOSITION); // resolve insert components final Map<String, Component> insertMap = new HashMap<String, Component>(); //(insert name, insert component) final Component parent = (Component) exec.getAttribute(PARENT); final Collection<Component> roots = (parent == null ? page.getRoots() : parent.getChildren()); resolveInsertComponents(roots, insertMap); //B65-ZK-2072: Resolves define components recursively. resolveDefineComponents(roots, insertMap); }
/** Processing the event and stores result into UiVisualizer. */ private void process(Desktop desktop, Event event) { // if (log.finable()) log.finer("Processing event: "+event); final Component comp; if (event instanceof ProxyEvent) { final ProxyEvent pe = (ProxyEvent) event; comp = pe.getRealTarget(); event = pe.getProxiedEvent(); } else { comp = event.getTarget(); } if (comp != null) { processEvent(desktop, comp, event); } else { //since an event might change the page/desktop/component relation, //we copy roots first final List<Component> roots = new LinkedList<Component>(); for (Page page : desktop.getPages()) { roots.addAll(page.getRoots()); } for (Component c : roots) { if (c.getPage() != null) //might be removed, so check first processEvent(desktop, c, event); } } }
for (Page page : _pgInvalid) { if (renderedComps != null) renderedComps.addAll(page.getRoots()); responses.add(new AuOuter(page, redraw(page)));
if (frag != null) Utils.adjustChildren( page, null, page.getRoots(), out.toString()); } catch (Exception ex) {