コード例 #1
0
 private String getExternalLink(final String url, final String label, final String css) {
   StringBuffer link = new StringBuffer();
   link.append("<a href=\"" + url + "\" ");
   if (css != null) {
     link.append("class=\"" + css + "\" ");
   }
   link.append(">");
   link.append(label);
   link.append("</a>");
   return link.toString();
 }
コード例 #2
0
  private String getLink(
      final String event,
      final String label,
      final String css,
      String defaultValue,
      String selectedValue,
      String tooltip) {
    String status = Utilities.escapeHTML(Utilities.filterOutHTMLTags(tooltip));

    StringBuffer link = new StringBuffer();
    defaultValue = defaultValue == null ? AbstractChip.FALSE : defaultValue;
    selectedValue = selectedValue == null ? AbstractChip.TRUE : selectedValue;
    link.append("<input type=\"hidden\" name=\"" + event + "\" value=\"" + defaultValue + "\" />");
    link.append(
        "<a href=\"#\" onMouseover=\"window.status='"
            + status
            + "'; return true;\" onMouseout=\"window.status=''; return true;\" ");
    if (css != null) {
      link.append("class=\"" + css + "\" ");
    }
    link.append("hidefocus=\"true\" ");
    link.append(
        "onclick=\"document.editorForm.elements['"
            + event
            + "'].value='"
            + selectedValue
            + "';setScrollAndSubmit();return false;\">");
    link.append(label);
    link.append("</a>");
    return link.toString();
  }
コード例 #3
0
  private String getSimpleImageConfirmLink(
      final String event,
      final String label,
      final String image,
      String imageOver,
      String javascript) {
    String status = Utilities.escapeHTML(Utilities.filterOutHTMLTags(label));

    if ((imageOver == null) || imageOver.equals("")) {
      imageOver = image;
    }

    if ((javascript == null) || javascript.equals("")) {
      javascript = "true";
    }

    final String imageID = event + "_img";

    StringBuffer link = new StringBuffer();

    link.append("<input type=\"hidden\" name=\"")
        .append(event)
        .append("\" value=\"")
        .append(AbstractChip.FALSE)
        .append("\" />");
    link.append("<a href=\"#\" hidefocus=\"true\" style=\"text-decoration:none; \" alt=\"")
        .append(status)
        .append("\" title=\"")
        .append(status)
        .append("\"");
    link.append("onMouseover=\"window.status='")
        .append(status)
        .append("'; swapImage('")
        .append(imageID)
        .append("', '")
        .append(imageOver)
        .append("'); return true;\" ");
    link.append("onMouseout=\"window.status=''; swapImage('")
        .append(imageID)
        .append("', '")
        .append(image)
        .append("'); return true;\" ");
    link.append("onFocus=\"swapImage('")
        .append(imageID)
        .append("', '")
        .append(imageOver)
        .append("'); return true;\" ");
    link.append("onBlur=\"swapImage('")
        .append(imageID)
        .append("', '")
        .append(image)
        .append("'); return true;\" ");
    link.append("onclick=\"document.editorForm.elements['")
        .append(event)
        .append("'].value = ")
        .append(javascript)
        .append("; setScrollAndSubmit(); return false;\">");
    link.append("<img id=\"")
        .append(imageID)
        .append("\" src=\"")
        .append(image)
        .append("\" alt=\"")
        .append(status)
        .append("\">");
    link.append("</a>");

    return link.toString();
  }
