comparison flys-client/src/main/java/de/intevation/flys/client/client/ui/ImgLink.java @ 2391:3c8ae5605a51

Picked rev 4059,4071,4072,4073 from trunk. flys-client/tags/2.6.1@4079 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Fri, 17 Feb 2012 11:33:03 +0000
parents 0d3d3860beb5
children 8d27d2d33d70
comparison
equal deleted inserted replaced
2390:39955a31f090 2391:3c8ae5605a51
1 package de.intevation.flys.client.client.ui; 1 package de.intevation.flys.client.client.ui;
2
3 import com.google.gwt.core.client.GWT;
2 4
3 import com.smartgwt.client.types.Overflow; 5 import com.smartgwt.client.types.Overflow;
4 import com.smartgwt.client.widgets.HTMLPane; 6 import com.smartgwt.client.widgets.HTMLPane;
5 7
6 8
7 public class ImgLink extends HTMLPane { 9 public class ImgLink extends HTMLPane {
8 10
11 private int width;
12 private int height;
13
14 private String href;
15 private String imgUrl;
16
17
9 public ImgLink(String imgUrl, String href, int width, int height) { 18 public ImgLink(String imgUrl, String href, int width, int height) {
10 super(); 19 super();
11 20
21 this.width = width;
22 this.height = height;
23 this.href = href;
24 this.imgUrl = imgUrl;
25
26 update();
27 }
28
29
30 protected void update() {
12 setContents("<a href='" + href + "'><img src='" + imgUrl + "'></a>"); 31 setContents("<a href='" + href + "'><img src='" + imgUrl + "'></a>");
13 setWidth(width); 32 setWidth(width);
14 setHeight(height); 33 setHeight(height);
15 setOverflow(Overflow.VISIBLE); 34 setOverflow(Overflow.VISIBLE);
16 } 35 }
36
37
38 public void setSource(String href) {
39 this.href = href;
40 update();
41 }
17 } 42 }

http://dive4elements.wald.intevation.org