com.sshtools.terminal.swing
Class SwingComponentTerminalComponentAdapter

java.lang.Object
  extended by com.sshtools.terminal.swing.SwingComponentTerminalComponentAdapter
All Implemented Interfaces:
VirtualSessionComponent

public class SwingComponentTerminalComponentAdapter
extends java.lang.Object
implements VirtualSessionComponent

Implementation of a VirtualSessionComponent that wraps a Swing component so it can be added to a VirtualSessionManagerUI.

This could be used for example to add a JLabel to a terminal displaying some text

AWTComponentTerminalComponentAdapter adapter = new AWTComponentTerminalComponentAdapter( new JLabel("Your are currently connected to foo.3sp.com")); terminal.addTerminalComponent(adapter, BorderLayout.NORTH, 0);

Author:
$Author: james $

Constructor Summary
SwingComponentTerminalComponentAdapter(javax.swing.JComponent component)
          Construct a new SwingComponentTerminalComponentAdapter given a Component to wrap
 
Method Summary
 java.awt.Component getComponent()
          Return the AWT / Swing component this terminal component provides.
 VirtualSessionManagerUI getTerminalDisplay()
          Return the TerminalDisplay this componet has been added to.
 void init(VirtualSessionManagerUI display)
          Invoked when the terminal adds the component to its UI.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SwingComponentTerminalComponentAdapter

public SwingComponentTerminalComponentAdapter(javax.swing.JComponent component)
Construct a new SwingComponentTerminalComponentAdapter given a Component to wrap

Parameters:
component -
Method Detail

init

public void init(VirtualSessionManagerUI display)
Description copied from interface: VirtualSessionComponent
Invoked when the terminal adds the component to its UI.

Specified by:
init in interface VirtualSessionComponent
Parameters:
display - display implementation

getTerminalDisplay

public VirtualSessionManagerUI getTerminalDisplay()
Description copied from interface: VirtualSessionComponent
Return the TerminalDisplay this componet has been added to. Before init(TerminalDisplay) is called this method should return null.

Specified by:
getTerminalDisplay in interface VirtualSessionComponent
Returns:
terminal display

getComponent

public java.awt.Component getComponent()
Description copied from interface: VirtualSessionComponent
Return the AWT / Swing component this terminal component provides. If the terminal component is not visual it will just return null

Specified by:
getComponent in interface VirtualSessionComponent
Returns:
component


Copyright © 2003-2009 SSHTOOLS LTD. All Rights Reserved.