public abstract class GralSelectList<UserData> extends java.lang.Object implements Removeable
actionTable
captures all key and mouse activities on the table-widget.
It is the base class for file selection and command selection.
The base idea is, left and right keys navigates in a tree to outer and deeper nodes. The table
shows only members of the current node. A text line shows the current node path.
It may be possible to switch to a tree presentation (TODO). But this complex widget should occupy
only a simple rectangle of a GUI, not some windows etc. It may be less in spread too if necessary.
GralTable
, because instances of derived classes
should be created as final compositions in the main thread before the table can be presented
in the graphic thread. Therefore the aggregation wdgdTable
cannot be final. It is set
only when #setToPanel(GralMngBuild_ifc, String, int, int[], char)
is called.
GralSelectList
|--wdgdTable
--->GralTable TableLineData
|---idxLine------*>|
|---tableLines---*>|
Modifier and Type | Field and Description |
---|---|
protected java.util.Map<java.lang.String,GralUserAction> |
actions
Not used yet, register actions?
|
private GralUserAction |
actionTable |
protected int |
keyLeft
The keys for left and right navigation.
|
protected int |
keyRight
The keys for left and right navigation.
|
static java.lang.String |
version
Version and history:
2018-10-28 Hartmut chg:
createImplWidget_Gthread() instead setToPanel(mng)
2011-11-18 chg: This class does not inherit from GralWidget now. |
GralTable<UserData> |
wdgdTable
The table which is showing in the widget.
|
Modifier | Constructor and Description |
---|---|
protected |
GralSelectList(java.lang.String posName,
int rows,
int[] columns,
char size) |
Modifier and Type | Method and Description |
---|---|
protected abstract void |
actionLeft(java.lang.Object userData,
GralTableLine_ifc<UserData> line)
Action if a table line is selected and ctrl-left is pressed or the release button is pressed.
|
protected abstract boolean |
actionOk(java.lang.Object userData,
GralTableLine_ifc<UserData> line)
Action if a table line is selected and entered.
|
protected abstract void |
actionRight(java.lang.Object userData,
GralTableLine_ifc<UserData> line)
Action if a table line is selected and ctrl-right is pressed or the release button is pressed.
|
protected abstract boolean |
actionUserKey(int key,
java.lang.Object userData,
GralTableLine_ifc<UserData> line)
Action if a table line is selected and any other key is pressed or the context menu is invoked.
|
void |
createImplWidget_Gthread() |
boolean |
remove()
Removes all data and all widgets of this class.
|
void |
set(java.util.List<java.lang.String[]> listData) |
boolean |
setFocus()
Sets the focus of the associated table widget.
|
void |
setLeftRightKeys(int keyLeft,
int keyRight)
The left and right key codes for selection left and right can be changed.
|
(package private) void |
stop() |
void |
XXXsetToPanel(GralMngBuild_ifc gralMng) |
public static final java.lang.String version
createImplWidget_Gthread()
instead setToPanel(mng)
wdgdTable
. Only this instance is registered on a panel
calling #setToPanel(GralMngBuild_ifc, String, int, int[], char)
.
KeyCode
now,
actionOk(Object, GralTableLine_ifc)
returns boolean now, false if no action is done.
protected int keyLeft
protected int keyRight
protected java.util.Map<java.lang.String,GralUserAction> actions
private final GralUserAction actionTable
protected GralSelectList(java.lang.String posName, int rows, int[] columns, char size)
public final void setLeftRightKeys(int keyLeft, int keyRight)
KeyCode
.keyLeft
- Key code for outer selectionkeyRight
- KeyCode for deeper selectionpublic void XXXsetToPanel(GralMngBuild_ifc gralMng)
panel
- identArgJbat
- rows
- columns
- size
- public void createImplWidget_Gthread()
public void set(java.util.List<java.lang.String[]> listData)
public boolean setFocus()
public boolean remove()
remove
in interface Removeable
protected abstract boolean actionOk(java.lang.Object userData, GralTableLine_ifc<UserData> line)
userData
- The user data stored in the line of table.protected abstract void actionLeft(java.lang.Object userData, GralTableLine_ifc<UserData> line)
userData
- The user data stored in the line of table.protected abstract void actionRight(java.lang.Object userData, GralTableLine_ifc<UserData> line)
userData
- The user data stored in the line of table.protected abstract boolean actionUserKey(int key, java.lang.Object userData, GralTableLine_ifc<UserData> line)
key
- code or mouse code, one of constans from KeyCode
.userData
- The user data stored in the line of table.line
- The table line.void stop()