|
GWT 2.0.3 | ||||||||
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
com.google.gwt.user.client.ui.Widget
com.google.gwt.user.client.ui.Label
public class Label
A widget that contains arbitrary text, not interpreted as HTML. This widget uses a <div> element, causing it to be displayed with block layout.
public class HTMLExample implements EntryPoint {
public void onModuleLoad() {
// Create a Label and an HTML widget.
Label lbl = new Label("This is just text. It will not be interpreted "
+ "as .");
HTML html = new HTML(
"This is HTML. It will be interpreted as such if you specify "
+ "the asHTML flag.", true);
// Add them to the root panel.
VerticalPanel panel = new VerticalPanel();
panel.add(lbl);
panel.add(html);
RootPanel.get().add(panel);
}
}
Nested Class Summary |
---|
Nested classes/interfaces inherited from class com.google.gwt.user.client.ui.UIObject |
---|
UIObject.DebugIdImpl, UIObject.DebugIdImplEnabled |
Nested classes/interfaces inherited from interface com.google.gwt.user.client.ui.HasHorizontalAlignment |
---|
HasHorizontalAlignment.HorizontalAlignmentConstant |
Nested classes/interfaces inherited from interface com.google.gwt.i18n.client.HasDirection |
---|
HasDirection.Direction |
Field Summary |
---|
Fields inherited from class com.google.gwt.user.client.ui.UIObject |
---|
DEBUG_ID_PREFIX |
Fields inherited from interface com.google.gwt.user.client.ui.HasHorizontalAlignment |
---|
ALIGN_CENTER, ALIGN_DEFAULT, ALIGN_LEFT, ALIGN_RIGHT |
Constructor Summary | |
---|---|
|
Label()
Creates an empty label. |
protected |
Label(Element element)
This constructor may be used by subclasses to explicitly use an existing element. |
|
Label(java.lang.String text)
Creates a label with the specified text. |
|
Label(java.lang.String text,
boolean wordWrap)
Creates a label with the specified text. |
Methods inherited from class com.google.gwt.user.client.ui.Widget |
---|
addDomHandler, addHandler, delegateEvent, doAttachChildren, doDetachChildren, fireEvent, getHandlerCount, getLayoutData, getParent, isAttached, isOrWasAttached, onAttach, onBrowserEvent, onDetach, onLoad, onUnload, removeFromParent, setLayoutData, sinkEvents |
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, setElement, setElement, setHeight, setPixelSize, setSize, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setTitle, setVisible, setVisible, setWidth, toString, unsinkEvents |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface com.google.gwt.event.shared.HasHandlers |
---|
fireEvent |
Constructor Detail |
---|
public Label()
public Label(java.lang.String text)
text
- the new label's textpublic Label(java.lang.String text, boolean wordWrap)
text
- the new label's textwordWrap
- false
to disable word wrappingprotected Label(Element element)
element
- the element to be usedMethod Detail |
---|
public static Label wrap(Element element)
RootPanel.detachNow(Widget)
.
element
- the element to be wrappedpublic HandlerRegistration addClickHandler(ClickHandler handler)
HasClickHandlers
ClickEvent
handler.
addClickHandler
in interface HasClickHandlers
handler
- the click handler
HandlerRegistration
used to remove this handler@Deprecated public void addClickListener(ClickListener listener)
addClickHandler(com.google.gwt.event.dom.client.ClickHandler)
instead
SourcesClickEvents
addClickListener
in interface SourcesClickEvents
listener
- the listener interface to addpublic HandlerRegistration addMouseDownHandler(MouseDownHandler handler)
HasMouseDownHandlers
MouseDownEvent
handler.
addMouseDownHandler
in interface HasMouseDownHandlers
handler
- the mouse down handler
HandlerRegistration
used to remove this handler@Deprecated public void addMouseListener(MouseListener listener)
addMouseOverHandler(com.google.gwt.event.dom.client.MouseOverHandler)
addMouseMoveHandler(com.google.gwt.event.dom.client.MouseMoveHandler)
, addMouseDownHandler(com.google.gwt.event.dom.client.MouseDownHandler)
, addMouseUpHandler(com.google.gwt.event.dom.client.MouseUpHandler)
and addMouseOutHandler(com.google.gwt.event.dom.client.MouseOutHandler)
instead
SourcesMouseEvents
addMouseListener
in interface SourcesMouseEvents
listener
- the listener interface to addpublic HandlerRegistration addMouseMoveHandler(MouseMoveHandler handler)
HasMouseMoveHandlers
MouseMoveEvent
handler.
addMouseMoveHandler
in interface HasMouseMoveHandlers
handler
- the mouse move handler
HandlerRegistration
used to remove this handlerpublic HandlerRegistration addMouseOutHandler(MouseOutHandler handler)
HasMouseOutHandlers
MouseOutEvent
handler.
addMouseOutHandler
in interface HasMouseOutHandlers
handler
- the mouse out handler
HandlerRegistration
used to remove this handlerpublic HandlerRegistration addMouseOverHandler(MouseOverHandler handler)
HasMouseOverHandlers
MouseOverEvent
handler.
addMouseOverHandler
in interface HasMouseOverHandlers
handler
- the mouse over handler
HandlerRegistration
used to remove this handlerpublic HandlerRegistration addMouseUpHandler(MouseUpHandler handler)
HasMouseUpHandlers
MouseUpEvent
handler.
addMouseUpHandler
in interface HasMouseUpHandlers
handler
- the mouse up handler
HandlerRegistration
used to remove this handlerpublic HandlerRegistration addMouseWheelHandler(MouseWheelHandler handler)
HasMouseWheelHandlers
MouseWheelEvent
handler.
addMouseWheelHandler
in interface HasMouseWheelHandlers
handler
- the mouse wheel handler
HandlerRegistration
used to remove this handler@Deprecated public void addMouseWheelListener(MouseWheelListener listener)
addMouseWheelHandler(com.google.gwt.event.dom.client.MouseWheelHandler)
instead
public HasDirection.Direction getDirection()
HasDirection
getDirection
in interface HasDirection
RTL
if the directionality is right-to-left,
LTR
if the directionality is left-to-right, or
DEFAULT
if the directionality is not explicitly specifiedpublic HasHorizontalAlignment.HorizontalAlignmentConstant getHorizontalAlignment()
HasHorizontalAlignment
getHorizontalAlignment
in interface HasHorizontalAlignment
public java.lang.String getText()
HasText
getText
in interface HasText
public boolean getWordWrap()
HasWordWrap
getWordWrap
in interface HasWordWrap
true
if word-wrapping is enabled.@Deprecated public void removeClickListener(ClickListener listener)
HandlerRegistration.removeHandler()
method on
the object returned by addClickHandler(com.google.gwt.event.dom.client.ClickHandler)
instead
SourcesClickEvents
removeClickListener
in interface SourcesClickEvents
listener
- the listener interface to remove@Deprecated public void removeMouseListener(MouseListener listener)
HandlerRegistration.removeHandler()
method on the object returned by an add*Handler method instead
SourcesMouseEvents
removeMouseListener
in interface SourcesMouseEvents
listener
- the listener interface to remove@Deprecated public void removeMouseWheelListener(MouseWheelListener listener)
HandlerRegistration.removeHandler()
method on the object returned by addMouseWheelHandler(com.google.gwt.event.dom.client.MouseWheelHandler)
instead
public void setDirection(HasDirection.Direction direction)
HasDirection
setDirection
in interface HasDirection
direction
- RTL
if the directionality should be set to right-to-left,
LTR
if the directionality should be set to left-to-right
DEFAULT
if the directionality should not be explicitly setpublic void setHorizontalAlignment(HasHorizontalAlignment.HorizontalAlignmentConstant align)
HasHorizontalAlignment
setHorizontalAlignment
in interface HasHorizontalAlignment
align
- the horizontal alignment (
HasHorizontalAlignment.ALIGN_LEFT
,
HasHorizontalAlignment.ALIGN_CENTER
,
HasHorizontalAlignment.ALIGN_RIGHT
), or
HasHorizontalAlignment.ALIGN_DEFAULT
).public void setText(java.lang.String text)
HasText
setText
in interface HasText
text
- the object's new textpublic void setWordWrap(boolean wrap)
HasWordWrap
setWordWrap
in interface HasWordWrap
wrap
- true
to enable word-wrapping.
|
GWT 2.0.3 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |