@Override
  public int doStartTag() throws JspException {
    UIComponentClassicTagBase componentTag =
        UIComponentELTag.getParentUIComponentClassicTagBase(pageContext);

    if (componentTag == null) {
      throw new JspException("no parent UIComponentTag found");
    }

    if (!componentTag.getCreated()) {
      return Tag.SKIP_BODY;
    }

    Validator validator = createValidator();

    UIComponent component = componentTag.getComponentInstance();
    if (component == null) {
      throw new JspException("parent UIComponentTag has no UIComponent");
    }

    if (!(component instanceof EditableValueHolder)) {
      throw new JspException("UIComponent is no EditableValueHolder");
    }
    ((EditableValueHolder) component).addValidator(validator);

    return Tag.SKIP_BODY;
  }
Пример #2
0
  // RELEASE
  public void release() {
    super.release();

    // component properties
    this.action = null;
    this.actionListener = null;
    this.immediate = null;
    this.value = null;

    // rendered attributes
    this.x = null;
    this.y = null;
    this.dx = null;
    this.dy = null;
    this.height = null;
    this.label = null;
    this.onactivate = null;
    this.onclick = null;
    this.onfocusin = null;
    this.onfocusout = null;
    this.onmousedown = null;
    this.onmousemove = null;
    this.onmouseout = null;
    this.onmouseover = null;
    this.onmouseup = null;
    this.rx = null;
    this.ry = null;
    this.style = null;
    this.styleClass = null;
    this.labelStyle = null;
    this.type = null;
    this.width = null;
  }
Пример #3
0
 @Override
 protected void setProperties(UIComponent component) {
   super.setProperties(component);
   if (resource != null) {
     component.getAttributes().put("resource", resource);
   }
 }
Пример #4
0
 public void release() {
   super.release();
   this._event = null;
   this._type = null;
   this._for = null;
   this._speed = null;
 }
Пример #5
0
  protected void setProperties(UIComponent component) {
    super.setProperties(component);
    javax.faces.component.UIOutput output = null;
    try {
      output = (javax.faces.component.UIOutput) component;
    } catch (ClassCastException cce) {
      throw new IllegalStateException(
          "Component "
              + component.toString()
              + " not expected type.  Expected: javax.faces.component.UIOutput.  Perhaps you're missing a tag?");
    }

    if (converter != null) {
      if (!converter.isLiteralText()) {
        output.setValueExpression("converter", converter);
      } else {
        Converter conv =
            FacesContext.getCurrentInstance()
                .getApplication()
                .createConverter(converter.getExpressionString());
        output.setConverter(conv);
      }
    }

    if (value != null) {
      if (!value.isLiteralText()) {
        output.setValueExpression("value", value);
      } else {
        output.setValue(value.getExpressionString());
      }
    }
    if (escape != null) {
      if (!escape.isLiteralText()) {
        output.setValueExpression("escape", escape);
      } else {
        output
            .getAttributes()
            .put("escape", java.lang.Boolean.valueOf(escape.getExpressionString()));
      }
    }
    if (style != null) {
      if (!style.isLiteralText()) {
        output.setValueExpression("style", style);
      } else {
        output.getAttributes().put("style", style.getExpressionString());
      }
    }
    if (styleClass != null) {
      if (!styleClass.isLiteralText()) {
        output.setValueExpression("styleClass", styleClass);
      } else {
        output.getAttributes().put("styleClass", styleClass.getExpressionString());
      }
    }
  }
Пример #6
0
  // RELEASE
  public void release() {
    super.release();

    // component properties
    this.converter = null;
    this.value = null;

    // rendered attributes
    this.escape = null;
    this.style = null;
    this.styleClass = null;
  }
  @Override
  protected final void setProperties(UIComponent component) {
    if (component instanceof UIViewRoot) {
      throw new IllegalStateException(
          "<f:view> was not present on this page; tag "
              + this
              + "encountered without an <f:view> being processed.");
    }

    super.setProperties(component);

    UIXComponent uixComponent = (UIXComponent) component;

    if (_attributeChangeListener != null) {
      uixComponent.setAttributeChangeListener(_attributeChangeListener);
    }

    setProperties(uixComponent.getFacesBean());
  }
