Exemple #1
0
  protected void setProperties(UIComponent component) {

    super.setProperties(component);
    FacesContext context = FacesContext.getCurrentInstance();
    UIAction cmpt = (UIAction) component;

    if (styleClass != null) {
      if (isValueReference(styleClass)) {
        ValueBinding vb = context.getApplication().createValueBinding(styleClass);
        component.setValueBinding("styleClass", vb);
      } else {
        component.getAttributes().put("styleClass", styleClass);
      }
    }

    if (actionListener != null) {
      if (UIComponentTag.isValueReference(actionListener)) {
        Class args[] = {ActionEvent.class};
        MethodBinding vb =
            FacesContext.getCurrentInstance()
                .getApplication()
                .createMethodBinding(actionListener, args);
        cmpt.setActionListener(vb);
      } else {
        Object params[] = {actionListener};
        throw new FacesException(
            Util.getExceptionMessageString("com.sun.faces.INVALID_EXPRESSION", params));
      }
    }
  } // setProperties()
  protected void setProperties(UIComponent component) {

    super.setProperties(component);

    TagUtil.setInteger(component, "totalItems", totalItems);
    TagUtil.setInteger(component, "firstItem", firstItem);
    TagUtil.setInteger(component, "pageSize", pageSize);
    TagUtil.setString(component, "value", value);
    TagUtil.setValueChangeListener(component, valueChangeListener);
    TagUtil.setString(component, "pageSizes", pageSizes);
    TagUtil.setBoolean(component, "accesskeys", accesskeys);
    TagUtil.setBoolean(component, "renderFirst", renderFirst);
    TagUtil.setBoolean(component, "renderPrev", renderPrev);
    TagUtil.setBoolean(component, "renderNext", renderNext);
    TagUtil.setBoolean(component, "renderLast", renderLast);
    TagUtil.setBoolean(component, "renderPageSize", renderPageSize);
    TagUtil.setString(component, "textFirst", textFirst);
    TagUtil.setString(component, "textPrev", textPrev);
    TagUtil.setString(component, "textNext", textNext);
    TagUtil.setString(component, "textLast", textLast);
    TagUtil.setString(component, "textPageSize", textPageSize);
    TagUtil.setString(component, "textStatus", textStatus);
    TagUtil.setString(component, "textItem", textItem);
    TagUtil.setBoolean(component, "immediate", immediate);
  }
Exemple #3
0
 public void release() {
   super.release();
   showpages = null;
   dataTableId = null;
   styleClass = null;
   selectedStyleClass = null;
 }
 /** @param component places the attributes in the component */
 protected void setProperties(UIComponent component) {
   super.setProperties(component);
   TagUtil.setString(component, "cssclass", cssclass);
   TagUtil.setString(component, "valign", valign);
   TagUtil.setString(component, "align", align);
   TagUtil.setString(component, "size", size);
 }
  protected void setProperties(UIComponent component) {

    super.setProperties(component);

    FacesContext context = getFacesContext();
    TagUtil.setString(component, "separator", separator);
    TagUtil.setString(component, "styleClass", styleClass);
  }
 /** Release any allocated tag handler attributes. */
 public void release() {
   super.release();
   converter = null;
   escape = null;
   style = null;
   styleClass = null;
   title = null;
   value = null;
 }
  protected void setProperties(UIComponent component) {
    super.setProperties(component);

    // FacesContext context = getFacesContext();
    TagUtil.setInteger(component, "height", height);
    TagUtil.setInteger(component, "width", width);
    TagUtil.setInteger(component, "wait", wait);
    TagUtil.setInteger(component, "elapsed", elapsed);
    TagUtil.setString(component, "expireScript", expireScript);
  }
 /** Release any allocated tag handler attributes. */
 public void release() {
   super.release();
   doctypePublic = null;
   doctypeRoot = null;
   doctypeSystem = null;
   output = null;
   prettyPrinting = null;
   converter = null;
   value = null;
 }
