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

    • result

      protected String result
    • resultListener

      protected FileChooser.ResultListener resultListener
    • selectionListener

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

    • FileChooser

      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

      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

      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

    • build

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

      public void setShowHidden(boolean showHidden)
    • setShowHiddenConsumer

      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

      public void setAcceptedFiles(String accepted)
    • getResult

      public Path getResult()
    • setFilter

      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

      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

      public FileChooser setFileNameEnabled(boolean fileNameEnabled)
    • setResultListener

      public void setResultListener(FileChooser.ResultListener result)
    • accept

      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

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

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