]> git.mxchange.org Git - addressbook-swing.git/blobdiff - src/org/mxchange/addressbook/menu/console/ConsoleMenu.java
Updated copyright year
[addressbook-swing.git] / src / org / mxchange / addressbook / menu / console / ConsoleMenu.java
index cefa2c54d845a8ad05d55ee6eb6f86cf8a171785..392d7e7c2772745d1478564367051bde040e79a4 100644 (file)
@@ -1,40 +1,54 @@
-/*\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.console;\r
-\r
-import org.mxchange.addressbook.client.Client;\r
-import org.mxchange.addressbook.menu.AddressbookMenu;\r
-import org.mxchange.addressbook.menu.BaseMenu;\r
-import org.mxchange.addressbook.menu.Menu;\r
-\r
-/**\r
- *\r
- * @author Roland Haeder\r
- */\r
-public class ConsoleMenu extends BaseMenu implements Menu {\r
-    /**\r
-     * Constructor for this menu\r
-     * @param menuType Menu type to initialize\r
-     * @param client CLient to call back\r
-     */\r
-    public ConsoleMenu (final String menuType, final Client client) {\r
-       this.initMenu(menuType, client);\r
-       \r
-       // Add all items\r
-       AddressbookMenu.addItemsToList(this.getMenuList(), menuType, client);\r
-    }\r
-}\r
+/*
+ * Copyright (C) 2016 - 2022 Free Software Foundation
+ *
+ * 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.console;
+
+import java.text.MessageFormat;
+import org.mxchange.addressbook.menu.AddressbookMenu;
+import org.mxchange.addressbook.menu.BaseMenu;
+import org.mxchange.addressbook.menu.Menu;
+import org.mxchange.jcore.client.Client;
+
+/**
+ * A menu system for the console
+ * <p>
+ * @author Roland Häder<roland@mxchange.org>
+ */
+public class ConsoleMenu extends BaseMenu implements Menu {
+
+       /**
+        * Constructor for this menu
+        * <p>
+        * @param menuType      Menu type to initialize
+        * @param client CLient to call back
+        */
+       public ConsoleMenu (final String menuType, final Client client) {
+               // Trace message
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("menuType={0},client={1} - CALLED!", menuType, client)); //NOI18N
+
+               // Client must not be null
+               if (null == client) {
+                       // Abort here
+                       throw new NullPointerException("client is null");
+               }
+
+               // Init menu
+               this.initMenu(menuType, client);
+
+               // Add all items
+               AddressbookMenu.addItemsToList(this.getMenuList(), menuType, client);
+       }
+}