Пример #8
0
  // RELEASE
  public void release() {
    super.release();

    // component properties
    this.converter = null;
    this.converterMessage = null;
    this.immediate = null;
    this.required = null;
    this.requiredMessage = null;
    this.validator = null;
    this.validatorMessage = null;
    this.value = null;
    this.valueChangeListener = null;

    // rendered attributes
    this.accesskey = null;
    this.dir = null;
    this.disabled = null;
    this.disabledClass = null;
    this.enabledClass = null;
    this.label = null;
    this.lang = null;
    this.onblur = null;
    this.onchange = null;
    this.onclick = null;
    this.ondblclick = null;
    this.onfocus = null;
    this.onkeydown = null;
    this.onkeypress = null;
    this.onkeyup = null;
    this.onmousedown = null;
    this.onmousemove = null;
    this.onmouseout = null;
    this.onmouseover = null;
    this.onmouseup = null;
    this.onselect = null;
    this.readonly = null;
    this.style = null;
    this.styleClass = null;
    this.tabindex = null;
    this.title = null;
  }
Пример #9
0
 public void release() {
   super.release();
   this._widgetVar = null;
   this._value = null;
   this._var = null;
   this._categoryField = null;
   this._dataField = null;
   this._styleClass = null;
   this._style = null;
   this._seriesStyle = null;
   this._wmode = null;
   this._live = null;
   this._refreshInterval = null;
   this._update = null;
   this._oncomplete = null;
   this._itemSelectListener = null;
   this._width = null;
   this._height = null;
   this._dataTipFunction = null;
 }
Пример #10
0
  protected void setProperties(UIComponent comp) {
    super.setProperties(comp);

    org.primefaces.component.effect.Effect component = null;
    try {
      component = (org.primefaces.component.effect.Effect) comp;
    } catch (ClassCastException cce) {
      throw new IllegalStateException("Component " + component.toString() + " not expected type.");
    }

    if (_event != null) {
      component.setValueExpression("event", _event);
    }
    if (_type != null) {
      component.setValueExpression("type", _type);
    }
    if (_for != null) {
      component.setValueExpression("for", _for);
    }
    if (_speed != null) {
      component.setValueExpression("speed", _speed);
    }
  }
Пример #11
0
  // RELEASE
  public void release() {
    super.release();

    // component properties

    // rendered attributes
    this.bgcolor = null;
    this.border = null;
    this.columnClasses = null;
    this.columns = null;
    this.onclick = null;
    this.ondblclick = null;
    this.onkeydown = null;
    this.onkeypress = null;
    this.onkeyup = null;
    this.onmousedown = null;
    this.onmousemove = null;
    this.onmouseout = null;
    this.onmouseover = null;
    this.onmouseup = null;
    this.rowClasses = null;
    this.style = null;
    this.styleClass = null;
  }
Пример #12
0
  protected void setProperties(UIComponent comp) {
    super.setProperties(comp);

    org.primefaces.component.chart.pie.PieChart component = null;
    try {
      component = (org.primefaces.component.chart.pie.PieChart) comp;
    } catch (ClassCastException cce) {
      throw new IllegalStateException("Component " + component.toString() + " not expected type.");
    }

    if (_widgetVar != null) {
      component.setValueExpression("widgetVar", _widgetVar);
    }
    if (_value != null) {
      component.setValueExpression("value", _value);
    }
    if (_var != null) {
      component.setVar(_var);
    }
    if (_categoryField != null) {
      component.setValueExpression("categoryField", _categoryField);
    }
    if (_dataField != null) {
      component.setValueExpression("dataField", _dataField);
    }
    if (_styleClass != null) {
      component.setValueExpression("styleClass", _styleClass);
    }
    if (_style != null) {
      component.setValueExpression("style", _style);
    }
    if (_seriesStyle != null) {
      component.setValueExpression("seriesStyle", _seriesStyle);
    }
    if (_wmode != null) {
      component.setValueExpression("wmode", _wmode);
    }
    if (_live != null) {
      component.setValueExpression("live", _live);
    }
    if (_refreshInterval != null) {
      component.setValueExpression("refreshInterval", _refreshInterval);
    }
    if (_update != null) {
      component.setValueExpression("update", _update);
    }
    if (_oncomplete != null) {
      component.setValueExpression("oncomplete", _oncomplete);
    }
    if (_itemSelectListener != null) {
      component.setItemSelectListener(_itemSelectListener);
    }
    if (_width != null) {
      component.setValueExpression("width", _width);
    }
    if (_height != null) {
      component.setValueExpression("height", _height);
    }
    if (_dataTipFunction != null) {
      component.setValueExpression("dataTipFunction", _dataTipFunction);
    }
  }
