Save This Page
Home » j2ssh-0.2.9-src » com.sshtools.common.ui » [javadoc | source]
com.sshtools.common.ui
public class: SessionProviderFrame [javadoc | source]
java.lang.Object
   java.awt.Component
      java.awt.Container
         java.awt.Window
            java.awt.Frame
               javax.swing.JFrame
                  com.sshtools.common.ui.SshToolsApplicationFrame
                     com.sshtools.common.ui.SessionProviderFrame

All Implemented Interfaces:
    SessionManager, SshToolsApplicationContainer, Accessible, TransferHandler$HasGetTransferHandler, RootPaneContainer, WindowConstants, MenuContainer, ImageObserver, Serializable

This frame class embeds a SessionProvider and manages the connection on behalf of the caller. To invoke a session provider from an external application is a straight forward procedure. Assuming that the connection has already been established [see SshClient] you can invoke a frame using the following code:

// Create an SshClient connection
SshClient ssh = new SshClient();

// Connection code goes here - see SshClient for more details

SessionProviderFrame frame = new SessionProviderFrame(null,
new SshToolsConnectionProfile(),
ssh,
SessionProviderFactory.getInstance().getProvider("sshterm"));
frame.pack();
frame.show();
Fields inherited from com.sshtools.common.ui.SshToolsApplicationFrame:
PREF_LAST_FRAME_GEOMETRY,  log,  exitAction,  aboutAction,  newWindowAction,  toolSeparator
Fields inherited from javax.swing.JFrame:
EXIT_ON_CLOSE
Fields inherited from java.awt.Frame:
DEFAULT_CURSOR,  CROSSHAIR_CURSOR,  TEXT_CURSOR,  WAIT_CURSOR,  SW_RESIZE_CURSOR,  SE_RESIZE_CURSOR,  NW_RESIZE_CURSOR,  NE_RESIZE_CURSOR,  N_RESIZE_CURSOR,  S_RESIZE_CURSOR,  W_RESIZE_CURSOR,  E_RESIZE_CURSOR,  HAND_CURSOR,  MOVE_CURSOR,  NORMAL,  ICONIFIED,  MAXIMIZED_HORIZ,  MAXIMIZED_VERT,  MAXIMIZED_BOTH
Fields inherited from java.awt.Component:
TOP_ALIGNMENT,  CENTER_ALIGNMENT,  BOTTOM_ALIGNMENT,  LEFT_ALIGNMENT,  RIGHT_ALIGNMENT
Constructor:
 public SessionProviderFrame(SshToolsConnectionProfile profile,
    SshClient ssh,
    SessionProvider provider) throws IOException, SshToolsApplicationException 
    Construct a new Session Provider frame.
    Parameters:
    app - The SshToolsApplication instance, can be null
    profile - The profile of the connection
    ssh - the client connection
    provider - the provider instance
    Throws:
    IOException -
    SshToolsApplicationException -