Exemple #9
0
 public void release() {
   super.release();
   value = null;
   var = null;
   width = null;
   rowSize = null;
   pageSize = null;
   pageSetting = null;
   actionBinding = null;
 }
Exemple #10
0
 /** @see javax.faces.webapp.UIComponentTag#setProperties(javax.faces.component.UIComponent) */
 protected void setProperties(UIComponent component) {
   super.setProperties(component);
   FacesContext context = getFacesContext();
   if (value != null) {
     ValueBinding vb = context.getApplication().createValueBinding(value);
     component.setValueBinding("value", vb);
   }
   if (var != null) {
     ((UIData) component).setVar(var);
   }
 }
  public void release() {
    super.release();

    name = null;
    label = null;
    icon = null;
    action = null;
    link = null;
    direct = null;
    disabled = null;
  }
 /** Transfer tag attributes to component properties. */
 protected void setProperties(UIComponent _component) {
   super.setProperties(_component);
   if (converter != null) {
     if (isValueReference(converter)) {
       ValueBinding _vb = getFacesContext().getApplication().createValueBinding(converter);
       _component.setValueBinding("converter", _vb);
     } else {
       Converter _converter =
           FacesContext.getCurrentInstance().getApplication().createConverter(converter);
       _component.getAttributes().put("converter", _converter);
     }
   }
   if (escape != null) {
     if (isValueReference(escape)) {
       ValueBinding _vb = getFacesContext().getApplication().createValueBinding(escape);
       _component.setValueBinding("escape", _vb);
     } else {
       _component.getAttributes().put("escape", Boolean.valueOf(escape));
     }
   }
   if (style != null) {
     if (isValueReference(style)) {
       ValueBinding _vb = getFacesContext().getApplication().createValueBinding(style);
       _component.setValueBinding("style", _vb);
     } else {
       _component.getAttributes().put("style", style);
     }
   }
   if (styleClass != null) {
     if (isValueReference(styleClass)) {
       ValueBinding _vb = getFacesContext().getApplication().createValueBinding(styleClass);
       _component.setValueBinding("styleClass", _vb);
     } else {
       _component.getAttributes().put("styleClass", styleClass);
     }
   }
   if (title != null) {
     if (isValueReference(title)) {
       ValueBinding _vb = getFacesContext().getApplication().createValueBinding(title);
       _component.setValueBinding("title", _vb);
     } else {
       _component.getAttributes().put("title", title);
     }
   }
   if (value != null) {
     if (isValueReference(value)) {
       ValueBinding _vb = getFacesContext().getApplication().createValueBinding(value);
       _component.setValueBinding("value", _vb);
     } else {
       _component.getAttributes().put("value", value);
     }
   }
 }
 /**
  * Returns the current option element's action.
  *
  * @return the current option element's action
  */
 public String nodeAction() {
   String id = getMenuModel().getSelectedNodeId();
   IMenuItem menuItem = (IMenuItem) getMenuModel().getMenuItem(id);
   String action = menuItem.getReference();
   if (UIComponentTag.isValueReference(action)) {
     FacesContext facesContext = FacesContext.getCurrentInstance();
     MethodBinding mb = facesContext.getApplication().createMethodBinding(action, null);
     action = (String) mb.invoke(facesContext, null);
   }
   LOGGER.fine("nodeAction: " + id + " action: " + action);
   return action;
 }
  public void decode(FacesContext context) {
    String curPage = null;
    String action = null;
    int actionInt = 0;
    int currentPage = 1;
    int currentRow = 1;
    String clientId = getClientId(context);
    Map requestParameterMap = (Map) context.getExternalContext().getRequestParameterMap();
    action = (String) requestParameterMap.get(clientId + "_action");
    if (action.equals("")) {
      action = lastAction;
    }
    MethodBinding mb = null;
    if (UIComponentTag.isValueReference(action)) {
      mb = FacesContext.getCurrentInstance().getApplication().createMethodBinding(action, null);
    } else {
      mb = Util.createConstantMethodBinding(action);
    }
    this.getAttributes().put("action", mb);
    lastAction = action;

    curPage = (String) requestParameterMap.get(clientId + "_curPage");
    if (!curPage.equals("")) {
      currentPage = Integer.valueOf(curPage).intValue();
    }

    // Assert that action's length is 1.
    switch (actionInt = Integer.valueOf(action).intValue()) {
      case ACTION_NEXT:
        currentPage++;
        break;
      case ACTION_PREVIOUS:
        // Assert 1 < currentPage
        if (currentPage > 1) {
          currentPage--;
        }
        break;
      default:
        currentPage = actionInt;
        break;
    }
    // from the currentPage, calculate the current row to scroll to.
    currentRow = (currentPage - 1) * getRowsPerPage(context);
    this.getAttributes().put("currentPage", new Integer(currentPage));
    this.getAttributes().put("currentRow", new Integer(currentRow));

    if (action == null || action.length() == 0) {
      // nothing to decode
      return;
    } else {
      this.queueEvent(new ActionEvent(this));
    }
  }
 protected void setProperties(UIComponent component) {
   super.setProperties(component);
   TagUtil.setString(component, "value", value);
   TagUtil.setString(component, "width", width);
   TagUtil.setString(component, "height", height);
   TagUtil.setString(component, "toolbarButtonRows", toolbarButtonRows);
   TagUtil.setString(component, "javascriptLibrary", javascriptLibrary);
   TagUtil.setString(component, "autoConfig", autoConfig);
   TagUtil.setString(component, "columns", columns);
   TagUtil.setString(component, "rows", rows);
   TagUtil.setString(component, "justArea", justArea);
 }
