Package org.zkoss.zk.ui

Examples of org.zkoss.zk.ui.WrongValueException


   *
   */
  public void setMold(String mold){
    if (isVertical()){
      if (mold.startsWith("accordion")){
        throw new WrongValueException("Unsupported vertical orient in mold : "+mold);
      }else{
        super.setMold(mold);
      }
    }else{
      super.setMold(mold);
View Full Code Here


   * @param orient
   *            either "horizontal" or "vertical".
   */
  public void setOrient(String orient) throws WrongValueException {
    if (!"horizontal".equals(orient) && !"vertical".equals(orient))
      throw new WrongValueException("Unknow orient : " + orient);
    if (inAccordionMold())
      throw new WrongValueException("Unsupported vertical orient in mold : "+getMold());
    if (!Objects.equals(_orient, orient)) {
      _orient = orient;
      smartUpdate("orient", _orient);
    }
  }
View Full Code Here

    df.setLenient(_lenient);
    final Date date;
    try {
      date = df.parse(value);
    } catch (ParseException ex) {
      throw showCustomError(new WrongValueException(this,
          MZul.DATE_REQUIRED, new Object[] { value, fmt }));
    }
    return date;
  }
View Full Code Here

        list.add(null);
      } else {
        try {
          list.add(Integer.valueOf(s));
        } catch (Throwable ex) {
          throw new WrongValueException("Not a valid number list: "+numbers);
        }
      } 

      if (k < 0) break;
      j = k + 1;
View Full Code Here

   */
  public void setMode(String mode) throws WrongValueException {
    if (!_mode.equals(mode)) {
      if (!"auto".equals(mode) && !"instant".equals(mode)
      && !"defer".equals(mode))
        throw new WrongValueException("Unknown mode: "+mode);
      if ((_localized || _progressing) && "instant".equals(mode))
        throw new UnsupportedOperationException("localized/progressing not allowed in instant mold");

      _mode = mode;
      fixMode();
View Full Code Here

    super.validate(comp, value);
  }
  private WrongValueException outOfRangeValue(Component comp) {
    final String errmsg = getErrorMessage(comp);
    if (errmsg != null)
      return new WrongValueException(comp, errmsg);

    final String s =
      _beg != null ? _end != null ?
          dateToString(comp, _beg) + " ~ " + dateToString(comp, _end):
          ">= " + dateToString(comp, _beg):
          "<= " + dateToString(comp, _end);
    return new WrongValueException(comp, MZul.OUT_OF_RANGE, s);
  }
View Full Code Here

      if (divscale > 0)
        v /= Math.pow(10, divscale);
      return new Double(v);
    } catch (NumberFormatException ex) {
      throw showCustomError(
        new WrongValueException(this, MZul.NUMBER_REQUIRED, value));
    }
  }
View Full Code Here

   * @since 3.0.4
   */
  public void setPagingPosition(String pagingPosition) {
    if (pagingPosition == null || (!pagingPosition.equals("top") &&
      !pagingPosition.equals("bottom") && !pagingPosition.equals("both")))
      throw new WrongValueException("Unsupported position : "+pagingPosition);
    if(!Objects.equals(_pagingPosition, pagingPosition)){
      _pagingPosition = pagingPosition;
      smartUpdate("pagingPosition", pagingPosition);
    }
  }
View Full Code Here

  public void setPagingPosition(String pagingPosition) {
    if (pagingPosition == null
        || (!pagingPosition.equals("top")
            && !pagingPosition.equals("bottom") && !pagingPosition
            .equals("both")))
      throw new WrongValueException("Unsupported position : "
          + pagingPosition);
    if (!Objects.equals(_pagingPosition, pagingPosition)) {
      _pagingPosition = pagingPosition;
      smartUpdate("pagingPosition", pagingPosition);
    }
View Full Code Here

   * @param sortDir one of "ascending", "descending" and "natural"
   */
  public void setSortDirection(String sortDir) throws WrongValueException {
    if (sortDir == null || (!"ascending".equals(sortDir)
    && !"descending".equals(sortDir) && !"natural".equals(sortDir)))
      throw new WrongValueException("Unknown sort direction: "+sortDir);
    if (!Objects.equals(_sortDir, sortDir)) {
      _sortDir = sortDir;
      smartUpdate("sortDirection", _sortDir);
    }
  }
View Full Code Here

TOP

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

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.