X-Git-Url: http://git.nikiroo.be/?a=blobdiff_plain;f=src%2Fbe%2Fnikiroo%2Fjvcard%2Ftui%2Fpanes%2FMainContent.java;h=c63afd9b47ef2da4dd919f1fac5ab6791d917e61;hb=d5260eeb873fcf2ef9855dedcd9e2a3a3a990582;hp=0bc9b29fce7bc091d0f3696534776b640b340b34;hpb=0b0b2b0ff1f5e21f7b0feb955b4b54855fb3d508;p=jvcard.git diff --git a/src/be/nikiroo/jvcard/tui/panes/MainContent.java b/src/be/nikiroo/jvcard/tui/panes/MainContent.java index 0bc9b29..c63afd9 100644 --- a/src/be/nikiroo/jvcard/tui/panes/MainContent.java +++ b/src/be/nikiroo/jvcard/tui/panes/MainContent.java @@ -1,5 +1,6 @@ package be.nikiroo.jvcard.tui.panes; +import java.io.IOException; import java.util.List; import be.nikiroo.jvcard.tui.KeyAction; @@ -29,13 +30,6 @@ abstract public class MainContent extends Panel { setLayoutManager(layout); } - /** - * The {@link KeyAction#Mode} that links to this {@link MainContent}. - * - * @return the linked mode - */ - abstract public KeyAction.Mode getMode(); - /** * The kind of data displayed by this {@link MainContent}. * @@ -51,12 +45,14 @@ abstract public class MainContent extends Panel { abstract public List getKeyBindings(); /** - * The title to display instead of the application name, or NULL for the + * The title to display in addition to the application name, or NULL for the * default application name. * * @return the title or NULL */ - abstract public String getTitle(); + public String getTitle() { + return null; + } /** * Returns an error message ready to be displayed if we should ask something @@ -79,6 +75,7 @@ abstract public class MainContent extends Panel { * * @return the error message to display if any */ + @SuppressWarnings("unused") public String move(int x, int y) { return null; } @@ -92,4 +89,31 @@ abstract public class MainContent extends Panel { 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(); + } + + /** + * Wake up call when the content is popped-back into view. You should call + * this method when you exit a previous content and come back to this one. + * + *

+ * By default, it will just refresh the data. + *

+ * + * @return a message to display, or NULL + * + * @throws IOException + * in case of error (the message of the {@link IOException} will + * be displayed to the user) + */ + public String wakeup() throws IOException { + refreshData(); + return null; + } }