com.artenum.rosetta.implementation
Class JSR270HistoryManager

java.lang.Object
  extended by com.artenum.rosetta.implementation.JSR270HistoryManager
All Implemented Interfaces:
HistoryManager

public class JSR270HistoryManager
extends Object
implements HistoryManager

History Manager for JSR270 implementation

Author:
Vincent COUVERT

Constructor Summary
JSR270HistoryManager()
           
 
Method Summary
 void addEntry(String newEntry)
          Add a line or a block in history
 void display()
          Display all history entries with line numbers
 String getEntry(int entryIndex)
          Gets an entry in the history by giving its number
 String getNextEntry(String beg)
          Gets next entry in the history by giving its beginning
 String getPreviousEntry(String beg)
          Gets previous entry in the history by giving its beginning
 String getTmpEntry()
          Gets the currently edited command line before erasing it
 boolean isInHistory()
          Are we browsing history ?
 void load()
          Load history from a file
 void reset()
          Clears the history
 void save()
          Save history to a file
 void setInHistory(boolean status)
          Sets the flag indicating if we are browsing history
 void setMaxEntryNumber(int numberOfEntries)
          Set the maximum number of entries (lines/blocks) allowed in the history
 void setTmpEntry(String currentCommandLine)
          Saves the currently edited command line before erasing it
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JSR270HistoryManager

public JSR270HistoryManager()
Method Detail

addEntry

public void addEntry(String newEntry)
Description copied from interface: HistoryManager
Add a line or a block in history

Specified by:
addEntry in interface HistoryManager
Parameters:
newEntry - the entry to be added at the end of the history

display

public void display()
Description copied from interface: HistoryManager
Display all history entries with line numbers

Specified by:
display in interface HistoryManager

getEntry

public String getEntry(int entryIndex)
Description copied from interface: HistoryManager
Gets an entry in the history by giving its number

Specified by:
getEntry in interface HistoryManager
Parameters:
entryIndex - the index of the entry in the history
Returns:
the entry

getNextEntry

public String getNextEntry(String beg)
Description copied from interface: HistoryManager
Gets next entry in the history by giving its beginning

Specified by:
getNextEntry in interface HistoryManager
Parameters:
beg - the beginning of the entry (can be empty)
Returns:
the entry

getPreviousEntry

public String getPreviousEntry(String beg)
Description copied from interface: HistoryManager
Gets previous entry in the history by giving its beginning

Specified by:
getPreviousEntry in interface HistoryManager
Parameters:
beg - the beginning of the entry (can be empty)
Returns:
the entry

getTmpEntry

public String getTmpEntry()
Description copied from interface: HistoryManager
Gets the currently edited command line before erasing it

Specified by:
getTmpEntry in interface HistoryManager
Returns:
the text currently edited by the user before going into history

isInHistory

public boolean isInHistory()
Description copied from interface: HistoryManager
Are we browsing history ?

Specified by:
isInHistory in interface HistoryManager
Returns:
true if we are browing history, false else

load

public void load()
Description copied from interface: HistoryManager
Load history from a file

Specified by:
load in interface HistoryManager

reset

public void reset()
Description copied from interface: HistoryManager
Clears the history

Specified by:
reset in interface HistoryManager

save

public void save()
Description copied from interface: HistoryManager
Save history to a file

Specified by:
save in interface HistoryManager

setInHistory

public void setInHistory(boolean status)
Description copied from interface: HistoryManager
Sets the flag indicating if we are browsing history

Specified by:
setInHistory in interface HistoryManager
Parameters:
status - is true if we begin to browse the history, false if we stop browsing

setMaxEntryNumber

public void setMaxEntryNumber(int numberOfEntries)
Description copied from interface: HistoryManager
Set the maximum number of entries (lines/blocks) allowed in the history

Specified by:
setMaxEntryNumber in interface HistoryManager
Parameters:
numberOfEntries - the number of entries to set

setTmpEntry

public void setTmpEntry(String currentCommandLine)
Description copied from interface: HistoryManager
Saves the currently edited command line before erasing it

Specified by:
setTmpEntry in interface HistoryManager
Parameters:
currentCommandLine - the text currently edited by the user


Copyright © 2007-2011 Artenum. All Rights Reserved.