Method from com.sshtools.common.ui.SessionProviderFrame Summary:
addEventHandler,   allowChannelOpen,   applyProfileChanges,   canExit,   exit,   getForwardingClient,   getProfile,   getRemoteEOL,   getServerId,   getSessionPanel,   initFrame,   isConnected,   openChannel,   openSession,   openSftpClient,   requestDisconnect,   sendGlobalRequest,   setDisconnectOnClose
Methods from com.sshtools.common.ui.SshToolsApplicationFrame:
closeContainer,   getApplication,   getApplicationPanel,   init,   isContainerVisible,   setContainerTitle,   setContainerVisible,   showAboutBox,   showExitAction,   showNewWindowAction
Methods from javax.swing.JFrame:
getAccessibleContext,   getContentPane,   getDefaultCloseOperation,   getGlassPane,   getGraphics,   getJMenuBar,   getLayeredPane,   getRootPane,   getTransferHandler,   isDefaultLookAndFeelDecorated,   remove,   repaint,   setContentPane,   setDefaultCloseOperation,   setDefaultLookAndFeelDecorated,   setGlassPane,   setIconImage,   setJMenuBar,   setLayeredPane,   setLayout,   setTransferHandler,   update
Methods from java.awt.Frame:
addNotify,   getAccessibleContext,   getCursorType,   getExtendedState,   getFrames,   getIconImage,   getMaximizedBounds,   getMenuBar,   getState,   getTitle,   isResizable,   isUndecorated,   remove,   removeNotify,   setCursor,   setExtendedState,   setIconImage,   setMaximizedBounds,   setMenuBar,   setResizable,   setState,   setTitle,   setUndecorated
Methods from java.awt.Window:
addNotify,   addPropertyChangeListener,   addPropertyChangeListener,   addWindowFocusListener,   addWindowListener,   addWindowStateListener,   applyResourceBundle,   applyResourceBundle,   createBufferStrategy,   createBufferStrategy,   dispose,   getAccessibleContext,   getBufferStrategy,   getFocusCycleRootAncestor,   getFocusOwner,   getFocusTraversalKeys,   getFocusableWindowState,   getGraphicsConfiguration,   getIconImages,   getInputContext,   getListeners,   getLocale,   getModalExclusionType,   getMostRecentFocusOwner,   getOwnedWindows,   getOwner,   getOwnerlessWindows,   getToolkit,   getWarningString,   getWindowFocusListeners,   getWindowListeners,   getWindowStateListeners,   getWindows,   hide,   isActive,   isAlwaysOnTop,   isAlwaysOnTopSupported,   isFocusCycleRoot,   isFocusableWindow,   isFocused,   isLocationByPlatform,   isShowing,   pack,   postEvent,   removeNotify,   removeWindowFocusListener,   removeWindowListener,   removeWindowStateListener,   reshape,   setAlwaysOnTop,   setBounds,   setBounds,   setCursor,   setFocusCycleRoot,   setFocusableWindowState,   setIconImage,   setIconImages,   setLocationByPlatform,   setLocationRelativeTo,   setMinimumSize,   setModalExclusionType,   setSize,   setSize,   setVisible,   show,   toBack,   toFront
Methods from java.awt.Container:
add,   add,   add,   add,   add,   addContainerListener,   addNotify,   addPropertyChangeListener,   addPropertyChangeListener,   applyComponentOrientation,   areFocusTraversalKeysSet,   countComponents,   deliverEvent,   doLayout,   findComponentAt,   findComponentAt,   getAlignmentX,   getAlignmentY,   getComponent,   getComponentAt,   getComponentAt,   getComponentCount,   getComponentZOrder,   getComponents,   getContainerListeners,   getFocusTraversalKeys,   getFocusTraversalPolicy,   getInsets,   getLayout,   getListeners,   getMaximumSize,   getMinimumSize,   getMousePosition,   getPreferredSize,   insets,   invalidate,   isAncestorOf,   isFocusCycleRoot,   isFocusCycleRoot,   isFocusTraversalPolicyProvider,   isFocusTraversalPolicySet,   layout,   list,   list,   locate,   minimumSize,   paint,   paintComponents,   preferredSize,   print,   printComponents,   remove,   remove,   removeAll,   removeContainerListener,   removeNotify,   setComponentZOrder,   setFocusCycleRoot,   setFocusTraversalKeys,   setFocusTraversalPolicy,   setFocusTraversalPolicyProvider,   setFont,   setLayout,   transferFocusBackward,   transferFocusDownCycle,   update,   validate
Methods from java.awt.Component:
action,   add,   addComponentListener,   addFocusListener,   addHierarchyBoundsListener,   addHierarchyListener,   addInputMethodListener,   addKeyListener,   addMouseListener,   addMouseMotionListener,   addMouseWheelListener,   addNotify,   addPropertyChangeListener,   addPropertyChangeListener,   applyComponentOrientation,   areFocusTraversalKeysSet,   bounds,   checkImage,   checkImage,   contains,   contains,   createImage,   createImage,   createVolatileImage,   createVolatileImage,   deliverEvent,   disable,   dispatchEvent,   doLayout,   enable,   enable,   enableInputMethods,   firePropertyChange,   firePropertyChange,   firePropertyChange,   firePropertyChange,   firePropertyChange,   firePropertyChange,   getAccessibleContext,   getAlignmentX,   getAlignmentY,   getBackground,   getBaseline,   getBaselineResizeBehavior,   getBounds,   getBounds,   getColorModel,   getComponentAt,   getComponentAt,   getComponentListeners,   getComponentOrientation,   getCursor,   getDropTarget,   getFocusCycleRootAncestor,   getFocusListeners,   getFocusTraversalKeys,   getFocusTraversalKeysEnabled,   getFont,   getFontMetrics,   getForeground,   getGraphics,   getGraphicsConfiguration,   getHeight,   getHierarchyBoundsListeners,   getHierarchyListeners,   getIgnoreRepaint,   getInputContext,   getInputMethodListeners,   getInputMethodRequests,   getKeyListeners,   getListeners,   getLocale,   getLocation,   getLocation,   getLocationOnScreen,   getMaximumSize,   getMinimumSize,   getMouseListeners,   getMouseMotionListeners,   getMousePosition,   getMouseWheelListeners,   getName,   getParent,   getPeer,   getPreferredSize,   getPropertyChangeListeners,   getPropertyChangeListeners,   getSize,   getSize,   getToolkit,   getTreeLock,   getWidth,   getX,   getY,   gotFocus,   handleEvent,   hasFocus,   hide,   imageUpdate,   inside,   invalidate,   isBackgroundSet,   isCursorSet,   isDisplayable,   isDoubleBuffered,   isEnabled,   isFocusCycleRoot,   isFocusOwner,   isFocusTraversable,   isFocusable,   isFontSet,   isForegroundSet,   isLightweight,   isMaximumSizeSet,   isMinimumSizeSet,   isOpaque,   isPreferredSizeSet,   isShowing,   isValid,   isVisible,   keyDown,   keyUp,   layout,   list,   list,   list,   list,   list,   locate,   location,   lostFocus,   minimumSize,   mouseDown,   mouseDrag,   mouseEnter,   mouseExit,   mouseMove,   mouseUp,   move,   nextFocus,   paint,   paintAll,   postEvent,   preferredSize,   prepareImage,   prepareImage,   print,   printAll,   remove,   removeComponentListener,   removeFocusListener,   removeHierarchyBoundsListener,   removeHierarchyListener,   removeInputMethodListener,   removeKeyListener,   removeMouseListener,   removeMouseMotionListener,   removeMouseWheelListener,   removeNotify,   removePropertyChangeListener,   removePropertyChangeListener,   repaint,   repaint,   repaint,   repaint,   requestFocus,   requestFocusInWindow,   reshape,   resize,   resize,   setBackground,   setBounds,   setBounds,   setComponentOrientation,   setCursor,   setDropTarget,   setEnabled,   setFocusTraversalKeys,   setFocusTraversalKeysEnabled,   setFocusable,   setFont,   setForeground,   setIgnoreRepaint,   setLocale,   setLocation,   setLocation,   setMaximumSize,   setMinimumSize,   setName,   setPreferredSize,   setSize,   setSize,   setVisible,   show,   show,   size,   toString,   transferFocus,   transferFocusBackward,   transferFocusUpCycle,   update,   validate
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from com.sshtools.common.ui.SessionProviderFrame Detail:
 public  void addEventHandler(SshEventAdapter eventHandler) 
    Implementation of the SessionManager method, simply calls the SshClient method addEventHandler.
 public  void allowChannelOpen(String channelType,
    ChannelFactory cf) throws IOException 
    Implemenation of the SessionManager method, simply calls the SshClient method allowChannelOpen.
 public  void applyProfileChanges(SshToolsConnectionProfile profile) 
    Implementation of the SessionManager method, this does nothing. Overide this method to provide additional functionality to save changes made by the session to the profile.
 public boolean canExit() 
    Called by the application framework when testing exit state
 public  void exit() 
    Called by the framework when exiting. Can also be called to close the session.
 public ForwardingClient getForwardingClient() 
    Implementation of the SessionManager method, simply calls the SshClient method getForwardingClient.
 public SshToolsConnectionProfile getProfile() 
    Gets the profile currently attached to the frame.
 public int getRemoteEOL() 
    Returns the guessed EOL setting of the remote computer
 public String getServerId() 
    Implemenation of the SessionManager method, simply calls the SshClient method getServerId.
 public SshToolsApplicationSessionPanel getSessionPanel() 
    Get the attached session provider panel.
 public boolean initFrame(SshToolsApplication app) throws IOException, SshToolsApplicationException 
    Initialize the frame and open the remote session
 public boolean isConnected() 
    Implementation of the SessionManager method, this simply calls the SshClient method isConnected.
 public boolean openChannel(Channel channel) throws IOException 
    Implementation of the SessionManager method, this simply calls the SshClient method openChannel.
 public SessionChannelClient openSession() throws IOException 
    Implementation of the SessionManager method, simply calls the SshClient openSession method.
 public SftpClient openSftpClient() throws IOException 
    Implementation of the SessionManager method, this simply calls the SshClient method openSftpClient.
 public boolean requestDisconnect() 
    Implementation of the SessionManager method, this simply returns false. Overide to change this behaviour
 public byte[] sendGlobalRequest(String requestname,
    boolean wantreply,
    byte[] requestdata) throws IOException 
    Implementation of the SessionManager method, simply calls the SshClient method sendGlobalRequest.
 public  void setDisconnectOnClose(boolean disconnectOnClose) 
    When the session closes, should the connection be disconnected?