annotate gwt-client/src/main/java/org/dive4elements/river/client/client/ui/WikiImgLink.java @ 6233:a8613826bcac

Call update after setting the instance Also adds an override and changes the ambigousness of the variable name "flys"
author Andre Heinecke <aheinecke@intevation.de>
date Fri, 07 Jun 2013 13:06:20 +0200
parents bfbccad9c3f0
children a52a038a6a09
rev   line source
6231
bfbccad9c3f0 Subclass ImgLink with a new class WikiImgLink
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
1 /* Copyright (C) 2011, 2012, 2013 by Bundesanstalt für Gewässerkunde
bfbccad9c3f0 Subclass ImgLink with a new class WikiImgLink
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
2 * Software engineering by Intevation GmbH
bfbccad9c3f0 Subclass ImgLink with a new class WikiImgLink
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
3 *
bfbccad9c3f0 Subclass ImgLink with a new class WikiImgLink
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
4 * This file is Free Software under the GNU AGPL (>=v3)
bfbccad9c3f0 Subclass ImgLink with a new class WikiImgLink
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
5 * and comes with ABSOLUTELY NO WARRANTY! Check out the
bfbccad9c3f0 Subclass ImgLink with a new class WikiImgLink
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
6 * documentation coming with Dive4Elements River for details.
bfbccad9c3f0 Subclass ImgLink with a new class WikiImgLink
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
7 */
bfbccad9c3f0 Subclass ImgLink with a new class WikiImgLink
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
8
bfbccad9c3f0 Subclass ImgLink with a new class WikiImgLink
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
9 package org.dive4elements.river.client.client.ui;
bfbccad9c3f0 Subclass ImgLink with a new class WikiImgLink
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
10
bfbccad9c3f0 Subclass ImgLink with a new class WikiImgLink
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
11 import com.smartgwt.client.types.Overflow;
bfbccad9c3f0 Subclass ImgLink with a new class WikiImgLink
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
12
bfbccad9c3f0 Subclass ImgLink with a new class WikiImgLink
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
13 import org.dive4elements.river.client.client.FLYS;
bfbccad9c3f0 Subclass ImgLink with a new class WikiImgLink
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
14 import org.dive4elements.river.client.client.ui.WikiLinks;
bfbccad9c3f0 Subclass ImgLink with a new class WikiImgLink
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
15
bfbccad9c3f0 Subclass ImgLink with a new class WikiImgLink
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
16 public class WikiImgLink extends ImgLink {
bfbccad9c3f0 Subclass ImgLink with a new class WikiImgLink
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
17
6233
a8613826bcac Call update after setting the instance
Andre Heinecke <aheinecke@intevation.de>
parents: 6231
diff changeset
18 protected FLYS instance;
6231
bfbccad9c3f0 Subclass ImgLink with a new class WikiImgLink
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
19
6233
a8613826bcac Call update after setting the instance
Andre Heinecke <aheinecke@intevation.de>
parents: 6231
diff changeset
20 public WikiImgLink(String imgUrl, String href, int width, int height, FLYS instance) {
6231
bfbccad9c3f0 Subclass ImgLink with a new class WikiImgLink
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
21 super(imgUrl, href, width, height, false);
6233
a8613826bcac Call update after setting the instance
Andre Heinecke <aheinecke@intevation.de>
parents: 6231
diff changeset
22 this.instance = instance;
a8613826bcac Call update after setting the instance
Andre Heinecke <aheinecke@intevation.de>
parents: 6231
diff changeset
23 update();
6231
bfbccad9c3f0 Subclass ImgLink with a new class WikiImgLink
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
24 }
bfbccad9c3f0 Subclass ImgLink with a new class WikiImgLink
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
25
6233
a8613826bcac Call update after setting the instance
Andre Heinecke <aheinecke@intevation.de>
parents: 6231
diff changeset
26 @Override
6231
bfbccad9c3f0 Subclass ImgLink with a new class WikiImgLink
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
27 protected void update() {
6233
a8613826bcac Call update after setting the instance
Andre Heinecke <aheinecke@intevation.de>
parents: 6231
diff changeset
28 setContents(WikiLinks.imageLinkHTML(instance, href, imgUrl));
6231
bfbccad9c3f0 Subclass ImgLink with a new class WikiImgLink
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
29 setWidth(width);
bfbccad9c3f0 Subclass ImgLink with a new class WikiImgLink
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
30 setHeight(height);
bfbccad9c3f0 Subclass ImgLink with a new class WikiImgLink
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
31 setOverflow(Overflow.VISIBLE);
bfbccad9c3f0 Subclass ImgLink with a new class WikiImgLink
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
32 }
bfbccad9c3f0 Subclass ImgLink with a new class WikiImgLink
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
33 }

http://dive4elements.wald.intevation.org