com.artenum.rosetta.interfaces.core
Interface HistoryManager

All Known Implementing Classes:
JSR270HistoryManager

public interface HistoryManager

Author:
Vincent COUVERT

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
 

Method Detail

addEntry

void addEntry(String newEntry)
Add a line or a block in history

Parameters:
newEntry - the entry to be added at the end of the history

display

void display()
Display all history entries with line numbers


setMaxEntryNumber

void setMaxEntryNumber(int numberOfEntries)
Set the maximum number of entries (lines/blocks) allowed in the history

Parameters:
numberOfEntries - the number of entries to set

reset

void reset()
Clears the history


load

void load()
Load history from a file


save

void save()
Save history to a file


getEntry

String getEntry(int entryIndex)
Gets an entry in the history by giving its number

Parameters:
entryIndex - the index of the entry in the history
Returns:
the entry

getPreviousEntry

String getPreviousEntry(String beg)
Gets previous entry in the history by giving its beginning

Parameters:
beg - the beginning of the entry (can be empty)
Returns:
the entry

getNextEntry

String getNextEntry(String beg)
Gets next entry in the history by giving its beginning

Parameters:
beg - the beginning of the entry (can be empty)
Returns:
the entry

setTmpEntry

void setTmpEntry(String currentCommandLine)
Saves the currently edited command line before erasing it

Parameters:
currentCommandLine - the text currently edited by the user

getTmpEntry

String getTmpEntry()
Gets the currently edited command line before erasing it

Returns:
the text currently edited by the user before going into history

isInHistory

boolean isInHistory()
Are we browsing history ?

Returns:
true if we are browing history, false else

setInHistory

void setInHistory(boolean status)
Sets the flag indicating if we are browsing history

Parameters:
status - is true if we begin to browse the history, false if we stop browsing


Copyright © 2007-2011 Artenum. All Rights Reserved.