Changeset 11416 in josm for trunk/src/org/openstreetmap/josm/gui/widgets/UrlLabel.java
- Timestamp:
- 2016-12-23T15:19:47+01:00 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/widgets/UrlLabel.java
r10604 r11416 74 74 75 75 protected final void refresh() { 76 if (url != null ) {76 if (url != null && !url.isEmpty()) { 77 77 setText("<html><a href=\""+url+"\">"+description+"</a></html>"); 78 78 setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); … … 86 86 87 87 /** 88 * Sets the URL to be visited if the user clicks on this URL label. If null, the89 * label turns into a normal label without hyperlink.88 * Sets the URL to be visited if the user clicks on this URL label. 89 * If null or empty, the label turns into a normal label without hyperlink. 90 90 * 91 91 * @param url the url. Can be null. … … 109 109 @Override 110 110 public void mouseClicked(MouseEvent e) { 111 if (SwingUtilities.isLeftMouseButton(e)) { 112 OpenBrowser.displayUrl(url); 113 } else if (SwingUtilities.isRightMouseButton(e)) { 114 ClipboardUtils.copyString(url); 111 if (url != null && !url.isEmpty()) { 112 if (SwingUtilities.isLeftMouseButton(e)) { 113 OpenBrowser.displayUrl(url); 114 } else if (SwingUtilities.isRightMouseButton(e)) { 115 ClipboardUtils.copyString(url); 116 } 115 117 } 116 118 }
Note:
See TracChangeset
for help on using the changeset viewer.