コード例 #1
0
  public String getViewDescription() {

    String d = super.getViewDescription();

    ResearchItem r = (ResearchItem) this.object;

    String url = r.getUrl();

    if ((url != null) && (url.trim().length() > 0)) {

      if (!url.toLowerCase().trim().startsWith("http://")) {

        url = "http://" + url;
      }

      // Add a space after the url to ensure that the markup code finds the "end".
      d = url + " <br /><br />" + d;
    }

    if (d == null) {

      d = "<i>No description.</i>";
    }

    return d;
  }
コード例 #2
0
  public void fillForEdit() {

    ResearchItem r = (ResearchItem) this.object;

    this.urlEdit.setText(r.getUrl());
  }