@Deprecated
public void updateCaptionOffset(com.google.gwt.user.client.Element caption) {
Element captionWrap = caption.getParentElement();
Style captionWrapStyle = captionWrap.getStyle();
captionWrapStyle.clearPaddingTop();
captionWrapStyle.clearPaddingRight();
captionWrapStyle.clearPaddingBottom();
captionWrapStyle.clearPaddingLeft();
Style captionStyle = caption.getStyle();
captionStyle.clearMarginTop();
captionStyle.clearMarginRight();
captionStyle.clearMarginBottom();
captionStyle.clearMarginLeft();
// Get caption position from the classname
CaptionPosition captionPosition = getCaptionPositionFromElement(captionWrap);
if (captionPosition == CaptionPosition.LEFT
|| captionPosition == CaptionPosition.RIGHT) {
int captionWidth;
if (layoutManager != null) {
captionWidth = layoutManager.getOuterWidth(caption)
- layoutManager.getMarginWidth(caption);
} else {
captionWidth = caption.getOffsetWidth();
}
if (captionWidth > 0) {
if (captionPosition == CaptionPosition.LEFT) {
captionWrapStyle.setPaddingLeft(captionWidth, Unit.PX);
captionStyle.setMarginLeft(-captionWidth, Unit.PX);
} else {
captionWrapStyle.setPaddingRight(captionWidth, Unit.PX);
captionStyle.setMarginRight(-captionWidth, Unit.PX);
}
}
}
if (captionPosition == CaptionPosition.TOP
|| captionPosition == CaptionPosition.BOTTOM) {
int captionHeight;
if (layoutManager != null) {
captionHeight = layoutManager.getOuterHeight(caption)
- layoutManager.getMarginHeight(caption);
} else {
captionHeight = caption.getOffsetHeight();
}
if (captionHeight > 0) {
if (captionPosition == CaptionPosition.TOP) {
captionWrapStyle.setPaddingTop(captionHeight, Unit.PX);
captionStyle.setMarginTop(-captionHeight, Unit.PX);
} else {
captionWrapStyle.setPaddingBottom(captionHeight, Unit.PX);
captionStyle.setMarginBottom(-captionHeight, Unit.PX);
}
}
}
}