df8731366b37d788e2ab5ff86258e018221fb4da
1 package be
.nikiroo
.jvcard
.tui
.panes
;
5 import be
.nikiroo
.jvcard
.tui
.KeyAction
;
7 import com
.googlecode
.lanterna
.gui2
.Direction
;
8 import com
.googlecode
.lanterna
.gui2
.LinearLayout
;
9 import com
.googlecode
.lanterna
.gui2
.Panel
;
12 * This class represents the main content that you can see in this application
13 * (i.e., everything but the title and the actions keys is a {@link Panel}
14 * extended from this class).
19 abstract public class MainContent
extends Panel
{
21 public MainContent() {
25 public MainContent(Direction dir
) {
27 LinearLayout layout
= new LinearLayout(dir
);
29 setLayoutManager(layout
);
33 * The title to display instead of the application name, or NULL for the
34 * default application name.
36 * @return the title or NULL
38 abstract public String
getTitle();
41 * Returns an error message ready to be displayed if we should ask something
42 * to the user before exiting.
44 * @return an error message or NULL
46 abstract public String
getExitWarning();
49 * The {@link KeyAction#Mode} that links to this {@link MainContent}.
51 * @return the linked mode
53 abstract public KeyAction
.Mode
getMode();
56 * The kind of data displayed by this {@link MainContent}.
58 * @return the kind of data displayed
60 abstract public KeyAction
.DataType
getDataType();
63 * Returns the list of actions and the keys that are bound to it.
65 * @return the list of actions
67 abstract public List
<KeyAction
> getKeyBindings();
70 * Move the active cursor (not the text cursor, but the currently active
74 * the horizontal move (< 0 for left, > 0 for right)
76 * the vertical move (< 0 for up, > 0 for down)
78 * @return the error message to display if any
80 abstract public String
move(int x
, int y
);