Package weka.gui

Class SimpleCLIPanel

All Implemented Interfaces:
ActionListener, ImageObserver, MenuContainer, Serializable, EventListener, Accessible

public class SimpleCLIPanel extends JPanel implements ActionListener
Creates a very simple command line for invoking the main method of classes. System.out and System.err are redirected to an output area. Features a simple command history -- use up and down arrows to move through previous commmands. This gui uses only AWT (i.e. no Swing).
Version:
$Revision: 7059 $
Author:
Len Trigg (trigg@cs.waikato.ac.nz), FracPete (fracpete at waikato dot ac dot nz)
See Also:
  • Constructor Details

    • SimpleCLIPanel

      public SimpleCLIPanel() throws Exception
      Constructor.
      Throws:
      Exception - if an error occurs
  • Method Details

    • runCommand

      public void runCommand(String commands) throws Exception
      Executes a simple cli command.
      Parameters:
      commands - the command string
      Throws:
      Exception - if an error occurs
    • doHistory

      public void doHistory(KeyEvent e)
      Changes the currently displayed command line when certain keys are pressed. The up arrow moves back through history entries and the down arrow moves forward through history entries.
      Parameters:
      e - a value of type 'KeyEvent'
    • doCommandlineCompletion

      public void doCommandlineCompletion(KeyEvent e)
      performs commandline completion on packages and classnames.
      Parameters:
      e - a value of type 'KeyEvent'
    • actionPerformed

      public void actionPerformed(ActionEvent e)
      Only gets called when return is pressed in the input area, which starts the command running.
      Specified by:
      actionPerformed in interface ActionListener
      Parameters:
      e - a value of type 'ActionEvent'
    • main

      public static void main(String[] args) throws Exception
      Main method for testing this class.
      Parameters:
      args - commandline arguments - ignored
      Throws:
      Exception - if initialization fails