X-Git-Url: http://git.nikiroo.be/?a=blobdiff_plain;f=src%2Fbe%2Fnikiroo%2Fjvcard%2Ftui%2Fpanes%2FMainContent.java;h=68230d490eeb98e3bb612f323fd91533f73caeef;hb=f04d8b1c4c3ed29d4d23cc076f307ef455b2dcb6;hp=df8731366b37d788e2ab5ff86258e018221fb4da;hpb=fae07ea7af01c64ca1a858db75a615555318d5e2;p=jvcard.git diff --git a/src/be/nikiroo/jvcard/tui/panes/MainContent.java b/src/be/nikiroo/jvcard/tui/panes/MainContent.java index df87313..68230d4 100644 --- a/src/be/nikiroo/jvcard/tui/panes/MainContent.java +++ b/src/be/nikiroo/jvcard/tui/panes/MainContent.java @@ -30,41 +30,38 @@ abstract public class MainContent extends Panel { } /** - * The title to display instead of the application name, or NULL for the - * default application name. - * - * @return the title or NULL - */ - abstract public String getTitle(); - - /** - * Returns an error message ready to be displayed if we should ask something - * to the user before exiting. + * The kind of data displayed by this {@link MainContent}. * - * @return an error message or NULL + * @return the kind of data displayed */ - abstract public String getExitWarning(); + abstract public KeyAction.DataType getDataType(); /** - * The {@link KeyAction#Mode} that links to this {@link MainContent}. + * Returns the list of actions and the keys that are bound to it. * - * @return the linked mode + * @return the list of actions */ - abstract public KeyAction.Mode getMode(); + abstract public List getKeyBindings(); /** - * The kind of data displayed by this {@link MainContent}. + * The title to display in addition to the application name, or NULL for the + * default application name. * - * @return the kind of data displayed + * @return the title or NULL */ - abstract public KeyAction.DataType getDataType(); + public String getTitle() { + return null; + } /** - * Returns the list of actions and the keys that are bound to it. + * Returns an error message ready to be displayed if we should ask something + * to the user before exiting. * - * @return the list of actions + * @return an error message or NULL */ - abstract public List getKeyBindings(); + public String getExitWarning() { + return null; + } /** * Move the active cursor (not the text cursor, but the currently active @@ -77,5 +74,25 @@ abstract public class MainContent extends Panel { * * @return the error message to display if any */ - abstract public String move(int x, int y); + public String move(int x, int y) { + return null; + } + + /** + * Return the number of items in this {@link MainContent}, or -1 if this + * {@link MainContent} is not countable. + * + * @return -1 or the number of present items + */ + public int getCount() { + return -1; + } + + /** + * Refresh the display according to the actual data (this method should be + * called when the data changed). + */ + public void refreshData() { + invalidate(); + } }