Contents
- Description
- Constructor Summary
- Method Summary
- Constructor Details
- Method Details
- buildRootSelector(UICommandBuilder, UIEventBuilder)
- buildSearchInput(UICommandBuilder, UIEventBuilder)
- buildCurrentPath(UICommandBuilder)
- getFileEntries()
- buildFileList(UICommandBuilder, UIEventBuilder)
- buildUI(UICommandBuilder, UIEventBuilder)
- handleEvent(FileBrowserEventData)
- resolveAssetPackPath(String)
- getAssetPackCurrentPath()
- getRoot()
- setRoot(Path)
- getCurrentDir()
- setCurrentDir(Path)
- getSearchQuery()
- setSearchQuery(String)
- navigateUp()
- navigateTo(Path)
- getSelectedItems()
- addSelection(String)
- clearSelection()
- getConfig()
Class ServerFileBrowser
java.lang.Object
com.hypixel.hytale.server.core.ui.browser.ServerFileBrowser
Reusable server-side file browser component.
Encapsulates common file browsing logic including: - Directory navigation - Root selector management - Fuzzy search - File filtering by extension
Designed to be composed into pages, not extended.
-
Constructor Summary
ConstructorsConstructorDescriptionServerFileBrowser(FileBrowserConfig config) ServerFileBrowser(FileBrowserConfig config, Path initialRoot, Path initialDir) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddSelection(String item) voidbuildCurrentPath(UICommandBuilder commandBuilder) Builds the current path display.voidbuildFileList(UICommandBuilder commandBuilder, UIEventBuilder eventBuilder) Builds the file list UI based on current state.voidbuildRootSelector(UICommandBuilder commandBuilder, UIEventBuilder eventBuilder) Builds the root selector dropdown UI.voidbuildSearchInput(UICommandBuilder commandBuilder, UIEventBuilder eventBuilder) Builds the search input UI.voidbuildUI(UICommandBuilder commandBuilder, UIEventBuilder eventBuilder) Builds the complete browser UI (root selector, search, path, file list).voidGets the current virtual path in asset pack mode.getRoot()booleanHandles a browser event.voidnavigateTo(Path relativePath) voidresolveAssetPackPath(String virtualPath) Resolves a virtual asset pack path to an actual filesystem path.voidsetCurrentDir(Path currentDir) voidvoidsetSearchQuery(String searchQuery)
-
Constructor Details
-
ServerFileBrowser
-
ServerFileBrowser
public ServerFileBrowser(@Nonnull FileBrowserConfig config, @Nullable Path initialRoot, @Nullable Path initialDir)
-
-
Method Details
-
buildRootSelector
public void buildRootSelector(@Nonnull UICommandBuilder commandBuilder, @Nonnull UIEventBuilder eventBuilder) Builds the root selector dropdown UI. Only adds UI elements if root selector is enabled in config. -
buildSearchInput
public void buildSearchInput(@Nonnull UICommandBuilder commandBuilder, @Nonnull UIEventBuilder eventBuilder) Builds the search input UI. Only adds UI elements if search is enabled in config. -
buildCurrentPath
Builds the current path display. -
getFileEntries
-
buildFileList
public void buildFileList(@Nonnull UICommandBuilder commandBuilder, @Nonnull UIEventBuilder eventBuilder) Builds the file list UI based on current state. -
buildUI
Builds the complete browser UI (root selector, search, path, file list). -
handleEvent
Handles a browser event.- Returns:
- true if the event was handled, false if it should be passed to the page
-
resolveAssetPackPath
-
getAssetPackCurrentPath
Gets the current virtual path in asset pack mode.- Returns:
- The virtual path string (e.g., "Assets/subfolder")
-
getRoot
-
setRoot
-
getCurrentDir
-
setCurrentDir
-
getSearchQuery
-
setSearchQuery
-
getSelectedItems
-
addSelection
-
clearSelection
public void clearSelection() -
getConfig
-