From 5bacd2cdd7a323b9047addcdd1b921c4ae8983a1 Mon Sep 17 00:00:00 2001 From: Roland Haeder Date: Mon, 20 Jul 2015 15:07:51 +0200 Subject: [PATCH] =?utf8?q?Sorted=20some=20members=20+=20added=202=20menu?= =?utf8?q?=20entries:=20list=20and=20search=20Signed-off-by:Roland=20H?= =?utf8?q?=C3=A4der=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../addressbook/menu/AddressbookMenu.java | 10 ++++++-- .../addressbook/menu/console/BaseMenu.java | 16 ++++++------- .../menu/item/console/ConsoleMenuItem.java | 24 +++++++++---------- 3 files changed, 28 insertions(+), 22 deletions(-) diff --git a/Addressbook/src/org/mxchange/addressbook/menu/AddressbookMenu.java b/Addressbook/src/org/mxchange/addressbook/menu/AddressbookMenu.java index 6282a420..02d00b65 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 02bc5b63..afa83c39 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 85a784d8..37f9c7ca 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); } } -- 2.39.5