org.vishia.commander

## Class FcmdFavorCard

- java.lang.Object
- - org.vishia.gral.widget.GralSelectList<FcmdFavorPathSelector.FavorPath>
  - - org.vishia.commander.FcmdFavorCard

- All Implemented Interfaces:
    Removeable

      public class FcmdFavorCard
      extends GralSelectList<FcmdFavorPathSelector.FavorPath>

  This is one table of favorite pathes in the file commander.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `(package private) GralUserAction` | `actionFavorSelected` Action is called any time if a line was focused in the favor table.
    `(package private) FcmdFileCard` | `fileTable`
    `(package private) java.util.Map<java.lang.String,FcmdFavorPathSelector.FavorPath>` | `indexFavorPaths` Index of all entries in the visible list.
    `(package private) Fcmd` | `main` The component
    `(package private) FcmdLeftMidRightPanel` | `mainPanel` The tabbed panel where this class is member of.
    `(package private) java.lang.String` | `sActSelectedFavorPath` Stores the last selected and used favor path (pressing enter or double click) to select the same line if the favor path will be re-opened.

    - ### Fields inherited from class org.vishia.gral.widget.GralSelectList

      `actions, keyLeft, keyRight, version, wdgdTable`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `FcmdFavorCard(Fcmd main, java.lang.String name, FcmdFileCard fileTable, FcmdLeftMidRightPanel panel)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected void` | `actionLeft(java.lang.Object userData, GralTableLine_ifc line)` Action if a table line is selected and ctrl-left is pressed or the release button is pressed.
    `protected boolean` | `actionOk(java.lang.Object userData, GralTableLine_ifc line)` Action if a table line is selected and entered.
    `protected void` | `actionRight(java.lang.Object userData, GralTableLine_ifc line)` Action if a table line is selected and ctrl-right is pressed or the release button is pressed.
    `protected boolean` | `actionUserKey(int key, java.lang.Object userData, GralTableLine_ifc line)` Handle the keys for the JavaCommander-Selection of favorites sh-F1 .. shF3: activates fileSelector for left, middle and right panel.
    `(package private) GralTableLine_ifc<FcmdFavorPathSelector.FavorPath>` | `add(FcmdFavorPathSelector.FavorPath favorPathInfo)` Adds a line to this table.
    `(package private) void` | `clear()`
    `(package private) void` | `fillFavorPaths(FcmdFavorPathSelector.FavorFolder favorTabInfo)` Add all favor paths from the SelectTab newly
    `boolean` | `remove()` Removes this file card with its widgets and data.
    `boolean` | `setFocus()` Overrides the `GralFileSelector.setFocus()` and calls him, before that sets the color of the current line of table of all 3 current file panels to the 3-stage color to see which table has the focus.
    `java.lang.String` | `toString()`

    - ### Methods inherited from class org.vishia.gral.widget.GralSelectList

      `createImplWidget_Gthread, set, setLeftRightKeys, XXXsetToPanel`

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

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

- - ### Field Detail

    - #### main

          final Fcmd main

      The component

    - #### mainPanel

          final FcmdLeftMidRightPanel mainPanel

      The tabbed panel where this class is member of.

    - #### fileTable

          final FcmdFileCard fileTable

    - #### sActSelectedFavorPath

          java.lang.String sActSelectedFavorPath

      Stores the last selected and used favor path (pressing enter or double click) to select the same line if the favor path will be re-opened.

    - #### indexFavorPaths

          java.util.Map<java.lang.String,FcmdFavorPathSelector.FavorPath> indexFavorPaths

      Index of all entries in the visible list.

    - #### actionFavorSelected

          GralUserAction actionFavorSelected

      Action is called any time if a line was focused in the favor table.

  - ### Constructor Detail

    - #### FcmdFavorCard

          public FcmdFavorCard(Fcmd main,
                               java.lang.String name,
                               FcmdFileCard fileTable,
                               FcmdLeftMidRightPanel panel)

  - ### Method Detail

    - #### add

          GralTableLine_ifc<FcmdFavorPathSelector.FavorPath> add(FcmdFavorPathSelector.FavorPath favorPathInfo)

      Adds a line to this table.
      Parameters:
        `ix` - Show which index is used for a local table, 0..2 for left, mid, right, than show the label in the left cell (column)
        `favorPathInfo` - The favorite info

    - #### clear

          void clear()

    - #### fillFavorPaths

          void fillFavorPaths(FcmdFavorPathSelector.FavorFolder favorTabInfo)

      Add all favor paths from the SelectTab newly
      Parameters:
        `favorTabInfo` -

    - #### setFocus

          public boolean setFocus()

      Overrides the `GralFileSelector.setFocus()` and calls him, before that sets the color of the current line of table of all 3 current file panels to the 3-stage color to see which table has the focus.
      Overrides:
        `setFocus` in class `GralSelectList<FcmdFavorPathSelector.FavorPath>`
      Returns:
        true if focused.

    - #### remove

          public boolean remove()

      Removes this file card with its widgets and data. It is 'close tab'.
      Specified by:
        `remove` in interface `Removeable`
      Overrides:
        `remove` in class `GralSelectList<FcmdFavorPathSelector.FavorPath>`
      Returns:
        true if successfully. If false it is a hint for the application that the instance itself should not be removed.

    - #### actionOk

          protected boolean actionOk(java.lang.Object userData,
                                     GralTableLine_ifc line)

      Description copied from class: `GralSelectList`
      Action if a table line is selected and entered. Its either a double click with the mouse or click of OK (Enter) button.
      Specified by:
        `actionOk` in class `GralSelectList<FcmdFavorPathSelector.FavorPath>`
      Parameters:
        `userData` - The user data stored in the line of table.

    - #### actionLeft

          protected void actionLeft(java.lang.Object userData,
                                    GralTableLine_ifc line)

      Description copied from class: `GralSelectList`
      Action if a table line is selected and ctrl-left is pressed or the release button is pressed.
      Specified by:
        `actionLeft` in class `GralSelectList<FcmdFavorPathSelector.FavorPath>`
      Parameters:
        `userData` - The user data stored in the line of table.

    - #### actionRight

          protected void actionRight(java.lang.Object userData,
                                     GralTableLine_ifc line)

      Description copied from class: `GralSelectList`
      Action if a table line is selected and ctrl-right is pressed or the release button is pressed.
      Specified by:
        `actionRight` in class `GralSelectList<FcmdFavorPathSelector.FavorPath>`
      Parameters:
        `userData` - The user data stored in the line of table.

    - #### actionUserKey

          protected boolean actionUserKey(int key,
                                          java.lang.Object userData,
                                          GralTableLine_ifc line)

      Handle the keys for the JavaCommander-Selection of favorites
      - sh-F1 .. shF3: activates fileSelector for left, middle and right panel.
      Specified by:
        `actionUserKey` in class `GralSelectList<FcmdFavorPathSelector.FavorPath>`
      Parameters:
        `key` - code or mouse code, one of constans from `KeyCode`.
        `userData` - The user data stored in the line of table.
        `line` - The table line.
      Returns:
        true if is was relevant for the key.
      See Also:
        `GralSelectList.actionUserKey(int, java.lang.Object, org.vishia.gral.ifc.GralTableLine_ifc)`

    - #### toString

          public java.lang.String toString()

      Overrides:
        `toString` in class `java.lang.Object`