Interface TFileChooserScreen.PathFilter
- All Superinterfaces:
Predicate<Path>, TDropdownWidget.Entry
- Enclosing class:
TFileChooserScreen
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@FunctionalInterface
public static interface TFileChooserScreen.PathFilter
extends Predicate<Path>, TDropdownWidget.Entry
A filter interface for filtering
Paths displayed on the
TFileChooserScreen interface.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final TFileChooserScreen.PathFilterTFileChooserScreen.PathFilterinstance that accepts allPaths. -
Method Summary
Modifier and TypeMethodDescriptionCreates a simpleTFileChooserScreen.PathFilterthat filtersPaths based on their extension name.Creates a simpleTFileChooserScreen.PathFilterthat filtersPaths based on their extension names.default @NotNull net.minecraft.network.chat.ComponentThe display name of theTDropdownWidget.Entrythat is to be displayed on a givenTDropdownWidget.default @NotNull PathsuggestValidPath(@NotNull Path original) Suggests a validPathbased on the provided original.boolean
-
Field Details
-
ALL
TFileChooserScreen.PathFilterinstance that accepts allPaths.
-
-
Method Details
-
getDisplayName
@NotNull default @NotNull net.minecraft.network.chat.Component getDisplayName()Description copied from interface:TDropdownWidget.EntryThe display name of theTDropdownWidget.Entrythat is to be displayed on a givenTDropdownWidget.- Specified by:
getDisplayNamein interfaceTDropdownWidget.Entry
-
test
- Specified by:
testin interfacePredicate<Path>- Throws:
NullPointerException- If the argument isnull.
-
suggestValidPath
@NotNull default @NotNull Path suggestValidPath(@NotNull @NotNull Path original) throws NullPointerException Suggests a validPathbased on the provided original.- Parameters:
original- ThePathto validate.- Returns:
- The original path if it satisfies
test(Path); otherwise, a modified path that conforms to this filter's requirements. - Throws:
NullPointerException- If the argument isnull.
-
extname
static TFileChooserScreen.PathFilter extname(@NotNull @NotNull String extname) throws NullPointerException, IllegalArgumentException Creates a simpleTFileChooserScreen.PathFilterthat filtersPaths based on their extension name.- Parameters:
extname- The extension name (case-sensitive).- Throws:
NullPointerException- If the argument isnull.IllegalArgumentException- If the extension name contains a known illegal character.
-
extnames
static TFileChooserScreen.PathFilter extnames(@NotNull @NotNull net.minecraft.network.chat.Component filterName, @NotNull @NotNull String... extnames) throws NullPointerException, IllegalArgumentException Creates a simpleTFileChooserScreen.PathFilterthat filtersPaths based on their extension names.- Parameters:
filterName- The display name for theTFileChooserScreen.PathFilter.extnames- The extension names (case-sensitive).- Throws:
NullPointerException- If an argument isnull.IllegalArgumentException- If the array is empty or an extension name contains a known illegal character.
-