Class JtvStatusItem
public class JtvStatusItem
A single entry in a JtvStatusLine item list.
JtvStatusItem combines a visual label, a keyboard hot key, and a command into one record. Status items serve two distinct roles:
- Visual label — when
textis non-nullit is drawn on the status line. Clicking on the label area triggers the associatedcommand. - Hot-key binding — when a key event matching
keyCodearrives, JtvStatusLine.handleEvent converts it to anevCommandevent withcommand, regardless of whether the item is visually shown. An item with anulltext can therefore act as a silent hot-key-to-command mapping.
Items are stored in insertion order in JtvStatusDef and rendered by JtvStatusLine in that same order.
org.viktor44.jtvision.views.JtvStatusItem
Summary
Constructors
| Visibility | Signature |
|---|---|
| public | JtvStatusItem(String aText, JtvKeyStroke aKeyStroke, int aCommand) |
Fields
| Modifiers | Field name | Type |
|---|---|---|
| private final | text | String |
| private final | keyStroke | org.viktor44.jtvision.core.JtvKeyStroke |
| private final | command | int |
Methods
| Modifiers | Method signature | Return type |
|---|---|---|
| public | getText() | String |
| public | getKeyStroke() | org.viktor44.jtvision.core.JtvKeyStroke |
| public | getCommand() | int |
Constructors
JtvStatusItem(String aText, JtvKeyStroke aKeyStroke, int aCommand)
Creates a status item.
Parameters
aText- the label string, ornullfor a hidden hot-key itemaKeyStroke- the hot-key keystroke, ornullaCommand- the command to generate on activation
Fields
String text
The label string displayed on the status line, such as "~F1~ Help",
or null if this item is invisible (hot-key binding only).
org.viktor44.jtvision.core.JtvKeyStroke keyStroke
The keystroke that triggers this item's command, or null if the item has no hot key.
int command
The cmXXXX command constant posted as an evCommand
event when the label is clicked or the hot key is pressed.
Methods
getText()
The label string displayed on the status line, such as "~F1~ Help",
or null if this item is invisible (hot-key binding only).
getKeyStroke()
The keystroke that triggers this item's command, or null if the item has no hot key.
getCommand()
The cmXXXX command constant posted as an evCommand
event when the label is clicked or the hot key is pressed.