    001package org.vishia.commander;
    002
    003import java.util.LinkedList;
    004import java.util.List;
    005
    006import org.vishia.gral.ifc.GralButtonKeyMenu;
    007import org.vishia.gral.widget.GralFileSelector;
    008import org.vishia.util.KeyCode;
    009
    010/**This class contains all texts and keys which are used in any menu, hot key etc.
    011 * The variables are attempt to set by a script - user or language specific menus and keys.
    012 * You find all menu and key actions named here, use find operation in all files (cross references)
    013 * to evaluate, where these functions are used.
    014 *
    015 * @author Hartmut Schorrig
    016 *
    017 */
    018public class FcmdIdents extends FcmdIdentsBase
    019{
    020  List<GralButtonKeyMenu> entries = new LinkedList<GralButtonKeyMenu>();
    021
    022  final GralButtonKeyMenu readMsg = new GralButtonKeyMenu(main.actionReadMsgConfig, "&Help/read &MsgCfg", null, null, null, 0, 0, entries);  ////
    023  final GralButtonKeyMenu deselectRecursFiles = new GralButtonKeyMenu(main.favorPathSelector.actionDeselectDirtree, "fol&Der/&Deselect dirtree  [ctrl-d]", "&Deselect dirtree [ctrl-d]", null, null, KeyCode.ctrl + 'd', KeyCode.ctrl + 'D', entries);
    024  final GralButtonKeyMenu cleanFileRemoteRecursFiles = new GralButtonKeyMenu(main.favorPathSelector.actionCleanFileRemote, "fol&Der/&Clean dirtree", null, null, null, 0, 0, entries);
    025
    026  final GralButtonKeyMenu openConfirmDelete = new GralButtonKeyMenu(main.delCmd.actionConfirmCopy, "&File/&Delete [sh-F8]", "&Delete", null, null, KeyCode.shift + KeyCode.F8, 0, entries);
    027
    028  final GralButtonKeyMenu openConfirmCompare = new GralButtonKeyMenu(main.compareCmd.actionConfirmCopy, "&File/&Compare [sh-F7]", "&Compare", null, null, KeyCode.shift + KeyCode.F7, 0, entries);
    029
    030  String menuBarSettings = "&Help/&Settings [cP]";
    031  String menuContextSettings = "Settings [cP]";
    032  String buttonSettings = "gF1:settings";
    033  int key1Settings = KeyCode.ctrl + 'p';
    034  int key2Settings = KeyCode.ctrl + 'P';
    035
    036  String menuBarStatus = "&Help/s&Tatus [cü]";
    037  String menuContextStatus = "Status [cü]";
    038  String buttonStatus = "gF9:status";
    039  int key1Status = KeyCode.ctrl + 'ü';
    040  int key2Status = KeyCode.ctrl + 'Ü';
    041
    042  String menuSaveFavoriteSel = "fa&Vors/&Save favorite paths";
    043  String menuReadFavoriteSel = "fa&Vors/&Read favorite paths";
    044
    045  String menuDelTab = "fa&Vors/close &tab";
    046
    047
    048  String menuBarCreateFavor = "fa&Vors/new [cB]";
    049  String menuContextCreateFavor = "new Favor [cB]";
    050  int keyCreateFavor = KeyCode.ctrl + 'b';
    051
    052  String menuContextShowBackslash = "backslash\\path (Windows)";
    053  String menuContextShowSlash = "slash path (compatible)";
    054
    055
    056  String menuBarFolderSyncMidRight = "fol&Der/s&Ync mid - right";
    057
    058
    059
    060  String menuBarSetOriginDir = "fol&Der/set &Origin dir [c<] [cHome]";
    061  String menuContextSetOriginDir = "set Origin dir [c<] [cHome]";
    062  String buttonSetOriginDir = null; //"cF2:origin";
    063  /**Show files in the start dir of the selection. Go to the origin dir.*/
    064  int keyOriginDir1 = KeyCode.ctrl + '<';  //like total commander: jump to the root directory
    065  int keyOriginDir2 = KeyCode.ctrl + KeyCode.home;  //like total commander: jump to the root directory
    066
    067
    068
    069
    070
    071  String menuFileNaviRefreshBar = "fol&Der/&Refresh [cR]";
    072  String menuFileNaviRefreshContext = "Refresh [cR]";
    073  String buttonRefereshFiles = "F5:refresh";
    074  /**Referesh files.*/
    075  int keyRefresh1 = KeyCode.ctrl + 'r'
    076    , keyRefresh2 = KeyCode.ctrl + 'R'  //like total commander: refresh
    077    , keyRefresh3 = KeyCode.F5;
    078
    079  String menuHelpBar = "&Help/&Help [F1]";
    080
    081  String menuHelpContext = "Help";
    082
    083  String buttonHelp = "F1:help";
    084
    085  int keyHelp = KeyCode.F1;
    086
    087  String menuBarViewButtons = "&Window/view Buttons [cF1]";
    088  String buttonViewButtons = "cF1:hide Btns";
    089  int keyViewButtons = KeyCode.ctrl + KeyCode.F1;
    090
    091
    092
    093  String menuBarAbout = "&Help/&About";
    094
    095  String menuBarExit = "&Help/e&Xit";
    096
    097
    098
    099
    100  String menuFilePropsBar = "&File/&Properties [F9]";  ////
    101
    102  String menuFilePropsContext = "Properties [F9]";
    103
    104  String buttonFileProps = "F9:props";
    105
    106  int keyFileProps = KeyCode.F9;
    107
    108  final String buttonFilePropsChg = "change file";
    109
    110  final String buttonFilePropsChanging = "changing ...";
    111
    112  final String buttonFilePropsCopying = "copying ...";
    113
    114  final String buttonFilePropsRetry = "retry";
    115
    116  final String buttonFilePropsAbort = "abort change";
    117
    118  final String buttonFilePropsOk = "done";
    119
    120  final String buttonFilePropsCopy = "copy file";
    121
    122  final String buttonFilePropsChgRecurisve = "change recursive";
    123
    124  final String buttonFilePropsGetAll = "get all properties";
    125
    126  final String buttonFilePropsCntLen = "count length all files in dir";
    127
    128
    129
    130  String menuFileViewBar = "&File/&View [F3]";
    131
    132  String menuFileViewContext = "View [F3]";
    133
    134  String buttonFileView = "F3:view";
    135
    136  int keyFileView = KeyCode.F3;
    137
    138
    139
    140  String menuBarQuickView = "&File/&Quick view";
    141  String menuContextQuickView = "&Quick view";
    142  String buttonQuickView = "cQ:qview";
    143  int key1QuickView = KeyCode.ctrl + 'q';
    144  int key2QuickView = KeyCode.ctrl + 'Q';
    145
    146
    147
    148
    149
    150  String menuFileEditBar = "&File/&Edit [F4]";
    151
    152  String menuFileEditContext = "Edit [F4]";
    153
    154  String buttonFileEdit = "F4:edit";
    155
    156  int keyFileEdit = KeyCode.F4;
    157
    158  String menuBarEditIntern = "&File/&Edit-intern [sh-F4]";
    159
    160  String menuContextEditIntern = "Edit-intern [sh-F4]";
    161
    162  String buttonEditIntern = "sF4:edit-i";
    163
    164  int keyEditIntern = KeyCode.shift | KeyCode.F4;
    165
    166  String menuConfirmCopyBar = "&File/&Copy, move [F6]";
    167
    168  String menuConfirmCopyContext = "&Copy, move [F6]";
    169
    170  String buttonFileCopy = "F6:copy / mv";
    171
    172  int keyFileCopy = KeyCode.F6;
    173  /**Window title. */
    174  String windConfirmCopy = "confirm copy";
    175
    176
    177
    178
    179  String menuConfirmMkdirFileBar = "fol&Der/&Mkdir-file [F7]";
    180
    181  String menuConfirmMkDirFileContext = "Mkdir-file [F7]";
    182
    183  String buttonMkdirFile = "F7:create";
    184
    185  int keyFileCreate = KeyCode.F7;
    186
    187
    188  String menuBarSearchFiles = "fol&Der/&Search files [aF7]";
    189
    190  String menuContextSearchFiles = "Search files [aF7]";
    191
    192  String buttonSearchFiles = "aF7:search";
    193
    194  int keySearchFiles = KeyCode.alt + KeyCode.F7;
    195
    196
    197  /**Window title. */
    198  String windConfirmMkdirFile = "confirm make dir / file";
    199
    200
    201
    202  String menuConfirmFileDelBar = "&File/&Del [F8]";
    203
    204  String menuConfirmFileDelContext = "del [F8]";
    205
    206  String buttonFileDel = "F8:del";
    207
    208  int keyFileDel1 = KeyCode.F8;
    209  int keyFileDel2 = KeyCode.del;
    210
    211
    212  /**Window title. */
    213  String windConfirmDelete = "confirm delete";
    214
    215
    216
    217  /**Opens the 'execute with' choice table with the selected file.  */
    218  String menuExecuteBar = "&File/&Execute by .ext [Enter]";
    219
    220  String menuExecuteContext = "execute .ext [Enter]";
    221
    222  String buttonExecute = null;
    223
    224  int keyExecuteExt = 0;   //Note: It is realized in the file table.
    225
    226  /**Window title. */
    227  String windConfirmExecute = "execute with";
    228
    229
    230  /**execute with currently selected cmd.  */
    231  //String menuExecuteCmdBar = "&File/&Execute [cF9]";
    232
    233  String menuExecuteCmdContext = "exec [cF2]";
    234  String menuBarExecuteCmdWithFile = "&Command/e~Xecute cmd with file [cEnter]";
    235  int keyExecuteCmdWithFile = KeyCode.ctrl + KeyCode.F2;
    236  int keyExecuteCmdWithFile2 = KeyCode.ctrl + KeyCode.enter;
    237  String buttonExecuteCmdWithFile = "cF2:exeCmd file";
    238
    239
    240  String menuBarEditCmdCfg = "&Command/cmdcfg - &Edit act file";
    241  String menuContextEditCmdCfg = "cmdcfg - &Edit act file";
    242  String buttonEditCmdCfg = null;
    243  int keyEditCmdCfg = 0;
    244
    245
    246  /**
    247   *
    248   */
    249  String menuBarReadCmdCfgAct = "&Command/cmdcfg - &Read act file";
    250  String menuContextReadCmdCfgAct = "cmdcfg - &Read act file";
    251  String buttonReadCmdCfgAct = null;
    252  int keyReadCmdCfgAct = 0;
    253
    254
    255  String menuBarNavigationLeft = "&Navigation/themes left [aF1]";
    256  String buttonFavorLeft = "aF1:fav-left";
    257  int keyFavorLeft = KeyCode.alt + KeyCode.F1;
    258
    259  String menuBarNavigationMiddle = "&Navigation/themes mid [aF2]";
    260  String buttonFavorMiddle = "aF2:fav-mid";
    261  int keyFavorMiddle = KeyCode.alt + KeyCode.F2;
    262
    263  String menuBarNavigationRight = "&Navigation/themes right [aF3]";
    264  String buttonFavorRight = "aF3:fav-right";
    265  int keyFavorRight = KeyCode.alt + KeyCode.F3;
    266
    267
    268  String menuBarSelectPanelLeft = "&Navigation/select left [shAlt-F1]";
    269  String buttonSelectPanelLeft = "sF1:left";
    270  int keySelectPanelLeft = KeyCode.shift + KeyCode.F1;
    271  int keySelectPanelLeft2 = KeyCode.shiftAlt + KeyCode.F1;
    272
    273  String menuBarSelectPanelMiddle = "&Navigation/select mid [shAlt-F2]";
    274  String buttonSelectPanelMiddle = "sF2:middle";
    275  int keySelectPanelMiddle = KeyCode.shift + KeyCode.F2;
    276  int keySelectPanelMiddle2 = KeyCode.shiftAlt + KeyCode.F2;
    277
    278  String menuBarSelectPanelRight = "&Navigation/select right [shAlt-F3]";
    279  String buttonSelectPanelRight = "sF3:right";
    280  int keySelectPanelRight = KeyCode.shift + KeyCode.F3;
    281  int keySelectPanelRight2 = KeyCode.shiftAlt + KeyCode.F3;
    282
    283  /**"&Navigation/select &other [ctrl-tab]" */
    284  String menuBarSelectPanelOther = "&Navigation/select &other [ctrl-tab]";
    285  String buttonSelectPanelOther = "cTab:other";
    286  int keySelectPanelOther = KeyCode.ctrl + KeyCode.tab; //;'\t';
    287
    288  ////
    289  String menuBarFocusLeftCard = "&Navigation/focus to left card [shAlt-left]";
    290  String buttonFocusLeftCard = null;
    291  int keyFocusLeftCard = KeyCode.shiftAlt + KeyCode.left;
    292
    293  String menuBarFocusRightCard = "&Navigation/focus to right card [shAlt-right]";
    294  String buttonFocusRightCard = null;
    295  int keyFocusRightCard = KeyCode.shiftAlt + KeyCode.right;
    296
    297  String menuBarFocusFileCard = "&Navigation/focus to file card [shAlt-up]";
    298  String buttonFocusFileCard = null;
    299  int keyFocusFileCard = KeyCode.shiftAlt + KeyCode.up;
    300
    301  String menuBarFocusThemeCard = "&Navigation/focus to theme card [shAlt-dn]";
    302  String buttonFocusThemeCard = null;
    303  int keyFocusThemeCard = KeyCode.shiftAlt + KeyCode.dn;
    304
    305  String menuBarFocusPaneltoLeft = "&Navigation/focus to left panel [shAlt-pgup]";
    306  String buttonFocusPanelToLeft = null;
    307  int keyFocusPanelToLeft = KeyCode.shiftAlt + KeyCode.pgup;
    308
    309  String menuBarFocusPanelToRight = "&Navigation/focus to right panel [shAlt-pgdn]";
    310  String buttonFocusPanelToRight = null;
    311  int keyFocusPanelToRight = KeyCode.shiftAlt + KeyCode.pgdn;
    312
    313
    314
    315
    316
    317
    318  int keyExecCmdFile = KeyCode.ctrl + KeyCode.enter;
    319
    320
    321
    322  String menuBarNavigatonCmd = "&Navigation/cmd [F2]";
    323  String buttonFocusCmd = "F2:cmdTable";
    324  int keyFocusCmd = KeyCode.F2;
    325
    326
    327
    328  String menuFilesCpBar = "fol&Der/com&Pare folder tree";
    329
    330  String menuFilesCpContext = "Compare folder tree";
    331
    332  /**Window title. */
    333  String windConfirmCompare = "confirm compare";
    334
    335
    336
    337  public String menuBarWindowOutput = "&Window/&Output";
    338  public String menuContextWindowOutput = "&Output zoom";
    339  public String buttonWindowOutput = null;
    340  public int keyWindowOutput = KeyCode.ctrl + 'o';
    341  public int keyWindowOutput2 = KeyCode.ctrl + 'O';
    342
    343
    344  public String menuWindowOutputContext = "Zoom/Unzoom";
    345
    346  int keyWindFullOut = KeyCode.ctrl + 'o';
    347
    348
    349
    350
    351  String menuBarFileSortNameCase = "&File/&Sort/&Name case sens";
    352  String menuContextFileSortNameCase = "&Sort/&Name case sens";
    353  String buttonFileSortNameCase = "gF3:A..Za..z";
    354  int keyFileSortNameCase = KeyCode.ctrl + KeyCode.F3;
    355
    356  String menuBarFileSortNameNonCase = "&File/&Sort/&Name non-case";
    357  String menuContextFileSortNameNonCase = "&Sort/&Name non-case";
    358  String buttonFileSortNameNonCase = "cF3:Aa..Zz";
    359  int keyFileSortNameNonCase = KeyCode.shiftCtrl + KeyCode.F3;
    360
    361  String menuBarFileSortExtCase = "&File/&Sort/e&Xt case sens";
    362  String menuContextFileSortExtCase = "&Sort/e&Xt case sens";
    363  String buttonFileSortExtCase = "gF4:.ext A..Za..z";
    364  int keyFileSortExtCase = KeyCode.ctrl + KeyCode.F4;
    365
    366  String menuBarFileSortExtNonCase = "&File/&Sort/e&Xt non-case";
    367  String menuContextFileSortExtNonCase = "&Sort/e&Xt non-case";
    368  String buttonFileSortExtNonCase = "cF4:.ext Aa..Zz";
    369  int keyFileSortExtNonCase = KeyCode.shiftCtrl + KeyCode.F4;
    370
    371  String menuBarFileSortDateNewest = "&File/&Sort/&Date newest";
    372  String menuContextFileSortDateNewest = "&Sort/&Date newest";
    373  String buttonFileSortDateNewest = "cF5:newest";
    374  int keyFileSortDateNewest = KeyCode.ctrl + KeyCode.F5;
    375
    376  String menuBarFileSortDateOldest = "&File/&Sort/date &Oldest";
    377  String menuContextFileSortOldest = "&Sort/date &Oldest";
    378  String buttonFileSortOldest = "gF5:oldest";
    379  int keyFileSortDateLast = KeyCode.shiftCtrl + KeyCode.F5;
    380
    381  String menuBarFileSortSizeLarge = "&File/&Sort/size &Largest";
    382  String menuContextFileSortSizeLarge = "&Sort/size &Largest";
    383  String buttonFileSortSizeLarge = "cF6:largest";
    384  int keyFileSortSizeLarge = KeyCode.ctrl + KeyCode.F6;
    385
    386  String menuBarFileSortSizeSmall = "&File/&Sort/size &Smallest";
    387  String menuContextFileSortSizeSmall = "&Sort/size &Smallest";
    388  String buttonFileSortSizeSmall = "gF6:smallest";
    389  int keyFileSortSizeSmall = KeyCode.shiftCtrl + KeyCode.F6;
    390
    391
    392  FcmdIdents(Fcmd main){
    393    super(main);  //firstly the superclass ctor is called.
    394    //after them all statements in the class body, main is known.
    395    GralFileSelector.contextMenuTexts.deselectRecursFiles = deselectRecursFiles.menuContext;
    396
    397    GralFileSelector.contextMenuTexts.sortNameCase = menuContextFileSortNameCase;
    398    GralFileSelector.contextMenuTexts.sortNameNonCase = menuContextFileSortNameNonCase;
    399    GralFileSelector.contextMenuTexts.sizeLarge = menuContextFileSortSizeLarge;
    400    GralFileSelector.contextMenuTexts.sizeLarge = menuContextFileSortSizeLarge;
    401    GralFileSelector.contextMenuTexts.sizeLarge = menuContextFileSortSizeLarge;
    402    GralFileSelector.contextMenuTexts.sizeLarge = menuContextFileSortSizeLarge;
    403    GralFileSelector.contextMenuTexts.sizeLarge = menuContextFileSortSizeLarge;
    404    GralFileSelector.contextMenuTexts.sizeLarge = menuContextFileSortSizeLarge;
    405  }
    406
    407
    408
    409}
    410
    411
    412class FcmdIdentsBase {
    413  protected Fcmd main;
    414  FcmdIdentsBase(Fcmd main){ this.main = main; }
    415}
    416