]> git.mxchange.org Git - jbonuscard-lib.git/blobdiff - src/org/mxchange/addressbook/client/AddressbookClient.java
updated jars
[jbonuscard-lib.git] / src / org / mxchange / addressbook / client / AddressbookClient.java
index e884edb7b4d3011cd70e06056b3205500400899a..ff8442bbf5fbaff5214a2cd9a4d13ec5d18a94f2 100644 (file)
 package org.mxchange.addressbook.client;
 
 import org.mxchange.addressbook.menu.item.SelectableMenuItem;
+import org.mxchange.jcontacts.contact.Contact;
+import org.mxchange.jcontacts.contact.gender.Gender;
 import org.mxchange.jcore.client.Client;
+import org.mxchange.jcore.exceptions.MenuInitializationException;
 import org.mxchange.jcore.exceptions.UnhandledUserChoiceException;
-import org.mxchange.jcore.model.contact.Contact;
-import org.mxchange.jcore.model.contact.gender.Gender;
 
 /**
  * A special client interface for addressbook applications.
@@ -30,11 +31,32 @@ import org.mxchange.jcore.model.contact.gender.Gender;
 public interface AddressbookClient extends Client {
 
        /**
-        * The user changes own name data
+        * Displays a "box" for the address
         * <p>
-        * @param contact
+        * @param contact Contact to show address from
         */
-       public void doChangeOwnNameData (final Contact contact);
+       public void displayAddressBox (final Contact contact);
+
+       /**
+        * Displays a "box" for the name
+        * <p>
+        * @param contact Contact to show name from
+        */
+       public void displayNameBox (final Contact contact);
+
+       /**
+        * Displays a "box" for other data
+        * <p>
+        * @param contact Contact to show other data from
+        */
+       public void displayOtherDataBox (final Contact contact);
+
+       /**
+        * Shows given contact instamce
+        *
+        * @param contact Contact instance
+        */
+       public void show (final Contact contact);
 
        /**
         * The user changes own address data
@@ -43,6 +65,13 @@ public interface AddressbookClient extends Client {
         */
        public void doChangeOwnAddressData (final Contact contact);
 
+       /**
+        * The user changes own name data
+        * <p>
+        * @param contact
+        */
+       public void doChangeOwnNameData (final Contact contact);
+
        /**
         * The user changes own other data
         * <p>
@@ -57,29 +86,13 @@ public interface AddressbookClient extends Client {
         */
        public Contact doEnterOwnData ();
 
-       /**
-        * Asks the user to enter his/her gender (M=Male, F=Female, C=Company)
-        * <p>
-        * @param message Message to output
-        * @return Gender enum
-        */
-       public Gender enterGender (final String message);
-
-       /**
-        * Let the user choose what to change on the address: [n]ame, [a]ddress,
-        * [o]ther
-        * <p>
-        * @param contact Contact instance to let the user change data
-        * @throws UnhandledUserChoiceException If choice is not supported
-        */
-       public void userChooseChangeContactData (final Contact contact) throws UnhandledUserChoiceException;
-
        /**
         * Asks the user for a choice and proceeds accordingly
         * <p>
         * @throws UnhandledUserChoiceException If choice is not supported
+        * @throws org.mxchange.jcore.exceptions.MenuInitializationException If the menu cannot be initialized
         */
-       public void doUserMenuChoice () throws UnhandledUserChoiceException;
+       public void doUserMenuChoice () throws UnhandledUserChoiceException, MenuInitializationException;
 
        /**
         * Asks the the user to enter a single character which must match validChars
@@ -91,17 +104,12 @@ public interface AddressbookClient extends Client {
        public char enterChar (final char[] validChars, final String message);
 
        /**
-        * Reads a string of minimum and maximum length from the user. An empty
-        * string should be generally not allowed, but might be okay for e.g.
-        * company name.
+        * Asks the user to enter his/her gender (M=Male, F=Female, C=Company)
         * <p>
-        * @param minLength     Minimum length of the string to read
-        * @param maxLength     Maximum length of the string to read
-        * @param message       Message to user
-        * @param allowEmpty Whether empty strings are allowed
-        * @return Entered string by user or null if empty string is allowed
+        * @param message Message to output
+        * @return Gender enum
         */
-       public String enterString (final int minLength, final int maxLength, final String message, final boolean allowEmpty);
+       public Gender enterGender (final String message);
 
        /**
         * Reads an integer (int) from the user
@@ -113,6 +121,19 @@ public interface AddressbookClient extends Client {
         */
        public int enterInt (final int minimum, final int maximum, final String message);
 
+       /**
+        * Reads a string of minimum and maximum length from the user. An empty
+        * string should be generally not allowed, but might be okay for e.g.
+        * company name.
+        * <p>
+        * @param minLength     Minimum length of the string to read
+        * @param maxLength     Maximum length of the string to read
+        * @param message       Message to user
+        * @param allowEmpty Whether empty strings are allowed
+        * @return Entered string by user or null if empty string is allowed
+        */
+       public String enterString (final int minLength, final int maxLength, final String message, final boolean allowEmpty);
+
        /**
         * Setter for current menu choice
         * <p>
@@ -129,6 +150,11 @@ public interface AddressbookClient extends Client {
         */
        public SelectableMenuItem getMenuItem (final char accessKey, final String text);
 
+       /**
+        * Shows current menu selection to the user
+        */
+       public void showCurrentMenu ();
+
        /**
         * Shows given menu entry in client
         * <p>
@@ -137,7 +163,11 @@ public interface AddressbookClient extends Client {
        public void showEntry (final SelectableMenuItem item);
 
        /**
-        * Shows current menu selection to the user
+        * Let the user choose what to change on the address: [n]ame, [a]ddress,
+        * [o]ther
+        * <p>
+        * @param contact Contact instance to let the user change data
+        * @throws UnhandledUserChoiceException If choice is not supported
         */
-       public void showCurrentMenu ();
+       public void userChooseChangeContactData (final Contact contact) throws UnhandledUserChoiceException;
 }