Package org.zkoss.zk.ui

Examples of org.zkoss.zk.ui.WrongValueException


   * Sets the text value to be shown as the distortion captcha.
   * @param text the captcha text value
   */
  public void setValue(String text) throws WrongValueException {
    if (Strings.isBlank(text))
      throw new WrongValueException("empty not allowed");
    if (!Objects.equals(text, _value)) {
      _value = text;
      smartDrawCaptcha();
    }
  }
View Full Code Here


      int divscale = vals[1] != null ? ((Integer) vals[1]).intValue() : 0;
      while (v != 0 && --divscale >= 0)
        v /= 10;
      return new Integer(v);
    } catch (NumberFormatException ex) {
      throw showCustomError(new WrongValueException(this,
          MZul.NUMBER_REQUIRED, value));
    }
  }
View Full Code Here

   * <p> Default: 0
   * @param start the column number
   */
  public void setStart(int start) {
    if (start < 0)
      throw new WrongValueException("Positive only");
    if (_start != start) {
      _start = start;
      smartUpdate("start", _start);
    }
  }
View Full Code Here

   * Sets the number of columns to freeze.(from left to right)
   * @param columns positive only
   */
  public void setColumns(int columns) {
    if (columns < 0)
      throw new WrongValueException("Positive only");
    if (_columns != columns) {
      _columns = columns;
      smartUpdate("columns", _columns);
    }
  }
View Full Code Here

   * @param orient either "horizontal" or "vertical".
   * @since 3.5.0
   */
  public void setOrient(String orient) throws WrongValueException {
    if (!"horizontal".equals(orient) && !"vertical".equals(orient))
      throw new WrongValueException("orient cannot be "+orient);
    if (!_orient.equals(orient)) {
      _orient = orient;
      smartUpdate("orient", _orient);
    }
  }
View Full Code Here

   * @exception WrongValueException if non-positive maxpos is passed
   */
  public void setMaxpos(int maxpos)
  throws WrongValueException {
    if (maxpos <= 0)
      throw new WrongValueException("Nonpositive is not allowed: "+maxpos);

    if (_maxpos != maxpos) {
      if (_curpos > maxpos)
        setCurpos(maxpos);
      _maxpos = maxpos;
View Full Code Here

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

    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

    else if ("overlapped".equals(name)) doOverlapped();
    else if ("embedded".equals(name)) doEmbedded();
    else if ("modal".equals(name))
      Events.postEvent(Events.ON_MODAL, this, null);
    else if ("highlighted".equals(name)) doHighlighted();
    else throw new WrongValueException("Uknown mode: "+name);
  }
View Full Code Here

    case MODAL:
      Events.postEvent(Events.ON_MODAL, this, null);
      break;
    case HIGHLIGHTED: doHighlighted(); break;
    default:
      throw new WrongValueException("Unknown mode: "+mode);
    }
  }
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.