ingo@1343: package de.intevation.flys.client.client.ui; ingo@1343: ingo@1343: import com.smartgwt.client.types.Overflow; ingo@1343: import com.smartgwt.client.widgets.HTMLPane; ingo@1343: ingo@1343: ingo@1343: public class ImgLink extends HTMLPane { ingo@1343: ingo@2391: private int width; ingo@2391: private int height; ingo@2391: ingo@2391: private String href; ingo@2391: private String imgUrl; ingo@2391: ingo@2500: private boolean newTab; ingo@2500: ingo@2391: ingo@1343: public ImgLink(String imgUrl, String href, int width, int height) { ingo@1343: super(); ingo@1343: ingo@2391: this.width = width; ingo@2391: this.height = height; ingo@2391: this.href = href; ingo@2391: this.imgUrl = imgUrl; ingo@2500: this.newTab = false; ingo@2500: ingo@2500: update(); ingo@2500: } ingo@2500: ingo@2500: ingo@2500: public ImgLink(String imgUrl, String href, int w, int h, boolean newTab) { ingo@2500: this(imgUrl, href, w, h); ingo@2500: this.newTab = newTab; ingo@2391: ingo@2391: update(); ingo@2391: } ingo@2391: ingo@2391: ingo@2391: protected void update() { ingo@2500: String target = newTab ? "_blank" : "_self"; ingo@2500: ingo@2500: setContents(""); ingo@1343: setWidth(width); ingo@1343: setHeight(height); ingo@1343: setOverflow(Overflow.VISIBLE); ingo@1343: } ingo@2391: ingo@2391: ingo@2391: public void setSource(String href) { ingo@2391: this.href = href; ingo@2391: update(); ingo@2391: } ingo@1343: }