Esempio n. 1
0
 public void setActive(boolean active) {
   IContext ctx = getContext();
   // if button is a input with no source this would be all
   String act = active ? "true" : null;
   ctx.setAttribute(getId(), "active", act);
   String btnsytlye = active ? "btn_cm_act" : "btn_cm";
   ctx.setAttribute(getId(), "class", btnsytlye);
   this.initJaveScript();
 }
Esempio n. 2
0
 public void setDisabled(boolean disabled) {
   IContext ctx = getContext();
   // if button is a input with no source this would be all
   String dis = disabled ? "true" : null;
   ctx.setAttribute(getId(), "disabled", dis);
   String btnsytlye = disabled ? "btn_cm_dis" : "btn_cm";
   String btnTextSytlye = disabled ? "btn_txt_dis" : "btn_txt";
   ctx.setAttribute(getId(), "class", btnsytlye);
   ctx.setAttribute(id4Text(), "class", btnTextSytlye);
   this.initJaveScript();
 }
  public String generateHTML(ITableColumn col, String cellId, int idxRow, int idxCol) {

    IContext ctx = col.getPage().getContext();
    String title = ctx.processValue(cellId + DOT_SPAN + ".title");
    String value = ctx.processValue(cellId + DOT_SPAN);

    String shortValue = ctx.processValue(cellId + DOT_SPAN);
    return "<span "
        + JSUtil.atId(cellId + DOT_SPAN)
        + " title=\""
        + title
        + "\">"
        + value
        + "</span>";
  }
  public void load(
      String cellId, Object data, ITableColumn col, IContext ctx, int idxRow, int idxCol) {
    String value = PropertyAccessor.retrieveString(data, col.getProperty());
    ctx.innerHtml(cellId + DOT_SPAN, value);

    if (StringUtils.isNotEmpty(propertyName)) {
      String tooltip = PropertyAccessor.retrieveString(data, propertyName);

      ctx.setAttribute(cellId, "title", tooltip);
      Tooltip tip = new Tooltip(tooltip);
      if (StringUtils.isNotEmpty(lineSeperator)) {
        tip.setShowBody(lineSeperator);
      }
      col.setTooltip(tip);
      tip.setTrackMouseMovement(true);
      String js =
          "jQuery(" + JSUtil.jQuery(cellId) + ").tooltip(" + tip.getJQueryParameter() + ");";
      ctx.sendJavaScript(cellId, js);
    }
  }
 public void clear(String cellId, ITableColumn col, IContext ctx, int idxRow, int idxCol) {
   ctx.innerHtml(cellId + DOT_SPAN, "");
 }