Пример #13
0
  protected void setProperties(UIComponent component) {
    super.setProperties(component);
    javax.faces.component.UISelectOne selectone = null;
    try {
      selectone = (javax.faces.component.UISelectOne) component;
    } catch (ClassCastException cce) {
      throw new IllegalStateException(
          "Component "
              + component.toString()
              + " not expected type.  Expected: javax.faces.component.UISelectOne.  Perhaps you're missing a tag?");
    }

    if (converter != null) {
      if (!converter.isLiteralText()) {
        selectone.setValueExpression("converter", converter);
      } else {
        Converter conv =
            FacesContext.getCurrentInstance()
                .getApplication()
                .createConverter(converter.getExpressionString());
        selectone.setConverter(conv);
      }
    }

    if (converterMessage != null) {
      selectone.setValueExpression("converterMessage", converterMessage);
    }

    if (immediate != null) {
      selectone.setValueExpression("immediate", immediate);
    }

    if (required != null) {
      selectone.setValueExpression("required", required);
    }

    if (requiredMessage != null) {
      selectone.setValueExpression("requiredMessage", requiredMessage);
    }

    if (validator != null) {
      selectone.addValidator(new MethodExpressionValidator(validator));
    }
    if (validatorMessage != null) {
      selectone.setValueExpression("validatorMessage", validatorMessage);
    }

    if (value != null) {
      selectone.setValueExpression("value", value);
    }

    if (valueChangeListener != null) {
      selectone.addValueChangeListener(
          new MethodExpressionValueChangeListener(valueChangeListener));
    }
    if (accesskey != null) {
      selectone.setValueExpression("accesskey", accesskey);
    }
    if (dir != null) {
      selectone.setValueExpression("dir", dir);
    }
    if (disabled != null) {
      selectone.setValueExpression("disabled", disabled);
    }
    if (disabledClass != null) {
      selectone.setValueExpression("disabledClass", disabledClass);
    }
    if (enabledClass != null) {
      selectone.setValueExpression("enabledClass", enabledClass);
    }
    if (label != null) {
      selectone.setValueExpression("label", label);
    }
    if (lang != null) {
      selectone.setValueExpression("lang", lang);
    }
    if (onblur != null) {
      selectone.setValueExpression("onblur", onblur);
    }
    if (onchange != null) {
      selectone.setValueExpression("onchange", onchange);
    }
    if (onclick != null) {
      selectone.setValueExpression("onclick", onclick);
    }
    if (ondblclick != null) {
      selectone.setValueExpression("ondblclick", ondblclick);
    }
    if (onfocus != null) {
      selectone.setValueExpression("onfocus", onfocus);
    }
    if (onkeydown != null) {
      selectone.setValueExpression("onkeydown", onkeydown);
    }
    if (onkeypress != null) {
      selectone.setValueExpression("onkeypress", onkeypress);
    }
    if (onkeyup != null) {
      selectone.setValueExpression("onkeyup", onkeyup);
    }
    if (onmousedown != null) {
      selectone.setValueExpression("onmousedown", onmousedown);
    }
    if (onmousemove != null) {
      selectone.setValueExpression("onmousemove", onmousemove);
    }
    if (onmouseout != null) {
      selectone.setValueExpression("onmouseout", onmouseout);
    }
    if (onmouseover != null) {
      selectone.setValueExpression("onmouseover", onmouseover);
    }
    if (onmouseup != null) {
      selectone.setValueExpression("onmouseup", onmouseup);
    }
    if (onselect != null) {
      selectone.setValueExpression("onselect", onselect);
    }
    if (readonly != null) {
      selectone.setValueExpression("readonly", readonly);
    }
    if (style != null) {
      selectone.setValueExpression("style", style);
    }
    if (styleClass != null) {
      selectone.setValueExpression("styleClass", styleClass);
    }
    if (tabindex != null) {
      selectone.setValueExpression("tabindex", tabindex);
    }
    if (title != null) {
      selectone.setValueExpression("title", title);
    }
  }
Пример #14
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());
      }
    }
  }
Пример #15
0
 @Override
 public void release() {
   super.release();
   resource = null;
 }
