|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.google.gwt.user.client.ui.UIObject
The base class for all user-interface objects. It simply wraps a DOM element,
and cannot receive events. Most interesting user-interface classes derive
from Widget
.
Field Summary |
Fields inherited from class java.lang.Object |
typeId, typeName |
Constructor Summary | |
UIObject()
|
Method Summary | |
void |
addStyleName(String style)
Adds a style name to the widget. |
int |
getAbsoluteLeft()
Gets the object's absolute left position in pixels, as measured from the browser window's client area. |
int |
getAbsoluteTop()
Gets the object's absolute top position in pixels, as measured from the browser window's client area. |
Element |
getElement()
Gets a handle to the object's underlying DOM element. |
int |
getOffsetHeight()
Gets the object's offset height in pixels. |
int |
getOffsetWidth()
Gets the object's offset width in pixels. |
String |
getStyleName()
Gets the style name associated with the object. |
boolean |
isVisible()
Determines whether or not this object is visible. |
static boolean |
isVisible(Element elem)
|
void |
removeStyleName(String style)
Removes a style name from the widget. |
protected void |
setElement(Element elem)
Sets this object's browser element. |
void |
setHeight(String height)
Sets the object's height. |
void |
setPixelSize(int width,
int height)
Sets the object's size, in pixels, not including decorations such as border, margin, and padding. |
void |
setSize(String width,
String height)
Sets the object's size. |
protected static void |
setStyleName(Element elem,
String style,
boolean add)
This convenience method implements allows one to easily add or remove the style name for any element. |
void |
setStyleName(String style)
Sets the object's style name, removing all other styles. |
void |
setVisible(boolean visible)
Sets whether this object is visible. |
static void |
setVisible(Element elem,
boolean visible)
|
void |
setWidth(String width)
Sets the object's width. |
void |
sinkEvents(int eventBitsToAdd)
Adds a set of events to be sunk by this object. |
String |
toString()
This method is overridden so that any object can be viewed in the debugger as an HTML snippet. |
void |
unsinkEvents(int eventBitsToRemove)
Removes a set of events from this object's event list. |
Methods inherited from class java.lang.Object |
equals, finalize, hashCode |
Constructor Detail |
public UIObject()
Method Detail |
public static boolean isVisible(Element elem)
public static void setVisible(Element elem, boolean visible)
protected static void setStyleName(Element elem, String style, boolean add)
UIObject
.
elem
- the element whose style is to be modifiedstyle
- the style name to be added or removedadd
- true
to add the given style, false
to remove itpublic void addStyleName(String style)
style
- the style name to be addedremoveStyleName(String)
public int getAbsoluteLeft()
public int getAbsoluteTop()
public Element getElement()
public int getOffsetHeight()
public int getOffsetWidth()
public String getStyleName()
setStyleName(com.google.gwt.user.client.Element, java.lang.String, boolean)
public boolean isVisible()
true
if the object is visiblepublic void removeStyleName(String style)
style
- the style name to be addedaddStyleName(String)
public void setHeight(String height)
height
- the object's new height, in CSS units (e.g. "10px", "1em")public void setPixelSize(int width, int height)
width
- the object's new width, in pixelsheight
- the object's new height, in pixelspublic void setSize(String width, String height)
width
- the object's new width, in CSS units (e.g. "10px", "1em")height
- the object's new height, in CSS units (e.g. "10px", "1em")public void setStyleName(String style)
The style name is the name referred to in CSS style rules (in HTML, this is
referred to as the element's "class"). By convention, style rules are of
the form [project]-[widget]
(e.g. the Button
widget's
style name is .gwt-Button
).
For example, if a widget's style name is myProject-MyWidget
,
then the style rule that applies to it will be
.myProject-MyWidget
. Note the "dot" prefix -- this is
necessary because calling this method sets the underlying element's
className
property.
An object may have any number of style names, which may be manipulated
using addStyleName(String)
and removeStyleName(String)
.
The attributes of all styles associated with the object will be applied to
it.
style
- the style name to be addedaddStyleName(String)
,
removeStyleName(String)
public void setVisible(boolean visible)
visible
- true
to show the object, false
to hide itpublic void setWidth(String width)
width
- the object's new width, in CSS units (e.g. "10px", "1em")public void sinkEvents(int eventBitsToAdd)
widgets
may actually receive events, but can receive events
from all objects contained within them.
eventBitsToAdd
- a bitfield representing the set of events to be added
to this element's event setEvent
public String toString()
public void unsinkEvents(int eventBitsToRemove)
eventBitsToRemove
- a bitfield representing the set of events to be
removed from this element's event setsinkEvents(int)
,
Event
protected void setElement(Element elem)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |