Class FileChooser

java.lang.Object
com.badlogic.gdx.scenes.scene2d.Actor
com.badlogic.gdx.scenes.scene2d.Group
com.badlogic.gdx.scenes.scene2d.ui.WidgetGroup
com.badlogic.gdx.scenes.scene2d.ui.Table
All Implemented Interfaces:
com.badlogic.gdx.scenes.scene2d.utils.Cullable, com.badlogic.gdx.scenes.scene2d.utils.Layout

public class FileChooser extends GenericDialog
  • Field Details Link icon

    • result Link icon

      protected String result
    • resultListener Link icon

      protected FileChooser.ResultListener resultListener
    • selectionListener Link icon

      protected com.badlogic.gdx.scenes.scene2d.EventListener selectionListener
  • Constructor Details Link icon

    • FileChooser Link icon

      public FileChooser(String title, com.badlogic.gdx.scenes.scene2d.ui.Skin skin, com.badlogic.gdx.scenes.scene2d.Stage stage, Path baseDir, FileChooser.FileChooserTarget target)
    • FileChooser Link icon

      public FileChooser(String title, com.badlogic.gdx.scenes.scene2d.ui.Skin skin, com.badlogic.gdx.scenes.scene2d.Stage stage, Path baseDir, FileChooser.FileChooserTarget target, com.badlogic.gdx.scenes.scene2d.EventListener selectionListener)
    • FileChooser Link icon

      public FileChooser(String title, com.badlogic.gdx.scenes.scene2d.ui.Skin skin, com.badlogic.gdx.scenes.scene2d.Stage stage, Path baseDir, FileChooser.FileChooserTarget target, com.badlogic.gdx.scenes.scene2d.EventListener selectionListener, boolean directoryBrowsingEnabled)
  • Method Details Link icon

    • build Link icon

      public void build()
      Description copied from class: GenericDialog
      Build the content here.
      Specified by:
      build in class GenericDialog
    • setShowHidden Link icon

      public void setShowHidden(boolean showHidden)
    • setShowHiddenConsumer Link icon

      public void setShowHiddenConsumer(Consumer<Boolean> r)
      Sets a consumer that is run when the property 'showHidden' changes, whit its value.
      Parameters:
      r - The consumer
    • setAcceptedFiles Link icon

      public void setAcceptedFiles(String accepted)
    • getResult Link icon

      public Path getResult()
    • setFilter Link icon

      public FileChooser setFilter(DirectoryStream.Filter<Path> filter)
      Overrides the default filter. If you use this, the attributes directoryBrowsingEnabled and fileBrowsingEnabled won't have effect anymore. To set additional filters on the path names, use setFileFilter(PathnameFilter) instead.
      Parameters:
      filter - The new file filter
      Returns:
      This file chooser
    • setFileFilter Link icon

      public FileChooser setFileFilter(FileChooser.PathnameFilter f)
      Sets the file filter. This filter will be used to check whether file path names are accepted or not. It works in conjunction with fileBrowsingEnabled, so you do not need to check whether the pathname is a file.
      Parameters:
      f - The file filter.
      Returns:
      This file chooser.
    • setFileNameEnabled Link icon

      public FileChooser setFileNameEnabled(boolean fileNameEnabled)
    • setResultListener Link icon

      public void setResultListener(FileChooser.ResultListener result)
    • accept Link icon

      public boolean accept()
      Description copied from class: GenericDialog
      The accept function, if any.
      Specified by:
      accept in class GenericDialog
      Returns:
      True if the dialog must close after the call, false otherwise.
    • cancel Link icon

      public void cancel()
      Description copied from class: GenericDialog
      The cancel function, if any.
      Specified by:
      cancel in class GenericDialog
    • dispose Link icon

      public void dispose()
      Specified by:
      dispose in class GenericDialog