|
|||||||||
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
public abstract class DataController
A controller class for data components. Implementations of DataController 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 DataController must provide references to a DataModel and a DataView.
Constructor Summary | ||
---|---|---|
DataController(DataModel model,
DataView view)
Create a DataController for the given model and view. |
Method Summary | ||
---|---|---|
DataModel |
getModel()
Retrieve the model associated with this table component. |
|
DataView |
getView()
Retrieve the view associated with this table component. |
|
protected boolean |
keyChar(char ch,
int status,
int time)
Handles key generation events. |
|
protected boolean |
keyControl(char ch,
int status,
int time)
Sends key generation event to the controlled field with focus. |
|
protected boolean |
keyDown(int keyCode,
int time)
Sends key down event to the controlled field with focus. |
|
protected boolean |
keyRepeat(int keyCode,
int time)
Sends key repeat event to the field with focus. |
|
protected boolean |
keyStatus(int keyCode,
int time)
Sends key status event to the field with focus. |
|
protected boolean |
keyUp(int keyCode,
int time)
Sends key up event to the row with focus. |
|
void |
makeMenu(Menu menu,
int instance)
Called from SimpleTableManager#makeMenu to populate the menu. |
|
boolean |
moveFocus(int where)
Moves focus one or more visible screenfuls in a specific direction. |
|
protected boolean |
navigationClick(int status,
int time)
Invoked when the navigational action is selected. |
|
protected boolean |
navigationMovement(int dx,
int dy,
int status,
int time)
Invoked when a navigational motion occurs. |
|
protected boolean |
navigationUnclick(int status,
int time)
Invoked when the navigational action is released. |
|
void |
setModel(DataModel model)
Provide a reference to this table component's model. |
|
void |
setView(DataView view)
Provide a reference to this table component's view. |
|
protected boolean |
touchEvent(TouchEvent message)
Handle a touch event in the table field. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DataController(DataModel 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 modelMethod Detail |
---|
public DataModel getModel()
public DataView getView()
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.
ch
- 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 keyControl(char ch, int status, int time)
If no controlled field has the focus, this method does nothing and returns false.
ch
- Character generated.status
- Modifier key status.time
- Number of milliseconds since the device was turned on.
protected boolean keyDown(int keyCode, int time)
If no controlled field has the focus, this method does nothing and returns false.
keyCode
- Code of key pressed.time
- Number of milliseconds since the device was turned on.
protected boolean keyRepeat(int keyCode, int time)
If no field has the focus, this method does nothing and returns false.
keyCode
- Code of key pressed.time
- Number of milliseconds since the device was turned on.
true
if event was consumed; otherwise, returns
false
.protected boolean keyStatus(int keyCode, int time)
If no field has the focus, this method does nothing and returns false.
keyCode
- Code of key pressed.time
- Number of milliseconds since the device was turned on.
true
if event was consumed; otherwise, returns
false
.protected boolean keyUp(int keyCode, int time)
If no row has the focus, this method does nothing and returns false.
keyCode
- Code of key pressed.time
- Number of milliseconds since the device was turned on.
true
if event was consumed; otherwise, returns
false
.public void makeMenu(Menu menu, int instance)
SimpleTableManager#makeMenu
to populate the menu.
menu
- Menu to which items should be added.instance
- The instance of the desired menu. If your screen supports
only one menu, this may be ignored. By default, it is 0.public boolean moveFocus(int where)
where
- Combination of constant values to indicate in which
direction, and how much, the focus is to move.
protected boolean navigationClick(int status, int time)
status
- Bitfield of values defined by KeypadListener
.time
- Number of milliseconds since the device was turned on.
protected boolean navigationMovement(int dx, int dy, int status, int time)
dx
- 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)
status
- Bitfield of values defined by KeypadListener
.time
- Number of milliseconds since the device was turned on.
protected boolean touchEvent(TouchEvent message)
message
- the touch event that has occured
public void setModel(DataModel model)
model
- Reference to an instance of a DataModel implementation.public void setView(DataView view)
view
- Reference to an instance of a TableView implementation.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright 1999-2010 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Copyright 1993-2003 Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, California, 94303, U.S.A. All Rights Reserved.
Copyright 2002-2003 Nokia Corporation All Rights Reserved.
Java is a trademark of Sun Microsystems, Inc.