LEONARDI Application Composer - 8.9.0.40 by W4 S.A.

leon.view.win.swing
Class LySwingFormKeyHandler

java.lang.Object
  extended by java.awt.event.KeyAdapter
      extended by leon.view.win.swing.LySwingFormKeyHandler
All Implemented Interfaces:
java.awt.event.KeyListener, java.util.EventListener

public class LySwingFormKeyHandler
extends java.awt.event.KeyAdapter

This class implments a key listener for swing form components. When enter is pressed, the form is validated. When escape is pressed, the form is canceled.


Field Summary
static java.lang.String __VERSION
           
static java.lang.String DEMAND_APPLY
          Demand identifiers for application.
static java.lang.String DEMAND_CANCEL
          Demand identifiers for cancelling.
static java.lang.String DEMAND_VALIDATE
          Demand identifiers for validation.
 
Constructor Summary
LySwingFormKeyHandler(LyActionTransmitter actionTransmitter)
          Class constructor of a handler object for the keys in a Swing form.
LySwingFormKeyHandler(LyActionTransmitter actionTransmitter, LyGetValueInterface valueInterface)
          Class constructor of a handler object for the keys in a Swing form.
 
Method Summary
 void actionPerformed(java.lang.String id)
          Invoked when an the button is pressed.
 void keyPressed(java.awt.event.KeyEvent e)
          Apply the correct action when a key event is generated.
 void keyReleased(java.awt.event.KeyEvent e)
          Apply the correct action when a key event is generated.
 void setIgnoreCtrlTab(boolean status)
          Indicates if the CTRL-TAB event should be notified.
 void setNotifyCancel(boolean status)
          Indicates if the CANCEL event should be notified.
 void setNotifyTab(boolean status)
          Indicates if the TAB event should be notified.
 void setNotifyValidate(boolean status)
          Indicates if the VALIDATE event should be notified.
 
Methods inherited from class java.awt.event.KeyAdapter
keyTyped
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

__VERSION

public static final java.lang.String __VERSION
See Also:
Constant Field Values

DEMAND_VALIDATE

public static java.lang.String DEMAND_VALIDATE
Demand identifiers for validation. Should be the same as LyFormController.DEMAND_VALIDATE.


DEMAND_APPLY

public static java.lang.String DEMAND_APPLY
Demand identifiers for application. Should be the same as LyFormController.DEMAND_APPLY.


DEMAND_CANCEL

public static java.lang.String DEMAND_CANCEL
Demand identifiers for cancelling. Should be the same as LyAreaController.DEMAND_CANCEL.

Constructor Detail

LySwingFormKeyHandler

public LySwingFormKeyHandler(LyActionTransmitter actionTransmitter)
Class constructor of a handler object for the keys in a Swing form.

Parameters:
actionTransmitter - an action transmitter that processes the key events of the form

LySwingFormKeyHandler

public LySwingFormKeyHandler(LyActionTransmitter actionTransmitter,
                             LyGetValueInterface valueInterface)
Class constructor of a handler object for the keys in a Swing form.

Parameters:
actionTransmitter - an action transmitter that processes the key events of the form
Method Detail

keyReleased

public void keyReleased(java.awt.event.KeyEvent e)
Apply the correct action when a key event is generated. The validation action is executed when the released key is Enter. The cancellation action is executed when the released key is Escape. The tab next action is executed when the released key is Tab.

Specified by:
keyReleased in interface java.awt.event.KeyListener
Overrides:
keyReleased in class java.awt.event.KeyAdapter
Parameters:
e - the key event with the event informations
See Also:
KeyListener.keyReleased(java.awt.event.KeyEvent)

keyPressed

public void keyPressed(java.awt.event.KeyEvent e)
Apply the correct action when a key event is generated. The tab previous action is executed when the pressed key is Tab and the shift key is down.

Specified by:
keyPressed in interface java.awt.event.KeyListener
Overrides:
keyPressed in class java.awt.event.KeyAdapter
Parameters:
e - the key event with the event informations
See Also:
KeyListener.keyPressed(java.awt.event.KeyEvent)

actionPerformed

public void actionPerformed(java.lang.String id)
Invoked when an the button is pressed.

Parameters:
id - source event id (DEMAND_VALIDATE or DEMAND_CANCEL)
See Also:
LyActionListener.actionPerformed(LyActionEvent)

setNotifyValidate

public void setNotifyValidate(boolean status)
Indicates if the VALIDATE event should be notified.

Parameters:
status - new validation status

setNotifyCancel

public void setNotifyCancel(boolean status)
Indicates if the CANCEL event should be notified.

Parameters:
status - new validation status

setNotifyTab

public void setNotifyTab(boolean status)
Indicates if the TAB event should be notified.

Parameters:
status - new validation status

setIgnoreCtrlTab

public void setIgnoreCtrlTab(boolean status)
Indicates if the CTRL-TAB event should be notified.

Parameters:
status - new validation status

(c) January 2013 - W4 S.A.

Website: W4 S.A., contact us: support@w4global.com