UIFileChooser

php\swing\UIFileChooser

extends: php\swing\UIContainer

Class UIFileChooser

Constants


constant FILES_ONLY
constant DIRECTORIES_ONLY
constant FILES_AND_DIRECTORIES

Properties


property dialogTitle

string

property approveButtonText

string

property selectedFile

php\io\File

property selectedFiles

php\swing\File[]

property multiSelection

bool

property selectionMode

int

Example: FILES_AND_DIRECTORIES, FILES_ONLY or DIRECTORIES_ONLY

property dragEnabled

bool

property fileHiding

bool

property controlButtonVisible

bool

property acceptAllFileFilterUsed

bool

Methods


showDialog($approveButtonText, $parent = null)
Parameters:
Returns:

bool

showSaveDialog($parent = null)
Parameters:
Returns:

bool

showOpenDialog($parent = null)
Parameters:
Returns:

bool

addChoosableFilter($filter, $description)
Parameters:
  • $filtercallable - (File $file) -> bool
  • $descriptionstring
addChoosableExtensions($extensions, $description, $showDirectories = true)
Parameters:
  • $extensionsarray - [‘jpg’, ‘gif’, ‘png’, ... etc]
  • $descriptionstring
  • $showDirectoriesbool
resetChoosableFilters()
isTraversable($file)
Parameters:
Returns:

bool

ensureFileIsVisible($file)
Parameters:
approveSelection()
cancelSelection()
changeToParentDirectory()
onFileView($field, $callback = null)
Parameters:
  • $fieldstring - - name (string), description (string), icon (Image), traversable (bool)
  • $callbackcallable - (File $file)