Class symantec.itools.awt.KeyPressManagerPanel
All Packages Class Hierarchy This Package Previous Next Index
Class symantec.itools.awt.KeyPressManagerPanel
Object
|
+----Component
|
+----Container
|
+----Panel
|
+----symantec.itools.awt.KeyPressManagerPanel
- public class KeyPressManagerPanel
- extends Panel
- implements Serializable
A Panel extension which provides for
tabbing between components and supporting certain key accelerations
by posting events provided by the user. Can be used directly or extended.
When extending be sure to super()
during construction and to super.handleEvent(evt) from
handleEvent if you override it.
The tab focus order is based on the order in which the components were
added to the panel. Each component receives
focus in turn, but the mouse cursor is not relocated. Look at the Project
window to see the tab order of components within the KeyPressManagerPanel.
You can change the tab order by moving the component names in the Project
window list, or by adding them to the panel in a different order in your
source code.
Components respond to default events when they receive focus. For example,
the TextField component displays text input from the keyboard, and the
Button component issues an action event when it is clicked.
Use KeyPressManagerPanel to create a panel whose elements can be tabbed
through, and specifically to:
- · Create a subcontainer that organizes container space within an Applet,
Frame or Dialog container. This simplifies your component layout task.
- · Hold other specialized Panel containers.
- Version:
- 1.1, July 18, 1997
- Author:
- Symantec
-
action
- Listens for an action and posts a default button action when triggered.
-
cancelButton
- The button to press when the Escape key is pressed.
-
defaultButton
- The button to press when the Enter/Return key is pressed.
-
key
- Listens for an key and if appropriate posts a default or cancel button action.
-
symantec.itools.awt.KeyPressManagerPanel()
- Constructs a Panel which handles key press events.
-
addImpl(Component, Object, int)
- Inserts a component into this container at the given position, and
adds it to the layout manager using the specified constraints object.
-
componentAdded(Component)
- Sets the tab stop if necessary, hooks up any listeners we need.
-
componentRemoved(Component)
- Utility routined automatically called before a component is removed from this panel.
-
consumeKeyTyped(KeyEvent)
- Internally called utility routine that handles ENTER and ESCAPE key processing.
-
handleTabEvent(KeyEvent)
- Internally called utility routine that handles TAB key processing.
-
remove(int)
- Removes the component at the specified zero-relative index from this
container.
-
removeAll()
- Removes all the components from this container.
-
removeCancelButton()
- Removes Escape key association with current Cancel button/event.
-
removeDefaultButton()
- Removes Enter/Return key association with current default
button/event.
-
resetKeyManager()
- Resets all KeyPressManager associations (default button, cancel
button, tab stop list).
-
sendAction(Button)
- This helper method sends an action event to the specified button.
-
setCancelButton(Button)
- Sets the button to press when the Escape key is pressed.
-
setCancelButton(Button, Event, Container, boolean)
-
-
setDefaultButton(Button)
- Sets the button to press when the Enter or Return key
is pressed.
-
setDefaultButton(Button, Event, Container, boolean)
-
action
protected symantec.itools.awt.KeyPressManagerPanel. A action
- Listens for an action and posts a default button action when triggered.
cancelButton
protected java.awt.Button cancelButton
- The button to press when the Escape key is pressed.
- See Also:
- setCancelButton
defaultButton
protected java.awt.Button defaultButton
- The button to press when the Enter/Return key is pressed.
- See Also:
- setDefaultButton
key
protected symantec.itools.awt.KeyPressManagerPanel. K key
- Listens for an key and if appropriate posts a default or cancel button action.
KeyPressManagerPanel
public KeyPressManagerPanel()
- Constructs a Panel which handles key press events.
By default, components added to this panel can be tabbed to. To change
this call method setAutoTabState() with false before adding components
that can't be tabbed to.
addImpl
protected void addImpl(Component component,
Object constraints,
int index)
- Inserts a component into this container at the given position, and
adds it to the layout manager using the specified constraints object.
This is a standard Java AWT method which is overridden to track
every add request to a container.
- Parameters:
- component - the component to add
- constraints - the positioning constraints for the layout manager
- index - the zero-relative index at which to add the component,
or -1 to append to the end
- Overrides:
- addImpl in class Container
- See Also:
- remove
componentAdded
protected void componentAdded(Component component)
- Sets the tab stop if necessary, hooks up any listeners we need.
Called when any component is added to the panel
- Parameters:
- component - component being added to the panel.
- See Also:
- componentRemoved
componentRemoved
protected void componentRemoved(Component component)
- Utility routined automatically called before a component is removed from this panel.
It removes this panel's key event listeners and, for TextFields,
action event listeners.
- Parameters:
- component - the component about to be removed from this panel
consumeKeyTyped
protected boolean consumeKeyTyped(KeyEvent evt)
- Internally called utility routine that handles ENTER and ESCAPE key processing.
- Parameters:
- evt - the key event
- Returns:
- true if an action event was sent to the default button
handleTabEvent
protected boolean handleTabEvent(KeyEvent evt)
- Internally called utility routine that handles TAB key processing.
- Parameters:
- evt - the key event
- Returns:
- true if an event was processed
remove
public void remove(int index)
- Removes the component at the specified zero-relative index from this
container.
This is a standard Java AWT method which gets called to remove a
component from a container. When this happens the component's
removeNotify() will also get called to indicate component removal.
- Parameters:
- index - the zero-relative index of the component to remove
- Overrides:
- remove in class Container
- See Also:
- removeAll, add
removeAll
public void removeAll()
- Removes all the components from this container.
This is a standard Java AWT method which gets called to remove all
the components from a container. When this happens each component's
removeNotify() will also get called to indicate component removal.
- Overrides:
- removeAll in class Container
- See Also:
- remove, add
removeCancelButton
public void removeCancelButton()
- Removes Escape key association with current Cancel button/event.
- See Also:
- setCancelButton
removeDefaultButton
public void removeDefaultButton()
- Removes Enter/Return key association with current default
button/event.
- See Also:
- setDefaultButton
resetKeyManager
public void resetKeyManager()
- Resets all KeyPressManager associations (default button, cancel
button, tab stop list).
sendAction
protected boolean sendAction(Button button)
- This helper method sends an action event to the specified button.
setCancelButton
public void setCancelButton(Button button)
- Sets the button to press when the Escape key is pressed.
- Parameters:
- button - the button to set as Cancel
- See Also:
- removeCancelButton
setCancelButton
public void setCancelButton(Button button,
Event evt,
Container deliverTo,
boolean bSetFocus)
- Note: setCancelButton() is deprecated.
CancelButton will be sent action and focus will be set.
-
- See Also:
- setCancelButton(java.awt.Button)
setDefaultButton
public void setDefaultButton(Button button)
- Sets the button to press when the Enter or Return key
is pressed.
- Parameters:
- button - the button to set as default
- See Also:
- removeDefaultButton
setDefaultButton
public void setDefaultButton(Button button,
Event evt,
Container deliverTo,
boolean bSetFocus)
- Note: setDefaultButton() is deprecated.
defaultButton will be sent action and focus will be set
-
- See Also:
- setDefaultButton(java.awt.Button)
All Packages Class Hierarchy This Package Previous Next Index