com.sybase.uep.bobclient.controls
Interface Control

All Known Implementing Classes:
AppLogsTable, Button, CellImage, CellLabel, CellTable, CheckBox, DateChoice, EmailAddressInput, GridLookupTable, HorizontalRuler, HyperLink, HyperLinkRichField, ImageControl, Label, ListFieldControl, MobileAppTable, NavigationBarField, NumericChoice, PasswordInput, PhoneEmailRichTextInput, PushLogsTable, RadioBox, RadioBoxGroup, RegionManager, RichTextInput, SelectBox, Spacer, TabLayoutManager, TableField, TextInput, ToolbarItem, TwoColumnLayout

public interface Control

This is the interface class for all the controls used in BOB Blackberry client.

All controls that goes in the LayoutManager needs to implement the Control class.

Any controls that is used to contain data such as TextInput, SelectBox, RadioBox, CheckBox, and etc. will also need to implement this interface.

The SubmitAction action loops through the list of controls on the screen and looks for the Control objects. Then it will call the Control#getName() and Control#getValue() method of each control to retrieve and set the value to send to the server for processing.

NOTE: You only need to implement the Control interface if you want to use your control in a SubmitAction action or if you want it included in a designer layout like the LayoutManager.

Otherwise, the control will be added to the end of an existing layout design.

If you wants to add your own custom control you can extend any existing control and overwrite the exposed methods, or you can create your own control and implement the Control interface to that control. If the control is a third party control you may have to place a sub-classing wrapper around the control that implements this interface. If this doesn’t work, then you will have to implement your own layout and screen manager that works with the control.

Author:
tdang
See Also:
LayoutManager, com.sybase.uep.bobclient.SubmitAction, Button, CheckBox, DateChoice, EmailAddressInput, HorizontalRuler, HyperLink, HyperLinkRichField, ImageControl, Label, ListFieldControl, NavigationBarField, NumericChoice, PasswordInput, PhoneEmailRichTextInput, RadioBox, RegionManager, RichTextInput, SelectBox, Spacer, TabLayoutManager, TableField, TextInput, TwoColumnLayout

Method Summary
 int getColSpan()
          Retrieves the column span for this control
 long getHorizontalAlignment()
          Retrieves the horizontal alignment of this control
 java.lang.String getName()
          Retrieves the key name for this control
 int getPreferredHeight()
          Retrieves the available layout height of this control
 int getPreferredWidth()
          Retrieves the available layout width of this control
 int getRowSpan()
          Retrieves the row span for this control
 java.lang.Object getValue()
          Retrieves the control value.
 long getVerticalAlignment()
          Retrieves the vertical alignment of this control
 void refresh()
          Refresh or redraws the control
 void setBackgroundColor(int bgcolor)
          Set the back ground color of this control
 void setColSpan(int colspan)
          Set the column span for this control.
 void setLayoutHeight(int height)
          Set the available layout height for this control
 void setLayoutWidth(int width)
          Set the available layout width for this control
 void setRowSpan(int rowspan)
          Set the row span for this control.
 

Method Detail

setLayoutWidth

void setLayoutWidth(int width)
Set the available layout width for this control

This is called by the LayoutManager to set the available width of this control.

Parameters:
width - int value of the available layout width
See Also:
LayoutManager

getPreferredWidth

int getPreferredWidth()
Retrieves the available layout width of this control

This is called by the LayoutManager to get the available width of this control.

Returns:
int value of the available layout width
See Also:
LayoutManager

setLayoutHeight

void setLayoutHeight(int height)
Set the available layout height for this control

This is called by the LayoutManager to set the available height of this control.

Parameters:
height - int value of the available layout height
See Also:
LayoutManager

getPreferredHeight

int getPreferredHeight()
Retrieves the available layout height of this control

This is called by the LayoutManager to get the available height of this control.

Returns:
int value of the available layout height
See Also:
LayoutManager

getName

java.lang.String getName()
Retrieves the key name for this control

This is called by the SubmitAction to get key name of this control.

Returns:
String value of the key name
See Also:
SubmitAction

getValue

java.lang.Object getValue()
Retrieves the control value. If the control is an input, then the value would be the text in the input.

This is called by the SubmitAction to get value set for this control.

Returns:
Object of the value set for this control
See Also:
SubmitAction

setColSpan

void setColSpan(int colspan)
Set the column span for this control.

Parameters:
colspan - int value of the column span

getColSpan

int getColSpan()
Retrieves the column span for this control

This is called by the LayoutManager to get the column span of this control.

Returns:
int value of the column span
See Also:
LayoutManager

setRowSpan

void setRowSpan(int rowspan)
Set the row span for this control.

Parameters:
rowspan - int value of the row span

getRowSpan

int getRowSpan()
Retrieves the row span for this control

This is called by the LayoutManager to get the row span of this control.

Returns:
int value of the row span
See Also:
LayoutManager

getVerticalAlignment

long getVerticalAlignment()
Retrieves the vertical alignment of this control

This is called by the LayoutManager to get the vertical alignment of this control.

Returns:
long value of the vertical alignment Possible values could be Field.FIELD_TOP, Field.FIELD_BOTTOM, or Field.FIELD_VCENTER
See Also:
LayoutManager, Field

getHorizontalAlignment

long getHorizontalAlignment()
Retrieves the horizontal alignment of this control

This is called by the LayoutManager to get the horizontal alignment of this control.

Returns:
long value of the horizontal alignment. Possible values could be Field.FIELD_HCENTER, Field.FIELD_RIGHT, or Field.FIELD_LEFT
See Also:
LayoutManager, Field

refresh

void refresh()
Refresh or redraws the control

This is called by the LayoutManager to refresh the control.

See Also:
LayoutManager

setBackgroundColor

void setBackgroundColor(int bgcolor)
Set the back ground color of this control

This is called by the LayoutManager to set the background color of this control. If the layout is set to a specific back ground color, this background needs to set to it's controls to paint the same color as the layout's background. Also if there are alternating colors, then the LayoutManager will set each corresponding row with a different alternating back ground color.

Parameters:
bgcolor - int value of the color in HEX. For example: 0x00000000, 0x00FF0000, 0x00FFFFFF
See Also:
LayoutManager