amber.server.component
Class MenuItemHandler

java.lang.Object
  |
  +--java.awt.Component
        |
        +--amber.server.component.ComponentHandler
              |
              +--amber.server.component.MenuComponentHandler
                    |
                    +--amber.server.component.MenuItemHandler
All Implemented Interfaces:
ApplicationInterface, java.awt.image.ImageObserver, java.awt.ItemSelectable, java.awt.MenuContainer, java.io.Serializable
Direct Known Subclasses:
CheckboxMenuItemHandler, MenuHandler

public class MenuItemHandler
extends MenuComponentHandler
implements java.io.Serializable

This class corresponds to a standard java.awt.MenuItem component. It differs in terms of being Amber aware. For this reason the component communicates with the remote client to perform the standard operations.

Version:
1.0.0
Author:
Dr. David J. Knowles
See Also:
BaseComponent, Serialized Form

Inner classes inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent
 
Field Summary
protected  java.lang.String actionCommand
           
protected  boolean enabled
           
protected  java.lang.String label
           
 
Fields inherited from class amber.server.component.MenuComponentHandler
name, parent
 
Fields inherited from class amber.server.component.ComponentHandler
active, ApplicationId, CancelReturn, dataEncoder, DefaultTimeout, enabledState, encoderBytes, id, InvalidId, MaximumId, NoReturn, OkCancelType, OkReturn, OkType, OkYesReturn, parentPage, responsePackets, timeoutValue, UnchangeableInvalidId, visibleState, YesNoCancelType, YesNoType, YesReturn
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
MenuItemHandler()
           
MenuItemHandler(ApplicationInterface pageHandler)
          The initialising constructor.
MenuItemHandler(ApplicationInterface pageHandler, java.lang.String label)
          The initialising constructor.
MenuItemHandler(ApplicationInterface pageHandler, java.lang.String label, java.awt.MenuShortcut shortcut)
          The initialising constructor.
MenuItemHandler(int id, ApplicationInterface pageHandler)
          The initialising constructor.
MenuItemHandler(int id, ApplicationInterface pageHandler, java.lang.String label)
          The initialising constructor.
MenuItemHandler(int id, ApplicationInterface pageHandler, java.lang.String label, java.awt.MenuShortcut shortcut)
          The initialising constructor.
 
Method Summary
 void deleteShortcut()
          Delete any MenuShortcut object associated with this menu item.
 java.lang.String getLabel()
          Gets the label for this menu item.
 java.lang.String getPanelType()
          This function returns the panel component to use with this class.
 java.awt.MenuShortcut getShortcut()
          Get the MenuShortcut object associated with this menu item,
protected  MenuItemHandler getShortcutMenuItem(java.awt.MenuShortcut s)
          This is a helper function which will return this object if the MenuShortcut matches.
 boolean isEnabled()
          Returns the enabled state of the enabled.
 java.lang.String paramString()
          Returns the parameter string representing the state of this menu item.
 void setEnabled(boolean state)
          Sets whether or not this menu item can be chosen.
 void setLabel(java.lang.String label)
          Sets the label for this menu item to the specified label.
 void setShortcut(java.awt.MenuShortcut s)
          Set the MenuShortcut object associated with this menu item.
 
Methods inherited from class amber.server.component.MenuComponentHandler
getId, getIdBaseOffset, getMenuParent, getName, getTopMenuParent, isMyId, removeIdBaseOffset, sendPacket, sendPacketAndBlock, setName, toString
 
Methods inherited from class amber.server.component.ComponentHandler
addActionListener, addComponentListener, addEventMask, addFocusListener, addItemListener, addKeyListener, addMouseListener, addMouseMotionListener, addNotify, addReceivedPacket, addTextListener, addWindowListener, booleanToInt, createDataInput, directPacket, displayMessageBox, fireWindowActivated, fireWindowClosed, fireWindowClosing, fireWindowDeactivated, fireWindowDeiconified, fireWindowEvent, fireWindowIconified, fireWindowOpened, forceComponentGetUrl, forceComponentGetUrl, forwardEventPacket, generateActionEvent, generateFocusEvent, generateItemEvent, generateKeyEvent, generateMouseEvent, getActionCommand, getBounds, getComponentStructure, getDefaultParameters, getEventMask, getFontCharacteristics, getFontCharacteristics, getFontCharacteristics, getFontCharacteristics, getFontStyle, getLocation, getLog, getModalObject, getParentApplication, getParentContainer, getParentServer, getResponsePacket, getSelectedObjects, getSize, getTimeout, getValidId, getX, getY, handleMessages, handlePacket, internalForwardPacket, internalGetBounds, intToBoolean, isActive, isApplicationActive, isComponentModal, isConnected, isVisible, processActionEvent, processComponentEvent, processCurrentPacket, processEvent, processFocusEvent, processItemEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processNormalResponse, processTextEvent, queryMessageBox, removeActionListener, removeComponentListener, removeEventMask, removeFocusListener, removeItemListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeNotify, removeTextListener, removeWindowListener, requestFocus, resetState, restart, sendPendingPackets, setActionCommand, setActive, setBackground, setComponentModal, setConnectedState, setCursor, setEventMask, setFont, setFont, setFontStyle, setForeground, setForegroundBackground, setId, setLog, setModalObject, setParentApplication, setParentContainer, setParentServer, setTimeout, setVisible, setX, setY, shutDown, shutDownClient, shutDownClient, start
 
