Class LabelBase<T>
- Type Parameters:
T- the value type
- All Implemented Interfaces:
HasAttachHandlers,HasHandlers,HasDirectionEstimator,EventListener,HasAutoHorizontalAlignment,HasHorizontalAlignment,HasVisibility,HasWordWrap,IsWidget
- Direct Known Subclasses:
Label,ValueLabel
Use in UiBinder Templates
-
Nested Class Summary
Nested classes/interfaces inherited from class com.google.gwt.user.client.ui.UIObject
UIObject.DebugIdImpl, UIObject.DebugIdImplEnabledNested classes/interfaces inherited from interface com.google.gwt.user.client.ui.HasHorizontalAlignment
HasHorizontalAlignment.AutoHorizontalAlignmentConstant, HasHorizontalAlignment.HorizontalAlignmentConstant -
Field Summary
FieldsModifier and TypeFieldDescription(package private) final DirectionalTextHelperThe widget's DirectionalTextHelper object.Fields inherited from class com.google.gwt.user.client.ui.Widget
eventsToSinkFields inherited from class com.google.gwt.user.client.ui.UIObject
DEBUG_ID_PREFIX, MISSING_ELEMENT_ERROR, SETELEMENT_TWICE_ERRORFields inherited from interface com.google.gwt.user.client.ui.HasAutoHorizontalAlignment
ALIGN_CONTENT_END, ALIGN_CONTENT_STARTFields inherited from interface com.google.gwt.user.client.ui.HasHorizontalAlignment
ALIGN_CENTER, ALIGN_DEFAULT, ALIGN_JUSTIFY, ALIGN_LEFT, ALIGN_LOCALE_END, ALIGN_LOCALE_START, ALIGN_RIGHT -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGets the horizontal auto-alignment setting.Returns theDirectionEstimatorobject.Gets the horizontal alignment.booleanGets whether word-wrapping is enabled.voidSets the horizontal alignment, allowing in addition to the "static"HasHorizontalAlignment.HorizontalAlignmentConstantvalues, the "automatic"HasHorizontalAlignment.AutoHorizontalAlignmentConstantvalues that depend on the content direction.voidsetDirectionEstimator(boolean enabled) Toggles on / off direction estimation.voidsetDirectionEstimator(DirectionEstimator directionEstimator) Sets theDirectionEstimatorobject.voidSets the horizontal alignment.voidsetWordWrap(boolean wrap) Sets whether word-wrapping is enabled.protected voidSets the horizontal alignment of the widget according to the current AutoHorizontalAlignment setting.Methods inherited from class com.google.gwt.user.client.ui.Widget
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, doAttachChildren, doDetachChildren, ensureHandlers, fireEvent, getHandlerCount, getHandlerManager, getLayoutData, getParent, isAttached, isOrWasAttached, onAttach, onBrowserEvent, onDetach, onLoad, onUnload, removeFromParent, replaceElement, setLayoutData, setParent, sinkEvents, unsinkEventsMethods 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, toString
-
Field Details
-
directionalTextHelper
The widget's DirectionalTextHelper object.
-
-
Constructor Details
-
LabelBase
protected LabelBase(boolean inline) -
LabelBase
-
-
Method Details
-
getAutoHorizontalAlignment
Description copied from interface:HasAutoHorizontalAlignmentGets the horizontal auto-alignment setting. This may be one of the auto-alignment values above that depend on content direction (e.g.HasAutoHorizontalAlignment.ALIGN_CONTENT_START), or one of the "static"HasHorizontalAlignment.HorizontalAlignmentConstantalignment values (e.g.HasHorizontalAlignment.ALIGN_LOCALE_START). It may be set by eithersetAutoHorizontalAlignmentorHasHorizontalAlignment#setHorizontalAlignment. The default is null, indicating that no specific horizontal alignment has been set, allowing it to be determined by the usual HTML and CSS mechanisms.- Specified by:
getAutoHorizontalAlignmentin interfaceHasAutoHorizontalAlignment- Returns:
- the current automatic horizontal alignment policy.
-
getDirectionEstimator
Description copied from interface:HasDirectionEstimatorReturns theDirectionEstimatorobject.- Specified by:
getDirectionEstimatorin interfaceHasDirectionEstimator
-
getHorizontalAlignment
Description copied from interface:HasHorizontalAlignmentGets the horizontal alignment.- Specified by:
getHorizontalAlignmentin interfaceHasHorizontalAlignment- Returns:
- the current horizontal alignment (
HasHorizontalAlignment.ALIGN_LEFT,HasHorizontalAlignment.ALIGN_CENTER,HasHorizontalAlignment.ALIGN_RIGHT,HasHorizontalAlignment.ALIGN_JUSTIFY, or null).
-
getWordWrap
public boolean getWordWrap()Description copied from interface:HasWordWrapGets whether word-wrapping is enabled.- Specified by:
getWordWrapin interfaceHasWordWrap- Returns:
trueif word-wrapping is enabled.
-
setAutoHorizontalAlignment
public void setAutoHorizontalAlignment(HasHorizontalAlignment.AutoHorizontalAlignmentConstant autoAlignment) Description copied from interface:HasAutoHorizontalAlignmentSets the horizontal alignment, allowing in addition to the "static"HasHorizontalAlignment.HorizontalAlignmentConstantvalues, the "automatic"HasHorizontalAlignment.AutoHorizontalAlignmentConstantvalues that depend on the content direction. Determines the values returned by bothHasAutoHorizontalAlignment.getAutoHorizontalAlignment()andHasHorizontalAlignment.getHorizontalAlignment().For the
ALIGN_CONTENT_STARTandALIGN_CONTENT_ENDvalues, sets the horizontal alignment (including the value ofHasHorizontalAlignment#getHorizontalAlignment()) to the start or end edge of the current content's direction, respectively, and continues to automatically update it whenever the content direction changes.For other values, operates like
HasHorizontalAlignment.setHorizontalAlignment(com.google.gwt.user.client.ui.HasHorizontalAlignment.HorizontalAlignmentConstant).For
null, the horizontal alignment is cleared, allowing it to be determined by the standard HTML mechanisms such as inheritance and CSS rules.- Specified by:
setAutoHorizontalAlignmentin interfaceHasAutoHorizontalAlignment- Parameters:
autoAlignment- the new automatic horizontal alignment policy- See Also:
-
setDirectionEstimator
public void setDirectionEstimator(boolean enabled) Toggles on / off direction estimation.See note at
setDirectionEstimator(DirectionEstimator).- Specified by:
setDirectionEstimatorin interfaceHasDirectionEstimator- Parameters:
enabled- Whether to enable direction estimation. Iftrue, sets theDirectionEstimatorobject to a defaultDirectionEstimator.
-
setHorizontalAlignment
Sets the horizontal alignment.Use
nullto clear horizontal alignment, allowing it to be determined by the standard HTML mechanisms such as inheritance and CSS rules.Note: A subsequent call to
setAutoHorizontalAlignment(com.google.gwt.user.client.ui.HasHorizontalAlignment.AutoHorizontalAlignmentConstant)may override the horizontal alignment set by this method.Note: For
null, the horizontal alignment is cleared, allowing it to be determined by the standard HTML mechanisms such as inheritance and CSS rules.- Specified by:
setHorizontalAlignmentin interfaceHasHorizontalAlignment- Parameters:
align- the horizontal alignment (HasHorizontalAlignment.ALIGN_LEFT,HasHorizontalAlignment.ALIGN_CENTER,HasHorizontalAlignment.ALIGN_RIGHT,HasHorizontalAlignment.ALIGN_JUSTIFY,HasHorizontalAlignment.ALIGN_LOCALE_START, orHasHorizontalAlignment.ALIGN_LOCALE_END).- See Also:
-
setWordWrap
public void setWordWrap(boolean wrap) Description copied from interface:HasWordWrapSets whether word-wrapping is enabled.- Specified by:
setWordWrapin interfaceHasWordWrap- Parameters:
wrap-trueto enable word-wrapping.
-
updateHorizontalAlignment
protected void updateHorizontalAlignment()Sets the horizontal alignment of the widget according to the current AutoHorizontalAlignment setting. Should be invoked whenever the horizontal alignment may be affected, i.e. on every modification of the content or its direction.
-