Class JSR270HistoryManager
- java.lang.Object
-
- com.artenum.rosetta.implementation.JSR270HistoryManager
-
- All Implemented Interfaces:
HistoryManager
public class JSR270HistoryManager extends java.lang.Object implements HistoryManager
History Manager for JSR270 implementation
-
-
Constructor Summary
Constructors Constructor Description JSR270HistoryManager()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddEntry(java.lang.String newEntry)Add a line or a block in historyvoiddisplay()Display all history entries with line numbersjava.lang.StringgetEntry(int entryIndex)Gets an entry in the history by giving its numberjava.lang.StringgetNextEntry(java.lang.String beg)Gets next entry in the history by giving its beginningjava.lang.StringgetPreviousEntry(java.lang.String beg)Gets previous entry in the history by giving its beginningjava.lang.StringgetTmpEntry()Gets the currently edited command line before erasing itbooleanisInHistory()Are we browsing history ?voidload()Load history from a filevoidreset()Clears the historyvoidsave()Save history to a filevoidsetInHistory(boolean status)Sets the flag indicating if we are browsing historyvoidsetMaxEntryNumber(int numberOfEntries)Set the maximum number of entries (lines/blocks) allowed in the historyvoidsetTmpEntry(java.lang.String currentCommandLine)Saves the currently edited command line before erasing it
-
-
-
Method Detail
-
addEntry
public void addEntry(java.lang.String newEntry)
Description copied from interface:HistoryManagerAdd a line or a block in history- Specified by:
addEntryin interfaceHistoryManager- Parameters:
newEntry- the entry to be added at the end of the history
-
display
public void display()
Description copied from interface:HistoryManagerDisplay all history entries with line numbers- Specified by:
displayin interfaceHistoryManager
-
getEntry
public java.lang.String getEntry(int entryIndex)
Description copied from interface:HistoryManagerGets an entry in the history by giving its number- Specified by:
getEntryin interfaceHistoryManager- Parameters:
entryIndex- the index of the entry in the history- Returns:
- the entry
-
getNextEntry
public java.lang.String getNextEntry(java.lang.String beg)
Description copied from interface:HistoryManagerGets next entry in the history by giving its beginning- Specified by:
getNextEntryin interfaceHistoryManager- Parameters:
beg- the beginning of the entry (can be empty)- Returns:
- the entry
-
getPreviousEntry
public java.lang.String getPreviousEntry(java.lang.String beg)
Description copied from interface:HistoryManagerGets previous entry in the history by giving its beginning- Specified by:
getPreviousEntryin interfaceHistoryManager- Parameters:
beg- the beginning of the entry (can be empty)- Returns:
- the entry
-
getTmpEntry
public java.lang.String getTmpEntry()
Description copied from interface:HistoryManagerGets the currently edited command line before erasing it- Specified by:
getTmpEntryin interfaceHistoryManager- Returns:
- the text currently edited by the user before going into history
-
isInHistory
public boolean isInHistory()
Description copied from interface:HistoryManagerAre we browsing history ?- Specified by:
isInHistoryin interfaceHistoryManager- Returns:
- true if we are browing history, false else
-
load
public void load()
Description copied from interface:HistoryManagerLoad history from a file- Specified by:
loadin interfaceHistoryManager
-
reset
public void reset()
Description copied from interface:HistoryManagerClears the history- Specified by:
resetin interfaceHistoryManager
-
save
public void save()
Description copied from interface:HistoryManagerSave history to a file- Specified by:
savein interfaceHistoryManager
-
setInHistory
public void setInHistory(boolean status)
Description copied from interface:HistoryManagerSets the flag indicating if we are browsing history- Specified by:
setInHistoryin interfaceHistoryManager- 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:HistoryManagerSet the maximum number of entries (lines/blocks) allowed in the history- Specified by:
setMaxEntryNumberin interfaceHistoryManager- Parameters:
numberOfEntries- the number of entries to set
-
setTmpEntry
public void setTmpEntry(java.lang.String currentCommandLine)
Description copied from interface:HistoryManagerSaves the currently edited command line before erasing it- Specified by:
setTmpEntryin interfaceHistoryManager- Parameters:
currentCommandLine- the text currently edited by the user
-
-