comparison flys-client/src/main/java/org/dive4elements/river/client/client/ui/ImgLink.java @ 5834:f507086aa94b

Repaired internal references.
author Sascha L. Teichmann <teichmann@intevation.de>
date Thu, 25 Apr 2013 12:31:32 +0200
parents flys-client/src/main/java/de/intevation/flys/client/client/ui/ImgLink.java@69a498896c9c
children 821a02bbfb4e
comparison
equal deleted inserted replaced
5833:a2bdc0f524e8 5834:f507086aa94b
1 package de.intevation.flys.client.client.ui;
2
3 import com.smartgwt.client.types.Overflow;
4 import com.smartgwt.client.widgets.HTMLPane;
5
6
7 public class ImgLink extends HTMLPane {
8
9 private int width;
10 private int height;
11
12 private String href;
13 private String imgUrl;
14
15 private boolean newTab;
16
17
18 public ImgLink(String imgUrl, String href, int width, int height) {
19 super();
20
21 this.width = width;
22 this.height = height;
23 this.href = href;
24 this.imgUrl = imgUrl;
25 this.newTab = false;
26
27 update();
28 }
29
30
31 public ImgLink(String imgUrl, String href, int w, int h, boolean newTab) {
32 this(imgUrl, href, w, h);
33 this.newTab = newTab;
34
35 update();
36 }
37
38
39 protected void update() {
40 String target = newTab ? "_blank" : "_self";
41
42 setContents("<a target='" + target + "' href='" + href + "'><img src='" + imgUrl + "'></a>");
43 setWidth(width);
44 setHeight(height);
45 setOverflow(Overflow.VISIBLE);
46 }
47
48
49 public void setSource(String href) {
50 this.href = href;
51 update();
52 }
53 }

http://dive4elements.wald.intevation.org