// Set application instance\r
this.setApplication(application);\r
\r
- // Init contact manager here\r
- this.initContactManager(this);\r
-\r
// Init scanner instance\r
this.scanner = new Scanner(System.in);\r
-\r
- // Fill menu map\r
- this.fillMenuMap();\r
}\r
\r
/**\r
@Override\r
public void displayAddressBox (final Contact contact) {\r
// Simple display ...\r
- // @todo Use mask\r
+ // @todo Use mask\r
this.outputMessage("Strasse, PLZ Ort, Land: " + contact.getStreet() + "\n" + contact.getZipCode() + " " + contact.getCity() + "\n" + contact.getCountryCode());\r
}\r
\r
@Override\r
public void displayOtherDataBox (final Contact contact) {\r
// Cellphone and such ...\r
- this.outputMessage("Telefonnumer: " + contact.getPhoneNumber() + "\nFaxnummer: " + contact.getFaxNumber() + "\nHandy: " + contact.getCellphoneNumber() + "\nKommentar:\n" + contact.getComment());\r
+ this.outputMessage(MessageFormat.format("Telefonnumer: {0}\nFaxnummer: {1}\nHandy: {2}\nKommentar:\n{3}", contact.getPhoneNumber(), contact.getFaxNumber(), contact.getCellphoneNumber(), contact.getComment()));\r
+ }\r
+\r
+ /**\r
+ * Shutdown this client\r
+ */\r
+ @Override\r
+ public void doShutdown () {\r
+ // Parent call\r
+ super.doShutdown();\r
+\r
+ // @TODO Add other shutdown stuff\r
}\r
\r
@Override\r
break;\r
\r
case '0': // Program exit\r
- this.disableIsRunning();\r
+ this.getApplication().doShutdown();\r
break;\r
\r
default:\r
// @TODO throw own exception\r
- throw new UnhandledUserChoiceException("Choice '" + choice + "' not handled yet.");\r
+ throw new UnhandledUserChoiceException(MessageFormat.format("Choice '{0}' not handled yet.", choice));\r
}\r
}\r
\r
return new ConsoleMenuItem(accessKey,text);\r
}\r
\r
+ /**\r
+ * Inizializes this client\r
+ */\r
+ @Override\r
+ public void initClient () {\r
+ // Init contact manager here\r
+ this.initContactManager();\r
+ \r
+ // Fill menu map\r
+ this.fillMenuMap();\r
+ }\r
+\r
/**\r
* Displays textural message to the user\r
* @param message\r
*/\r
@Override\r
public void showWelcome () {\r
- this.outputMessage("Welcome to " + AddressbookApplication.APP_TITLE + " v" + AddressbookApplication.APP_VERSION);\r
+ this.outputMessage("Welcome to " + AddressbookApplication.printableTitle());\r
this.outputMessage("");\r
this.outputMessage("Copyright(c) 2015 by Roland Haeder, this is free software");\r
\r