org.vishia.commander

## Class FcmdExecuter

- java.lang.Object
- - org.vishia.commander.FcmdExecuter

-     public class FcmdExecuter
      extends java.lang.Object

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `(package private) GralUserAction` | `actionCmdAbort` User action to abort a running command.
    `(package private) GralUserAction` | `actionCmdFromOutputBox`
    `(package private) GralUserAction` | `actionEditCmdCfgAct` Action to open an editor for the command list from actual file.
    `(package private) GralUserAction` | `actionExecuteFileByExtension`
    `(package private) GralUserAction` | `actionJZextAfterChoice`
    `(package private) GralUserAction` | `actionOnEnterFile` This action is associated to any `FcmdFileCard` as action on enter file.
    `(package private) GralUserAction` | `actionSetCmdCfg` Action to set the command list from file.
    `(package private) GralUserAction` | `actionSetCmdCfgAct` Action to set the command list from actual file.
    `(package private) GralUserAction` | `actionSetCmdWorkingDir` Action to set the working directory for the next command invocation.
    `(package private) CmdExecuter` | `cmdExecuter` The command queue to execute
    `(package private) GralCommandSelector` | `cmdSelector` Table contains some commands, can be selected and executed.
    `(package private) MainCmd_ifc` | `console` For output messages.
    `private Fcmd` | `main`
    `(package private) java.util.Map<java.lang.String,java.util.List<JZtxtcmdScript.Subroutine>>` | `mapCmdExt` Store of all possible commands given in the command file.
    `static java.lang.String` | `version` Version, history and license.
    `(package private) GralTable<JZtxtcmdScript.Subroutine>` | `widgSelectJzExt`
    `(package private) GralWindow_ifc` | `windConfirmExec`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `FcmdExecuter(MainCmd_ifc console, java.lang.Appendable outStatus, Fcmd main)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `(package private) void` | `buildWindowConfirmExec()` Builds the content of the confirm-execute window.
    `private char` | `checkKeyOfExecution(int key)`
    `private void` | `executeFileByExtension(java.io.File file)`
    `(package private) java.lang.String` | `readCfgExt(java.io.File cfgFileCmdsForExt)`
    `java.lang.String` | `readCmdCfgSelectList(JZtxtcmdScript.AddSub2List dst, java.io.File cfgFile, MainCmdLogging_ifc log)`

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

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

- - ### Field Detail

    - #### version

          public static final java.lang.String version

      Version, history and license. This String is visible in the about info.
      - 2017-01-01 Hartmut uses `JZtxtcmdExecuter` and `CmdExecuter`. CmdQueue and CmdStore are obsolete.
      - 2016-08-28 Hartmut chg: The cfg file for jzcmd commands are named cmdjz.cfg anyway, in the directory given with cmdcfg:path/to/cmd.cfg.
      - 2011-10-00 Hartmut created
      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

    - #### console

          final MainCmd_ifc console

      For output messages.

    - #### main

          private final Fcmd main

    - #### windConfirmExec

          GralWindow_ifc windConfirmExec

    - #### widgSelectJzExt

          GralTable<JZtxtcmdScript.Subroutine> widgSelectJzExt

    - #### mapCmdExt

          final java.util.Map<java.lang.String,java.util.List<JZtxtcmdScript.Subroutine>> mapCmdExt

      Store of all possible commands given in the command file.

    - #### cmdExecuter

          final CmdExecuter cmdExecuter

      The command queue to execute

    - #### cmdSelector

          final GralCommandSelector cmdSelector

      Table contains some commands, can be selected and executed.
      - The table is filled in `#readCmdCfgSelectList(CmdStore, File, MainCmdLogging_ifc)`.
      - Commands can be either operation system commands or c `JZtxtcmdScript.Subroutine` entry point. They are stored in the list in user data of type `CmdBlock`.
      - Execution of a command: see `GralCommandSelector.actionExecCmdWithFiles` respectively GralCommandSelector#actionOk(...)
      - The arguments of a command are read from `CmdStore.CmdBlock#getArguments(org.vishia.cmd.CmdGetFileArgs_ifc)`. That deals with `Fcmd#getterFiles` because it is initialized with `GralCommandSelector#setGetterFiles(org.vishia.cmd.CmdGetFileArgs_ifc)`

    - #### actionSetCmdWorkingDir

          GralUserAction actionSetCmdWorkingDir

      Action to set the working directory for the next command invocation. The working directory is the directory in the focused file tab.

    - #### actionSetCmdCfg

          GralUserAction actionSetCmdCfg

      Action to set the command list from file. It is called from menu.

    - #### actionSetCmdCfgAct

          GralUserAction actionSetCmdCfgAct

      Action to set the command list from actual file. It is called from menu.

    - #### actionEditCmdCfgAct

          GralUserAction actionEditCmdCfgAct

      Action to open an editor for the command list from actual file. It is called from menu.

    - #### actionExecuteFileByExtension

          GralUserAction actionExecuteFileByExtension

    - #### actionOnEnterFile

          GralUserAction actionOnEnterFile

      This action is associated to any `FcmdFileCard` as action on enter file. The file is given as parameter then.

    - #### actionJZextAfterChoice

          GralUserAction actionJZextAfterChoice

    - #### actionCmdFromOutputBox

          GralUserAction actionCmdFromOutputBox

    - #### actionCmdAbort

          GralUserAction actionCmdAbort

      User action to abort a running command.

  - ### Constructor Detail

    - #### FcmdExecuter

          FcmdExecuter(MainCmd_ifc console,
                       java.lang.Appendable outStatus,
                       Fcmd main)

  - ### Method Detail

    - #### buildWindowConfirmExec

          void buildWindowConfirmExec()

      Builds the content of the confirm-execute window. The window is created static. It is shown whenever it is used.

    - #### readCfgExt

          java.lang.String readCfgExt(java.io.File cfgFileCmdsForExt)

    - #### readCmdCfgSelectList

          public java.lang.String readCmdCfgSelectList(JZtxtcmdScript.AddSub2List dst,
                                                       java.io.File cfgFile,
                                                       MainCmdLogging_ifc log)

    - #### executeFileByExtension

          private void executeFileByExtension(java.io.File file)

    - #### checkKeyOfExecution

          private char checkKeyOfExecution(int key)