HasHorizontalAlignment abstract class
Characteristic interface which indicates that a widget can be aligned horizontally.
Use in UiBinder Templates
The names of the static members of {@link HorizontalAlignmentConstant}, as
well as simple alignment names (left
, center
,
right
, justify
), can be used as values for a
horizontalAlignment
attribute of any widget that implements this
interface. (In fact, this will work for any widget method that takes a single
HorizontalAlignmentConstant value.)
For example,
<g:Label horizontalAlignment='ALIGN_RIGHT'>Hi there.</g:Label> <g:Label horizontalAlignment='right'>Hi there.</g:Label>
abstract class HasHorizontalAlignment { /** * Specifies that the widget's contents should be aligned in the center. */ static const HorizontalAlignmentConstant ALIGN_CENTER = const HorizontalAlignmentConstant(TextAlign.CENTER); /** * Specifies that the widget's contents should be aligned as justify. */ static const HorizontalAlignmentConstant ALIGN_JUSTIFY = const HorizontalAlignmentConstant(TextAlign.JUSTIFY); /** * Specifies that the widget's contents should be aligned to the left. */ static const HorizontalAlignmentConstant ALIGN_LEFT = const HorizontalAlignmentConstant(TextAlign.LEFT); /** * Specifies that the widget's contents should be aligned to the right. */ static const HorizontalAlignmentConstant ALIGN_RIGHT = const HorizontalAlignmentConstant(TextAlign.RIGHT); /** * In a RTL layout, specifies that the widget's contents should be aligned to * the right. In a LTR layout, specifies that the widget's constants should be * aligned to the left. */ static const HorizontalAlignmentConstant ALIGN_LOCALE_START = HasHorizontalAlignment.ALIGN_LEFT; //LocaleInfo.getCurrentLocale().isRTL() ? HasHorizontalAlignment.ALIGN_RIGHT : HasHorizontalAlignment.ALIGN_LEFT; /** * In a RTL layout, specifies that the widget's contents should be aligned to * the left. In a LTR layout, specifies that the widget's constants should be * aligned to the right. */ static const HorizontalAlignmentConstant ALIGN_LOCALE_END = HasHorizontalAlignment.ALIGN_RIGHT ; //LocaleInfo.getCurrentLocale().isRTL() ? HasHorizontalAlignment.ALIGN_LEFT : HasHorizontalAlignment.ALIGN_RIGHT; /** * Synonym of {@link #ALIGN_LOCALE_START}. */ static const HorizontalAlignmentConstant ALIGN_DEFAULT = HasHorizontalAlignment.ALIGN_LOCALE_START; /** * Gets the horizontal alignment. * * @return the current horizontal alignment ( * {@link HasHorizontalAlignment#ALIGN_LEFT}, * {@link HasHorizontalAlignment#ALIGN_CENTER}, * {@link HasHorizontalAlignment#ALIGN_RIGHT}, * {@link HasHorizontalAlignment#ALIGN_JUSTIFY}, or * null). */ HorizontalAlignmentConstant getHorizontalAlignment(); /** * Sets the horizontal alignment. * <p> Use {@code null} to clear horizontal alignment, allowing it to be * determined by the standard HTML mechanisms such as inheritance and CSS * rules. * * @param align the horizontal alignment ( * {@link HasHorizontalAlignment#ALIGN_LEFT}, * {@link HasHorizontalAlignment#ALIGN_CENTER}, * {@link HasHorizontalAlignment#ALIGN_RIGHT}, * {@link HasHorizontalAlignment#ALIGN_JUSTIFY}, * {@link HasHorizontalAlignment#ALIGN_LOCALE_START}, or * {@link HasHorizontalAlignment#ALIGN_LOCALE_END}). */ void setHorizontalAlignment(HorizontalAlignmentConstant align); }
Subclasses
Anchor, HasAlignment, HasAutoHorizontalAlignment
Static Properties
const HorizontalAlignmentConstant ALIGN_CENTER #
Specifies that the widget's contents should be aligned in the center.
static const HorizontalAlignmentConstant ALIGN_CENTER = const HorizontalAlignmentConstant(TextAlign.CENTER)
const HorizontalAlignmentConstant ALIGN_DEFAULT #
Synonym of {@link #ALIGNLOCALESTART}.
static const HorizontalAlignmentConstant ALIGN_DEFAULT = HasHorizontalAlignment.ALIGN_LOCALE_START
const HorizontalAlignmentConstant ALIGN_JUSTIFY #
Specifies that the widget's contents should be aligned as justify.
static const HorizontalAlignmentConstant ALIGN_JUSTIFY = const HorizontalAlignmentConstant(TextAlign.JUSTIFY)
const HorizontalAlignmentConstant ALIGN_LEFT #
Specifies that the widget's contents should be aligned to the left.
static const HorizontalAlignmentConstant ALIGN_LEFT = const HorizontalAlignmentConstant(TextAlign.LEFT)
const HorizontalAlignmentConstant ALIGN_LOCALE_END #
In a RTL layout, specifies that the widget's contents should be aligned to the left. In a LTR layout, specifies that the widget's constants should be aligned to the right.
static const HorizontalAlignmentConstant ALIGN_LOCALE_END = HasHorizontalAlignment.ALIGN_RIGHT
const HorizontalAlignmentConstant ALIGN_LOCALE_START #
In a RTL layout, specifies that the widget's contents should be aligned to the right. In a LTR layout, specifies that the widget's constants should be aligned to the left.
static const HorizontalAlignmentConstant ALIGN_LOCALE_START = HasHorizontalAlignment.ALIGN_LEFT
const HorizontalAlignmentConstant ALIGN_RIGHT #
Specifies that the widget's contents should be aligned to the right.
static const HorizontalAlignmentConstant ALIGN_RIGHT = const HorizontalAlignmentConstant(TextAlign.RIGHT)
Methods
abstract HorizontalAlignmentConstant getHorizontalAlignment() #
Gets the horizontal alignment.
@return the current horizontal alignment (
{@link HasHorizontalAlignment#ALIGN_LEFT},
{@link HasHorizontalAlignment#ALIGN_CENTER},
{@link HasHorizontalAlignment#ALIGN_RIGHT},
{@link HasHorizontalAlignment#ALIGN_JUSTIFY}, or
null).
abstract void setHorizontalAlignment(HorizontalAlignmentConstant align) #
Sets the horizontal alignment. <p> Use {@code null} to clear horizontal alignment, allowing it to be determined by the standard HTML mechanisms such as inheritance and CSS rules.
@param align the horizontal alignment (
{@link HasHorizontalAlignment#ALIGN_LEFT},
{@link HasHorizontalAlignment#ALIGN_CENTER},
{@link HasHorizontalAlignment#ALIGN_RIGHT},
{@link HasHorizontalAlignment#ALIGN_JUSTIFY},
{@link HasHorizontalAlignment#ALIGN_LOCALE_START}, or
{@link HasHorizontalAlignment#ALIGN_LOCALE_END}).