View Javadoc

1   /*
2    *  File: ConsoleListener.java 
3    *  Copyright (c) 2004-2007  Peter Kliem (Peter.Kliem@jaret.de)
4    *  A commercial license is available, see http://www.jaret.de.
5    *
6    * All rights reserved. This program and the accompanying materials
7    * are made available under the terms of the Common Public License v1.0
8    * which accompanies this distribution, and is available at
9    * http://www.eclipse.org/legal/cpl-v10.html
10   */
11  package de.jaret.util.ui.console;
12  
13  /**
14   * Listener for listening to entered lines in a <code>ConsoleControl</code>.
15   * 
16   * @author Peter Kliem
17   */
18  public interface ConsoleListener {
19      /**
20       * Will be called whenever a line has been entered
21       * 
22       * @param consoleControl the calling ConsoleControl
23       * @param line the entered line
24       * @return a String or <code>null</code> acting as a result that will be displayed. If multiple listeners return
25       * messages these will be concatenated.
26       */
27      public String lineEntered(ConsoleControl consoleControl, String line);
28  }