Package net.lenni0451.imnbt.ui
Class SearchProvider
java.lang.Object
net.lenni0451.imnbt.ui.SearchProvider
A provider to search for tag names and content.
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidbuildSearchPaths(net.lenni0451.mcstructs.nbt.INbtTag tag) Refresh the search with the given tag.intgetOpenedPage(String path) Get the page which is required to show the scroll path.booleanisExpanded(String path) Check if the given path is expanded.booleanisSearched(String path) Check if the given path is searched.booleanisTargeted(String path) Check if the given path is targeted.
The targeted path is the path which should be scrolled to.voidRefresh the search with the last used tag.voidsetDoScroll(SearchProvider.SearchDirection direction) Set the scroll position to the next or previous searched path.voidSet the current search string.
This does not refresh the search, userefreshSearch()for that.booleanshouldDoScroll(String path) Check if the given path should be scrolled to.
-
Constructor Details
-
SearchProvider
-
-
Method Details
-
setSearch
Set the current search string.
This does not refresh the search, userefreshSearch()for that.- Parameters:
search- The search string
-
refreshSearch
public void refreshSearch()Refresh the search with the last used tag. -
buildSearchPaths
public void buildSearchPaths(@Nullable net.lenni0451.mcstructs.nbt.INbtTag tag) Refresh the search with the given tag.- Parameters:
tag- The tag to search in
-
isSearched
Check if the given path is searched.- Parameters:
path- The path to check- Returns:
- If the path is searched
-
isTargeted
Check if the given path is targeted.
The targeted path is the path which should be scrolled to.- Parameters:
path- The path to check- Returns:
- If the path is targeted
-
isExpanded
Check if the given path is expanded.- Parameters:
path- The path to check- Returns:
- If the path is expanded
-
setDoScroll
Set the scroll position to the next or previous searched path.- Parameters:
direction- The direction to scroll
-
shouldDoScroll
Check if the given path should be scrolled to.- Parameters:
path- The path to check- Returns:
- If the path should be scrolled to
-
getOpenedPage
Get the page which is required to show the scroll path.- Parameters:
path- The path to check- Returns:
- The page
-