|
|||||||||
| 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.DataController
net.rim.device.api.ui.component.table.TableController
public class TableController
A controller class for table components. Implementations of TableController should handle user input and programmatic requests by notifying the model of possible changes, e.g. updating the contents of a table row. It may also be necessary for the controller to modify the view directly, e.g. visual state changes such as focus. Each TableController must provide references to a DataModel and a DataView.
| Field Summary | ||
|---|---|---|
static int |
FIELD_FOCUS
A focus policy that ensures that Data Records (shaped by a Data Template) do not receive focus as a whole. |
|
static int |
REGION_FOCUS
A focus policy that ensures that Data Records (shaped by a Data Template) do not receive focus as a whole. |
|
static int |
ROW_FOCUS
A focus policy that ensures that only the Data Records (shaped by a Data Template) receive focus in the form of background focus that appears behind the area defined by the Data Template. |
|
| Constructor Summary | ||
|---|---|---|
TableController(AbstractTableModel model,
DataView view)
Create a TableController for the given model and view. |
||
TableController(AbstractTableModel model,
DataView view,
int focusPolicy)
Create a TableController for the given model and view. |
||
| Method Summary | ||
|---|---|---|
protected boolean |
keyChar(char ch,
int status,
int time)
Handles key generation events. |
|
void |
moveFocus(int x,
int y,
int status,
int time)
Moves focus to an exact position within this manager. |
|
protected boolean |
navigationMovement(int dx,
int dy,
int status,
int time)
Move the Table Field focus from one data template to the next one to be focused vertically. |
|
protected boolean |
navigationUnclick(int status,
int time)
handle the navigation unclick event by invoking the command handler if it is set. |
|
void |
setCommand(Command command)
Set the command that will be executed on navigation click and touch click events. |
|
void |
setCommand(CommandHandler commandHandler,
ReadOnlyCommandMetadata metadata,
Object context)
Deprecated. Use setCommand(Command command) and setCommandContext(Object commandContext) instead. |
|
void |
setCommandContext(Object commandContext)
Sets command context to use on navigation click and touch click events. |
|
void |
setFocusPolicy(int newFocusPolicy)
Sets the current focus policy of this Table object. |
|
protected boolean |
touchEvent(TouchEvent message)
Handles touch input events (see TouchEvent). |
|
| Methods inherited from class net.rim.device.api.ui.component.table.DataController |
|---|
getModel, getView, keyControl, keyDown, keyRepeat, keyStatus, keyUp, makeMenu, moveFocus, navigationClick, setModel, setView |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int FIELD_FOCUS
public static final int ROW_FOCUS
public static final int REGION_FOCUS
DataTemplate.createRegion(XYRect) or DataTemplate.createRegion(XYRect, RegionStyles).
| Constructor Detail |
|---|
public TableController(AbstractTableModel model,
DataView view)
model - the data model that contains the data that is displayed in the tableview - the view that displays the data in the model
public TableController(AbstractTableModel model,
DataView view,
int focusPolicy)
model - the data model that contains the data that is displayed in the tableview - the view that displays the data in the modelfocusPolicy - the focus policy that this TableController will follow.
Acceptable focusPolicy values are: TableController.FIELD_FOCUS,
TableController.ROW_FOCUS or TableController.REGION_FOCUS| Method Detail |
|---|
public void moveFocus(int x,
int y,
int status,
int time)
x - Distance from left edge of virtual region.y - Distance from top edge of virtual region.status - Trackwheel event modifiers.time - Number of milliseconds since the device was turned on.public void setFocusPolicy(int newFocusPolicy)
newFocusPolicy - Acceptable values are: TableController.FIELD_FOCUS,
TableController.ROW_FOCUS or TableController.REGION_FOCUSprotected boolean touchEvent(TouchEvent message)
TouchEvent).
The coordinates reflect the location of the touch event with respect to the top-left of this Manager.
The x, y coordinates are then further mapped to the top-left corner of the field with input.
touchEvent in class DataControllermessage - TouchEvent object containing various input parameters
including the event type and touch coordinates.
IllegalArgumentException - If message is null.
protected boolean keyChar(char ch,
int status,
int time)
Sends the event to the field with focus. If no field has the focus, this method does nothing and returns false.
keyChar in class DataControllerch - Character generated.status - Modifier key status.time - Number of milliseconds since the device was turned on.
true if event was consumed; otherwise, returns
false.
protected boolean navigationMovement(int dx,
int dy,
int status,
int time)
navigationMovement in class DataControllerdx - Magnitude of navigational motion: negative for a move left and
postive for a move right.dy - Magnitude of navigational motion: negative for an upwards move,
and positive for a downwards move.status - Bitfield of values defined by KeypadListener.time - Number of milliseconds since the device was turned on.
protected boolean navigationUnclick(int status,
int time)
navigationUnclick in class DataControllerstatus - Bitfield of values defined by KeypadListener.time - Number of milliseconds since the device was turned on.
public void setCommand(CommandHandler commandHandler,
ReadOnlyCommandMetadata metadata,
Object context)
command - the command to be executed.metadata - the metadata to be sent when the command is executedcontext - the context to be sent whent he command is executedpublic void setCommand(Command command)
Command Framework API.
command - Command to be executed.public void setCommandContext(Object commandContext)
commandContext - Command context to use when the Command instance is executed.
|
|||||||||
| 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