Пример #16
0
  protected void setProperties(UIComponent component) {
    super.setProperties(component);
    javax.faces.component.UIPanel panel = null;
    try {
      panel = (javax.faces.component.UIPanel) component;
    } catch (ClassCastException cce) {
      throw new IllegalStateException(
          "Component "
              + component.toString()
              + " not expected type.  Expected: javax.faces.component.UIPanel.  Perhaps you're missing a tag?");
    }

    if (bgcolor != null) {
      if (!bgcolor.isLiteralText()) {
        panel.setValueExpression("bgcolor", bgcolor);
      } else {
        panel.getAttributes().put("bgcolor", bgcolor.getExpressionString());
      }
    }
    if (border != null) {
      if (!border.isLiteralText()) {
        panel.setValueExpression("border", border);
      } else {
        panel
            .getAttributes()
            .put("border", java.lang.Integer.valueOf(border.getExpressionString()));
      }
    }
    if (columnClasses != null) {
      if (!columnClasses.isLiteralText()) {
        panel.setValueExpression("columnClasses", columnClasses);
      } else {
        panel.getAttributes().put("columnClasses", columnClasses.getExpressionString());
      }
    }
    if (columns != null) {
      if (!columns.isLiteralText()) {
        panel.setValueExpression("columns", columns);
      } else {
        panel
            .getAttributes()
            .put("columns", java.lang.Integer.valueOf(columns.getExpressionString()));
      }
    }
    if (onclick != null) {
      if (!onclick.isLiteralText()) {
        panel.setValueExpression("onclick", onclick);
      } else {
        panel.getAttributes().put("onclick", onclick.getExpressionString());
      }
    }
    if (ondblclick != null) {
      if (!ondblclick.isLiteralText()) {
        panel.setValueExpression("ondblclick", ondblclick);
      } else {
        panel.getAttributes().put("ondblclick", ondblclick.getExpressionString());
      }
    }
    if (onkeydown != null) {
      if (!onkeydown.isLiteralText()) {
        panel.setValueExpression("onkeydown", onkeydown);
      } else {
        panel.getAttributes().put("onkeydown", onkeydown.getExpressionString());
      }
    }
    if (onkeypress != null) {
      if (!onkeypress.isLiteralText()) {
        panel.setValueExpression("onkeypress", onkeypress);
      } else {
        panel.getAttributes().put("onkeypress", onkeypress.getExpressionString());
      }
    }
    if (onkeyup != null) {
      if (!onkeyup.isLiteralText()) {
        panel.setValueExpression("onkeyup", onkeyup);
      } else {
        panel.getAttributes().put("onkeyup", onkeyup.getExpressionString());
      }
    }
    if (onmousedown != null) {
      if (!onmousedown.isLiteralText()) {
        panel.setValueExpression("onmousedown", onmousedown);
      } else {
        panel.getAttributes().put("onmousedown", onmousedown.getExpressionString());
      }
    }
    if (onmousemove != null) {
      if (!onmousemove.isLiteralText()) {
        panel.setValueExpression("onmousemove", onmousemove);
      } else {
        panel.getAttributes().put("onmousemove", onmousemove.getExpressionString());
      }
    }
    if (onmouseout != null) {
      if (!onmouseout.isLiteralText()) {
        panel.setValueExpression("onmouseout", onmouseout);
      } else {
        panel.getAttributes().put("onmouseout", onmouseout.getExpressionString());
      }
    }
    if (onmouseover != null) {
      if (!onmouseover.isLiteralText()) {
        panel.setValueExpression("onmouseover", onmouseover);
      } else {
        panel.getAttributes().put("onmouseover", onmouseover.getExpressionString());
      }
    }
    if (onmouseup != null) {
      if (!onmouseup.isLiteralText()) {
        panel.setValueExpression("onmouseup", onmouseup);
      } else {
        panel.getAttributes().put("onmouseup", onmouseup.getExpressionString());
      }
    }
    if (rowClasses != null) {
      if (!rowClasses.isLiteralText()) {
        panel.setValueExpression("rowClasses", rowClasses);
      } else {
        panel.getAttributes().put("rowClasses", rowClasses.getExpressionString());
      }
    }
    if (style != null) {
      if (!style.isLiteralText()) {
        panel.setValueExpression("style", style);
      } else {
        panel.getAttributes().put("style", style.getExpressionString());
      }
    }
    if (styleClass != null) {
      if (!styleClass.isLiteralText()) {
        panel.setValueExpression("styleClass", styleClass);
      } else {
        panel.getAttributes().put("styleClass", styleClass.getExpressionString());
      }
    }
  }