com.sshtools.daemon.terminal
Class Editline

java.lang.Object
  extended by com.sshtools.daemon.terminal.Editline

public class Editline
extends java.lang.Object

Version:
$Revision: 1.1 $
Author:
$author$

Nested Class Summary
(package private)  class Editline.Buffer
           
 
Field Summary
private  Editline.Buffer buf
           
private  int Cursor
           
private  boolean hardwrapped
           
private  boolean InsertMode
           
private  int lastcurspos
           
private  char lastread
           
private  int lastSize
           
private  char mask
           
private  boolean maskInput
           
private  TerminalIO myIO
           
 
Constructor Summary
Editline(TerminalIO io)
          Creates a new Editline object.
 
Method Summary
 void append(char ch)
           
 void append(java.lang.String str)
           
 void clear()
           
 void draw()
           
 int getCursorPosition()
           
 java.lang.String getHardwrap()
           
private  char getLastRead()
           
 java.lang.String getSoftwrap()
           
 java.lang.String getValue()
           
private  void handleCharInput(int ch)
           
private  void insertCharAt(int pos, char ch)
           
private  void insertStringAt(int pos, java.lang.String str)
           
private  boolean isCursorAtEnd()
           
 boolean isHardwrapped()
           
 boolean isInInsertMode()
           
 void maskInput(boolean maskInput)
           
private  boolean moveLeft()
           
private  boolean moveRight()
           
private  void removeCharAt(int pos)
           
 int run()
           
private  void setCharAt(int pos, char ch)
           
 void setCursorPosition(int pos)
           
 void setHardwrapped(boolean b)
           
 void setInsertMode(boolean b)
           
private  void setLastRead(char ch)
           
 void setMask(char mask)
           
 void setValue(java.lang.String str)
           
 int size()
           
private  void storeSize()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

buf

private Editline.Buffer buf

myIO

private TerminalIO myIO

Cursor

private int Cursor

InsertMode

private boolean InsertMode

lastSize

private int lastSize

hardwrapped

private boolean hardwrapped

lastread

private char lastread

lastcurspos

private int lastcurspos

maskInput

private boolean maskInput

mask

private char mask
Constructor Detail

Editline

public Editline(TerminalIO io)
Creates a new Editline object.

Parameters:
io -
Method Detail

size

public int size()

getValue

public java.lang.String getValue()

setValue

public void setValue(java.lang.String str)
              throws BufferOverflowException,
                     java.io.IOException
Throws:
BufferOverflowException
java.io.IOException

maskInput

public void maskInput(boolean maskInput)

setMask

public void setMask(char mask)
Parameters:
mask -

clear

public void clear()
           throws java.io.IOException
Throws:
java.io.IOException

getSoftwrap

public java.lang.String getSoftwrap()
                             throws java.lang.IndexOutOfBoundsException,
                                    java.io.IOException
Throws:
java.lang.IndexOutOfBoundsException
java.io.IOException

getHardwrap

public java.lang.String getHardwrap()
                             throws java.lang.IndexOutOfBoundsException,
                                    java.io.IOException
Throws:
java.lang.IndexOutOfBoundsException
java.io.IOException

setCharAt

private void setCharAt(int pos,
                       char ch)
                throws java.lang.IndexOutOfBoundsException,
                       java.io.IOException
Throws:
java.lang.IndexOutOfBoundsException
java.io.IOException

insertCharAt

private void insertCharAt(int pos,
                          char ch)
                   throws BufferOverflowException,
                          java.lang.IndexOutOfBoundsException,
                          java.io.IOException
Throws:
BufferOverflowException
java.lang.IndexOutOfBoundsException
java.io.IOException

removeCharAt

private void removeCharAt(int pos)
                   throws java.lang.IndexOutOfBoundsException,
                          java.io.IOException
Throws:
java.lang.IndexOutOfBoundsException
java.io.IOException

insertStringAt

private void insertStringAt(int pos,
                            java.lang.String str)
                     throws BufferOverflowException,
                            java.lang.IndexOutOfBoundsException,
                            java.io.IOException
Throws:
BufferOverflowException
java.lang.IndexOutOfBoundsException
java.io.IOException

append

public void append(char ch)
            throws BufferOverflowException,
                   java.io.IOException
Throws:
BufferOverflowException
java.io.IOException

append

public void append(java.lang.String str)
            throws BufferOverflowException,
                   java.io.IOException
Throws:
BufferOverflowException
java.io.IOException

getCursorPosition

public int getCursorPosition()

setCursorPosition

public void setCursorPosition(int pos)

getLastRead

private char getLastRead()

setLastRead

private void setLastRead(char ch)

isInInsertMode

public boolean isInInsertMode()

setInsertMode

public void setInsertMode(boolean b)

isHardwrapped

public boolean isHardwrapped()

setHardwrapped

public void setHardwrapped(boolean b)

run

public int run()

draw

public void draw()
          throws java.io.IOException
Throws:
java.io.IOException

moveRight

private boolean moveRight()
                   throws java.io.IOException
Throws:
java.io.IOException

moveLeft

private boolean moveLeft()
                  throws java.io.IOException
Throws:
java.io.IOException

isCursorAtEnd

private boolean isCursorAtEnd()

handleCharInput

private void handleCharInput(int ch)
                      throws BufferOverflowException,
                             java.io.IOException
Throws:
BufferOverflowException
java.io.IOException

storeSize

private void storeSize()