Methods inherited from class java.awt.Component
action, add, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addPropertyChangeListener, addPropertyChangeListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, deliverEvent, disable, disableEvents, dispatchEvent, doLayout, enable, enable, enableEvents, enableInputMethods, firePropertyChange, getAccessibleContext, getAlignmentX, getAlignmentY, getBackground, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getInputContext, getInputMethodRequests, getListeners, getLocale, getLocation, getLocationOnScreen, getMaximumSize, getMinimumSize, getParent, getPeer, getPreferredSize, getSize, getToolkit, getTreeLock, getWidth, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, invalidate, isDisplayable, isDoubleBuffered, isFocusTraversable, isLightweight, isOpaque, isShowing, isValid, keyDown, keyUp, layout, list, list, list, list, list, locate, location, lostFocus, minimumSize, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paint, paintAll, postEvent, preferredSize, prepareImage, prepareImage, print, printAll, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, remove, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, reshape, resize, resize, setBounds, setBounds, setComponentOrientation, setDropTarget, setLocale, setLocation, setLocation, setSize, setSize, show, show, size, transferFocus, update, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

enabled

protected boolean enabled

label

protected java.lang.String label

actionCommand

protected java.lang.String actionCommand
Constructor Detail

MenuItemHandler

public MenuItemHandler()

MenuItemHandler

public MenuItemHandler(int id,
                       ApplicationInterface pageHandler)
The initialising constructor.
Parameters:
id - The int containing the id of the corresponding remote component residing on the browser.
pageHandler - The handle to the main ApplicationInterface which handles the functions of page overall.

MenuItemHandler

public MenuItemHandler(ApplicationInterface pageHandler)
The initialising constructor. This constructor dynamically requests a valid ID value from the ApplicationInterface.
Parameters:
pageHandler - The handle to the main ApplicationInterface which handles the functions of page overall. residing on the browser.

MenuItemHandler

public MenuItemHandler(ApplicationInterface pageHandler,
                       java.lang.String label)
The initialising constructor. This constructor dynamically requests a valid ID value from the ApplicationInterface.
Parameters:
pageHandler - The handle to the main ApplicationInterface which handles the functions of page overall. residing on the browser.
label - The label for this menu item.

MenuItemHandler

public MenuItemHandler(ApplicationInterface pageHandler,
                       java.lang.String label,
                       java.awt.MenuShortcut shortcut)
The initialising constructor. This constructor dynamically requests a valid ID value from the ApplicationInterface.
Parameters:
pageHandler - The handle to the main ApplicationInterface which handles the functions of page overall. residing on the browser.
label - The label for this menu item.
shorcut - The instance of MenuShortcut associated with this menu item.

MenuItemHandler

public MenuItemHandler(int id,
                       ApplicationInterface pageHandler,
                       java.lang.String label)
The initialising constructor.
Parameters:
id - The int containing the id of the corresponding remote component residing on the browser.
pageHandler - The handle to the main ApplicationInterface which handles the functions of page overall.
label - The label for this menu item.

MenuItemHandler

public MenuItemHandler(int id,
                       ApplicationInterface pageHandler,
                       java.lang.String label,
                       java.awt.MenuShortcut shortcut)
The initialising constructor.
Parameters:
id - The int containing the id of the corresponding remote component residing on the browser.
pageHandler - The handle to the main ApplicationInterface which handles the functions of page overall.
label - The label for this menu item.
shorcut - The instance of MenuShortcut associated with this menu item.
Method Detail

getLabel

public java.lang.String getLabel()
Gets the label for this menu item.
Returns:
the label of this menu item, or null if this menu item has no label.

setLabel

public void setLabel(java.lang.String label)
Sets the label for this menu item to the specified label.
Parameters:
label - The new label, or null for no label.

isEnabled

public boolean isEnabled()
Returns the enabled state of the enabled.
Overrides:
isEnabled in class ComponentHandler
Returns:
boolean containing the enabled state.

setEnabled

public void setEnabled(boolean state)
Sets whether or not this menu item can be chosen.
Overrides:
setEnabled in class ComponentHandler
Parameters:
state - boolean enabled state to set the menu item to.

getShortcut

public java.awt.MenuShortcut getShortcut()
Get the MenuShortcut object associated with this menu item,
Returns:
MenuShortcut containing the menu shortcut associated with this menu item or null if none has been specified.

setShortcut

public void setShortcut(java.awt.MenuShortcut s)
Set the MenuShortcut object associated with this menu item. If a menu shortcut is already associated with this menu item, it is replaced.
Parameters:
s - The menu shortcut to associate with this menu item.

deleteShortcut

public void deleteShortcut()
Delete any MenuShortcut object associated with this menu item.

getShortcutMenuItem

protected MenuItemHandler getShortcutMenuItem(java.awt.MenuShortcut s)
This is a helper function which will return this object if the MenuShortcut matches.
Parameters:
s - MenuShortcut which is to be matched.
Returns:
MenuItemHandler if this MenuShortcut matches or null.

paramString

public java.lang.String paramString()
Returns the parameter string representing the state of this menu item. This string is useful for debugging.
Overrides:
paramString in class MenuComponentHandler
Returns:
String which is the parameter string of this menu item.

getPanelType

public java.lang.String getPanelType()
This function returns the panel component to use with this class.
Overrides:
getPanelType in class MenuComponentHandler
Returns:
String containing the panel type to use.


Copyright © 2002 Clearfield Research Ltd. All Rights Reserved.