Exemple #16
0
 public void setProperties(UIComponent component) {
   super.setProperties(component);
   if (component == null) {
     return;
   }
   TagUtil.setInteger(component, "showpages", showpages);
   TagUtil.setString(component, "dataTableId", dataTableId);
   TagUtil.setString(component, "controlId", controlId);
   TagUtil.setString(component, "styleClass", styleClass);
   TagUtil.setString(component, "selectedStyleClass", selectedStyleClass);
   TagUtil.setBoolean(component, "showLinks", showLinks);
 }
  public void release() {
    super.release();

    value = null;
    width = null;
    height = null;
    toolbarButtonRows = null;
    javascriptLibrary = null;
    autoConfig = null;
    columns = null;
    rows = null;
    justArea = null;
  }
  @Override
  public int doStartTag() throws JspException {
    UIComponentTag tag = UIComponentTag.getParentUIComponentTag(pageContext);
    if (tag == null) {
      throw new JspException(
          _LOG.getMessage("FILEDOWNLOADACTIONLISTENER_MUST_INSIDE_UICOMPONENT_TAG"));
    }

    // Only run on the first time the tag executes
    if (!tag.getCreated()) return SKIP_BODY;

    UIComponent component = tag.getComponentInstance();
    if (!(component instanceof ActionSource)) {
      throw new JspException(
          _LOG.getMessage("FILEDOWNLOADACTIONLISTENER_MUST_INSIDE_UICOMPONENT_TAG"));
    }

    ELContextTag parentELContext = (ELContextTag) findAncestorWithClass(this, ELContextTag.class);

    Application application = FacesContext.getCurrentInstance().getApplication();

    FileDownloadActionListener listener = new FileDownloadActionListener();

    if (_filename != null) {
      listener.setValueExpression(FileDownloadActionListener.FILENAME_KEY, _filename);
    }

    if (_contentType != null) {
      listener.setValueExpression(FileDownloadActionListener.CONTENT_TYPE_KEY, _contentType);
    }

    listener.setMethod(_method);

    ((ActionSource) component).addActionListener(listener);

    return super.doStartTag();
  }
 public void release() {
   super.release();
   this._plugins = null;
   this._accesskey = null;
   this._cols = -1;
   this._dir = null;
   this._disabled = false;
   this._lang = null;
   this._readonly = false;
   this._rows = -1;
   this._style = null;
   this._styleClass = null;
   this._tabindex = null;
   this._title = null;
 }
 protected void setProperties(UIComponent component) {
   super.setProperties(component);
   if (component != null) {
     component.getAttributes().put("plugins", this._plugins);
     component.getAttributes().put("accesskey", this._accesskey);
     component.getAttributes().put("cols", new Integer(this._cols));
     component.getAttributes().put("dir", this._dir);
     component.getAttributes().put("disabled", new Boolean(this._disabled));
     component.getAttributes().put("lang", this._lang);
     component.getAttributes().put("readonly", new Boolean(this._readonly));
     component.getAttributes().put("rows", new Integer(this._rows));
     component.getAttributes().put("style", this._style);
     component.getAttributes().put("styleClass", this._styleClass);
     component.getAttributes().put("tabindex", this._tabindex);
     component.getAttributes().put("title", this._title);
   }
 }
