Class PersistableSearchHistoryBase
- java.lang.Object
-
- com._1c.g5.v8.dt.common.ui.controls.search.PersistableSearchHistoryBase
-
- All Implemented Interfaces:
ISearchHistory
- Direct Known Subclasses:
EclipsePreferencesPersistableSearchHistory
,InMemorySearchHistory
public abstract class PersistableSearchHistoryBase extends Object implements ISearchHistory
Base implementation ofISearchHistory
with persistency support.
-
-
Field Summary
-
Fields inherited from interface com._1c.g5.v8.dt.common.ui.controls.search.ISearchHistory
ALL_PATTERNS
-
-
Constructor Summary
Constructors Constructor Description PersistableSearchHistoryBase()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description String
getActivePattern()
protected List<String>
getPatterns()
List<String>
getRecentPatterns(int maxPatterns)
Return recent history patterns.protected abstract void
loadState()
Loads the state.void
savePattern(String pattern)
Saves pattern in the history.protected abstract void
saveState()
Saves the state.
-
-
-
Method Detail
-
savePattern
public void savePattern(String pattern)
Saves pattern in the history.- Specified by:
savePattern
in interfaceISearchHistory
- Parameters:
pattern
- pattern to save.
-
getRecentPatterns
public List<String> getRecentPatterns(int maxPatterns)
Return recent history patterns. UseISearchHistory.ALL_PATTERNS
to obtain all patterns stored in the history.- Specified by:
getRecentPatterns
in interfaceISearchHistory
- Parameters:
maxPatterns
- maximum number of patterns to return.- Returns:
- recent patterns or empty iterable if there are no patterns.
-
getActivePattern
public String getActivePattern()
- Specified by:
getActivePattern
in interfaceISearchHistory
- Returns:
- active pattern or empty string if there is no one.
-
saveState
protected abstract void saveState()
Saves the state.
-
loadState
protected abstract void loadState()
Loads the state.
-
-