]> git.mxchange.org Git - jaddressbook-lib.git/blobdiff - Addressbook/src/org/mxchange/addressbook/menu/AddressbookMenu.java
Global commit: Changed spaces to tabs, because all Java files have tabs for indenting
[jaddressbook-lib.git] / Addressbook / src / org / mxchange / addressbook / menu / AddressbookMenu.java
index 02d00b65808179e9c8231d88b7ffbb7671da1bfe..418a7cb1b784bf39c26c2618d481945ab803242a 100644 (file)
@@ -1,85 +1,86 @@
-/*\r
- * Copyright (C) 2015 Roland Haeder\r
- *\r
- * This program is free software: you can redistribute it and/or modify\r
- * it under the terms of the GNU General Public License as published by\r
- * the Free Software Foundation, either version 3 of the License, or\r
- * (at your option) any later version.\r
- *\r
- * This program is distributed in the hope that it will be useful,\r
- * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
- * GNU General Public License for more details.\r
- *\r
- * You should have received a copy of the GNU General Public License\r
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.\r
- */\r
-package org.mxchange.addressbook.menu;\r
-\r
-import java.util.List;\r
-import org.apache.logging.log4j.Logger;\r
-import org.mxchange.addressbook.BaseFrameworkSystem;\r
-import org.mxchange.addressbook.client.Client;\r
-import org.mxchange.addressbook.menu.item.SelectableMenuItem;\r
-\r
-/**\r
- * Utility class for menu structure\r
- * \r
- * @author Roland Haeder\r
- */\r
-public class AddressbookMenu extends BaseFrameworkSystem {\r
-    /**\r
-     * Copies entries for given type into the menu list\r
-     *\r
-     * @param menuList Menu list for later showing\r
-     * @param menuType Type of menu\r
-     * @param client Client instance to call back\r
-     */\r
-    public static void addItemsToList (final List<SelectableMenuItem> menuList, final String menuType, final Client client) {\r
-       // Get logger\r
-       Logger log = new AddressbookMenu().getLogger();\r
-\r
-       // Get list size\r
-       int size = menuList.size();\r
-\r
-       // Debug message\r
-       log.debug("Adding menu for '" + menuType + "' (old size: '" + size + "') ...");\r
-\r
-       // Depends on type\r
-       switch (menuType) {\r
-           case "main": // Main menu\r
-               // Enter own data\r
-               menuList.add(client.getMenuItem('1', "Eigene Adresse anlegen"));\r
-\r
-               // Change own data\r
-               menuList.add(client.getMenuItem('2', "Eigene Adresse ändern"));\r
-\r
-               // Add new addess\r
-               menuList.add(client.getMenuItem('3', "Neue Adresse hinzufügen"));\r
-\r
-               // List entries\r
-               menuList.add(client.getMenuItem('4', "Adressbuch anzeigen"));\r
-\r
-               // Address search\r
-               menuList.add(client.getMenuItem('5', "Adresse suchen"));\r
-\r
-               // Change other address\r
-               menuList.add(client.getMenuItem('6', "Adresse ändern"));\r
-\r
-               // Delete other address\r
-               menuList.add(client.getMenuItem('7', "Adresse löschen"));\r
-\r
-               // Always last line: Exit program\r
-               menuList.add(client.getMenuItem('0', "Programm verlassen"));\r
-               break;\r
-\r
-           default: // Not supported\r
-               log.error("Menu type '" + menuType + "' ont supported");\r
-               System.exit(1);\r
-       }\r
-\r
-       // Size must have changed to more entries than before\r
-       assert(menuList.size() > size);\r
-    }\r
-\r
-}\r
+/*
+ * Copyright (C) 2015 Roland Haeder
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+package org.mxchange.addressbook.menu;
+
+import java.util.List;
+import org.apache.logging.log4j.Logger;
+import org.mxchange.addressbook.BaseFrameworkSystem;
+import org.mxchange.addressbook.client.Client;
+import org.mxchange.addressbook.menu.item.SelectableMenuItem;
+
+/**
+ * Utility class for menu structure
+ *
+ * @author Roland Haeder
+ */
+public class AddressbookMenu extends BaseFrameworkSystem {
+
+       /**
+        * Copies entries for given type into the menu list
+        *
+        * @param menuList Menu list for later showing
+        * @param menuType Type of menu
+        * @param client Client instance to call back
+        */
+       public static void addItemsToList (final List<SelectableMenuItem> menuList, final String menuType, final Client client) {
+               // Get logger
+               Logger log = new AddressbookMenu().getLogger();
+
+               // Get list size
+               int size = menuList.size();
+
+               // Debug message
+               log.debug("Adding menu for '" + menuType + "' (old size: '" + size + "') ...");
+
+               // Depends on type
+               switch (menuType) {
+                       case "main": // Main menu
+                               // Enter own data
+                               menuList.add(client.getMenuItem('1', "Eigene Adresse anlegen"));
+
+                               // Change own data
+                               menuList.add(client.getMenuItem('2', "Eigene Adresse ändern"));
+
+                               // 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('6', "Adresse ändern"));
+
+                               // Delete other address
+                               menuList.add(client.getMenuItem('7', "Adresse löschen"));
+
+                               // Always last line: Exit program
+                               menuList.add(client.getMenuItem('0', "Programm verlassen"));
+                               break;
+
+                       default: // Not supported
+                               log.error("Menu type '" + menuType + "' ont supported");
+                               System.exit(1);
+               }
+
+               // Size must have changed to more entries than before
+               assert (menuList.size() > size);
+       }
+
+}