com.extjs.gxt.ui.client.widget.impl.PngImageImplIE6 Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of gxt Show documentation
Show all versions of gxt Show documentation
Rich Internet Application Framework for GWT
The newest version!
/*
* Sencha GXT 2.3.1 - Sencha for GWT
* Copyright(c) 2007-2013, Sencha, Inc.
* [email protected]
*
* http://www.sencha.com/products/gxt/license/
*/
package com.extjs.gxt.ui.client.widget.impl;
import com.extjs.gxt.ui.client.widget.PngImage;
import com.google.gwt.user.client.DOM;
import com.google.gwt.user.client.Element;
/**
* PNG support.
*
* Implementation adapted from GWT Widget Library
* (http://gwt-widget.sourceforge.net/).
*
*
*/
public class PngImageImplIE6 extends PngImageImpl {
private String url;
private boolean isPng;
public Element createElement(String url, int width, int height) {
this.url = url;
if (url.endsWith(".png") || url.endsWith(".PNG")) {
isPng = true;
} else {
isPng = false;
}
if (isPng) {
Element div = DOM.createDiv();
DOM.setInnerHTML(div, "");
return DOM.getFirstChild(div);
} else {
return super.createElement(url, width, height);
}
}
public String getUrl(PngImage image) {
if (isPng) {
return url;
} else {
return super.getUrl(image);
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy