|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface za_UI_api_callbacks
Interface to ZAUIAPI. Anyone intending to use UIAPI would have to write a class that extends za_UI_api and implements za_UI_api_callbacks interface.
See an example below:
public class Navigation extends za_UI_api implements za_UI_api_callbacks
{
[...]
private Midlet midlet;
public Navigation(Midlet mid)
{
midlet = mid;
}
public void setNavigationDefinition()
{
startUIFontDefinition();
createFontDefinition(
"91001",
fMainMenuFonts
);
addUIElementDefinition(K_ZA_UI_ATTR_DEF_FINAL_FONT);
endUIFontDefinition();
[...]
}
public boolean runActionExecute(int ifocusedElementID, int keyPressed, int[] ivectFormElementsDefinition, int iElementIndex, boolean bIsTimer)
{
boolean bHandled = false;
if (bIsTimer == false)
{
//check which key was pressed
if (keyPressed == FIRE)
{
if (ifocusedElementID == 14006)
{
//do something here
bHandled = true;
}
else
if (ifocusedElementID == 14900)
{
//do something here
//and set bHandled to false so the default behavior will also take place
bHandled = false ;
} //end if
}
else
if (keyPressed == DOWN)
{
} //end if
}
else
{
//this is a TIMER TASK, so here would come the overriden behavior
} //end if
return bHandled;
}
}
za_UI_api| Method Summary | |
|---|---|
boolean |
runActionExecute(int ifocusedElementID,
int keyPressed,
int[] ivectFormElementsDefinition,
int iElementIndex,
boolean bIsTimer)
This method is called each time the midlet is notificated of a keypressed event. |
void |
setNavigationDefinition(boolean bDBFlagFound,
boolean bPostInit)
efThis method should be implemented by actual za_UI_api instantiation and should include any set of calls to procedures createUIFormDefinition, buttons etc and any other element for a kick start navigation definition This method is called twice: once before XML init, and the next call is after XML init. |
| Method Detail |
|---|
void setNavigationDefinition(boolean bDBFlagFound,
boolean bPostInit)
bDBFlagFound - bPostInit - za_UI_api
boolean runActionExecute(int ifocusedElementID,
int keyPressed,
int[] ivectFormElementsDefinition,
int iElementIndex,
boolean bIsTimer)
ifocusedElementID - the elementID of the element that was focused at the time of the kerypressed event generationkeyPressed - the actuall keypressed ID (UP, DOWN, LEFT, RIGHT, FIRE)ivectFormElementsDefinition - reference to the form elements definition for the form that contains the focused object being shown when the keypressed event was receivediElementIndex - index in the form element definition vector where the focused element definition starts.bIsTimer - boolean value indicating that the action was triggered by a timer rather than user interaction (i.e. other than keypressed)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||