|
|||||||||
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.
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 interface com.google.gwt.user.client.ui.HasHorizontalAlignment |
---|
HasHorizontalAlignment.HorizontalAlignmentConstant |
Field Summary |
---|
Fields inherited from interface com.google.gwt.user.client.ui.HasHorizontalAlignment |
---|
ALIGN_CENTER, ALIGN_LEFT, ALIGN_RIGHT |
Constructor Summary | |
---|---|
Label()
Creates an empty label. |
|
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. |
Method Summary | |
---|---|
void |
addClickListener(ClickListener listener)
Adds a listener interface to receive click events. |
void |
addMouseListener(MouseListener listener)
Adds a listener interface to receive mouse events. |
void |
addMouseWheelListener(MouseWheelListener listener)
Adds a listener interface to receive mouse events. |
HasHorizontalAlignment.HorizontalAlignmentConstant |
getHorizontalAlignment()
Gets the horizontal alignment. |
java.lang.String |
getText()
Gets this object's text. |
boolean |
getWordWrap()
Gets whether word-wrapping is enabled. |
void |
onBrowserEvent(Event event)
Fired whenever a browser event is received. |
void |
removeClickListener(ClickListener listener)
Removes a previously added listener interface. |
void |
removeMouseListener(MouseListener listener)
Removes a previously added listener interface. |
void |
removeMouseWheelListener(MouseWheelListener listener)
Removes a previously added listener interface. |
void |
setHorizontalAlignment(HasHorizontalAlignment.HorizontalAlignmentConstant align)
Sets the horizontal alignment. |
void |
setText(java.lang.String text)
Sets this object's text. |
void |
setWordWrap(boolean wrap)
Sets whether word-wrapping is enabled. |
Methods inherited from class com.google.gwt.user.client.ui.Widget |
---|
doAttachChildren, doDetachChildren, getParent, isAttached, onAttach, onDetach, onLoad, onUnload, removeFromParent, setElement |
Methods inherited from class com.google.gwt.user.client.ui.UIObject |
---|
addStyleDependentName, addStyleName, getAbsoluteLeft, getAbsoluteTop, getElement, getOffsetHeight, getOffsetWidth, getStyleElement, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, getTitle, isVisible, isVisible, removeStyleDependentName, removeStyleName, setHeight, setPixelSize, setSize, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setTitle, setVisible, setVisible, setWidth, sinkEvents, toString, unsinkEvents |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
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 wrappingMethod Detail |
---|
public void addClickListener(ClickListener listener)
SourcesClickEvents
addClickListener
in interface SourcesClickEvents
listener
- the listener interface to addpublic void addMouseListener(MouseListener listener)
SourcesMouseEvents
addMouseListener
in interface SourcesMouseEvents
listener
- the listener interface to addpublic void addMouseWheelListener(MouseWheelListener listener)
SourcesMouseWheelEvents
addMouseWheelListener
in interface SourcesMouseWheelEvents
listener
- the listener interface to addpublic 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.public void onBrowserEvent(Event event)
EventListener
onBrowserEvent
in interface EventListener
onBrowserEvent
in class Widget
event
- the event receivedpublic void removeClickListener(ClickListener listener)
SourcesClickEvents
removeClickListener
in interface SourcesClickEvents
listener
- the listener interface to removepublic void removeMouseListener(MouseListener listener)
SourcesMouseEvents
removeMouseListener
in interface SourcesMouseEvents
listener
- the listener interface to removepublic void removeMouseWheelListener(MouseWheelListener listener)
SourcesMouseWheelEvents
removeMouseWheelListener
in interface SourcesMouseWheelEvents
listener
- the listener interface to removepublic void setHorizontalAlignment(HasHorizontalAlignment.HorizontalAlignmentConstant align)
HasHorizontalAlignment
setHorizontalAlignment
in interface HasHorizontalAlignment
align
- the horizontal alignment (
HasHorizontalAlignment.ALIGN_LEFT
,
HasHorizontalAlignment.ALIGN_CENTER
, or
HasHorizontalAlignment.ALIGN_RIGHT
).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.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |