Package org.zkoss.zk.ui.sys

Examples of org.zkoss.zk.ui.sys.ComponentCtrl


  3. If anchor is not found, use AuAppendChild for the first
    and INSERT_AFTER for the rest
    */
    final List before = new LinkedList();
    Component anchor = null;
    final ComponentCtrl parentCtrl = (ComponentCtrl)parent;
    final Object parentxc =
      parentCtrl != null ? parentCtrl.getExtraCtrl(): null;
    for (Iterator it = sibs.iterator(); it.hasNext();) {
      final Component comp = (Component)it.next();
      if (anchor != null) {
        if (newsibs.remove(comp)) {
          responses.add(new AuInsertAfter(anchor, redraw(comp)));
View Full Code Here


    }
  }

  //[0] expr, [1] loadWhenEvents, [2] saveWhenEvents, [3] access, [4] converter, [5] args, [6] loadAfterEvents, [7] saveAfterEvents
  protected Object[] loadPropertyAnnotation(Component comp, String propName, String bindName) {
    ComponentCtrl compCtrl = (ComponentCtrl) comp;
    Annotation ann = compCtrl.getAnnotation(propName, bindName);
    if (ann != null) {
      final Map attrs = ann.getAttributes(); //(tag, tagExpr)
      List loadWhenEvents = null;
      List saveWhenEvents = null;
      List loadAfterEvents = null;
View Full Code Here

    Tree tree = getTree();
    if (!tree.inPagingMold()) {
      super.redrawChildren(out);
    } else if (isVisible() && shallVisitTree(tree, this)) {
      if (shallRenderTree(tree)) {
        ComponentCtrl child = getTreerow();
        if (child != null)
          child.redraw(out);
      }
      boolean close = !isOpen();
      ComponentCtrl child = getTreechildren();
      if (child != null) {
        if (close) ((Component)child).setAttribute(Attributes.SHALL_RENDER_ITEM, Boolean.TRUE);
        child.redraw(out);
        if (close) ((Component)child).removeAttribute(Attributes.SHALL_RENDER_ITEM);
      }     
    }
  }
View Full Code Here

  boolean clear) {
    for (Iterator it = _annots.iterator(); it.hasNext();) {
      final Object[] info = (Object[])it.next();
      final String annotName = (String)info[0];
      final Map annotAttrs = (Map)info[1];
      ComponentCtrl ctrl = (ComponentCtrl) comp;
      if (propName != null)
        ctrl.addAnnotation(propName, annotName, annotAttrs);
      else
        ctrl.addAnnotation(annotName, annotAttrs);
    }
    if (clear)
      _annots.clear();
  }
View Full Code Here

    loadComponentPropertyAnnotationByAnnotName(comp, "default");
    loadComponentPropertyAnnotationByAnnotName(comp, "bind");
  }

  private void loadComponentPropertyAnnotationByAnnotName(Component comp, String annotName) {
    ComponentCtrl compCtrl = (ComponentCtrl) comp;
    final List props = compCtrl.getAnnotatedPropertiesBy(annotName);
    for (final Iterator it = props.iterator(); it.hasNext(); ) {
      final String propName = (String) it.next();
      //[0] value, [1] loadWhenEvents, [2] saveWhenEvents, [3] access, [4] converter, [5] args, [6] loadAfterEvents, [7] saveAfterEvents
      final Object[] objs = loadPropertyAnnotation(comp, propName, annotName);
      addBinding(comp, propName, (String) objs[0],
View Full Code Here

    loadComponentAnnotation(comp, "default");
    loadComponentAnnotation(comp, "bind");
  }
 
  private void loadComponentAnnotation(Component comp, String annotName) {
    ComponentCtrl compCtrl = (ComponentCtrl) comp;
    Annotation ann = compCtrl.getAnnotation(annotName);
    if (ann != null) {
      Map attrs = ann.getAttributes();
      for(final Iterator it = attrs.entrySet().iterator(); it.hasNext();) {
        Entry me = (Entry) it.next();
        String attr = (String) me.getKey();
View Full Code Here

  }
 
  @SuppressWarnings("deprecation")
  private static Map prepareFragmentMap(Map fragmentMap, Collection comps) {
    for (final Iterator it = comps.iterator(); it.hasNext();) {
      final ComponentCtrl comp = (ComponentCtrl) it.next();
      final Annotation annt = comp.getAnnotation("fragment");
      if (annt != null) {
        final String fragment = annt.getAttribute("value");
        if (fragment != null) {
          if (fragmentMap.containsKey(fragment)) {
            throw new UiException("fragment id must be unique in a desktop. Components:"+comp+", "+fragmentMap.get(fragment)+", Fragment:"+fragment);
View Full Code Here

  private static void dump(StringBuffer sb, Component comp)
  {
        if(comp instanceof ComponentPrinter) return;
    String srClss=comp.getClass().toString();
    srClss = srClss.substring(srClss.lastIndexOf(".")+1);
    ComponentCtrl compCtrl = (ComponentCtrl)comp;
   
    //sb.append("->"+srClss+"-"+comp.getId() +" "+comp.toString());
    sb.append("->"+comp.toString());
       
        //print annotation;
        if(true) return;
    sb.append("=").append(compCtrl.getAnnotations().size()+" : ")
      .append(compCtrl.getAnnotatedProperties().size());
    String prop;
    for (Iterator it = compCtrl.getAnnotations().iterator(); it.hasNext();) {
      Annotation annot = (Annotation) it.next();
      sb.append(" self").append(annot);
    }
    for (Iterator it = compCtrl.getAnnotatedProperties().iterator(); it.hasNext();) {
      prop = (String) it.next();
      sb.append(" ").append(prop)
      .append(compCtrl.getAnnotations(prop));
    }
  }
View Full Code Here

TOP

Related Classes of org.zkoss.zk.ui.sys.ComponentCtrl

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.