Class TFileChooserScreen
java.lang.Object
com.thecsdev.common.scene.Node<TElement>
com.thecsdev.commonmc.api.client.gui.TElement
com.thecsdev.commonmc.api.client.gui.screen.TScreen
com.thecsdev.commonmc.api.client.gui.screen.promise.TCompletableScreen<List<Path>>
com.thecsdev.commonmc.api.client.gui.screen.promise.TFileChooserScreen
- All Implemented Interfaces:
INode<TElement>, INodeBounded<TElement,Bounds2i>, INodeRenderable<TElement, TGuiGraphics>, ILastScreenProvider, Iterable<TElement>, Collection<TElement>
TScreen implementation that provides a user-friendly interface for selecting
files from the device's file-system. This screen is particularly useful for cases that
require file opening and saving functionalities, allowing users to easily navigate
through their directories and choose the desired files.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classA builder class for creatingTFileChooserScreeninstances.static enumDefines the operational modes of theTFileChooserScreen, determining its behavior and user interactions.static interfaceA filter interface for filteringPaths displayed on theTFileChooserScreeninterface. -
Field Summary
Fields inherited from class TElement
eInitialized -
Method Summary
Modifier and TypeMethodDescriptionfinal @NotNull TFileChooserScreen.ModegetMode()Returns the operatingTFileChooserScreen.Modeof thisTFileChooserScreen.protected final voidCallback method that is invoked when thisTElementis initializing.final booleaninputCallback(TInputContext.InputDiscoveryPhase phase, @NotNull TInputContext context) A callback method that is invoked when the user makes an input.final voidrefresh()Refreshes the window element, re-initializing its contents to reflect any changes in the file-system or current directory.protected final voidCallback method that is invoked automatically every GUI tick, if and afterNode.getParent()ticks.Methods inherited from class TCompletableScreen
canCompleteAsync, closeCallback, getLastScreen, getResult, renderCallbackMethods inherited from class TScreen
close, createWrapperScreen, focusedElementProperty, getAsScreen, getClient, hoveredElementProperty, isAllowingInGameHud, isOpen, isPauseScreen, openCallback, sendInput, titlePropertyMethods inherited from class TElement
addRel, boundsProperty, clearAndInit, clipsDescendantsProperty, contextMenuProperty, dragEndCallback, dragStartCallback, findElementAt, focusableProperty, focusGainedCallback, focusLostCallback, forEachVisible, getBaseType, getBounds, getContentBounds, getCursor, getSelf, getTooltip, hoverableProperty, hoverGainedCallback, hoverLostCallback, invalidateTooltipCache, isFocusable, isFocused, isHoverable, isHovered, isHoveredOrFocused, isVisible, move, moveChildren, moveTo, postRenderCallback, removeRel, screenProperty, setBounds, setBounds, setBounds, showContextMenu, tooltipProperty, toString, visiblePropertyMethods inherited from class Node
add, addAll, childAddedCallback, childRemovedCallback, clear, contains, containsAll, equals, findChild, findParent, findSibling, forEach, get, getFirst, getLast, getParent, hashCode, indexOf, isEmpty, iterator, parentProperty, remove, remove, remove, removeAll, retainAll, rootProperty, size, toArray, toArray
-
Method Details
-
getMode
Returns the operatingTFileChooserScreen.Modeof thisTFileChooserScreen. -
tickCallback
protected final void tickCallback()Description copied from class:TElementCallback method that is invoked automatically every GUI tick, if and afterNode.getParent()ticks.For performance optimization reasons, this is invoked if this element is contained within its parent's
TElement.getBounds().Note that this is regardless of what
TElement.isVisible()returns. The only requirements are the element being "within parent bounds" and the parent having ticked.- Overrides:
tickCallbackin classTElement
-
refresh
public final void refresh()Refreshes the window element, re-initializing its contents to reflect any changes in the file-system or current directory. -
initCallback
protected final void initCallback()Description copied from class:TElementCallback method that is invoked when thisTElementis initializing. You may override this method to create and add childTElements.- Specified by:
initCallbackin classTScreen- See Also:
-
inputCallback
public final boolean inputCallback(@NotNull TInputContext.InputDiscoveryPhase phase, @NotNull @NotNull TInputContext context) throws NullPointerException Description copied from class:TElementA callback method that is invoked when the user makes an input.- Overrides:
inputCallbackin classTElement- Parameters:
phase- The input discovery phase.context- Information about the user's input.- Returns:
trueif thisTElementhandled the input.- Throws:
NullPointerException- If an argument isnull.
-