public class JSR270HistoryManager extends Object implements HistoryManager
Constructor and Description |
---|
JSR270HistoryManager() |
Modifier and Type | Method and Description |
---|---|
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
|
public void addEntry(String newEntry)
HistoryManager
addEntry
in interface HistoryManager
newEntry
- the entry to be added at the end of the historypublic void display()
HistoryManager
display
in interface HistoryManager
public String getEntry(int entryIndex)
HistoryManager
getEntry
in interface HistoryManager
entryIndex
- the index of the entry in the historypublic String getNextEntry(String beg)
HistoryManager
getNextEntry
in interface HistoryManager
beg
- the beginning of the entry (can be empty)public String getPreviousEntry(String beg)
HistoryManager
getPreviousEntry
in interface HistoryManager
beg
- the beginning of the entry (can be empty)public String getTmpEntry()
HistoryManager
getTmpEntry
in interface HistoryManager
public boolean isInHistory()
HistoryManager
isInHistory
in interface HistoryManager
public void load()
HistoryManager
load
in interface HistoryManager
public void reset()
HistoryManager
reset
in interface HistoryManager
public void save()
HistoryManager
save
in interface HistoryManager
public void setInHistory(boolean status)
HistoryManager
setInHistory
in interface HistoryManager
status
- is true if we begin to browse the history, false if we stop browsingpublic void setMaxEntryNumber(int numberOfEntries)
HistoryManager
setMaxEntryNumber
in interface HistoryManager
numberOfEntries
- the number of entries to setpublic void setTmpEntry(String currentCommandLine)
HistoryManager
setTmpEntry
in interface HistoryManager
currentCommandLine
- the text currently edited by the userCopyright © 2007-2012 Artenum. All Rights Reserved.