import com.google.gwt.user.client.ui.Widget;
import com.itmill.toolkit.terminal.gwt.client.ui.Icon;
-//TODO Move styles to CSS
public class ICaption extends HTML {
public static final String CLASSNAME = "i-caption";
setStyleName(CLASSNAME);
sinkEvents(ITooltip.TOOLTIP_EVENTS);
- DOM.setStyleAttribute(getElement(), "whiteSpace", "nowrap");
-
}
/**
if (uidl.hasAttribute(ATTRIBUTE_ICON)) {
if (icon == null) {
icon = new Icon(client);
+ icon.setWidth("0px");
+ icon.setHeight("0px");
DOM.sinkEvents(icon.getElement(), Event.ONLOAD);
DOM.insertChild(getElement(), icon.getElement(),
if (DOM.eventGetType(event) == Event.ONLOAD
&& icon.getElement() == target && !iconOnloadHandled) {
+ icon.setWidth("");
+ icon.setHeight("");
+
/*
* IE6 pngFix causes two onload events to be fired and we want to
* react only to the first one
public int getHeight() {
int height = clearElement.getOffsetTop() - getElement().getOffsetTop();
- if (icon != null) {
- int iconHeight = icon.getOffsetHeight();
- ApplicationConnection.getConsole().log(
- "Caption height: " + height + ", icon height: "
- + iconHeight);
- }
-
return height;
}