Example #1
0
  public void restoreState(FacesContext context, Object value) {
    Object[] state = (Object[]) value;

    if (state != null) super.restoreState(context, state[0]);

    _dir = (String) state[1];
    _escape = (Boolean) state[2];
    _lang = (String) state[3];
    _style = (String) state[4];
    _styleClass = (String) state[5];
    _title = (String) state[6];
  }
Example #2
0
  /** Sets the value expression with the given name. */
  @Override
  public void setValueExpression(String name, ValueExpression expr) {
    PropEnum prop = _propMap.get(name);

    if (prop != null) {
      switch (prop) {
        case DIR:
          if (expr != null && expr.isLiteralText()) {
            _dir = Util.evalString(expr);
            return;
          } else _dirExpr = expr;
          break;

        case ESCAPE:
          if (expr != null && expr.isLiteralText()) {
            _escape = Util.evalBoolean(expr);
            return;
          } else _escapeExpr = expr;
          break;

        case LANG:
          if (expr != null && expr.isLiteralText()) {
            _lang = Util.evalString(expr);
            return;
          } else _langExpr = expr;
          break;

        case STYLE:
          if (expr != null && expr.isLiteralText()) {
            _style = Util.evalString(expr);
            return;
          } else _styleExpr = expr;
          break;

        case STYLE_CLASS:
          if (expr != null && expr.isLiteralText()) {
            _styleClass = Util.evalString(expr);
            return;
          } else _styleClassExpr = expr;
          break;

        case TITLE:
          if (expr != null && expr.isLiteralText()) {
            _title = Util.evalString(expr);
            return;
          } else _titleExpr = expr;
          break;
      }
    }

    super.setValueExpression(name, expr);
  }