1977358557114d8aa84bccfe0d27a7b63864ee18
1 package be
.nikiroo
.jvcard
.tui
;
5 import com
.googlecode
.lanterna
.gui2
.Direction
;
6 import com
.googlecode
.lanterna
.gui2
.Interactable
;
7 import com
.googlecode
.lanterna
.gui2
.LinearLayout
;
8 import com
.googlecode
.lanterna
.gui2
.Panel
;
11 * This class represents the main content that you can see in this application
12 * (i.e., everything but the title and the actions keys is a {@link Panel}
13 * extended from this class).
18 abstract public class MainContent
extends Panel
{
20 public MainContent() {
24 public MainContent(Direction dir
) {
26 LinearLayout layout
= new LinearLayout(dir
);
28 setLayoutManager(layout
);
32 * The title to display instead of the application name, or NULL for the
33 * default application name.
35 * @return the title or NULL
37 abstract public String
getTitle();
40 * Returns an error message ready to be displayed if we should ask something
41 * to the user before exiting.
43 * @return an error message or NULL
45 abstract public String
getExitWarning();
48 * The {@link KeyAction#Mode} that links to this {@link MainContent}.
50 * @return the linked mode
52 abstract public KeyAction
.Mode
getMode();
55 * The kind of data displayed by this {@link MainContent}.
57 * @return the kind of data displayed
59 abstract public KeyAction
.DataType
getDataType();
62 * Returns the list of actions and the keys that are bound to it.
64 * @return the list of actions
66 abstract public List
<KeyAction
> getKeyBindings();
69 * Move the active cursor (not the text cursor, but the currently active
73 * the horizontal move (< 0 for left, > 0 for right)
75 * the vertical move (< 0 for up, > 0 for down)
77 * @return the error message to display if any
79 abstract public String
move(int x
, int y
);