|
GWT 2.7.0 | |||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectcom.google.gwt.user.client.ui.DirectionalTextHelper
public class DirectionalTextHelper
A helper class for displaying bidi (i.e. potentially opposite-direction) text or HTML in an element. Note: this class assumes that callers perform all their text/html and direction manipulations through it alone.
| Field Summary | |
|---|---|
static DirectionEstimator |
DEFAULT_DIRECTION_ESTIMATOR
A default direction estimator instance. |
| Constructor Summary | |
|---|---|
DirectionalTextHelper(Element element,
boolean isElementInline)
|
|
| Method Summary | |
|---|---|
DirectionEstimator |
getDirectionEstimator()
Returns the DirectionEstimator object. |
HasDirection.Direction |
getTextDirection()
|
java.lang.String |
getTextOrHtml(boolean isHtml)
Get the inner text or html of the element, taking the inner span wrap into consideration, if needed. |
void |
setDirection(HasDirection.Direction direction)
Deprecated. |
void |
setDirectionEstimator(boolean enabled)
See note at setDirectionEstimator(com.google.gwt.i18n.shared.DirectionEstimator). |
void |
setDirectionEstimator(DirectionEstimator directionEstimator)
Note: if the element already has non-empty content, this will update its direction according to the new estimator's result. |
void |
setTextOrHtml(java.lang.String content,
boolean isHtml)
Sets the element's content to the given value (either plain text or HTML). |
void |
setTextOrHtml(java.lang.String content,
HasDirection.Direction dir,
boolean isHtml)
Sets the element's content to the given value (either plain text or HTML), applying the given direction. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final DirectionEstimator DEFAULT_DIRECTION_ESTIMATOR
| Constructor Detail |
|---|
public DirectionalTextHelper(Element element,
boolean isElementInline)
element - The widget's element holding text.isElementInline - Whether the element is an inline element.| Method Detail |
|---|
public DirectionEstimator getDirectionEstimator()
HasDirectionEstimatorDirectionEstimator object.
getDirectionEstimator in interface HasDirectionEstimatorpublic HasDirection.Direction getTextDirection()
public java.lang.String getTextOrHtml(boolean isHtml)
isHtml - true to get the inner html, false to get the inner text
@Deprecated public void setDirection(HasDirection.Direction direction)
public void setDirectionEstimator(boolean enabled)
setDirectionEstimator(com.google.gwt.i18n.shared.DirectionEstimator).
setDirectionEstimator in interface HasDirectionEstimatorenabled - Whether to enable direction estimation. If true,
sets the DirectionEstimator object to a default
DirectionEstimator.public void setDirectionEstimator(DirectionEstimator directionEstimator)
setDirectionEstimator in interface HasDirectionEstimatordirectionEstimator - The DirectionEstimator to be set. null means turning off direction estimation.
public void setTextOrHtml(java.lang.String content,
boolean isHtml)
setTextOrHtml(String, Direction, boolean).
content - the element's new contentisHtml - whether the content is HTML
public void setTextOrHtml(java.lang.String content,
HasDirection.Direction dir,
boolean isHtml)
Implementation details:
BidiFormatter for more
details.
content - the element's new contentdir - the content's directionisHtml - whether the content is HTML
|
GWT 2.7.0 | |||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||