Пример #1
0
  protected void setProperties(UIComponent component) {
    super.setProperties(component);
    javax.faces.component.UICommand command = null;
    try {
      command = (javax.faces.component.UICommand) component;
    } catch (ClassCastException cce) {
      throw new IllegalStateException(
          "Component "
              + component.toString()
              + " not expected type.  Expected: javax.faces.component.UICommand.  Perhaps you're missing a tag?");
    }

    if (action != null) {
      command.setActionExpression(action);
    }
    if (actionListener != null) {
      command.addActionListener(new MethodExpressionActionListener(actionListener));
    }
    if (immediate != null) {
      if (!immediate.isLiteralText()) {
        command.setValueExpression("immediate", immediate);
      } else {
        command.setImmediate(
            java.lang.Boolean.valueOf(immediate.getExpressionString()).booleanValue());
      }
    }
    if (label != null) {
      if (!label.isLiteralText()) {
        command.setValueExpression("label", label);
      } else {
        command.getAttributes().put("label", label.getExpressionString());
      }
    }
    if (oncommand != null) {
      if (!oncommand.isLiteralText()) {
        command.setValueExpression("oncommand", oncommand);
      } else {
        command.getAttributes().put("oncommand", oncommand.getExpressionString());
      }
    }
    if (onclick != null) {
      if (!onclick.isLiteralText()) {
        command.setValueExpression("onclick", onclick);
      } else {
        command.getAttributes().put("onclick", onclick.getExpressionString());
      }
    }
    if (onfocusin != null) {
      if (!onfocusin.isLiteralText()) {
        command.setValueExpression("onfocusin", onfocusin);
      } else {
        command.getAttributes().put("onfocusin", onfocusin.getExpressionString());
      }
    }
    if (onfocusout != null) {
      if (!onfocusout.isLiteralText()) {
        command.setValueExpression("onfocusout", onfocusout);
      } else {
        command.getAttributes().put("onfocusout", onfocusout.getExpressionString());
      }
    }
    if (onmousedown != null) {
      if (!onmousedown.isLiteralText()) {
        command.setValueExpression("onmousedown", onmousedown);
      } else {
        command.getAttributes().put("onmousedown", onmousedown.getExpressionString());
      }
    }
    if (onmousemove != null) {
      if (!onmousemove.isLiteralText()) {
        command.setValueExpression("onmousemove", onmousemove);
      } else {
        command.getAttributes().put("onmousemove", onmousemove.getExpressionString());
      }
    }
    if (onmouseout != null) {
      if (!onmouseout.isLiteralText()) {
        command.setValueExpression("onmouseout", onmouseout);
      } else {
        command.getAttributes().put("onmouseout", onmouseout.getExpressionString());
      }
    }
    if (onmouseover != null) {
      if (!onmouseover.isLiteralText()) {
        command.setValueExpression("onmouseover", onmouseover);
      } else {
        command.getAttributes().put("onmouseover", onmouseover.getExpressionString());
      }
    }
    if (onmouseup != null) {
      if (!onmouseup.isLiteralText()) {
        command.setValueExpression("onmouseup", onmouseup);
      } else {
        command.getAttributes().put("onmouseup", onmouseup.getExpressionString());
      }
    }
    if (style != null) {
      if (!style.isLiteralText()) {
        command.setValueExpression("style", style);
      } else {
        command.getAttributes().put("style", style.getExpressionString());
      }
    }
    if (styleClass != null) {
      if (!styleClass.isLiteralText()) {
        command.setValueExpression("styleClass", styleClass);
      } else {
        command.getAttributes().put("styleClass", styleClass.getExpressionString());
      }
    }
    if (type != null) {
      if (!type.isLiteralText()) {
        command.setValueExpression("type", type);
      } else {
        command.getAttributes().put("type", type.getExpressionString());
      }
    }
    if (value != null) {
      if (!value.isLiteralText()) {
        command.setValueExpression("value", value);
      } else {
        command.setValue(value.getExpressionString());
      }
    }
  }
Пример #2
0
 /**
  * @param immediate
  * @see javax.faces.component.UICommand#setImmediate(boolean)
  */
 public void setImmediate(boolean immediate) {
   _commandBrige.setImmediate(immediate);
 }