comparison flys-client/src/main/java/de/intevation/flys/client/client/ui/ImgLink.java @ 2500:69a498896c9c

Create a link to an online help page and put it in front of the input panels. flys-client/trunk@4336 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Thu, 03 May 2012 06:19:04 +0000
parents 8d27d2d33d70
children
comparison
equal deleted inserted replaced
2499:8f36d4b5890c 2500:69a498896c9c
10 private int height; 10 private int height;
11 11
12 private String href; 12 private String href;
13 private String imgUrl; 13 private String imgUrl;
14 14
15 private boolean newTab;
16
15 17
16 public ImgLink(String imgUrl, String href, int width, int height) { 18 public ImgLink(String imgUrl, String href, int width, int height) {
17 super(); 19 super();
18 20
19 this.width = width; 21 this.width = width;
20 this.height = height; 22 this.height = height;
21 this.href = href; 23 this.href = href;
22 this.imgUrl = imgUrl; 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;
23 34
24 update(); 35 update();
25 } 36 }
26 37
27 38
28 protected void update() { 39 protected void update() {
29 setContents("<a href='" + href + "'><img src='" + imgUrl + "'></a>"); 40 String target = newTab ? "_blank" : "_self";
41
42 setContents("<a target='" + target + "' href='" + href + "'><img src='" + imgUrl + "'></a>");
30 setWidth(width); 43 setWidth(width);
31 setHeight(height); 44 setHeight(height);
32 setOverflow(Overflow.VISIBLE); 45 setOverflow(Overflow.VISIBLE);
33 } 46 }
34 47

http://dive4elements.wald.intevation.org