Package snap.viewx
Class FilePanel
java.lang.Object
snap.props.PropObject
snap.view.ViewOwner
snap.viewx.FilePanel
- All Implemented Interfaces:
PropChange.DoChange
A class to select a file to open or save.
-
Field Summary
Fields inherited from class snap.view.ViewOwner
Action, DragDrop, DragEnter, DragEvents, DragExit, DragGesture, DragOver, KeyEvents, KeyPress, KeyRelease, KeyType, MouseDrag, MouseEnter, MouseEvents, MouseExit, MouseMove, MousePress, MouseRelease, Showing_Prop, WinClose
Fields inherited from class snap.props.PropObject
_pcs, EMPTY_OBJECT
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
addDefaultSite
(WebSite aSite) Adds a site.protected void
Adds a new Folder button.void
Adds a site available to open/save files.protected View
createUI()
Override to return FileBrowser UI.protected void
fireActionEvent
(ViewEvent anEvent) Called on FileBrowser double-click or InputText enter key.Returns the action event listener.static WebSite[]
Returns the sites.Returns the function that determines whether file can be selected.Returns the selected file.Returns the selected file and adds it to recent files.Returns the site currently being browsed.Returns the current selected site pane.WebSite[]
getSites()
Return sites available to open/save files.String[]
getTypes()
Returns the file types.protected void
initUI()
Initialize UI.boolean
isSaving()
Returns whether is saving.static void
removeDefaultSite
(WebSite aSite) Removes a site.void
removeSite
(WebSite aSite) Removes a site available to open/save files.protected void
Respond UI.void
setActionHandler
(EventListener actionHandler) Sets the action event listener.void
Sets the description.void
setFileValidator
(Predicate<WebFile> fileValidator) Sets the function that determines whether file can be selected.void
setSaving
(boolean aValue) Sets whether is saving.void
setSelFile
(WebFile aFile) Returns the selected file.void
setSelSite
(WebSite aSite) Sets the site currently being browsed.void
Sets the file types.showFilePanel
(View aView) Runs a file chooser that remembers last open file and size.static WebFile
showOpenFilePanel
(View aView, String aDesc, String... theTypes) Shows an Open panel for given description and types.static String
showOpenPanel
(View aView, String aDesc, String... theTypes) Shows an Open panel for given description and types.static WebFile
showSaveFilePanel
(View aView, String aDesc, String... theTypes) Shows a Save panel for given description and types.static String
showSavePanel
(View aView, String aDesc, String... theTypes) Shows a Save panel for given description and types.Methods inherited from class snap.view.ViewOwner
addKeyActionFilter, addKeyActionHandler, addViewEventHandler, beep, cancelReset, createUIForClass, dispatchEventToOwner, enableEvents, fireActionEventForObject, getEnv, getFirstFocus, getImage, getNative, getToggleGroup, getUI, getUI, getUISource, getView, getView, getViewBoolValue, getViewFloatValue, getViewIntValue, getViewItems, getViewSelIndex, getViewSelItem, getViewStringValue, getViewText, getViewValue, getWindow, initShowing, initWindow, invokeResetUI, invokeRespondUI, isEventThread, isSendEventDisabled, isShowing, isUISet, isViewDisabled, isViewEnabled, isViewVisible, isWindowSet, isWindowVisible, requestFocus, resetLater, resetUI, runDelayed, runLater, setFirstFocus, setSendEventDisabled, setShowing, setViewDisabled, setViewEnabled, setViewItems, setViewItems, setViewSelIndex, setViewSelItem, setViewText, setViewValue, setViewVisible, setWindowVisible
Methods inherited from class snap.props.PropObject
addDeepChangeListener, addPropChangeListener, addPropChangeListener, clone, firePropChange, firePropChange, firePropChange, getPropDefault, getPropForName, getPropParent, getPropSet, getPropsForArchival, getPropsForArchivalExtra, getPropsString, getPropValue, initProps, isPropDefault, processPropChange, removeDeepChangeListener, removePropChangeListener, removePropChangeListener, setPropsString, setPropValue, setPropValues, toString, toStringProps
-
Field Details
-
SelFile_Prop
- See Also:
-
SelSite_Prop
- See Also:
-
-
Constructor Details
-
FilePanel
public FilePanel()Constructor.
-
-
Method Details
-
isSaving
public boolean isSaving()Returns whether is saving. -
setSaving
public void setSaving(boolean aValue) Sets whether is saving. -
getFileValidator
Returns the function that determines whether file can be selected. -
setFileValidator
Sets the function that determines whether file can be selected. -
getTypes
Returns the file types. -
setTypes
Sets the file types. -
getActionHandler
Returns the action event listener. -
setActionHandler
Sets the action event listener. -
setDesc
Sets the description. -
getSites
Return sites available to open/save files. -
addSite
Adds a site available to open/save files. -
removeSite
Removes a site available to open/save files. -
getSelSite
Returns the site currently being browsed. -
setSelSite
Sets the site currently being browsed. -
getSelFile
Returns the selected file. -
setSelFile
Returns the selected file. -
getSelFileAndAddToRecentFiles
Returns the selected file and adds it to recent files. -
showFilePanel
Runs a file chooser that remembers last open file and size. -
createUI
Override to return FileBrowser UI. -
initUI
protected void initUI()Initialize UI. -
respondUI
Respond UI. -
fireActionEvent
Called on FileBrowser double-click or InputText enter key. -
getSelSitePane
Returns the current selected site pane. -
addNewFolderButton
protected void addNewFolderButton()Adds a new Folder button. -
showOpenPanel
Shows an Open panel for given description and types. -
showSavePanel
Shows a Save panel for given description and types. -
showOpenFilePanel
Shows an Open panel for given description and types. -
showSaveFilePanel
Shows a Save panel for given description and types. -
getDefaultSites
Returns the sites. -
addDefaultSite
Adds a site. -
removeDefaultSite
Removes a site.
-