Exemple #21
0
  @Override
  protected void setProperties(UIComponent component) {

    super.setProperties(component);

    UIStub componentStub = (UIStub) component;
    Application application = getFacesContext().getApplication();

    // Action

    if (mAction != null) {
      if (!isValueReference(mAction)) {
        throw MetawidgetException.newException("Action '" + mAction + "' must be an EL expression");
      }

      componentStub.setAction(application.createMethodBinding(mAction, null));
    }

    // Value

    if (mValue != null) {
      if (!isValueReference(mValue)) {
        throw MetawidgetException.newException("Value '" + mValue + "' must be an EL expression");
      }

      componentStub.setValueBinding("value", application.createValueBinding(mValue));
    }

    // Attributes

    if (mStubAttributes != null) {
      if (isValueReference(mStubAttributes)) {
        componentStub.setValueBinding(
            "stubAttributes", application.createValueBinding(mStubAttributes));
      } else {
        componentStub.setStubAttributes(mStubAttributes);
      }
    }
  }
 public void release() {
   super.release();
   totalItems = null;
   firstItem = null;
   pageSize = null;
   value = null;
   valueChangeListener = null;
   pageSizes = null;
   accesskeys = null;
   renderFirst = null;
   renderPrev = null;
   renderNext = null;
   renderLast = null;
   renderPageSize = null;
   textFirst = null;
   textPrev = null;
   textNext = null;
   textLast = null;
   textPageSize = null;
   textStatus = null;
   textItem = null;
   immediate = null;
 }
  public void release() {
    super.release();

    styleClass = null;
    onclick = null;
    ondblclick = null;
    onkeydown = null;
    onkeypress = null;
    onkeyup = null;
    onmousedown = null;
    onmousemove = null;
    onmouseout = null;
    onmouseover = null;
    onmouseup = null;
    disabled = null;
    alt = null;
    lang = null;
    dir = null;
    tabindex = null;
    accesskey = null;
    title = null;
    style = null;
  }
  protected void setProperties(UIComponent component) {
    super.setProperties(component);

    Application app = getFacesContext().getApplication();
    Util.addAttribute(app, component, "onclick", onclick);
    Util.addAttribute(app, component, "ondblclick", ondblclick);
    Util.addAttribute(app, component, "onkeydown", onkeydown);
    Util.addAttribute(app, component, "onkeypress", onkeypress);
    Util.addAttribute(app, component, "onkeyup", onkeyup);
    Util.addAttribute(app, component, "onmousedown", onmousedown);
    Util.addAttribute(app, component, "onmousemove", onmousemove);
    Util.addAttribute(app, component, "onmouseout", onmouseout);
    Util.addAttribute(app, component, "onmouseover", onmouseover);
    Util.addAttribute(app, component, "onmouseup", onmouseup);
    Util.addAttribute(app, component, "disabled", disabled);
    Util.addAttribute(app, component, "alt", alt);
    Util.addAttribute(app, component, "lang", lang);
    Util.addAttribute(app, component, "dir", dir);
    Util.addAttribute(app, component, "tabindex", tabindex);
    Util.addAttribute(app, component, "accesskey", accesskey);
    Util.addAttribute(app, component, "title", title);
    Util.addAttribute(app, component, "style", style);
    Util.addAttribute(app, component, "styleClass", styleClass);
  }
