Skip to content

Latest commit

 

History

History
87 lines (52 loc) · 2.51 KB

File metadata and controls

87 lines (52 loc) · 2.51 KB

File Dialog

We plan to have it here under spec1-file-dialog but no time.

Build Status Coverage Status

A simple replacement for Pharo's native file/folder selection dialog.

Features

  • contextMenu to add/remove bookmark
  • toggle hidden files (right-click on file listing)
  • preset file name
  • filtering files by subclass FDAbstractSelect
  • TextInputField like window path text input
  • preview system
  • you can change the column of the tablePresente

Installation

(catalog soon)

Metacello new
	baseline: 'FileDialog';
	repository: 'github://pharo-contributions/file-dialog/repository';
	load.

Replacing native dialogs

If you feel brave, you can replace the native dialogs everywhere in the system by running

FDMorphicUIManager new beDefault

Of course you can switch back anytime you want.

MorphicUIManager new beDefault

Howto

If you chose using the extended UIManager, then you can use that

UIManager default chooseFileMatching: #('*.ston')

You can also use the classes directly — there are just minor differences in the behavior, such as DirectoryDialog will not show files, etc.

Classes

  • FDSaveFileDialog - saving a file
  • FDOpenFileDialog - selecting a file
  • FDOpenDirectoryDialog - selecting a directory

API

The user-facing API is in the api-customization protocol of FDFileDialogPresenter

  • defaultFolder: aPath — where should the dialog open, the default is the imageDirectory
  • filtersCustomization: aCollectionOfFDAbstractPredicate — a collection of FDAbstractPredicate
  • bookmarks: aCollectionOfBookmark _ see bookmark example class side of FileDialog
  • okActionBlock: aBlock — a one arg block executed when a file was selected
  • previewer: aPreviewer _ a son of FDAbstractPreviewer that returning a Spec widget
  • columns: aCollectionOfColumns _ you have to give a collection of subclass of FDAbstractFileReferenceColumn

Custom Icons

Example