From: Roland Haeder Date: Mon, 20 Jul 2015 13:07:51 +0000 (+0200) Subject: Sorted some members + added 2 menu entries: list and search X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=5bacd2cdd7a323b9047addcdd1b921c4ae8983a1;p=jbonuscard-lib.git Sorted some members + added 2 menu entries: list and search Signed-off-by:Roland Häder --- diff --git a/Addressbook/src/org/mxchange/addressbook/menu/AddressbookMenu.java b/Addressbook/src/org/mxchange/addressbook/menu/AddressbookMenu.java index 6282a42..02d00b6 100644 --- a/Addressbook/src/org/mxchange/addressbook/menu/AddressbookMenu.java +++ b/Addressbook/src/org/mxchange/addressbook/menu/AddressbookMenu.java @@ -57,11 +57,17 @@ public class AddressbookMenu extends BaseFrameworkSystem { // Add new addess menuList.add(client.getMenuItem('3', "Neue Adresse hinzufügen")); + // List entries + menuList.add(client.getMenuItem('4', "Adressbuch anzeigen")); + + // Address search + menuList.add(client.getMenuItem('5', "Adresse suchen")); + // Change other address - menuList.add(client.getMenuItem('4', "Adresse ändern")); + menuList.add(client.getMenuItem('6', "Adresse ändern")); // Delete other address - menuList.add(client.getMenuItem('5', "Adresse löschen")); + menuList.add(client.getMenuItem('7', "Adresse löschen")); // Always last line: Exit program menuList.add(client.getMenuItem('0', "Programm verlassen")); diff --git a/Addressbook/src/org/mxchange/addressbook/menu/console/BaseMenu.java b/Addressbook/src/org/mxchange/addressbook/menu/console/BaseMenu.java index 02bc5b6..afa83c3 100644 --- a/Addressbook/src/org/mxchange/addressbook/menu/console/BaseMenu.java +++ b/Addressbook/src/org/mxchange/addressbook/menu/console/BaseMenu.java @@ -41,6 +41,14 @@ public class BaseMenu extends BaseFrameworkSystem { super(); } + /** + * Size of menu items + * @return Count of menu items + */ + public int getMenuItemsCount () { + return this.menuList.size(); + } + /** * "Getter" for an iterator of this menu's items * @@ -50,14 +58,6 @@ public class BaseMenu extends BaseFrameworkSystem { return this.menuList.iterator(); } - /** - * Size of menu items - * @return Count of menu items - */ - public int getMenuItemsCount () { - return this.menuList.size(); - } - /** * Shows this menu * diff --git a/Addressbook/src/org/mxchange/addressbook/menu/item/console/ConsoleMenuItem.java b/Addressbook/src/org/mxchange/addressbook/menu/item/console/ConsoleMenuItem.java index 85a784d..37f9c7c 100644 --- a/Addressbook/src/org/mxchange/addressbook/menu/item/console/ConsoleMenuItem.java +++ b/Addressbook/src/org/mxchange/addressbook/menu/item/console/ConsoleMenuItem.java @@ -55,6 +55,14 @@ public class ConsoleMenuItem extends BaseMenuItem implements SelectableMenuItem return this.accessKey; } + /** + * Access key + * @param accessKey the accessKey to set + */ + private void setAccessKey (char accessKey) { + this.accessKey = accessKey; + } + /** * Text to user * @return the text @@ -64,12 +72,6 @@ public class ConsoleMenuItem extends BaseMenuItem implements SelectableMenuItem return this.text; } - @Override - public void show (final Client client) { - // Call-back client over menu - client.showEntry(this); - } - /** * Text to user * @param text the text to set @@ -78,12 +80,10 @@ public class ConsoleMenuItem extends BaseMenuItem implements SelectableMenuItem this.text = text; } - /** - * Access key - * @param accessKey the accessKey to set - */ - private void setAccessKey (char accessKey) { - this.accessKey = accessKey; + @Override + public void show (final Client client) { + // Call-back client over menu + client.showEntry(this); } }