Ignore:
Timestamp:
2009-10-04T12:07:16+02:00 (15 years ago)
Author:
Gubaer
Message:

fixed #3650: Double-click on items in history dialog should open history
fixed #3649: History dialog does not show moved nodes
fixed #3383: changeset tags in history dialog (partial fix, there's now a link to the server page for browsing changesets)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/tools/UrlLabel.java

    r1169 r2243  
    1212public class UrlLabel extends JEditorPane implements HyperlinkListener {
    1313
    14     private final String url;
     14    private String url = "";
     15    private String description = "";
     16
     17    public UrlLabel() {
     18        addHyperlinkListener(this);
     19        setEditable(false);
     20        setOpaque(false);
     21    }
    1522
    1623    public UrlLabel(String url) {
     
    1926
    2027    public UrlLabel(String url, String description) {
    21         this.url = url;
     28        this();
     29        setUrl(url);
     30        setDescription(description);
     31        refresh();
     32    }
     33
     34    protected void refresh() {
    2235        setContentType("text/html");
    2336        setText("<html><a href=\""+url+"\">"+description+"</a></html>");
    2437        setToolTipText(url);
    25         setEditable(false);
    26         setOpaque(false);
    27         addHyperlinkListener(this);
    2838    }
    2939
     
    3343        }
    3444    }
     45
     46    public void setUrl(String url) {
     47        this.url = url == null ? "" : url;
     48        refresh();
     49    }
     50
     51    public void setDescription(String description) {
     52        this.description = description == null? "" : description;
     53        refresh();
     54    }
    3555}
Note: See TracChangeset for help on using the changeset viewer.