View Javadoc

1   /*
2    * $Id$
3    *
4    * The contents of this file are subject to the Mozilla Public License 
5    * Version 1.1 (the "License"); you may not use this file except in 
6    * compliance with the License. You may obtain a copy of the License at 
7    * http://www.mozilla.org/MPL/ 
8    *
9    * Software distributed under the License is distributed on an "AS IS" basis, 
10   * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 
11   * for the specific language governing rights and limitations under the License.
12   *
13   * The Original Code is XML Hammer code. (org.xmlhammer.*)
14   *
15   * The Initial Developer of the Original Code is Edwin Dankert. Portions created 
16   * by the Initial Developer are Copyright (C) 2005 - 2006 the Initial Developer. 
17   * All Rights Reserved.
18   *
19   * Contributor(s): Edwin Dankert <edankert@gmail.com>
20   */
21  
22  package org.xmlhammer.gui.output;
23  
24  import java.awt.BorderLayout;
25  
26  import javax.swing.JScrollPane;
27  
28  import org.xmlhammer.gui.util.ConsolePane;
29  
30  /***
31   * Log Panel.
32   * 
33   * @version $Revision$, $Date$
34   * @author Edwin Dankert <edankert@gmail.com>
35   */
36  
37  public class ConsolePanel extends SearchablePanel {
38  
39  	private static final long serialVersionUID = -8240982226071212475L;
40      
41      private ConsolePane consolePane = null;
42  
43  	/***
44  	 * Constructs a new Input Panel.
45  	 */
46  	public ConsolePanel() {
47  		super( new BorderLayout());
48  		
49  		consolePane = new ConsolePane();
50          JScrollPane scrollPane = new JScrollPane(consolePane,
51                                    JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,
52                                    JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
53  		add( scrollPane, BorderLayout.CENTER);
54  	}
55  	
56      public boolean search(String search, boolean matchCase, boolean forward) {
57          return search(consolePane, search, matchCase, forward);
58      }
59  
60      public void start(Thread thread) {
61  		consolePane.start(thread);
62  	}
63  
64      public void stop(Thread thread) {
65          consolePane.stop(thread);
66      }
67  }