GWT - UIObject Class

Advertisements


Introduction

The class UIObject is the superclass for all user-interface objects. It simply wraps a DOM element, and cannot receive events. It provides direct child classes like Widget, MenuItem, MenuItemSeparator, TreeItem.

  • All UIObject objects can be styled using CSS.

  • Every UIObject has a primary style name that identifies the key CSS style rule that should always be applied to it.

  • More complex styling behavior can be achieved by manipulating an object's secondary style names.

Class declaration

Following is the declaration for com.google.gwt.user.client.ui.UIObject class:

public abstract class UIObject
   extends java.lang.Object

Field

Following are the fields for com.google.gwt.user.client.ui.UIObject class:

  • public static final java.lang.String DEBUG_ID_PREFIX -- The element ID that you specify will be prefixed by the static string DEBUG_ID_PREFIX.

Class constructors

S.N.Constructor & Description
1UIObject()
This creates a UIObject for the child classes.

Class methods

S.N.Method & Description
1void addStyleDependentName(java.lang.String styleSuffix)
Adds a dependent style name by specifying the style name's suffix.
2void addStyleName(java.lang.String style)
Adds a secondary or dependent style name to this object.
3static void ensureDebugId(Element elem, java.lang.String id)
Ensure that elem has an ID property set, which allows it to integrate with third-party libraries and test tools.
4protected static void ensureDebugId(Element elem, java.lang.String baseID, java.lang.String id)
Set the debug id of a specific element.
5ensureDebugId(java.lang.String id)
Ensure that the main Element for this UIObject has an ID property set, which allows it to integrate with third-party libraries and test tools.
6int getAbsoluteLeft()
Gets the object's absolute left position in pixels, as measured from the browser window's client area.
7int getAbsoluteTop()
Gets the object's absolute top position in pixels, as measured from the browser window's client area.
8Element getElement()
Gets a handle to the object's underlying DOM element.
9int getOffsetHeight()
Gets the object's offset height in pixels.
10int getOffsetWidth()
Gets the object's offset width in pixels.
11protected Element getStyleElement()
Template method that returns the element to which style names will be applied.
12java.lang.String getStyleName()
Gets all of the object's style names, as a space-separated list.
13protected static java.lang.String getStyleName(Element elem)
Gets all of the element's style names, as a space-separated list.
14java.lang.String getStylePrimaryName()
Gets the primary style name associated with the object.
15protected static java.lang.String getStylePrimaryName(Element elem)
Gets the element's primary style name.
16java.lang.String getTitle()
Gets the title associated with this object.
17boolean isVisible()
Determines whether or not this object is visible.
18static boolean isVisible(Element elem)
Determines whether element is visible or not.
19protected void onEnsureDebugId(java.lang.String baseID)
Called when the user sets the id using the ensureDebugId(String) method.
20void removeStyleDependentName(java.lang.String styleSuffix)
Removes a dependent style name by specifying the style name's suffix.
21void removeStyleName(java.lang.String style)
Removes a style name.
22protected void setElement(Element elem)
Sets this object's browser element.
23protected void setElement(Element elem)
Sets this object's browser element.
24void setHeight(java.lang.String height)
Sets the object's height.
25void setPixelSize(int width, int height)
Sets the object's size, in pixels, not including decorations such as border, margin, and padding.
26void setSize(java.lang.String width, java.lang.String height)
Sets the object's size.
27protected static void setStyleName(Element elem, java.lang.String styleName)
Clears all of the element's style names and sets it to the given style.
28protected static void setStyleName(Element elem, java.lang.String style, boolean add)
This convenience method adds or removes a style name for a given element.
29void setStyleName(java.lang.String style)
Clears all of the object's style names and sets it to the given style.
30protected static void setStylePrimaryName(Element elem, java.lang.String style)
Sets the element's primary style name and updates all dependent style names.
31void setStylePrimaryName(java.lang.String style)
Sets the object's primary style name and updates all dependent style names.
32void setTitle(java.lang.String title)
Sets the title associated with this object.
33void setVisible(boolean visible)
Sets whether this object is visible.
34static void setVisible(Element elem, boolean visible)
Sets whether this element is visible
35void setWidth(java.lang.String width)
Sets the object's width.
36java.lang.String toString()
This method is overridden so that any object can be viewed in the debugger as an HTML snippet.
37void unsinkEvents(int eventBitsToRemove)
Removes a set of events from this object's event list.

Methods inherited

This class inherits methods from the following classes:

  • java.lang.Object



Advertisements
Advertisements