|
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.i18n.client.AutoDirectionHandler
public class AutoDirectionHandler
Utility class for handling auto-direction adjustment. This class is useful for automatically adjusting the direction of an object that takes text input, while the text is being entered.
| Nested Class Summary | |
|---|---|
static interface |
AutoDirectionHandler.Target
The interface an object must implement in order to add an AutoDirectionHandler to it. |
| Method Summary | |
|---|---|
static AutoDirectionHandler |
addTo(AutoDirectionHandler.Target target)
Operates like addTo(Target, DirectionEstimator), but always uses
a default DirectionEstimator, WordCountDirectionEstimator. |
static AutoDirectionHandler |
addTo(AutoDirectionHandler.Target target,
boolean enabled)
Operates like addTo(Target, DirectionEstimator), but uses a
default DirectionEstimator, WordCountDirectionEstimator if enabled,
or else a null DirectionEstimator, which means disabling direction
estimation. |
static AutoDirectionHandler |
addTo(AutoDirectionHandler.Target target,
DirectionEstimator directionEstimator)
Adds auto-direction adjustment to a given object: - Creates an AutoDirectionHandler. |
DirectionEstimator |
getDirectionEstimator()
Returns the DirectionEstimator object. |
void |
onKeyUp(KeyUpEvent event)
Automatically adjusts hasDirection's direction on KeyUpEvent events. |
void |
refreshDirection()
Adjusts target's direction according to the estimated direction of the text it supplies. |
void |
setDirectionEstimator(boolean enabled)
Toggles direction estimation on (using a default estimator) and off. |
void |
setDirectionEstimator(DirectionEstimator directionEstimator)
Sets the DirectionEstimator object. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static AutoDirectionHandler addTo(AutoDirectionHandler.Target target)
addTo(Target, DirectionEstimator), but always uses
a default DirectionEstimator, WordCountDirectionEstimator.
target - Object whose direction should be automatically adjusted on
relevant events.
public static AutoDirectionHandler addTo(AutoDirectionHandler.Target target,
boolean enabled)
addTo(Target, DirectionEstimator), but uses a
default DirectionEstimator, WordCountDirectionEstimator if enabled,
or else a null DirectionEstimator, which means disabling direction
estimation.
target - Object whose direction should be automatically adjusted on
relevant events.enabled - Whether the handler is enabled upon creation.
public static AutoDirectionHandler addTo(AutoDirectionHandler.Target target,
DirectionEstimator directionEstimator)
target - Object whose direction should be automatically adjusted on
relevant events.directionEstimator - A DirectionEstimator object used for direction
estimation (use null to disable direction estimation).
public DirectionEstimator getDirectionEstimator()
getDirectionEstimator in interface HasDirectionEstimatorpublic void onKeyUp(KeyUpEvent event)
onKeyUp in interface KeyUpHandlerevent - the KeyUpEvent that was firedpublic void refreshDirection()
public void setDirectionEstimator(boolean enabled)
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.
|
GWT 2.7.0 | |||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||