org.vishia.gral.widget

## Class GralFileSelector

- java.lang.Object
- - org.vishia.gral.base.GralWidget
  - - org.vishia.gral.widget.GralFileSelector

- All Implemented Interfaces:
    GetGralWidget_ifc, GralSetValue_ifc, GralWidget_ifc, Removeable
  Direct Known Subclasses:
    FcmdFileCard

      public class GralFileSelector
      extends GralWidget
      implements Removeable

  This class is a large widget which contains a list to select files in a directory, supports navigation in the directory tree and shows the current path in an extra text field. Additional 'search in files' is supported.
  The type of a file is a `FileRemote`. This type inherits from `File` and is supported for a local file system on PC. It is possible to work with any remote file system.
  The graphical user interface allows some action to do with the right mouse menu:
  - Refresh content
  - sort files by date latest, newest, by size largest, smallest, by name and by extension.
  - Search content in files with a dialog window.
  Callback to users program:
  The method `specifyActionOnFileSelected(GralUserAction)` allows any action while the user select any file. For example a user's program can show the content of the file.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `private static class` | `GralFileSelector.ERefresh`
    `protected class` | `GralFileSelector.FileSelectList` Implementation of the base widget.
    `static class` | `GralFileSelector.MenuTexts` This class is instantiated static and contains English menu texts.
    `static class` | `GralFileSelector.WindowConfirmSearch` A window for search-in-file dialogue.

    - ### Nested classes/interfaces inherited from class org.vishia.gral.base.GralWidget

      `GralWidget.ActionChangeSelect, GralWidget.ConfigData, GralWidget.DynamicData, GralWidget.ImplAccess`

    - ### Nested classes/interfaces inherited from interface org.vishia.gral.ifc.GralWidget_ifc

      `GralWidget_ifc.ActionChange, GralWidget_ifc.ActionChangeWhen`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `(package private) GralUserAction` | `actionDeselectDirtree`
    `(package private) GralUserAction` | `actionFavorButton`
    `private GralUserAction` | `actionOnEnterDirectory` This action will be called on pressing enter or mouse-click on a directory.
    `private GralUserAction` | `actionOnEnterFile` This action will be called on pressing enter or mouse-click on a simple file.
    `private GralUserAction` | `actionOnEnterPathNewFile` This action will be called on pressing enter or mouse-click on the path text field if it contains any text which can't assigned to an existing file.
    `protected GralUserAction` | `actionOnFileSelected` This action will be called any time when the selection of a current file is changed.
    `private GralUserAction` | `actionOnFileSelection` Action to show the file properties in the info line.
    `private MarkMask_ifc` | `actionOnMarkLine`
    `(package private) GralUserAction` | `actionRefreshFileTable` Sets the origin dir of the last focused file table.
    `(package private) GralUserAction` | `actionSetFileAttribs`
    `(package private) GralUserAction` | `actionSetPath` Action on [Enter]-key on the path text field.
    `(package private) GralUserAction` | `actionShowCreationTime`
    `(package private) GralUserAction` | `actionShowLastAccessTime`
    `(package private) GralUserAction` | `actionShowLastModifiedTime`
    `(package private) GralUserAction` | `actionSortFilePerExtensionCase`
    `(package private) GralUserAction` | `actionSortFilePerExtensionNonCase`
    `(package private) GralUserAction` | `actionSortFilePerLenghLargestFirst`
    `(package private) GralUserAction` | `actionSortFilePerNameCase`
    `(package private) GralUserAction` | `actionSortFilePerNameNonCase`
    `(package private) GralUserAction` | `actionSortFilePerTimestamp`
    `(package private) GralUserAction` | `actionSortFilePerTimestampOldestFirst`
    `(package private) GralUserAction` | `actionSortFilesPerLenghSmallestFirst`
    `(package private) GralUserAction` | `actionSwitchoffCheckRefresh` Sets the check refresh mode to off.
    `(package private) GralUserAction` | `actionSwitchonCheckRefresh` Sets the check refresh mode to on.
    `FileRemoteCallback` | `callbackChildren1`
    `(package private) GralColor` | `colorBack`
    `(package private) GralColor` | `colorBackPending`
    `(package private) GralUserAction` | `confirmCreate`
    `static GralFileSelector.MenuTexts` | `contextMenuTexts`
    `protected FileRemote` | `currentDir` The current shown directory.
    `protected FileRemote` | `currentFile` Currently selected file in the table.
    `(package private) java.text.SimpleDateFormat` | `dateFormatNewer`
    `(package private) java.text.SimpleDateFormat` | `dateFormatOlder`
    `(package private) java.text.SimpleDateFormat` | `dateFormatToday`
    `(package private) java.text.SimpleDateFormat` | `dateFormatYear`
    `(package private) boolean` | `donotCheckRefresh`
    `protected int` | `durationFillin` Duration of last fillin.
    `protected int` | `durationRefresh` Duration of last fillin.
    `protected GralTable<java.lang.String>` | `favorList`
    `(package private) boolean` | `fillinPending` Set to true if a fillin is pending.
    `private IndexMultiTable<java.lang.String,GralTableLine_ifc<FileRemote>>` | `idxLines`
    `private java.util.Map<java.lang.String,FileRemote>` | `indexSelection` This index stores the last selected file for any directory path which was used.
    `static int` | `kColDate` Column which contains the time stamp
    `static int` | `kColDesignation` Column which contains the designation of entry.
    `static int` | `kColFilename` Column which contains the filename.
    `static int` | `kColLength` Column which contains the length of file
    `static char` | `kSortDateNewest`
    `static char` | `kSortDateOldest`
    `static char` | `kSortExtension`
    `static char` | `kSortExtensionNonCase`
    `static char` | `kSortName`
    `static char` | `kSortNameNonCase`
    `static char` | `kSortSizeLargest`
    `static char` | `kSortSizeSmallest`
    `(package private) FileRemote` | `originDir` The directory which was used on start.
    `protected int` | `refreshCount`
    `(package private) java.lang.String` | `sCurrentDir`
    `(package private) java.lang.String` | `sDatePrefixNewer`
    `(package private) java.lang.String` | `sDatePrefixOlder`
    `(package private) java.lang.String` | `sDatePrefixToday`
    `(package private) java.lang.String` | `sDatePrefixYear`
    `protected GralFileSelector.FileSelectList` | `selectList` The implementation of SelectList.
    `protected char` | `showTime` Determines which time are present in the date/time column.
    `private char` | `sortOrder`
    `private char` | `sortOrderLast`
    `static java.lang.String` | `sVersion` Version, history and copyright/copyleft.
    `protected long` | `timeFilesRefreshed` The time after 1970 when the fillin was invoked and finished at last.
    `protected long` | `timeFillinFinished` The time after 1970 when the fillin was invoked and finished at last.
    `protected long` | `timeFillinInvoked` The time after 1970 when the fillin was invoked and finished at last.
    `protected GralButton` | `widgBtnFavor`
    `protected GralTextField` | `widgdPathDir` The widget for showing the path.
    `protected GralFileSelector.WindowConfirmSearch` | `windSearch`
    `static int` | `zColumns` Number of columns of the table.

    - ### Fields inherited from class org.vishia.gral.base.GralWidget

      `_wdgImpl, bEditable, bHasFocus, bShouldInitialize, buildMng, bVisibleState, cfg, contextMenu, dateUser, dyda, htmlHelp, itsMng, name, repaintDelay, repaintDelayMax, sCmd, sFormat, sToolTip, whatIs`

    - ### Fields inherited from interface org.vishia.gral.ifc.GralSetValue_ifc

      `version`

    - ### Fields inherited from interface org.vishia.gral.base.GetGralWidget_ifc

      `version`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `GralFileSelector(java.lang.String name, int rows, int[] columns, int[] columnsFavorlist)` Creates

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `actionUserKey(int keyCode, java.lang.Object userDataOfLine, GralTableLine_ifc<FileRemote> line)` This method is called on any user key or mouse event while operating in the file table.
    `protected java.lang.String` | `buildKey(FileRemote file, boolean bAllCompleteWithFileInfo, java.lang.String[] retSortName)`
    `void` | `checkRefresh(long since)`
    `private void` | `completeLine(GralTableLine_ifc<FileRemote> tline, FileRemote file, long timeNow)`
    `void` | `createImplWidget_Gthread()` Sets the widgets of this instance to a panel.
    `static GralFileSelector.WindowConfirmSearch` | `createWindowConfirmSearchGthread(GralMngBuild_ifc mng)` Creates the window to confirm search in files.
    `FileRemote` | `currentDir()` Gets the directory which is currently shown.
    `FileRemote` | `currentFile()` Gets the current selected file.
    `void` | `fillIn(FileRemote fileIn, boolean bDonotRefrehs)` Fills the content with given directory.
    `private void` | `fillIn(java.util.List<java.io.File> files)`
    `void` | `fillInCurrentDir()` It is the refresh operation.
    `void` | `fillInOriginDir()` Fills the content with the first directory or the directory which was set with `#setOriginDir(File)`.
    `(package private) void` | `finishShowFileTable()` Finishes a newly showed file table.
    `void` | `forcefillIn(FileRemote fileIn, boolean bCompleteWithFileInfo)`
    `FileRemote` | `getCurrentDir()` same as `currentDir()`.
    `java.lang.String` | `getCurrentDirPath()`
    `java.util.List<FileRemote>` | `getSelectedFiles(boolean bAlsoDirs, int mask)` Gets the selected file from this panel.
    `boolean` | `remove()` Removes the widget from the lists in its panel and from the graphical representation.
    `boolean` | `selectFile(java.lang.String name)` Selects the file with the given name in the table
    `GralUserAction` | `setActionOnEnterDirectory(GralUserAction newAction)` This action will be called on pressing enter or mouse-click on a directory.
    `GralUserAction` | `setActionOnEnterFile(GralUserAction newAction)` Sets the action which is called if any file is entered.
    `GralUserAction` | `setActionOnEnterPathNewFile(GralUserAction newAction)` This action will be called on pressing enter or mouse-click on the path text field if it contains any text which can't assigned to an existing file.
    `GralUserAction` | `setActionSetFileLineAttrib(GralUserAction newAction)` Sets the action which is called if any file is set to the table.
    `void` | `setDateFormat(java.lang.String sFormat)`
    `void` | `setFocus()` Sets the focus of the associated table widget.
    `void` | `setNameWidget(java.lang.String name)` Maybe called after construction, should be called before `GralWidget.setToPanel(GralMngBuild_ifc)`
    `void` | `setOriginDir(FileRemote dir)`
    `void` | `setSortOrder(char sortOrder)` Sets the sort order of entries.
    `void` | `setSortOrderFiles(char order)`
    `boolean` | `setVisible(boolean visible)` Sets the widget visible or not.
    `(package private) void` | `showFile(FileRemote file1)` This routine is invoked in callback of `callbackChildren1` for `fillIn(FileRemote, boolean)` in the refresh thread.
    `void` | `specifyActionOnFileSelected(GralUserAction actionOnLineSelected)` Sets an action which is called any time when another line is selected.
    `(package private) void` | `stop()`
    `java.io.File` | `XXXgetSelectedFile()` Gets the selected file from this panel.

    - ### Methods inherited from class org.vishia.gral.base.GralWidget

      `chgPos, clearShowParam, getActionChange, getActionChangeStrict, getActionDrag, getActionDrop, getActionFocused, getActionShow, getBackColor, getCfgElement, getCmd, getCmd, getContentIdent, getContentInfo, getContextMenu, getData, getDataIx, getDataPath, getDataPath, getFloatValue, getFormat, getGralWidget, getHtmlHelp, getImpl, getItsPanel, getLongValue, getName, getShowMethod, getShowParam, getsToolTip, getText, getValue, getVariable, getVariableFromContentInfo, gralMng, isChanged, isEditable, isGraphicDisposed, isInFocus, isNotEditableOrShouldInitialize, isVisible, pos, refreshFromVariable, refreshFromVariable, repaint, repaint, requestNewValueForVariable, setActionChange, setActionFocused, setActionMouse, setActionShow, setBackColor, setBackgroundColor, setBoundsPixel, setCfgElement, setCmd, setContentIdent, setContentInfo, setData, setDataIx, setDataPath, setDragEnable, setDropEnable, setEditable, setFocus, setForegroundColor, setFormat, setHtmlHelp, setLineColor, setLongValue, setMinMax, setPanelMng, setPrimaryWidgetOfPanel, setText, setTextColor, setToolTip, setToPanel, setValue, setValue, setValue, setValue, setVisibleState, setVisibleStateWidget, specifyActionChange, specifyContextMenu, toString, XXXgetPixelPositionSize, XXXgetWidgetImplementation, XXXremoveWidgetImplementation, XXXrepaintGthread, XXXsetFocusGThread, XXXsetVisibleGThread`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### sVersion

          public static final java.lang.String sVersion

      Version, history and copyright/copyleft.
      - 2018-10-28 Hartmut: The Creation and Position is old style yet. Should invoked in the graphic thread. TODO: create and position in other (main) thread, createImplWidget_Gthread for Swt incarnation.
      - 2018-10-28 Hartmut: The `favorList` is unused yet, create only if position is given.
      - 2018-10-28 Hartmut: questionWindow is removed yet, TODO: should have better solution. Status line!
      - 2018-10-28 Hartmut: `GralFileSelector(String, int, int[], int[])`: The rows argument is used yet for table zLinesMax. The old last argument size was never used. replaced by the column designation for the `favorList`. If it is null, do not create a `favorList`.
      - 2016-05-02 Hartmut: actionFileSearch writes a result list in the panel of the file window. Yet you can copy the path and insert in the directory text widget to select the file. TODO: Pressing enter to select, store the list etc.
      - 2016-05-02 Hartmut now: derived from GralWidget, it is a large widget
      - 2016-05-03 Hartmut new: `setVisible(boolean)` for this large widget.
      - 2015-11-19 Hartmut chg: `fillInCurrentDir()` does not refresh if it was refreshed in the last seconds.
      - 2014-12-26 Hartmut chg: `fillIn(FileRemote, boolean)` now with new meaning of boolean: show newly without refresh with the file system. This is used in callback routines which does a refresh but does not invoke `showFile(FileRemote)` especially called from `Fcmd.refreshFilePanel(FileRemote)`.
      - 2014-01-02 Hartmut chg: does not call 'file.refreshProperties(null);' in `actionSetPath` because the property whether it is a directory or not should be known. Prevents a timeout waiting in graphic thread!!!
      - 2013-09-06 Hartmut chg: Now a new request of fillIn can be executed with aborting the old one.
      - 2013-09-15 Hartmut chg: New implementation of `fillIn(FileRemote, boolean)` using the new `FileRemote#getChildren(org.vishia.fileRemote.FileRemote.ChildrenEvent).`
      - 2013-09-14 Hartmut chg: Sets the background to magenta while refreshing.
      - 2013-09-05 Hartmut chg: `getSelectedFiles(boolean, int)` now has that 2 arguments for directory and mark mask. Now it is possible and necessary for the application to choice whether directories are gotten too. The usage is improved. If some files are marked but not visible, it was able that the user does not know about this situation and an unexpected behavior for the user is done. Now only marked files are returned if the current file is marked too. The method is correct named 'selected' because the selection is returned, either the current file or all marked.
      - 2013-06-15 Hartmut chg: `fillIn(FileRemote, boolean)` modi of refresh.
      - 2013-05-30 Hartmut new: switch refresh mode on and off
      - 2013-05-20 Hartmut chg: `#fillInRefreshed(FileRemote, boolean)` now does not clear the table but writes only lines if the data are changed. This method can be called in a higher frequency without disturbing the appearance of the table. Used for cyclically refresh.
      - 2013-05-20 Hartmut new: Context menu for sort etc. It was part of Fcmd, now here.
      - 2013-04-30 Hartmut new: context menu now available. Sort, refresh, deselect
      - 2013-04-30 Hartmut new: `checkRefresh(long)`, chg: Don't change the content in the table if the content is identical with the current presentation in table, for refreshing.
      - 2013-04-30 Hartmut chg: `fillIn(FileRemote, boolean)` now uses the `FileRemote.timeRefresh`
      - 2013-04-28 Hartmut new: `actionOnMarkLine` changes the select status of `FileRemote.setMarked(int)`
      - 2013-04-12 Hartmut adapt Event, FileRemote: The attributes Event.data1, data2, oData, refData are removed. Any special data should be defined in any derived instance of the event. A common universal data concept may be error-prone because unspecified types and meanings. FileRemote: Dedicated attributes for `CallbackCmd#successCode` etc.
      - 2013-03-28 Hartmut chg: `#setToPanel(GralMngBuild_ifc, String, int, int[], char)` preserves the panel before calling.
      - 2012-11-11 Hartmut bugfix: `#fillInRefreshed(File, boolean)`: If all files are complete with file info, nevertheless the RefreshTimed#delayedFillin(int) was called because the whole routine was called with false as bCompleteWithFileInfo-argument. Now that is prevented if all files were tested already.
      - 2012-10-12 Hartmut chg {@link WindowFileSelection#openDialog(String, String)} with title.
      - 2012-10-01 Hartmut new now {@link #fillIn(File, boolean)} doesn't get the file properties if it is called with false. This makes it faster to show large content of folders on remote devices (in PC-network). If a file is selected it replaces its properties.
      - 2012-09-24 Hartmut new.jar files opened as zip file.
      - 2012-07-30 Hartmut improved using of extra thread on refreshing file properties. Write first 'waiting', the other thread writes the content maybe delayed. The user can abort the access if a response is not kept.
      - 2012-07-28 Hartmut improved zipfile access.
      - 2012-07-29 Hartmut improved access to the file system using the new capabilities of FileRemote. TODO consequently writing 'wait for response' in table and access to the file in another thread.
      - 2012-07-01 Hartmut new {@link #setActionOnEnterPathNewFile(GralUserAction)}. Now this widget is used to select a file to read and save in an application other than the.File.commander.
      - 2012-07-01 Hartmut Refactoring usage of FileRemote: Normally the java.io.File is used. The FileRemote is a specialization, which is not used in all cases.
      - 2012-06-17 new Hartmut: Now sorts list with name, size, date, format of size and date in list adjusted: Separate timestamp of file for today, last year.
      - 2012-06-09 new Hartmut: {@link GralFileSelector.WindowFileSelection}, not ready yet.
      - 2012-04-16 chg: Capability to sort enhanced.
      - 2012-04-10 chg: Now ctrl-PgUp to select parent dir, like in Norton Commander, ctrl-PgDn to entry in dir (parallel to Enter).
      - 2012-03-09 new {@link #kColFilename} etc.
      - 2012-02-14 corr: Anytime a file was selected as current, it was added in the {@link #indexSelection}. Not only if the directory was changed. It is necessary for refresh to select the current file again.
      - 2011-12-11 chg: If the directory is empty, show --empty-- because the table should not be empty.
      - 2011-11-27 new: {@link FileAndName#isWriteable}-property.
      - 2011-11-20 new: Phenomenal basic idea: The files may be located in remote hardware. It means, that a File can't be access here. Therefore the path, name, date, length in the class {@link FileAndName} are the data represents on this process on PC. The access to the file is given with remote access. Usage of inner class FileAndName containing path, name, date, length instead a File instance.
      - 2011-10-02 new: {@link #setActionOnEnterFile(GralUserAction)}. It executes this action if Enter is pressed (or mouse-left- or doubleclick-TODO).
      - 2011-10-01 new: {@link #setOriginDir(File)} and {@link #fillInOriginDir()}. The origin dir is the directory of first selection or can be set by user. If the user navigates misty, the origin dir helps to find again the start point.
      - 2011-09-28 new: {@link #getCurrentDir()}
      - 2011-08-14 created. Firstly used for the Java commander. But it is a universal file select widget.
      Copyright/Copyleft:
      For this source the LGPL Lesser General Public License, published by the Free Software Foundation is valid. It means:
      1. You can use this source without any restriction for any desired purpose.
      2. You can redistribute copies of this source to everybody.
      3. Every user of this source, also the user of redistribute copies with or without payment, must accept this license for further using.
      4. But the LPGL is not appropriate for a whole software product, if this source is only a part of them. It means, the user must publish this part of source, but doesn't need to publish the whole source of the own product.
      5. You can study and modify (improve) this source for own using or for redistribution, but you have to license the modified sources likewise under this LGPL Lesser General Public License. You mustn't delete this Copyright/Copyleft inscription in this source file.
      If you intent to use this source without publishing its usage, you can get a second license subscribing a special contract with the author.
      See Also:
        Constant Field Values

    - #### windSearch

          protected GralFileSelector.WindowConfirmSearch windSearch

    - #### actionOnFileSelection

          private final GralUserAction actionOnFileSelection

      Action to show the file properties in the info line. This action is called anytime if a line was changed in the file view table.

    - #### actionOnMarkLine

          private final MarkMask_ifc actionOnMarkLine

    - #### zColumns

          public static final int zColumns

      Number of columns of the table.
      See Also:
        Constant Field Values

    - #### kColDesignation

          public static final int kColDesignation

      Column which contains the designation of entry.
      - "/" a directory
      - ">" a linked directory (unix systems, symbolic link)
      - " " space, normal file
      - "*" a linked file
      - "#" comparison result: there are differences
      - "+" comparison result: contains more
      - "-" comparison result: contains less
      See Also:
        Constant Field Values

    - #### kColFilename

          public static final int kColFilename

      Column which contains the filename. The column contains either the name of the file or ".." or "--unknown--".
      See Also:
        Constant Field Values

    - #### kColLength

          public static final int kColLength

      Column which contains the length of file
      See Also:
        Constant Field Values

    - #### kColDate

          public static final int kColDate

      Column which contains the time stamp
      See Also:
        Constant Field Values

    - #### kSortName

          public static final char kSortName

      See Also:
        Constant Field Values

    - #### kSortNameNonCase

          public static final char kSortNameNonCase

      See Also:
        Constant Field Values

    - #### kSortExtension

          public static final char kSortExtension

      See Also:
        Constant Field Values

    - #### kSortExtensionNonCase

          public static final char kSortExtensionNonCase

      See Also:
        Constant Field Values

    - #### kSortDateNewest

          public static final char kSortDateNewest

      See Also:
        Constant Field Values

    - #### kSortDateOldest

          public static final char kSortDateOldest

      See Also:
        Constant Field Values

    - #### kSortSizeLargest

          public static final char kSortSizeLargest

      See Also:
        Constant Field Values

    - #### kSortSizeSmallest

          public static final char kSortSizeSmallest

      See Also:
        Constant Field Values

    - #### contextMenuTexts

          public static GralFileSelector.MenuTexts contextMenuTexts

    - #### sortOrder

          private char sortOrder

    - #### sortOrderLast

          private char sortOrderLast

    - #### showTime

          protected char showTime

      Determines which time are present in the date/time column. m a c for last modified, last access, creation

    - #### selectList

          protected GralFileSelector.FileSelectList selectList

      The implementation of SelectList.

    - #### colorBack

          GralColor colorBack

    - #### colorBackPending

          GralColor colorBackPending

    - #### idxLines

          private final IndexMultiTable<java.lang.String,GralTableLine_ifc<FileRemote>> idxLines

    - #### favorList

          protected final GralTable<java.lang.String> favorList

    - #### indexSelection

          private final java.util.Map<java.lang.String,FileRemote> indexSelection

      This index stores the last selected file for any directory path which was used. If the directory path is reused later, the same file will be selected initially. It helps by navigation through the file tree.
      - The key is the path in canonical form with '/' as separator (in windows too!) but without terminating '/'.
      - The value is the name of the file in this directory.

    - #### timeFillinInvoked

          protected long timeFillinInvoked

      The time after 1970 when the fillin was invoked and finished at last. timeFillinFinished=0, then pending.

    - #### timeFilesRefreshed

          protected long timeFilesRefreshed

      The time after 1970 when the fillin was invoked and finished at last. timeFillinFinished=0, then pending.

    - #### timeFillinFinished

          protected long timeFillinFinished

      The time after 1970 when the fillin was invoked and finished at last. timeFillinFinished=0, then pending.

    - #### durationRefresh

          protected int durationRefresh

      Duration of last fillin.

    - #### durationFillin

          protected int durationFillin

      Duration of last fillin.

    - #### refreshCount

          protected int refreshCount

    - #### donotCheckRefresh

          boolean donotCheckRefresh

    - #### widgdPathDir

          protected GralTextField widgdPathDir

      The widget for showing the path.

    - #### widgBtnFavor

          protected GralButton widgBtnFavor

    - #### sDatePrefixNewer

          java.lang.String sDatePrefixNewer

    - #### dateFormatNewer

          java.text.SimpleDateFormat dateFormatNewer

    - #### sDatePrefixToday

          java.lang.String sDatePrefixToday

    - #### dateFormatToday

          java.text.SimpleDateFormat dateFormatToday

    - #### sDatePrefixYear

          java.lang.String sDatePrefixYear

    - #### dateFormatYear

          java.text.SimpleDateFormat dateFormatYear

    - #### sDatePrefixOlder

          java.lang.String sDatePrefixOlder

    - #### dateFormatOlder

          java.text.SimpleDateFormat dateFormatOlder

    - #### currentDir

          protected FileRemote currentDir

      The current shown directory.

    - #### currentFile

          protected FileRemote currentFile

      Currently selected file in the table.

    - #### sCurrentDir

          java.lang.String sCurrentDir

    - #### originDir

          FileRemote originDir

      The directory which was used on start.

    - #### actionOnFileSelected

          protected GralUserAction actionOnFileSelected

      This action will be called any time when the selection of a current file is changed.

    - #### actionOnEnterFile

          private GralUserAction actionOnEnterFile

      This action will be called on pressing enter or mouse-click on a simple file.

    - #### actionOnEnterDirectory

          private GralUserAction actionOnEnterDirectory

      This action will be called on pressing enter or mouse-click on a directory. Usual the directory can be entered and showed. But the user can do any other action. If this action returns false, the default behavior: enter the directory will be done.

    - #### actionOnEnterPathNewFile

          private GralUserAction actionOnEnterPathNewFile

      This action will be called on pressing enter or mouse-click on the path text field if it contains any text which can't assigned to an existing file.

    - #### actionSetFileAttribs

          GralUserAction actionSetFileAttribs

    - #### fillinPending

          boolean fillinPending

      Set to true if a fillin is pending.

    - #### callbackChildren1

          public FileRemoteCallback callbackChildren1

    - #### actionSetPath

          GralUserAction actionSetPath

      Action on [Enter]-key on the path text field.
      - If the text represents an existing directory, it is used as current.
      - If the text represents an existing file, the parent directory is used as current and the file is stored as current in this directory, see `indexSelection`.
      - If the path is absolute (starting with '/' or '\\' maybe with leading drive letter for windows then it is used absolute. If the path is not absolute, it is used starting from the current one.
      - If the path contains a name only, it is a file. You can
      - If the text represents a file which is not existing, but its directory path is existing, a quest is posted whether the file should be created. On [OK] either the file will be created as new file or its path is returned.

    - #### actionSortFilePerNameCase

          GralUserAction actionSortFilePerNameCase

    - #### actionSortFilePerNameNonCase

          GralUserAction actionSortFilePerNameNonCase

    - #### actionSortFilePerExtensionCase

          GralUserAction actionSortFilePerExtensionCase

    - #### actionSortFilePerExtensionNonCase

          GralUserAction actionSortFilePerExtensionNonCase

    - #### actionSortFilePerTimestamp

          GralUserAction actionSortFilePerTimestamp

    - #### actionSortFilePerTimestampOldestFirst

          GralUserAction actionSortFilePerTimestampOldestFirst

    - #### actionShowLastModifiedTime

          GralUserAction actionShowLastModifiedTime

    - #### actionShowLastAccessTime

          GralUserAction actionShowLastAccessTime

    - #### actionShowCreationTime

          GralUserAction actionShowCreationTime

    - #### actionSortFilePerLenghLargestFirst

          GralUserAction actionSortFilePerLenghLargestFirst

    - #### actionSortFilesPerLenghSmallestFirst

          GralUserAction actionSortFilesPerLenghSmallestFirst

    - #### actionDeselectDirtree

          GralUserAction actionDeselectDirtree

    - #### actionRefreshFileTable

          GralUserAction actionRefreshFileTable

      Sets the origin dir of the last focused file table.
      Implementation note: The last focused file tab is searched using `Fcmd.getLastSelectedFileCards()`.

    - #### actionSwitchoffCheckRefresh

          GralUserAction actionSwitchoffCheckRefresh

      Sets the check refresh mode to off.

    - #### actionSwitchonCheckRefresh

          GralUserAction actionSwitchonCheckRefresh

      Sets the check refresh mode to on.

    - #### confirmCreate

          GralUserAction confirmCreate

    - #### actionFavorButton

          GralUserAction actionFavorButton

  - ### Constructor Detail

    - #### GralFileSelector

          public GralFileSelector(java.lang.String name,
                                  int rows,
                                  int[] columns,
                                  int[] columnsFavorlist)

      Creates
      Parameters:
        `posName` - `"@position=name"` or `"name"`, see `GralWidget.GralWidget(String, char)` arg1,
        `rows` -
        `columns` -
        `size` -

  - ### Method Detail

    - #### setNameWidget

          public void setNameWidget(java.lang.String name)

      Maybe called after construction, should be called before `GralWidget.setToPanel(GralMngBuild_ifc)`
      Parameters:
        `name` -

    - #### setDateFormat

          public void setDateFormat(java.lang.String sFormat)

    - #### createImplWidget_Gthread

          public void createImplWidget_Gthread()

      Sets the widgets of this instance to a panel. The panel and the position in the panel should be set before using `GralMngBuild_ifc.selectPanel(String)` and `GralMngBuild_ifc#setPositionInPanel(float, float, float, float, char)`. The instance has more as one widget, all widgets are set in the area of the given position. The position area should be a range of at least 3 lines.
      Specified by:
        `createImplWidget_Gthread` in interface `GralWidget_ifc`
      Overrides:
        `createImplWidget_Gthread` in class `GralWidget`
      Parameters:
        `panelMng` - The panelManager.
        `identArgJbat` - The name of the table widget. The Text-widget for the path gets the name * "-Path".
        `rows` - Number of rows to show
        `columns` - Array with column width.
        `size` - Presentation size. It is a character 'A'..'E', where 'A' is a small size. The size determines the font size especially.

    - #### createWindowConfirmSearchGthread

          public static GralFileSelector.WindowConfirmSearch createWindowConfirmSearchGthread(GralMngBuild_ifc mng)

      Creates the window to confirm search in files. This window can be created only one time for all file panels, if the application has more as one. On activating the directory and the file panel to show results should be given. But only one search process can be run simultaneously.
      Returns:
        The created window.

    - #### specifyActionOnFileSelected

          public void specifyActionOnFileSelected(GralUserAction actionOnLineSelected)

      Sets an action which is called any time when another line is selected.
      Parameters:
        `actionOnLineSelected` - The action, null to switch off this functionality.

    - #### getCurrentDirPath

          public java.lang.String getCurrentDirPath()

    - #### setOriginDir

          public void setOriginDir(FileRemote dir)

    - #### setSortOrder

          public void setSortOrder(char sortOrder)

      Sets the sort order of entries. Valid chars for 'sortOrder' are:
      - n: sort by name, case sensitive, A..Z a..z in ASCII order
      - N: sort by name, non case-sensitive, Aa..Zz, other characters in ASCII order but '_' first.
      - x: sort by extension, case sensitive. sort by names with equal extension, case sensitive
      - X: sort by extension, non case sensitive. sort by names with equal extension, non case sensitive
      - d: sort by timestamp, newest first
      - o: sort by timestamp, oldest first.
      - l: sort by size, largest first.
      - s: sort by size, smallest first.
      Parameters:
        `sortOrder` -

    - #### setActionOnEnterFile

          public GralUserAction setActionOnEnterFile(GralUserAction newAction)

      Sets the action which is called if any file is entered. It means the Enter-Key is pressed or a mouse double-click is done on a file.
      Parameters:
        `newAction` - The action to use. The action is invoked with TODO
      Returns:
        The current assigned action or null.

    - #### setActionOnEnterDirectory

          public GralUserAction setActionOnEnterDirectory(GralUserAction newAction)

      This action will be called on pressing enter or mouse-click on a directory. Usual the directory can be entered and showed. But the user can do any other action. If this action returns false, the default behavior: enter the directory will be done.

    - #### setActionOnEnterPathNewFile

          public GralUserAction setActionOnEnterPathNewFile(GralUserAction newAction)

      This action will be called on pressing enter or mouse-click on the path text field if it contains any text which can't assigned to an existing file.

    - #### setActionSetFileLineAttrib

          public GralUserAction setActionSetFileLineAttrib(GralUserAction newAction)

      Sets the action which is called if any file is set to the table.
      Parameters:
        `newAction` - The action to use. The action is invoked with TODO
      Returns:
        The current assigned action or null.

    - #### fillInOriginDir

          public void fillInOriginDir()

      Fills the content with the first directory or the directory which was set with `#setOriginDir(File)`.

    - #### fillInCurrentDir

          public void fillInCurrentDir()

      It is the refresh operation. If `fillinPending` is set yet this operation does nothing. It means it is possible to call in a short cycle more as one time after another, for example for all files of a directory without calculation effort.

    - #### fillIn

          private void fillIn(java.util.List<java.io.File> files)

    - #### forcefillIn

          public void forcefillIn(FileRemote fileIn,
                                  boolean bCompleteWithFileInfo)

    - #### fillIn

          public void fillIn(FileRemote fileIn,
                             boolean bDonotRefrehs)

      Fills the content with given directory. If the same directory was refreshed in a short time before, it is not refreshed here. That is while fast navigation in a tree.
      Parameters:
        `fileIn` - The directory which's files are shown.
        `bDonotRefrehs` - false then invoke an extra thread to walk through the file system, see @`FileRemote#refreshPropertiesAndChildren(FileRemoteCallback)` and `callbackChildren1`. If true then it is presumed that the FileRemote children are refreshed in the last time already. The fill the table newly with given content in this thread.

    - #### showFile

          void showFile(FileRemote file1)

      This routine is invoked in callback of `callbackChildren1` for `fillIn(FileRemote, boolean)` in the refresh thread.
      Parameters:
        `file1` -

    - #### finishShowFileTable

          void finishShowFileTable()

      Finishes a newly showed file table. Removes all lines which have the `colorBackPending` yet, they are not refreshed because that files don't exist furthermore. Gets the `currentFile()` of this table from the `indexSelection` if the `currentFile` is null, sets the current line and repaint the table.

    - #### completeLine

          private void completeLine(GralTableLine_ifc<FileRemote> tline,
                                    FileRemote file,
                                    long timeNow)

    - #### buildKey

          protected java.lang.String buildKey(FileRemote file,
                                              boolean bAllCompleteWithFileInfo,
                                              java.lang.String[] retSortName)

    - #### checkRefresh

          public void checkRefresh(long since)

    - #### XXXgetSelectedFile

          public java.io.File XXXgetSelectedFile()

      Gets the selected file from this panel.
      Returns:
        null if no line is selected, for example if the panel isn't used yet.

    - #### getSelectedFiles

          public java.util.List<FileRemote> getSelectedFiles(boolean bAlsoDirs,
                                                             int mask)

      Gets the selected file from this panel. If the current file of this panel is marked, then all other marked files and directories of this panel are returned too. If the current file is not marked, then only this current file is returned as selected file.
      Strategy changed since 2013-09-05: Before, the marked files are returned. But it is possible that some files are marked outside of the visible area, and the user does not know that there are marked files. In this case an unexpected behavior from the user's view occurs. If the user selects a marked file, then one should be sure that there are other marked files in non visible areas too.
      Parameters:
        `bAlsoDirs` - false then returns never a directory. If the current selected file is a directory then return null.
      Returns:
        null if no line is selected, for example if the panel isn't used yet. If the current file is non-marked, then returns a list of only 1 element, that current file. If the current file is marked, return all marked files.

    - #### selectFile

          public boolean selectFile(java.lang.String name)

      Selects the file with the given name in the table
      Parameters:
        `name` - name of file like it is shown in the table (given as key).
      Returns:
        true if found and selected.

    - #### currentFile

          public FileRemote currentFile()

      Gets the current selected file. Note: If the .. is selected, the current file is the parent directory. If any directory is selected, this is the currentFile(). Check with `File.isDirectory()`.

    - #### currentDir

          public FileRemote currentDir()

      Gets the directory which is currently shown. Note: If the .. is selected, the current directory is the directory where the .. is located, whereby the `currentFile()` is the parent. Elsewhere this method returns the parent of `currentFile()`.

    - #### getCurrentDir

          public FileRemote getCurrentDir()

      same as `currentDir()`.

    - #### setFocus

          public void setFocus()

      Sets the focus of the associated table widget.
      Specified by:
        `setFocus` in interface `GralWidget_ifc`
      Overrides:
        `setFocus` in class `GralWidget`
      See Also:
        `GralWidget_ifc.setFocus()`

    - #### setVisible

          public boolean setVisible(boolean visible)

      Description copied from class: `GralWidget`
      Sets the widget visible or not. It is the default implementation for all simple widgets: Sets `GralWidget.ImplAccess.chgVisible` or `GralWidget.ImplAccess.chgInvisible` in `GralWidget.DynamicData.setChanged(int)` and invokes `GralWidget.repaint()` with the `GralWidget.repaintDelay` and `GralWidget.repaintDelayMax`
      Specified by:
        `setVisible` in interface `GralWidget_ifc`
      Overrides:
        `setVisible` in class `GralWidget`
      Returns:
        the old state.

    - #### stop

          void stop()

    - #### remove

          public boolean remove()

      Description copied from class: `GralWidget`
      Removes the widget from the lists in its panel and from the graphical representation. It calls the protected `#removeWidgetImplementation()` which is implemented in the adaption.
      Specified by:
        `remove` in interface `Removeable`
      Overrides:
        `remove` in class `GralWidget`
      Returns:
        true if successfully. If false it is a hint for the application that the instance itself should not be removed.

    - #### actionUserKey

          public boolean actionUserKey(int keyCode,
                                       java.lang.Object userDataOfLine,
                                       GralTableLine_ifc<FileRemote> line)

      This method is called on any user key or mouse event while operating in the file table. It should be overwritten by a derived class. This routine is empty.
      Parameters:
        `key` - code or mouse code, one of constants from `KeyCode`.
        `userDataOfLine` - The user data stored in the line of table.
        `line` - The table line.
      Returns:
        true if is was relevant for the key.

    - #### setSortOrderFiles

          public void setSortOrderFiles(char order)