コード例 #4
0
  private String getFooterButton(
      final String event,
      final String label,
      final String tooltip,
      final String image,
      String javascript,
      boolean showLabel,
      boolean isEnabled) {
    if ((javascript == null) || javascript.equals("")) {
      javascript = "true";
    }

    final String imageID = event + "_img";

    StringBuffer link = new StringBuffer();
    final String color = isEnabled ? "#333333" : "#999999";

    if (isEnabled) {
      link.append(
          "<input type=\"hidden\" name=\"" + event + "\" value=\"" + AbstractChip.FALSE + "\" />");
      link.append(
          "<a href=\"#\" hidefocus=\"true\" style=\"text-decoration:none; \" alt=\""
              + tooltip
              + "\" ");
      link.append(
          "onMouseover=\"window.status='"
              + tooltip
              + "'; "
              + " document.getElementById('"
              + imageID
              + "_bg_left').style.backgroundImage = 'url(images/icons/footer_background_hover_l.gif)'; "
              + " document.getElementById('"
              + imageID
              + "_bg_middle').style.backgroundImage = 'url(images/icons/footer_background_hover_m.gif)'; "
              + " document.getElementById('"
              + imageID
              + "_bg_right').style.backgroundImage = 'url(images/icons/footer_background_hover_r.gif)'; "
              + " return true;\" ");
      link.append(
          "onMouseout=\"window.status='';"
              + " document.getElementById('"
              + imageID
              + "_bg_left').style.backgroundImage = 'url(images/icons/footer_background_l.gif)'; "
              + " document.getElementById('"
              + imageID
              + "_bg_middle').style.backgroundImage = 'url(images/icons/footer_background_m.gif)'; "
              + " document.getElementById('"
              + imageID
              + "_bg_right').style.backgroundImage = 'url(images/icons/footer_background_r.gif)'; "
              + " return true;\" ");
      link.append(
          "onFocus=\"window.status='"
              + tooltip
              + "'; "
              + " document.getElementById('"
              + imageID
              + "_bg_left').style.backgroundImage = 'url(images/icons/footer_background_hover_l.gif)'; "
              + " document.getElementById('"
              + imageID
              + "_bg_middle').style.backgroundImage = 'url(images/icons/footer_background_hover_m.gif)'; "
              + " document.getElementById('"
              + imageID
              + "_bg_right').style.backgroundImage = 'url(images/icons/footer_background_hover_r.gif)'; "
              + " return true;\" ");
      link.append(
          "onBlur=\"window.status='';"
              + " document.getElementById('"
              + imageID
              + "_bg_left').style.backgroundImage = 'url(images/icons/footer_background_l.gif)'; "
              + " document.getElementById('"
              + imageID
              + "_bg_middle').style.backgroundImage = 'url(images/icons/footer_background_m.gif)'; "
              + " document.getElementById('"
              + imageID
              + "_bg_right').style.backgroundImage = 'url(images/icons/footer_background_r.gif)'; "
              + " return true;\" ");
      link.append(
          "onclick=\"document.editorForm.elements['"
              + event
              + "'].value = "
              + javascript
              + "; setScrollAndSubmit(); return false;\">");
    }

    link.append(
        "<table title=\""
            + tooltip
            + "\" style=\"vertical-align:middle; width:100%; height:23px;\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\">");
    link.append("<tr>");
    link.append(
        "<td id=\""
            + imageID
            + "_bg_left\" style=\"width:3px;\" background=\"images/icons/footer_background_l.gif\">&nbsp;</td>");
    link.append(
        "<td id=\""
            + imageID
            + "_bg_middle\" style=\"white-space:nowrap;vertical-align:middle;text-align:center;\" background=\"images/icons/footer_background_m.gif\">");

    link.append(
        "<img id=\"" + imageID + "\" style=\"vertical-align:middle\" src=\"" + image + "\">");
    if (showLabel) {
      link.append("<span style=\"padding-left:5px; color:" + color + "\">" + label + "</span>");
    }

    link.append("</td>");
    link.append(
        "<td id=\""
            + imageID
            + "_bg_right\" style=\"width:3px;\" background=\"images/icons/footer_background_r.gif\">&nbsp;</td>");
    link.append("</tr>");
    link.append("</table>");

    if (isEnabled) {
      link.append("</a>");
    }

    return link.toString();
  }