JSampler
v0.8a

org.jsampler
Class DefaultLSConsoleModel

java.lang.Object
  extended by org.jsampler.DefaultLSConsoleModel
All Implemented Interfaces:
LSConsoleModel

public class DefaultLSConsoleModel
extends java.lang.Object
implements LSConsoleModel

This class provides default implementation of the LSConsoleModel interface.


Constructor Summary
DefaultLSConsoleModel()
          Creates a new instance of DefaultLSConsoleModel.
 
Method Summary
 void addLSConsoleListener(LSConsoleListener l)
          Registers the specified listener for receiving event messages.
 void addToCommandHistory(java.lang.String command)
          Adds the specified command to command history.
 void browseCommandHistoryDown()
          Browses the command history one line down.
 void browseCommandHistoryFirst()
          Browses to the first line of the command history.
 void browseCommandHistoryLast()
          Browses to the last line of the command history.
 void browseCommandHistoryUp()
          Browses the command history one line up.
 void clearCommandHistory()
          Clears the complete/multisession command history.
 void clearSessionHistory()
          Clears the session history.
 void execCommand()
          Executes the command specified in the command line.
 java.lang.String[] getCommandHistory()
          Gets the complete command history, excluding blank lines and comments.
 int getCommandHistorySize()
          Determines the maximum number of lines to be kept in the command history.
 java.lang.String getCommandLineText()
          Gets the text in the command line.
 java.lang.String[] getCommandList()
          Gets a list of all LSCP commands.
 java.lang.String getLastExecutedCommand()
          Gets the last executed command.
 java.lang.String[] getSessionHistory()
          Gets the command history of the current session, including blank lines and comments.
 void removeLSConsoleListener(LSConsoleListener l)
          Removes the specified listener.
 java.lang.String[] searchCommandHistory()
          Searches the command history for commands containing the string returned by getCommandLineText().
 java.lang.String[] searchCommandHistory(java.lang.String substring)
          Searches the command history for commands containing substring.
 java.lang.String[] searchCommandList()
          Searches the LSCP command list for commands containing the string returned by getCommandLineText().
 java.lang.String[] searchCommandList(java.lang.String substring)
          Searches the LSCP command list for commands containing substring.
 void setCommandHistorySize(int size)
          Sets the maximum number of lines to be kept in the command history.
 void setCommandLineText(java.lang.String cmdLine)
          Sets the text in the command line.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultLSConsoleModel

public DefaultLSConsoleModel()
Creates a new instance of DefaultLSConsoleModel.

Method Detail

addLSConsoleListener

public void addLSConsoleListener(LSConsoleListener l)
Registers the specified listener for receiving event messages.

Specified by:
addLSConsoleListener in interface LSConsoleModel
Parameters:
l - The LSConsoleListener to register.

removeLSConsoleListener

public void removeLSConsoleListener(LSConsoleListener l)
Removes the specified listener.

Specified by:
removeLSConsoleListener in interface LSConsoleModel
Parameters:
l - The LSConsoleListener to remove.

execCommand

public void execCommand()
Executes the command specified in the command line.

Specified by:
execCommand in interface LSConsoleModel

getLastExecutedCommand

public java.lang.String getLastExecutedCommand()
Gets the last executed command.

Specified by:
getLastExecutedCommand in interface LSConsoleModel
Returns:
The last command executed in the LS Console.

setCommandLineText

public void setCommandLineText(java.lang.String cmdLine)
Sets the text in the command line.

Specified by:
setCommandLineText in interface LSConsoleModel
Parameters:
cmdLine - The new command line text.

getCommandLineText

public java.lang.String getCommandLineText()
Gets the text in the command line.

Specified by:
getCommandLineText in interface LSConsoleModel
Returns:
The command line's text.

getSessionHistory

public java.lang.String[] getSessionHistory()
Gets the command history of the current session, including blank lines and comments.

Specified by:
getSessionHistory in interface LSConsoleModel
Returns:
The command history of the current session, including blank lines and comments.

clearSessionHistory

public void clearSessionHistory()
Clears the session history.

Specified by:
clearSessionHistory in interface LSConsoleModel
See Also:
getSessionHistory()

addToCommandHistory

public void addToCommandHistory(java.lang.String command)
Adds the specified command to command history.

Specified by:
addToCommandHistory in interface LSConsoleModel
Parameters:
command - The command to be added to command history.

getCommandHistory

public java.lang.String[] getCommandHistory()
Gets the complete command history, excluding blank lines and comments.

Specified by:
getCommandHistory in interface LSConsoleModel
Returns:
The complete command history, excluding blank lines and comments.

clearCommandHistory

public void clearCommandHistory()
Clears the complete/multisession command history.

Specified by:
clearCommandHistory in interface LSConsoleModel
See Also:
getCommandHistory()

getCommandHistorySize

public int getCommandHistorySize()
Determines the maximum number of lines to be kept in the command history.

Specified by:
getCommandHistorySize in interface LSConsoleModel
Returns:
The maximum number of lines to be kept in the command history.

setCommandHistorySize

public void setCommandHistorySize(int size)
Sets the maximum number of lines to be kept in the command history.

Specified by:
setCommandHistorySize in interface LSConsoleModel
Parameters:
size - Determines the maximum number of lines to be kept in the command history.

getCommandList

public java.lang.String[] getCommandList()
Gets a list of all LSCP commands.

Specified by:
getCommandList in interface LSConsoleModel
Returns:
A list of all LSCP commands.

browseCommandHistoryUp

public void browseCommandHistoryUp()
Browses the command history one line up.

Specified by:
browseCommandHistoryUp in interface LSConsoleModel

browseCommandHistoryDown

public void browseCommandHistoryDown()
Browses the command history one line down.

Specified by:
browseCommandHistoryDown in interface LSConsoleModel

browseCommandHistoryFirst

public void browseCommandHistoryFirst()
Browses to the first line of the command history.

Specified by:
browseCommandHistoryFirst in interface LSConsoleModel

browseCommandHistoryLast

public void browseCommandHistoryLast()
Browses to the last line of the command history.

Specified by:
browseCommandHistoryLast in interface LSConsoleModel

searchCommandHistory

public java.lang.String[] searchCommandHistory()
Searches the command history for commands containing the string returned by getCommandLineText().

Specified by:
searchCommandHistory in interface LSConsoleModel
Returns:
All commands that contains the string returned by getCommandLineText().
See Also:
getCommandHistory()

searchCommandHistory

public java.lang.String[] searchCommandHistory(java.lang.String substring)
Searches the command history for commands containing substring.

Specified by:
searchCommandHistory in interface LSConsoleModel
Parameters:
substring - The substring to be used to perform the search.
Returns:
All commands that contains substring.
See Also:
getCommandList()

searchCommandList

public java.lang.String[] searchCommandList()
Searches the LSCP command list for commands containing the string returned by getCommandLineText().

Specified by:
searchCommandList in interface LSConsoleModel
Returns:
All commands that contains the string returned by getCommandLineText().
See Also:
getCommandList()

searchCommandList

public java.lang.String[] searchCommandList(java.lang.String substring)
Searches the LSCP command list for commands containing substring.

Specified by:
searchCommandList in interface LSConsoleModel
Parameters:
substring - The substring to be used to perform the search.
Returns:
All commands that contains substring.
See Also:
getCommandList()

JSampler
v0.8a

Copyright © 2007 Grigor Iliev. All rights reserved.