Class DomUtils

  • All Implemented Interfaces:
    com.google.gwt.user.client.ui.HasVisibility

    public class DomUtils
    extends com.google.gwt.user.client.ui.UIObject
    Created for a uniform implementation of HasEnabled, but will be useful in the future for other DOM related things.

    This is a subclass of UIObject to gain access to the useful setStyleName method of UIObject which is implemented as protected.

    • Nested Class Summary

      • Nested classes/interfaces inherited from class com.google.gwt.user.client.ui.UIObject

        com.google.gwt.user.client.ui.UIObject.DebugIdImpl, com.google.gwt.user.client.ui.UIObject.DebugIdImplEnabled
    • Field Summary

      • Fields inherited from class com.google.gwt.user.client.ui.UIObject

        DEBUG_ID_PREFIX
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static boolean isEnabled​(com.google.gwt.dom.client.Element element)
      Returns true if the element has the disabled attribute.
      static void setEnabled​(com.google.gwt.dom.client.Element element, boolean enabled)
      It's enough to just set the disabled attribute on the element, but we want to also add a "disabled" class so that we can style it.
      • Methods inherited from class com.google.gwt.user.client.ui.UIObject

        addStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getElement, getOffsetHeight, getOffsetWidth, getStyleElement, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, getTitle, isVisible, isVisible, onEnsureDebugId, removeStyleDependentName, removeStyleName, resolvePotentialElement, setElement, setElement, setHeight, setPixelSize, setSize, setStyleDependentName, setStyleName, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setTitle, setVisible, setVisible, setWidth, sinkBitlessEvent, sinkEvents, toString, unsinkEvents
    • Method Detail

      • setEnabled

        public static void setEnabled​(com.google.gwt.dom.client.Element element,
                                      boolean enabled)
        It's enough to just set the disabled attribute on the element, but we want to also add a "disabled" class so that we can style it.

        At some point we'll just be able to use .button:disabled, but that doesn't work in IE8-

      • isEnabled

        public static boolean isEnabled​(com.google.gwt.dom.client.Element element)
        Returns true if the element has the disabled attribute.