]> git.mxchange.org Git - addressbook-swing.git/blob - Addressbook/src/org/mxchange/addressbook/client/Client.java
Initial commit
[addressbook-swing.git] / Addressbook / src / org / mxchange / addressbook / client / Client.java
1 /*\r
2  * Copyright (C) 2015 Roland Haeder\r
3  *\r
4  * This program is free software: you can redistribute it and/or modify\r
5  * it under the terms of the GNU General Public License as published by\r
6  * the Free Software Foundation, either version 3 of the License, or\r
7  * (at your option) any later version.\r
8  *\r
9  * This program is distributed in the hope that it will be useful,\r
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
12  * GNU General Public License for more details.\r
13  *\r
14  * You should have received a copy of the GNU General Public License\r
15  * along with this program.  If not, see <http://www.gnu.org/licenses/>.\r
16  */\r
17 package org.mxchange.addressbook.client;\r
18 \r
19 import org.mxchange.addressbook.FrameworkInterface;\r
20 import org.mxchange.addressbook.menu.item.SelectableMenuItem;\r
21 \r
22 /**\r
23  *\r
24  * @author Roland Haeder\r
25  */\r
26 public interface Client extends FrameworkInterface {\r
27 \r
28     /**\r
29      * Displays a message to the user\r
30      * @param message Message to show to the user\r
31      */\r
32     public void displayMessage (final String message);\r
33 \r
34     /**\r
35      * Asks the user for a choice and proceeds accordingly\r
36      * @throws java.lang.Exception\r
37      */\r
38     public void doUserChoice () throws Exception ;\r
39 \r
40     /**\r
41      * Enables isRunning attribute which singals that the client is running\r
42      */\r
43     public void enableIsRunning ();\r
44 \r
45     /**\r
46      * Asks the the user to enter a single character which must match validChars\r
47      * @param   validChars  Valid chars that are accepted\r
48      * @param   message     Message to user\r
49      * @return  Allowed character\r
50      */\r
51     public char enterChar (final char[] validChars, final String message);\r
52 \r
53     /**\r
54      * Reads a string of minimum and maximum length from the user\r
55      * @param minLength Minimum length of the string to read\r
56      * @param maxLength Maximum length of the string to read\r
57      * @param message   Message to user\r
58      * @return \r
59      */\r
60     public String enterString (final int minLength, final int maxLength, final String message);\r
61 \r
62     /**\r
63      * Setter for current menu choice\r
64      * @param currentMenu Current menu choice\r
65      */\r
66     public void setCurrentMenu (final String currentMenu);\r
67 \r
68     /**\r
69      * Some "Getter" for menu item\r
70      * @param accessKey Key to press to access this menu\r
71      * @param text Text to show to user\r
72      * @return \r
73      */\r
74     public SelectableMenuItem getMenuItem (final char accessKey, final String text);\r
75 \r
76     /**\r
77      * Determines whether the application is still active by checking some\r
78      * conditions\r
79      * \r
80      * @return Whether the application is still active\r
81      */\r
82     public boolean isApplicationRunning ();\r
83 \r
84     /**\r
85      * Shows given menu entry in client\r
86      * @param item Menu item to show\r
87      */\r
88     public void showEntry (final SelectableMenuItem item);\r
89 \r
90     /**\r
91      * Shows introduction to user\r
92      */\r
93     public void showWelcome ();\r
94 \r
95     /**\r
96      * Shows current menu selection to the user\r
97      */\r
98     public void showCurrentMenu ();\r
99 }\r