X-Git-Url: http://git.nikiroo.be/?a=blobdiff_plain;f=src%2Fbe%2Fnikiroo%2Fjvcard%2Ftui%2Fpanes%2FMainContent.java;h=c33bbd3fdb93a868b84177382add38f49d6712bb;hb=bcb54330afff6a443ab43ee3d38cc7f863c701b7;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..c33bbd3 100644 --- a/src/be/nikiroo/jvcard/tui/panes/MainContent.java +++ b/src/be/nikiroo/jvcard/tui/panes/MainContent.java @@ -29,22 +29,6 @@ abstract public class MainContent extends Panel { setLayoutManager(layout); } - /** - * 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. - * - * @return an error message or NULL - */ - abstract public String getExitWarning(); - /** * The {@link KeyAction#Mode} that links to this {@link MainContent}. * @@ -66,6 +50,26 @@ abstract public class MainContent extends Panel { */ abstract public List getKeyBindings(); + /** + * The title to display in addition to the application name, or NULL for the + * default application name. + * + * @return the title or NULL + */ + public String getTitle() { + return null; + } + + /** + * Returns an error message ready to be displayed if we should ask something + * to the user before exiting. + * + * @return an error message or NULL + */ + public String getExitWarning() { + return null; + } + /** * Move the active cursor (not the text cursor, but the currently active * item). @@ -77,5 +81,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(); + } }