Package snap.viewx

Class FilePanel

All Implemented Interfaces:
PropChange.DoChange

public class FilePanel extends ViewOwner
A class to select a file to open or save.
  • Field Details

  • 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

      public Predicate<WebFile> getFileValidator()
      Returns the function that determines whether file can be selected.
    • setFileValidator

      public void setFileValidator(Predicate<WebFile> fileValidator)
      Sets the function that determines whether file can be selected.
    • getTypes

      public String[] getTypes()
      Returns the file types.
    • setTypes

      public void setTypes(String... theExts)
      Sets the file types.
    • getActionHandler

      public EventListener getActionHandler()
      Returns the action event listener.
    • setActionHandler

      public void setActionHandler(EventListener actionHandler)
      Sets the action event listener.
    • setDesc

      public void setDesc(String aValue)
      Sets the description.
    • getSites

      public WebSite[] getSites()
      Return sites available to open/save files.
    • addSite

      public void addSite(WebSite aSite)
      Adds a site available to open/save files.
    • removeSite

      public void removeSite(WebSite aSite)
      Removes a site available to open/save files.
    • getSelSite

      public WebSite getSelSite()
      Returns the site currently being browsed.
    • setSelSite

      public void setSelSite(WebSite aSite)
      Sets the site currently being browsed.
    • getSelFile

      public WebFile getSelFile()
      Returns the selected file.
    • setSelFile

      public void setSelFile(WebFile aFile)
      Returns the selected file.
    • getSelFileAndAddToRecentFiles

      public WebFile getSelFileAndAddToRecentFiles()
      Returns the selected file and adds it to recent files.
    • showFilePanel

      public WebFile showFilePanel(View aView)
      Runs a file chooser that remembers last open file and size.
    • createUI

      protected View createUI()
      Override to return FileBrowser UI.
      Overrides:
      createUI in class ViewOwner
    • initUI

      protected void initUI()
      Initialize UI.
      Overrides:
      initUI in class ViewOwner
    • respondUI

      protected void respondUI(ViewEvent anEvent)
      Respond UI.
      Overrides:
      respondUI in class ViewOwner
    • fireActionEvent

      protected void fireActionEvent(ViewEvent anEvent)
      Called on FileBrowser double-click or InputText enter key.
    • addNewFolderButton

      protected void addNewFolderButton()
      Adds a new Folder button.
    • showOpenPanel

      public static String showOpenPanel(View aView, String aDesc, String... theTypes)
      Shows an Open panel for given description and types.
    • showSavePanel

      public static String showSavePanel(View aView, String aDesc, String... theTypes)
      Shows a Save panel for given description and types.
    • showOpenFilePanel

      public static WebFile showOpenFilePanel(View aView, String aDesc, String... theTypes)
      Shows an Open panel for given description and types.
    • showSaveFilePanel

      public static WebFile showSaveFilePanel(View aView, String aDesc, String... theTypes)
      Shows a Save panel for given description and types.
    • getDefaultSites

      public static WebSite[] getDefaultSites()
      Returns the sites.
    • addDefaultSite

      public static void addDefaultSite(WebSite aSite)
      Adds a site.
    • removeDefaultSite

      public static void removeDefaultSite(WebSite aSite)
      Removes a site.