Package org.zkoss.zk.ui

Examples of org.zkoss.zk.ui.UiException


      throw new UiException("Wrong parent: "+parent);
    super.beforeParentChanged(parent);
  }
  public void beforeChildAdded(Component child, Component refChild) {
    if (!(child instanceof Treecol))
      throw new UiException("Unsupported child for treecols: "+child);
    super.beforeChildAdded(child, refChild);
  }
View Full Code Here


   * @param varnameSet set with all _var names
   */
  public void addBinding(String path, Binding binding, Set varnameSet) {
    final List nodeids = DataBinder.parseExpression(path, ".");
    if (nodeids.size() <= 0) {
      throw new UiException("Incorrect bean expression: "+path);
    }
    boolean var = varnameSet.contains(nodeids.get(0));
    BindingNode currentNode = this;
    for(final Iterator it = nodeids.iterator(); it.hasNext();) {
      final String nodeid = (String) it.next();
      if (nodeid == null) {
        throw new UiException("Incorrect bean expression: "+path);
      }
      BindingNode kidNode = (BindingNode) currentNode.getKidNode(nodeid);
      if (kidNode == null) { //if not found, then add one
        if ("/".equals(currentNode._path)) {
          kidNode = new BindingNode(nodeid, var, nodeid, true);
        } else {
          kidNode = new BindingNode(currentNode._path + "." + nodeid, var, nodeid, false);
        }
        currentNode.addKidNode(nodeid, kidNode);
      } else {
        var = var || kidNode._var;
      }
      currentNode = kidNode;
    }
    if (currentNode == this) {
      throw new UiException("Incorrect bean expression: "+path);
    }
    currentNode.addBinding(binding);
    if ("_var".equals(binding.getAttr())) {
      currentNode._innerCollectionNode =  DataBinder.hasTemplateOwner(binding.getComponent());
    }
View Full Code Here

    BindingNode currentNode = this;
    final List nodeids = DataBinder.parseExpression(path, ".");
    for(final Iterator it = nodeids.iterator(); it.hasNext(); ) {
      final String nodeid = (String) it.next();
      if (nodeid == null) {
        throw new UiException("Incorrect format of bean expression: "+path);
      }
      currentNode = (BindingNode) currentNode.getKidNode(nodeid);
      if (currentNode == null) {
        return null;
      }
View Full Code Here

  }
 
  public void beforeParentChanged(Component parent) {
    if (parent != null && !(parent instanceof Menubar)
    && !(parent instanceof Menupopup))
      throw new UiException("Unsupported parent for menu: "+parent);
    super.beforeParentChanged(parent);
  }
View Full Code Here

    super.beforeParentChanged(parent);
  }
  public void beforeChildAdded(Component child, Component refChild) {
    if (child instanceof Menupopup) {
      if (_popup != null && _popup != child)
        throw new UiException("Only one menupopup is allowed: "+this);
    } else {
      throw new UiException("Unsupported child for menu: "+child);
    }
    super.beforeChildAdded(child, refChild);
  }
View Full Code Here

              .trim());
          _max = new Integer(constraint.substring(maxIndex + 3,
              minIndex).trim());
        }
        if (_min.compareTo(_max) > 0)
          throw new UiException("Constraint error: " + _min + " > "
              + _max);
        return 0;
      } else if (minIndex >= 0) { // only have "min"
        _min = new Integer(constraint.substring(minIndex + 3).trim());
        return 0;
      } else if (maxIndex >= 0) { // only have "max"
        _max = new Integer(constraint.substring(maxIndex + 3).trim());
        return 0;
      }
    } catch (NumberFormatException e) {
      throw new UiException("Constraint error: " + constraint);
    }
    return super.parseConstraint(constraint);
  }
View Full Code Here

            if (val.equals(li.getValue())) {
              return li;
            }
          }
        } else {
          throw new UiException("model of the databind listbox "+lbx+" must be an instanceof of org.zkoss.zkplus.databind.BindingListModel." + xmodel);
        }
      }
      return null;
  }
View Full Code Here

    else if (constraint.equals("strict"))
      return STRICT;
    else if (constraint.equals("server"))
      return SERVER;
    else if (constraint.length() > 0)
      throw new UiException("Unknown constraint: "+constraint);
    return 0;
  }
View Full Code Here

 
  //-- Component --//
  public void beforeParentChanged(Component parent) {
    if (parent != null && !(parent instanceof Menupopup)
    && !(parent instanceof Menubar))
      throw new UiException("Unsupported parent for menuitem: "+parent);
    super.beforeParentChanged(parent);
  }
View Full Code Here

  public final String getUuid() {
    return _uuid;
  }
  public void setId(String id) {
    if (_desktop != null && _desktop.getPages().contains(this))
      throw new UiException("ID cannot be changed after initialized");
    _id = id != null ? id: "";
    //No need to update client since it is allowed only before init(...)
  }
View Full Code Here

TOP

Related Classes of org.zkoss.zk.ui.UiException

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.