Class TFileChooserScreen.Builder
java.lang.Object
com.thecsdev.commonmc.api.client.gui.screen.promise.TFileChooserScreen.Builder
- Enclosing class:
TFileChooserScreen
A builder class for creating
TFileChooserScreen instances.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddPathFilter(@NotNull TFileChooserScreen.PathFilter pathFilter) Adds aTFileChooserScreen.PathFilterthat will be used by theTFileChooserScreeninstance created by this builder.final @NotNull TFileChooserScreenbuild()Builds a newTFileChooserScreeninstance using the parameters previously set in this builder.final @NotNull TFileChooserScreen.Modegetmode()Gets theTFileChooserScreen.ModethisTFileChooserScreen.Builderwas initialized with.setCurrentDirectory(@NotNull Path currDir) Sets the starting directory that theTFileChooserScreeninstance created by this builder will display upon opening.setLastScreen(@Nullable net.minecraft.client.gui.screens.Screen lastScreen) Sets theScreeninstance that will be assigned as the "last screen" for theTFileChooserScreeninstance created by this builder.setPathFilter(@NotNull TFileChooserScreen.PathFilter pathFilter) Sets theTFileChooserScreen.PathFilterthat will be used by theTFileChooserScreeninstance created by this builder.
-
Constructor Details
-
Builder
- Throws:
NullPointerException
-
-
Method Details
-
getmode
Gets theTFileChooserScreen.ModethisTFileChooserScreen.Builderwas initialized with. -
setLastScreen
public final TFileChooserScreen.Builder setLastScreen(@Nullable @Nullable net.minecraft.client.gui.screens.Screen lastScreen) Sets theScreeninstance that will be assigned as the "last screen" for theTFileChooserScreeninstance created by this builder.- Parameters:
lastScreen- The lastScreeninstance.
-
setCurrentDirectory
public final TFileChooserScreen.Builder setCurrentDirectory(@NotNull @NotNull Path currDir) throws NullPointerException, IllegalArgumentException Sets the starting directory that theTFileChooserScreeninstance created by this builder will display upon opening.- Parameters:
currDir- The current directoryPath.- Throws:
NullPointerException- If the argument isnull.IllegalArgumentException- If the givenPathis not absolute.- See Also:
-
setPathFilter
public final TFileChooserScreen.Builder setPathFilter(@NotNull @NotNull TFileChooserScreen.PathFilter pathFilter) throws NullPointerException Sets theTFileChooserScreen.PathFilterthat will be used by theTFileChooserScreeninstance created by this builder.- Parameters:
pathFilter- TheTFileChooserScreen.PathFilterinstance.- Throws:
NullPointerException- If the argument isnull.
-
addPathFilter
public final TFileChooserScreen.Builder addPathFilter(@NotNull @NotNull TFileChooserScreen.PathFilter pathFilter) throws NullPointerException, IllegalStateException Adds aTFileChooserScreen.PathFilterthat will be used by theTFileChooserScreeninstance created by this builder.- Parameters:
pathFilter- TheTFileChooserScreen.PathFilterinstance.- Throws:
NullPointerException- If the argument isnull.IllegalStateException- If theTFileChooserScreen.Modeof thisTFileChooserScreen.BuilderisTFileChooserScreen.Mode.EXPLORE. For now there is no interface to select aTFileChooserScreen.PathFilterin that mode. This may change in the future.
-
build
Builds a newTFileChooserScreeninstance using the parameters previously set in this builder.
-