Exemple #25
0
 public void release() {
   super.release();
   value = null;
   target = null;
 }
Exemple #26
0
 public void setProperties(UIComponent component) {
   super.setProperties(component);
   uk.ac.lancs.e_science.fileUpload.util.Tags.setString(component, "target", target);
   uk.ac.lancs.e_science.fileUpload.util.Tags.setString(component, "value", value);
 }
 public void release() {
   super.release();
   value = null;
   target = null;
   valueChangeListener = null;
 }
 public void setProperties(UIComponent component) {
   super.setProperties(component);
   com.corejsf.util.Tags.setString(component, "target", target);
   com.corejsf.util.Tags.setString(component, "value", value);
   com.corejsf.util.Tags.setValueChangeListener(component, valueChangeListener);
 }
 /** Transfer tag attributes to component properties. */
 protected void setProperties(UIComponent _component) {
   super.setProperties(_component);
   if (doctypePublic != null) {
     if (isValueReference(doctypePublic)) {
       ValueBinding _vb = getFacesContext().getApplication().createValueBinding(doctypePublic);
       _component.setValueBinding("doctypePublic", _vb);
     } else {
       _component.getAttributes().put("doctypePublic", doctypePublic);
     }
   }
   if (doctypeRoot != null) {
     if (isValueReference(doctypeRoot)) {
       ValueBinding _vb = getFacesContext().getApplication().createValueBinding(doctypeRoot);
       _component.setValueBinding("doctypeRoot", _vb);
     } else {
       _component.getAttributes().put("doctypeRoot", doctypeRoot);
     }
   }
   if (doctypeSystem != null) {
     if (isValueReference(doctypeSystem)) {
       ValueBinding _vb = getFacesContext().getApplication().createValueBinding(doctypeSystem);
       _component.setValueBinding("doctypeSystem", _vb);
     } else {
       _component.getAttributes().put("doctypeSystem", doctypeSystem);
     }
   }
   if (output != null) {
     if (isValueReference(output)) {
       ValueBinding _vb = getFacesContext().getApplication().createValueBinding(output);
       _component.setValueBinding("output", _vb);
     } else {
       _component.getAttributes().put("output", output);
     }
   }
   if (prettyPrinting != null) {
     if (isValueReference(prettyPrinting)) {
       ValueBinding _vb = getFacesContext().getApplication().createValueBinding(prettyPrinting);
       _component.setValueBinding("prettyPrinting", _vb);
     } else {
       _component.getAttributes().put("prettyPrinting", prettyPrinting);
     }
   }
   if (converter != null) {
     if (isValueReference(converter)) {
       ValueBinding _vb = getFacesContext().getApplication().createValueBinding(converter);
       _component.setValueBinding("converter", _vb);
     } else {
       Converter _converter =
           FacesContext.getCurrentInstance().getApplication().createConverter(converter);
       _component.getAttributes().put("converter", _converter);
     }
   }
   if (value != null) {
     if (isValueReference(value)) {
       ValueBinding _vb = getFacesContext().getApplication().createValueBinding(value);
       _component.setValueBinding("value", _vb);
     } else {
       _component.getAttributes().put("value", value);
     }
   }
 }
 public void release() {
   super.release();
   this.enabled = "true";
   this.targetId = null;
 }