public class GralCommandSelector extends GralSelectList<JZtxtcmdScript.Subroutine>
CmdExecuter
which is given by constructor
and executed there in the thread of the CmdExecuter
. It is possible to share the CmdQueue-instance
with some other application parts. The execution is queued there.
The commands are shown in a table. The appearance of the table can be controlled by the application
or maybe by the user. Only one command can be selected to execute.
All commands to select are contained in the public field #cmdStore
.
This storage of commands can be filled calling CmdStore#readCmdCfg(File)
or in any other way
of that class.GralWidgetBase.GralWidgComposite, GralWidgetBase.TimeOrderCreateImplWidget
Modifier and Type | Field and Description |
---|---|
GralUserAction |
actionExecCmdWithFiles |
private GralUserAction |
actionOnLineSelected |
JZtxtcmdScript.AddSub2List |
addJZsub2SelectTable |
protected CmdExecuter |
cmdExecuter
Execution instance in another thread.
|
protected CmdGetterArguments |
getterArguments |
(package private) java.lang.Appendable |
out |
protected JZtxtcmdScript.Subroutine |
selectedCmd
The currently selected command.
|
static java.lang.String |
version
Version, history and license.
|
actions, keyLeft, keyLeft2, keyRight, keyRight2, wdgdTable
_cdata, _wdgPos, bVisibleState, gralMng, name, pixSize, sVersion
Constructor and Description |
---|
GralCommandSelector(GralPos currPos,
java.lang.String posName,
int rows,
int[] columns,
CmdExecuter cmdExecuter,
java.lang.Appendable out,
CmdGetterArguments getterArguments) |
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<JZtxtcmdScript.Subroutine> line)
Action on click Ok at any line of table.
|
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)
Action if a table line is selected and any other key is pressed or the context menu is invoked.
|
void |
clear() |
void |
executeCurrCmdWithFiles()
Executes the command which is selected currently.
|
JZtxtcmdScript.Subroutine |
getCurrCmd()
Returns the currently selected command.
|
createImplWidget_Gthread, getFocusedWidget, isInFocus, isVisible, remove, removeImplWidget_Gthread, set, setFocus, setFocus, setFocusedWidget, setLeftRightKeys, setLeftRightKeys, setVisible, stop, XXXXsetToPanel
checkImplWidgetCreation, createImplWidget, getImplAccess, getName, gralMng, hasFocus, pos, resizePostPreparation, setFocused, toString, toString
public static final java.lang.String version
JZtxtcmdScript.Subroutine
, no more CmdStore.
The CmdStore is the older concept before JZcmd was found. JZcmd contains more capabilities.
protected final CmdExecuter cmdExecuter
protected final CmdGetterArguments getterArguments
protected JZtxtcmdScript.Subroutine selectedCmd
final java.lang.Appendable out
public JZtxtcmdScript.AddSub2List addJZsub2SelectTable
private final GralUserAction actionOnLineSelected
public GralUserAction actionExecCmdWithFiles
public GralCommandSelector(GralPos currPos, java.lang.String posName, int rows, int[] columns, CmdExecuter cmdExecuter, java.lang.Appendable out, CmdGetterArguments getterArguments)
public void clear()
public JZtxtcmdScript.Subroutine getCurrCmd()
public void executeCurrCmdWithFiles()
protected boolean actionOk(java.lang.Object userData, GralTableLine_ifc<JZtxtcmdScript.Subroutine> line)
actionOk
in class GralSelectList<JZtxtcmdScript.Subroutine>
userData
- It is the GralTableLine_ifc.getUserData()
, which is the
CmdStore.CmdBlock
-instance which is assigned with the line. The method casts without check.line
- isn't used here. It can be null in direct invocations.GralSelectList.actionOk(java.lang.Object, org.vishia.gral.ifc.GralTableLine_ifc)
protected void actionLeft(java.lang.Object userData, GralTableLine_ifc line)
GralSelectList
actionLeft
in class GralSelectList<JZtxtcmdScript.Subroutine>
userData
- The user data stored in the line of table.protected void actionRight(java.lang.Object userData, GralTableLine_ifc line)
GralSelectList
actionRight
in class GralSelectList<JZtxtcmdScript.Subroutine>
userData
- The user data stored in the line of table.protected boolean actionUserKey(int key, java.lang.Object userData, GralTableLine_ifc line)
GralSelectList
actionUserKey
in class GralSelectList<JZtxtcmdScript.Subroutine>
key
- code or mouse code, one of constans from KeyCode
.userData
- The user data stored in the line of table.line
- The table line.