Mercurial > dive4elements > river
changeset 6231:bfbccad9c3f0
Subclass ImgLink with a new class WikiImgLink
author | Andre Heinecke <aheinecke@intevation.de> |
---|---|
date | Fri, 07 Jun 2013 11:49:03 +0200 |
parents | 954dbb0806f3 |
children | 175df4c01ae7 |
files | gwt-client/src/main/java/org/dive4elements/river/client/client/ui/ImgLink.java gwt-client/src/main/java/org/dive4elements/river/client/client/ui/WikiImgLink.java |
diffstat | 2 files changed, 36 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/ImgLink.java Fri Jun 07 11:47:47 2013 +0200 +++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/ImgLink.java Fri Jun 07 11:49:03 2013 +0200 @@ -14,13 +14,13 @@ public class ImgLink extends HTMLPane { - private int width; - private int height; + protected int width; + protected int height; - private String href; - private String imgUrl; + protected String href; + protected String imgUrl; - private boolean newTab; + protected boolean newTab; public ImgLink(String imgUrl, String href, int width, int height) {
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/WikiImgLink.java Fri Jun 07 11:49:03 2013 +0200 @@ -0,0 +1,31 @@ +/* Copyright (C) 2011, 2012, 2013 by Bundesanstalt für Gewässerkunde + * Software engineering by Intevation GmbH + * + * This file is Free Software under the GNU AGPL (>=v3) + * and comes with ABSOLUTELY NO WARRANTY! Check out the + * documentation coming with Dive4Elements River for details. + */ + +package org.dive4elements.river.client.client.ui; + +import com.smartgwt.client.types.Overflow; + +import org.dive4elements.river.client.client.FLYS; +import org.dive4elements.river.client.client.ui.WikiLinks; + +public class WikiImgLink extends ImgLink { + + protected FLYS flys; + + public WikiImgLink(String imgUrl, String href, int width, int height, FLYS flys) { + super(imgUrl, href, width, height, false); + this.flys = flys; + } + + protected void update() { + setContents(WikiLinks.imageLinkHTML(flys, href, imgUrl)); + setWidth(width); + setHeight(height); + setOverflow(Overflow.VISIBLE); + } +}