Class KeyHandler

java.lang.Object
net.vincent.communidirect.KeyHandler
All Implemented Interfaces:
ActionListener, EventListener

public class KeyHandler extends Object implements ActionListener
Listens for action events on the Command text field (e.g. the user pressing Enter) and delegates to the command executor.
  • Constructor Details

    • KeyHandler

      public KeyHandler(CommuniDirect communiDirect)
      Creates a handler linked to the given application.
      Parameters:
      communiDirect - the main application instance
  • Method Details

    • actionPerformed

      public void actionPerformed(ActionEvent e)
      Invoked when the user submits a command. Extracts the text from the source Command field and executes it.
      Specified by:
      actionPerformed in interface ActionListener
      Parameters:
      e - the action event