Package org.zkoss.zk.ui

Examples of org.zkoss.zk.ui.UiException


  }
 
  public void beforeChildAdded(Component newChild, Component refChild) {
    if (newChild instanceof Detail) {
      if (_detail != null && _detail != newChild)
        throw new UiException("Only one detail is allowed: "+this);
    }
    super.beforeChildAdded(newChild, refChild);
  }
View Full Code Here


    try {
      ((HttpServletResponse)getNativeResponse()).sendRedirect(
        uri != null ? uri: "");
      setVoided(true);
    } catch (IOException ex) {
      throw new UiException(ex);
    }
  }
View Full Code Here

  private void doModal(Page page, String url) {
    final Execution exec = Executions.getCurrent();
    final Object[] urls = parseUrl(url);
      final Component modalwin = exec.createComponents((String)urls[0], null, (Map)urls[1]);
      if (!(modalwin instanceof Window)) {
        throw new UiException("The page must enclosed with a Window component. Check url definition: "+url);
      }
      modalwin.setPage(page);
      try {
        ((Window)modalwin).doModal();
      } catch(java.lang.InterruptedException ex) {
View Full Code Here

  private void doModal(Page page, String url) {
    final Execution exec = Executions.getCurrent();
    final Object[] urls = parseUrl(url);
      final Component modalwin = exec.createComponents((String)urls[0], null, (Map)urls[1]);
      if (!(modalwin instanceof Window)) {
        throw new UiException("The page must enclosed with a Window component. Check url definition: "+url);
      }
      modalwin.setPage(page);
      try {
        ((Window)modalwin).doModal();
      } catch(java.lang.InterruptedException ex) {
View Full Code Here

  private void doModal(Page page, String url) {
    final Execution exec = Executions.getCurrent();
    final Object[] urls = parseUrl(url);
      final Component modalwin = exec.createComponents((String)urls[0], null, (Map)urls[1]);
      if (!(modalwin instanceof Window)) {
        throw new UiException("The page must enclosed with a Window component. Check url definition: "+url);
      }
      modalwin.setPage(page);
      try {
        ((Window)modalwin).doModal();
      } catch(java.lang.InterruptedException ex) {
View Full Code Here

  private void doModal(Page page, String url) {
    final Execution exec = Executions.getCurrent();
    final Object[] urls = parseUrl(url);
      final Component modalwin = exec.createComponents((String)urls[0], null, (Map)urls[1]);
      if (!(modalwin instanceof Window)) {
        throw new UiException("The page must enclosed with a Window component. Check url definition: "+url);
      }
      modalwin.setPage(page);
      try {
        ((Window)modalwin).doModal();
      } catch(java.lang.InterruptedException ex) {
View Full Code Here

      String deviceType = el.getElementValue("device-type", true);
      String connType = el.getElementValue("connection-type", true);
      v = parseInteger(el, "error-code", true);
      if (v == null)
        throw new UiException("error-code is required, "+el.getLocator());
      String uri = IDOMs.getRequiredElementValue(el, "reload-uri");
      if ("false".equals(uri)) uri = null;

      config.setClientErrorReload(deviceType, v.intValue(), uri, connType);
    }
View Full Code Here

      try {
        final Class klass = Classes.forNameByThread(clsnm);
        if (cls != null && !cls.isAssignableFrom(klass)) {
          String msg = clsnm+" must implement "+cls.getName()+", "+el.getLocator();
          if (required)
            throw new UiException(msg);
          log.error(msg);
          return null;
        }
//        if (log.debuggable()) log.debug("Using "+clsnm+" for "+cls);
        return klass;
      } catch (Throwable ex) {
        String msg = ex instanceof ClassNotFoundException ?
          clsnm + " not found": "Unable to load "+clsnm;
        msg += ", at "+el.getLocator();
        if (required)
          throw new UiException(msg, ex);
        log.error(msg);
        return null;
      }
    } else if (required)
      throw new UiException(elnm+" required, at "+el.getLocator());
    return null;
  }
View Full Code Here

    String val = el.getElementValue(subnm, true);
    if (val != null && val.length() > 0) {
      try {
        final int v = Integer.parseInt(val);
        if (positiveOnly && v <= 0)
          throw new UiException("The "+subnm+" element must be a positive number, not "+val+", at "+el.getLocator());
        return new Integer(v);
      } catch (NumberFormatException ex) { //eat
        throw new UiException("The "+subnm+" element must be a number, not "+val+", at "+el.getLocator());
      }
    }
    return null;
  }
View Full Code Here

   * and it is different from {@link Listbox}.</p>
   * @since 3.0.2
   */
  public void setSelectedItem(Comboitem item) {
    if (item != null && item.getParent() != this)
      throw new UiException("Not a child: "+item);

    if (item != _selItem) {
      _selItem = item;
      if (item != null) {
        setValue(item.getLabel());
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.