com.sybase.uep.bobclient.controls
Class MenuAction

java.lang.Object
  extended by net.rim.device.api.ui.MenuItem
      extended by com.sybase.uep.bobclient.controls.MenuAction
All Implemented Interfaces:
java.lang.Runnable

public class MenuAction
extends net.rim.device.api.ui.MenuItem

Menu Action class to hold properties of a menu item

Author:
tdang

Field Summary
 
Fields inherited from class net.rim.device.api.ui.MenuItem
CANCEL_SELECT, CHANGE_OPTION, CLOSE, COPY, CUT, ORDINAL_COMPARATOR, PASTE, SAVE_CLOSE, SELECT
 
Constructor Summary
MenuAction(int resourceID, net.rim.device.api.ui.Field controlContext, ControlVariable variable, boolean showForTable)
          Constructor to create Menu Action object
MenuAction(int resourceID, IBOBAction action, net.rim.device.api.ui.Field controlContext, ControlVariable variable, boolean showForTable)
          Constructor to create Menu Action object
MenuAction(int resourceID, int ordinal, int priority, IBOBAction action, net.rim.device.api.ui.Field controlContext, boolean showForTable)
          Constructor to create Menu Action object
MenuAction(java.lang.String text, net.rim.device.api.ui.Field controlContext, ControlVariable variable, boolean showForTable)
          Constructor to create Menu Action object
MenuAction(java.lang.String text, IBOBAction action, net.rim.device.api.ui.Field controlContext, ControlVariable variable, boolean showForTable)
          Constructor to create Menu Action object
MenuAction(java.lang.String text, int ordinal, int priority, IBOBAction action, net.rim.device.api.ui.Field controlContext, boolean showForTable)
          Constructor to create Menu Action object
 
Method Summary
 java.lang.Runnable getAction()
          Get the Action assigned to this menu item
 net.rim.device.api.ui.Field getControlContext()
          Get the control that needs to be focus to show this menu
 java.lang.String getLabel()
          Get the label of this menu item
 boolean isActionNull()
          Check to see if the action is null
 boolean isDisable()
          Disable the menu action When disabled it will not appear in the menu list
 boolean isShowForTable()
          Returns whether this menu action should always show for table.
 void refresh()
          refresh
 void run()
          Run the action assigned to this menu action
 void setAction(IBOBAction action)
          Set the Action to this menu item
 void setDisable(boolean bol)
          Set the disable flag for this menu action
 void setLabel(java.lang.String label)
           
 
Methods inherited from class net.rim.device.api.ui.MenuItem
getBundle, getId, getOrdinal, getPrefab, getPriority, getTarget, isSeparator, separator, setOrdinal, setPriority, setText, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MenuAction

public MenuAction(java.lang.String text,
                  net.rim.device.api.ui.Field controlContext,
                  ControlVariable variable,
                  boolean showForTable)
Constructor to create Menu Action object

Parameters:
text - - The text to appear with the menu item
controlContext - - the control that will need to be in focus to show this menu
variable - - the control variable
showForTable - - whether always show the menu for the table

MenuAction

public MenuAction(int resourceID,
                  net.rim.device.api.ui.Field controlContext,
                  ControlVariable variable,
                  boolean showForTable)
Constructor to create Menu Action object

Parameters:
resourceID - - localization resource ID for the label
controlContext - - the control that will need to be in focus to show this menu
variable - - the control variable
showForTable - - whether always show the menu for the table

MenuAction

public MenuAction(java.lang.String text,
                  IBOBAction action,
                  net.rim.device.api.ui.Field controlContext,
                  ControlVariable variable,
                  boolean showForTable)
Constructor to create Menu Action object

Parameters:
text - - The text to appear with the menu item
action - - Action to perform when menu it clicked on
controlContext - - the control that will need to be in focus to show this menu
variable - - the control variable
showForTable - - whether always show the menu for the table

MenuAction

public MenuAction(int resourceID,
                  IBOBAction action,
                  net.rim.device.api.ui.Field controlContext,
                  ControlVariable variable,
                  boolean showForTable)
Constructor to create Menu Action object

Parameters:
resourceID - - localization resource ID for the label
action - - Action to perform when menu it clicked on
controlContext - - the control that will need to be in focus to show this menu
variable - - the control variable
showForTable - - whether always show the menu for the table

MenuAction

public MenuAction(java.lang.String text,
                  int ordinal,
                  int priority,
                  IBOBAction action,
                  net.rim.device.api.ui.Field controlContext,
                  boolean showForTable)
Constructor to create Menu Action object

Parameters:
text - - The text to appear with the menu item
ordinal - - Ordering parameter, lower values are placed closer to the top of the menu screen.
priority - - Priority of the menu item. A lower value indicates a higher priority, conversely a higher value indicates a lower priority
action - - Action to perform when menu it clicked on
controlContext - - the control that will need to be in focus to show this menu
showForTable - - whether always show the menu for the table

MenuAction

public MenuAction(int resourceID,
                  int ordinal,
                  int priority,
                  IBOBAction action,
                  net.rim.device.api.ui.Field controlContext,
                  boolean showForTable)
Constructor to create Menu Action object

Parameters:
resourceID - - localization resource ID for the label
ordinal - - Ordering parameter, lower values are placed closer to the top of the menu screen.
priority - - Priority of the menu item. A lower value indicates a higher priority, conversely a higher value indicates a lower priority
action - - Action to perform when menu it clicked on
controlContext - - the control that will need to be in focus to show this menu
showForTable - - whether always show the menu for the table
Method Detail

getLabel

public java.lang.String getLabel()
Get the label of this menu item

Returns:
String value of the label

getAction

public java.lang.Runnable getAction()
Get the Action assigned to this menu item

Returns:
The Action menu item

setAction

public void setAction(IBOBAction action)
Set the Action to this menu item

Parameters:
action - the action to set

isActionNull

public boolean isActionNull()
Check to see if the action is null

Returns:
True if the action is null

isDisable

public boolean isDisable()
Disable the menu action When disabled it will not appear in the menu list

Returns:
True if this menu action is disabled

setDisable

public void setDisable(boolean bol)
Set the disable flag for this menu action

Parameters:
bol - - If true set this menu action to not appear

getControlContext

public net.rim.device.api.ui.Field getControlContext()
Get the control that needs to be focus to show this menu

Returns:
Field control object

refresh

public void refresh()
refresh


setLabel

public void setLabel(java.lang.String label)

run

public void run()
Run the action assigned to this menu action


isShowForTable

public boolean isShowForTable()
Returns whether this menu action should always show for table.

Returns:
true if this menu action should always show for table and false otherwise.