|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectnet.rim.device.api.ui.component.table.RegionStyles
public class RegionStyles
Container class for the region styles to be applied to a region.
| Field Summary | ||
|---|---|---|
static int |
ALIGN_BOTTOM
A vertical alignment behavior code indicating that the field in the region should be aligned to the bottom. |
|
static int |
ALIGN_CENTER
A horizontal alignment behavior code indicating that the field in the region should be aligned to the center. |
|
static int |
ALIGN_LEFT
A horizontal alignment behavior code indicating that the field in the region should be aligned to the left. |
|
static int |
ALIGN_MIDDLE
A vertical alignment behavior code indicating that the field in the region should be aligned to the middle. |
|
static int |
ALIGN_RIGHT
A horizontal alignment behavior code indicating that the field in the region should be aligned to the right. |
|
static int |
ALIGN_TOP
A vertical alignment behavior code indicating that the field in the region should be aligned to the top. |
|
static int |
BEHAVIOR_FONT
A behavior type that describes how the region obtains its font. |
|
static int |
BEHAVIOR_HALIGN
A behavior type that describes how the field in the region will be horizontally aligned. |
|
static int |
BEHAVIOR_LAYOUT
A behavior type that describes the layout of the field that will be housed in this region. |
|
static int |
BEHAVIOR_VALIGN
A behavior type that describes how the field in the region will be vertically aligned. |
|
static int |
FONT_FOLLOW_SPECIFIED
A font behavior code indicating that the region's font should be the one specified in the RegionStyles constructor or via the setFont() method. |
|
static int |
FONT_FOLLOW_THEME
A font behavior code indicating that the region's font should be specified by the current theme. |
|
static int |
FONT_FOLLOW_USER
A font behavior code indicating that the region's font should be specified by the current user-specified font. |
|
static int |
LAYOUT_DYNAMIC
A layout behavior code indicating that the field will need several re-layouts throughout its lifetime on screen. |
|
static int |
LAYOUT_STATIC
A layout behavior code indicating that the field will only need to be laid out once in the table. |
|
| Constructor Summary | ||
|---|---|---|
RegionStyles(Border border,
Font font,
XYEdges margin,
XYEdges padding,
int horizontalAlignment,
int verticalAlignment)
Creates an instance of a RegionStyles object that will later correspond to a Data Template region. |
||
| Method Summary | ||
|---|---|---|
int |
getBehavior(int behaviorType)
Gets the current setting of a particular behavior type for this region. |
|
Border |
getBorder()
Get the border that has been applied to this region. |
|
Font |
getFont()
Get the font that has been applied to this region. |
|
int |
getHorizontalAlignment()
A convenience method to get the horizontal alignment that has been applied to this region. |
|
XYEdges |
getMargin()
Get the margin that has been applied to this region. |
|
XYEdges |
getPadding()
Get the padding that has been applied to this region. |
|
int |
getVerticalAlignment()
A convenience method to get the vertical alignment that has been applied to this region. |
|
void |
setBehavior(int behaviorType,
int behavior)
Sets one of the behavior types for this region. |
|
void |
setBorder(Border border)
Set the border for this region. |
|
void |
setFont(Font font)
Specifies a font for this region. |
|
void |
setHorizontalAlignment(int horizontalAlignment)
A convenience method to set the horizontal alignment for this region. |
|
void |
setMargin(XYEdges margin)
Set the margin for this region. |
|
void |
setPadding(XYEdges padding)
Set the padding for this region. |
|
void |
setVerticalAlignment(int verticalAlignment)
A convenience method to set the vertical alignment for this region. |
|
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int BEHAVIOR_FONT
RegionStyles.FONT_FOLLOW_SPECIFIED,
RegionStyles.FONT_FOLLOW_THEME and RegionStyles.FONT_FOLLOW_USER.
public static final int BEHAVIOR_HALIGN
RegionStyles.ALIGN_LEFT,
RegionStyles.ALIGN_RIGHT and RegionStyles.ALIGN_CENTER.
public static final int BEHAVIOR_VALIGN
RegionStyles.ALIGN_TOP,
RegionStyles.ALIGN_BOTTOM and RegionStyles.ALIGN_MIDDLE.
public static final int BEHAVIOR_LAYOUT
LAYOUT_STATIC and LAYOUT_DYNAMIC.
public static final int LAYOUT_STATIC
RegionStyles.setBehavior(int,int).
public static final int LAYOUT_DYNAMIC
ChoiceField, where the shape of the choice box changes with each choice.
public static final int ALIGN_LEFT
public static final int ALIGN_RIGHT
public static final int ALIGN_CENTER
public static final int ALIGN_TOP
public static final int ALIGN_BOTTOM
public static final int ALIGN_MIDDLE
public static final int FONT_FOLLOW_THEME
public static final int FONT_FOLLOW_USER
public static final int FONT_FOLLOW_SPECIFIED
| Constructor Detail |
|---|
public RegionStyles(Border border,
Font font,
XYEdges margin,
XYEdges padding,
int horizontalAlignment,
int verticalAlignment)
border - A Border object that will describe a border around the region.
Setting this to null will trigger the application of the cell border settings from the currently active theme.font - The font that will be active in the region.
Setting this to null will the trigger the application of the cell font settings from the currently active theme.margin - The margin assignments for the region.padding - The padding assignments for the region.
Setting this to null will trigger the application of the cell padding settings from the currently active theme.horizontalAlignment - The horizontal alignment for the region.
Should be one of: RegionStyles.ALIGN_LEFT, RegionStyles.ALIGN_RIGHT, RegionStyles.ALIGN_CENTER
The default horizontalAlignment is RegionStyles.ALIGN_LEFTverticalAlignment - The vertical alignment for the region.
Should be one of: RegionStyles.ALIGN_TOP, RegionStyles.ALIGN_BOTTOM, RegionStyles.ALIGN_MIDDLE
The default verticalAlignment is RegionStyles.ALIGN_TOP| Method Detail |
|---|
public Border getBorder()
public void setBorder(Border border)
border - the new border for this regionpublic Font getFont()
public void setFont(Font font)
RegionStyles.FONT_FOLLOW_SPECIFIED
font - the new font for this region
public void setBehavior(int behaviorType,
int behavior)
behaviorType - An integer specifying the type of behavior being modified.behavior - An integer specifying the desired behavior code under the specified behavior type.
Note that currently there are three behavior types defined:RegionStyles.BEHAVIOR_FONT, BEHAVIOR_VALIGN, BEHAVIOR_HALIGN.
Under the RegionStyles.BEHAVIOR_FONT category, the following behaviors are defined: RegionStyles.FONT_FOLLOW_SPECIFIED,
RegionStyles.FONT_FOLLOW_THEME and RegionStyles.FONT_FOLLOW_USER.
Under the RegionStyles.BEHAVIOR_VALIGN category, the following behaviors are defined: RegionStyles.ALIGN_TOP, RegionStyles.ALIGN_BOTTOM, RegionStyles.ALIGN_MIDDLE.
Under the RegionStyles.BEHAVIOR_HALIGN category, the following behaviors are defined: RegionStyles.ALIGN_LEFT, RegionStyles.ALIGN_RIGHT, RegionStyles.ALIGN_CENTER.
If an invalid behavior type is defined, no action will be performed.
If an invalid behavior is defined, an IllegalArgumentException will be thrownpublic int getBehavior(int behaviorType)
behaviorType - An integer describing the type of behavior being modified.
RegionStyles.BEHAVIOR_FONT.
Under the RegionStyles.BEHAVIOR_FONT category, the following behaviors are defined: RegionStyles.FONT_FOLLOW_SPECIFIED,
RegionStyles.FONT_FOLLOW_THEME and RegionStyles.FONT_FOLLOW_USER.
If an invalid type is detected, a value of -1 will be returned.public int getHorizontalAlignment()
RegionStyles.getBehavior(int behaviorType)
public void setHorizontalAlignment(int horizontalAlignment)
RegionStyles.setBehavior(int behaviorType, int behavior)
horizontalAlignment - the new horizontal alignment for this region
IllegalArgumentException - if Horizontal Alignment is not one of the following:
RegionStyles.ALIGN_LEFT, RegionStyles.ALIGN_RIGHT, RegionStyles.ALIGN_CENTERpublic int getVerticalAlignment()
RegionStyles.getBehavior(int behaviorType)
public void setVerticalAlignment(int verticalAlignment)
RegionStyles.setBehavior(int behaviorType, int behavior)
verticalAlignment - the new vertical alignment for this region
IllegalArgumentException - if Horizontal Alignment is not one of the following:
RegionStyles.ALIGN_TOP, RegionStyles.ALIGN_BOTTOM, RegionStyles.ALIGN_MIDDLEpublic XYEdges getPadding()
public void setPadding(XYEdges padding)
padding - the new padding for this regionpublic XYEdges getMargin()
public void setMargin(XYEdges margin)
margin - the new margin for this region
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
Copyright 1999-2011 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Java is a trademark of Oracle America Inc. in the US and other countries.
Legal