com.zasysdev.zamae
Interface za_UI_api_callbacks


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;
 
    }
 
 
 }
 

See Also:
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

setNavigationDefinition

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. You can know which call this is by evaluating the bPostInit parameter, it's true if this is the second call to setNavigationDefinition

Parameters:
bDBFlagFound -
bPostInit -
See Also:
za_UI_api

runActionExecute

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. This method allows for behavior extensions by the programmer who uses ZA_UI_API. You should place any needed code here, basing behavior on the parameters given by the interface in the method call.

Parameters:
ifocusedElementID - the elementID of the element that was focused at the time of the kerypressed event generation
keyPressed - 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 received
iElementIndex - 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)
Returns:
true if event was handled false if event was not handled