Mercurial > dive4elements > river
changeset 1343:0d3d3860beb5
Added a ImgLink class which creates an html link with an image.
flys-client/trunk@2997 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Mon, 17 Oct 2011 17:28:24 +0000 |
parents | 9bf91bce6ca4 |
children | 51d4b51a51ed |
files | flys-client/ChangeLog flys-client/src/main/java/de/intevation/flys/client/client/ui/ExportPanel.java flys-client/src/main/java/de/intevation/flys/client/client/ui/ImgLink.java |
diffstat | 3 files changed, 28 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/flys-client/ChangeLog Mon Oct 17 15:37:24 2011 +0000 +++ b/flys-client/ChangeLog Mon Oct 17 17:28:24 2011 +0000 @@ -1,3 +1,11 @@ +2011-10-17 Ingo Weinzierl <ingo@intevation.de> + + * src/main/java/de/intevation/flys/client/client/ui/ImgLink.java: New. + This class creates a link with an image. + + * src/main/java/de/intevation/flys/client/client/ui/ExportPanel.java: + Makes use of ImgLink to create export icons. + 2011-10-17 Ingo Weinzierl <ingo@intevation.de> * src/main/java/de/intevation/flys/client/server/CollectionHelper.java:
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/ExportPanel.java Mon Oct 17 15:37:24 2011 +0000 +++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/ExportPanel.java Mon Oct 17 17:28:24 2011 +0000 @@ -89,12 +89,10 @@ String url = getExportUrl(name, facet); String iUrl = GWT.getHostPageBaseURL() + MSG.imageSave(); - HTMLPane pane = new HTMLPane(); - pane.setContents("<a href='" + url + "'><img src='" + iUrl + "'></a>"); - pane.setWidth(30); - pane.setTooltip(getTooltipText(name, facet)); + ImgLink link = new ImgLink(iUrl, url, 30, 30); + link.setTooltip(getTooltipText(name, facet)); - return pane; + return link; }
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/ImgLink.java Mon Oct 17 17:28:24 2011 +0000 @@ -0,0 +1,17 @@ +package de.intevation.flys.client.client.ui; + +import com.smartgwt.client.types.Overflow; +import com.smartgwt.client.widgets.HTMLPane; + + +public class ImgLink extends HTMLPane { + + public ImgLink(String imgUrl, String href, int width, int height) { + super(); + + setContents("<a href='" + href + "'><img src='" + imgUrl + "'></a>"); + setWidth(width); + setHeight(height); + setOverflow(Overflow.VISIBLE); + } +}