--- /dev/null
+============================================
+AddressbookApplication management:
+============================================
+
+Inernet("public" service) and Intranet
+
+Version 1.0+:
+- Single-user local application
+- Fields:
+ + Gender
+ + Surname
+ + Family name
+ + Company name
+ + Street + number
+ + ZIP code
+ + City
+ + Landline number
+ + Fax number
+ + Cell phone number
+ + Email address
+ + Birth day
+ + Comment (?)
+- Edit own data
+- Add new contact
+- Edit contacts
+- Delete contacts
+- Categorization of contacts
+
+Version 1.1+:
+- Permanent storage in database
+
+Version 2.0+:
+- Multi-user web application
+- Local user registration / login / resend confirmation link / password
+ recovery
+- User groups (aka. teams)
+- Administration area (user role)
+ + Create/edit/delete groups
+ + Edit/delete/lock/unlock user
+ + Assign user roles/rights
+- Allow other users / groups to view addressbook
+ + Full addressbook
+ + Only some categories
+- VCard export
+ + Allow users/guests (not recommended)
+- XML export of addressbook and compressable (ZIP)
+- Form to contact other user/group without need of mail program
+ + User can disabled this
+- Directory for ussers/groups (who allowed to be listed)
+ + Simple click to add user to own addressbook
+ + Search form?
+
+Version 2.1+:
+- Multi-language support
+
+Version 2.2+:("socialized")
+- "Social login" (OpenID consumer)
+ + Connect user account to social account
+ + Sync own data?
+- "Social profile"
+ + OpenID provider
+ + RSS/activity feed
+
+============================================
+Time esitmation:
+============================================
+- 1.0 (console):
+ + 2 days
+
+- 1.1 (database):
+ + 2 day
+ + Initial tables: contacts, categories, contact_category
+
+- 2.0 (web):
+ + 3 days
+ + Additional tables: admins (?), admin_rights, groups,
+ users, user_contacts, user_user_rights, user_category_rights,
+
+- 2.1 (language)
+ + 1 day
+ + Additional tables: languages (disable, enable language "pack" ?)
+
+- 2.2 (social):
+ + 3 days
+ + Additional tables: ???
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
-
-/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
-/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
-/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
-/*!40101 SET NAMES utf8 */;
-
-
-DROP TABLE IF EXISTS `contacts`;
-CREATE TABLE IF NOT EXISTS `contacts` (
-`id` bigint(20) unsigned NOT NULL COMMENT 'Primary key',
- `own_contact` tinyint(1) NOT NULL DEFAULT '0' COMMENT 'Whether own contact',
- `gender` varchar(10) NOT NULL DEFAULT 'UNKNOWN' COMMENT 'Gender',
- `surname` varchar(100) NOT NULL COMMENT 'Surname',
- `family_name` varchar(100) NOT NULL COMMENT 'Family name',
- `company_name` varchar(255) DEFAULT NULL COMMENT 'Company name',
- `street` varchar(255) DEFAULT NULL COMMENT 'Street name',
- `house_number` smallint(5) unsigned DEFAULT NULL COMMENT 'House number',
- `city` varchar(100) DEFAULT NULL COMMENT 'City name',
- `zip_code` smallint(5) unsigned DEFAULT NULL COMMENT 'ZIP code',
- `country_code` char(2) DEFAULT NULL COMMENT 'Country code',
- `phone_number` varchar(100) DEFAULT NULL COMMENT 'Phone number',
- `cellphone_number` varchar(100) DEFAULT NULL COMMENT 'Cellphone number',
- `fax_number` varchar(100) DEFAULT NULL COMMENT 'Fax number',
- `email_address` varchar(100) DEFAULT NULL COMMENT 'Email addres',
- `birthday` date DEFAULT NULL COMMENT 'Birth day',
- `comment` tinytext NOT NULL COMMENT 'Comment',
- `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'Entry created',
- `updated` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE CURRENT_TIMESTAMP
-) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='Contacts data' AUTO_INCREMENT=1 ;
-
-
-ALTER TABLE `contacts`
- ADD PRIMARY KEY (`id`);
-
-
-ALTER TABLE `contacts`
-MODIFY `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Primary key';
-/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
-/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
-/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
import org.mxchange.jcore.manager.application.ApplicationManager;
/**
- * ============================================
- * AddressbookApplication management:
- * ============================================
- *
- * Inernet("public" service) and Intranet
- *
- * Version 1.0+:
- * - Single-user local application
- * - Fields:
- * + Gender
- * + Surname
- * + Family name
- * + Company name
- * + Street + number
- * + ZIP code
- * + City
- * + Landline number
- * + Fax number
- * + Cell phone number
- * + Email address
- * + Birth day
- * + Comment (?)
- * - Edit own data
- * - Add new contact
- * - Edit contacts
- * - Delete contacts
- * - Categorization of contacts
- *
- * Version 1.1+:
- * - Permanent storage in database
- *
- * Version 2.0+:
- * - Multi-user web application
- * - Local user registration / login / resend confirmation link / password
- * recovery
- * - User groups (aka. teams)
- * - Administration area (user role)
- * + Create/edit/delete groups
- * + Edit/delete/lock/unlock user
- * + Assign user roles/rights
- * - Allow other users / groups to view addressbook
- * + Full addressbook
- * + Only some categories
- * - VCard export
- * + Allow users/guests (not recommended)
- * - XML export of addressbook and compressable (ZIP)
- * - Form to contact other user/group without need of mail program
- * + User can disabled this
- * - Directory for ussers/groups (who allowed to be listed)
- * + Simple click to add user to own addressbook
- * + Search form?
- *
- * Version 2.1+:
- * - Multi-language support
- *
- * Version 2.2+:("socialized")
- * - "Social login" (OpenID consumer)
- * + Connect user account to social account
- * + Sync own data?
- * - "Social profile"
- * + OpenID provider
- * + RSS/activity feed
- *
- * ============================================
- * Time esitmation:
- * ============================================
- * 1.0 (console):
- * + 2 days
- *
- * 1.1 (database):
- * + 2 day
- * + Initial tables: contacts, categories, contact_category
- *
- * 2.0 (web):
- * + 3 days
- * + Additional tables: admins (?), admin_rights, groups,
- * users, user_contacts, user_user_rights, user_category_rights,
- *
- * 2.1 (language)
- * + 1 day
- * + Additional tables: languages (disable, enable language "pack" ?)
- *
- * 2.2 (social):
- * + 3 days
- * + Additional tables: ???
-*
+ * Address book application class. Please see ROADMAP.txt for details.
+ * <p>
* @author Roland Haeder
* @version 0.0
*/
/**
* Protected constructor
+ * <p>
* @throws java.io.IOException If any IO error occurs
*/
protected AddressbookApplication () throws IOException {
/**
* Checks whether the client shoule be console client should be launched by
* checking if -console is set.
- *
+ * <p>
* @return Whether console client should be taken
*/
private boolean isConsole () {
/**
* Checks whether the client shoule be GUI client should be launched by
* checking if -gui is set.
- *
+ * <p>
* @return Whether GUI client should be taken
*/
private boolean isGui () {
/**
* Parses all given arguments
- *
+ * <p>
* @param args Arguments from program launch
*/
private void parseArguments (final String[] args) {
/**
* Launches the application
- *
+ * <p>
* @param args Arguments handled to program
*/
private void start (final String args[]) {
/**
* Main method (entry point)
- *
+ * <p>
* @param args the command line arguments
*/
public static void main (String[] args) {
/**
* Getter for printable application name
- *
+ * <p>
* @return A printable name
*/
public static String printableTitle () {
/**
* A special client interface for addressbook applications.
- *
+ * <p>
* @author Roland Haeder
*/
public interface AddressbookClient extends Client {
/**
* The user changes own name data
- *
+ * <p>
* @param contact
*/
public void doChangeOwnNameData (final Contact contact);
/**
* The user changes own address data
- *
+ * <p>
* @param contact Contact instance to change
*/
public void doChangeOwnAddressData (final Contact contact);
/**
* The user changes own other data
- *
+ * <p>
* @param contact Constact instance to change
*/
public void doChangeOwnOtherData (final Contact contact);
/**
* Allows the user to enter own data
- *
+ * <p>
* @return Finished Contact instance
*/
public Contact doEnterOwnData ();
/**
* Asks the user to enter his/her gender (M=Male, F=Female, C=Company)
- *
+ * <p>
* @param message Message to output
* @return Gender enum
*/
/**
* Let the user choose what to change on the address: [n]ame, [a]ddress,
* [o]ther
- *
+ * <p>
* @param contact Contact instance to let the user change data
* @throws UnhandledUserChoiceException If choice is not supported
*/
/**
* Asks the user for a choice and proceeds accordingly
- *
+ * <p>
* @throws UnhandledUserChoiceException If choice is not supported
*/
public void doUserMenuChoice () throws UnhandledUserChoiceException;
/**
* Asks the the user to enter a single character which must match validChars
- *
+ * <p>
* @param validChars Valid chars that are accepted
* @param message Message to user
* @return Allowed character
* Reads a string of minimum and maximum length from the user. An empty
* string should be generally not allowed, but might be okay for e.g.
* company name.
- *
+ * <p>
* @param minLength Minimum length of the string to read
* @param maxLength Maximum length of the string to read
* @param message Message to user
/**
* Reads an integer (int) from the user
- *
+ * <p>
* @param minimum Minimum allowed number
* @param maximum Maximum allowed number
* @param message Message to user
/**
* Setter for current menu choice
- *
+ * <p>
* @param currentMenu Current menu choice
*/
public void setCurrentMenu (final String currentMenu);
/**
* Some "Getter" for menu item
- *
+ * <p>
* @param accessKey Key to press to access this menu
* @param text Text to show to user
* @return
/**
* Shows given menu entry in client
- *
+ * <p>
* @param item Menu item to show
*/
public void showEntry (final SelectableMenuItem item);
/**
* A general addressbook client
- *
- * @author Roland Haeder
- * TODO: Find better name
+ * <p>
+ * @author Roland Haeder TODO: Find better name
*/
public abstract class BaseAddressbookClient extends BaseClient implements AddressbookClient {
/**
* Current menu choice
- *
+ * <p>
* @return the currentMenu
*/
public final String getCurrentMenu () {
/**
* "Getter" for given menu type
- *
+ * <p>
* @param menuType Menu type instance to return
* @return Menu or null if not found
*/
/**
* Getter for menus map
- *
+ * <p>
* @return Map of all menus
*/
protected final Map<String, Menu> getMenus () {
/**
* Initializes contact manager
- *
+ * <p>
* @throws java.sql.SQLException If any SQL error occurs
*/
protected void initContactManager () throws SQLException {
/**
* Shows given menu
- *
+ * <p>
* @param menuType Given menu to show
*/
protected void showMenu (final String menuType) {
/**
* A client for the console
- *
+ * <p>
* @author Roland Haeder
*/
public class ConsoleClient extends BaseAddressbookClient implements AddressbookClient {
/**
* Parameterless constructor
- *
+ * <p>
* @param application An instance of an Application class
*/
public ConsoleClient (final Application application) {
/**
* Reads one character
- *
+ * <p>
* @return A single character
*/
private char readChar () {
/**
* Reads an integer (int) from user
- *
+ * <p>
* @return An integer number
*/
private int readInt () {
/**
* Reads a string from a scanner until RETURN is pressed
- *
+ * <p>
* @return Read string from scanner
*/
private String readString () {
/**
* Singelton getter for this frame instance.
- *
+ * <p>
* @param client Client instance
* @return Returns a singelton instance of this frame
*/
/**
* Creates an instance of this frame with a client instance
- *
+ * <p>
* @param client
*/
private AddressbookFrame (final Client client) {
this.getLogger().trace("EXIT!"); //NOI18N
}
-
/**
* Enables main window (frame)
*/
/**
* Setups the frame, do not set isInitialized here
- *
+ * <p>
* @param client Client instance
*/
@Override
* Initalizes this frame. Having initComponents() exposed (publicly
* accessible) means that any other object can initialize components which
* you may not want.
- *
- * @throws
- * org.mxchange.jcore.exceptions.FrameAlreadyInitializedException If
+ * <p>
+ * @throws org.mxchange.jcore.exceptions.FrameAlreadyInitializedException If
* this method has been called twice
*/
@Override
/**
* Returns field isInitialized. This flag indicates whether this frame has
* been initialized or not.
- *
+ * <p>
* @return Field isInitialized
*/
@Override
/**
* Adds a new menu item with given key to menu instance
- *
+ * <p>
* @param menu Menu instance to add item to
* @param key Message key part
* @param listener Listener instance
private void addMenuItem (final JMenu menu, final String key, final ActionListener listener) {
// Trace message
this.getLogger().trace(MessageFormat.format("menu={0},key={1},listener={2} - CALLED!", menu, key, listener)); //NOI18N
-
+
// New instance
JMenuItem item = this.initMenuItemWithTooltip(key);
-
+
// Add listener
item.addActionListener(listener);
-
+
// Add item -> menu
menu.add(item);
-
+
// Trace message
this.getLogger().trace("EXIT!"); //NOI18N
}
/**
* Adds a JTextField with label and tool tip to given panel
- *
+ * <p>
* @param panel Panel instance to add text field
* @param key Part of message key from resource bundle
* @param fieldLength Length of text field
private void addTextFieldWithLabelToPanel (final JPanel panel, final String key, final int fieldLength) {
// Trace message
this.getLogger().trace(MessageFormat.format("panel={0},key={1},fieldLength={2} - CALLED!", panel, key, fieldLength)); //NOI18N
-
+
// Init label for given key
JLabel label = new JLabel(this.getBundle().getString(String.format("AddressbookFrame.%s.text", key))); //NOI18N
-
+
// And input box wih tool tip
JTextField field = new JTextField(fieldLength);
field.setToolTipText(this.getBundle().getString(String.format("AddressbookFrame.%s.toolTipText", key))); //NOI18N
-
+
// Add both to panel
panel.add(label);
panel.add(field);
-
+
// Trace message
this.getLogger().trace("EXIT!"); //NOI18N
}
/**
* Generates a title for borders
- *
+ * <p>
* @param key Key part to look for
* @return Human-readable title
*/
/**
* Generates a title for all frames based on given sub title key. If null is
* given, the sub title is not generated.
- *
+ * <p>
* @param subKey Key for sub title resource
* @return A full application title
*/
initAddCancelButtons();
// x)Only for developing:
- /* DEBUG: */ this.addContact.setVisible(true);
+ /*
+ * DEBUG:
+ */ this.addContact.setVisible(true);
// Trace message
this.getLogger().trace("EXIT!"); //NOI18N
/**
* Initializes address panel
- *
+ * <p>
* @param dialog A JDialog instance to this components to
*/
private void initAddressDataPanel (final JDialog dialog) {
/**
* Initializes a menu item instance with tool tip
- *
+ * <p>
* @param key Message key part
* @return A finished JMenuItem instance
*/
this.addMenuItem(menu, "exitProgram", new ActionListener() { //NOI18N
/**
* If the user has performed this action
- *
+ * <p>
* @param e An instance of an ActionEvent class
*/
@Override
this.addOwnItem.addActionListener(new ActionListener() {
/**
* If the user has performed this action
- *
+ * <p>
* @param e An instance of an ActionEvent class
*/
@Override
this.editOwnItem.addActionListener(new ActionListener() {
/**
* If the user has performed this action
- *
+ * <p>
* @param e An instance of an ActionEvent class
*/
@Override
this.addMenuItem(menu, "addNewContact", new ActionListener() { //NOI18N
/**
* If the user has performed this action
- *
+ * <p>
* @param e An instance of an ActionEvent class
*/
@Override
/**
* Initializes name panel
- *
+ * <p>
* @param dialog A JDialog instance to this components to
*/
private void initNameDataPanel (final JDialog dialog) {
/**
* Initializes "other" data panel
- *
- * @param dialog A JDialog instance to this components to
- * TODO Fill this with life
+ * <p>
+ * @param dialog A JDialog instance to this components to TODO Fill this
+ * with life
*/
private void initOtherDataPanel (final JDialog dialog) {
// Trace message
this.dataTable.addMouseListener(new MouseAdapter() {
/**
* If the user peformed a click on a cell
- *
+ * <p>
* @param e Mouse event instance
*/
@Override
/**
* Updates status to given type
- *
+ * <p>
* @param type Status type
*/
private void updateStatus (final String type) {
* Class for "add address" button
*/
private static class AddActionListener extends BaseFrameworkSystem implements ActionListener {
+
/**
* Dialog instance
*/
/**
* Constructor for action listener
- *
+ * <p>
* @param dialog Dialog instance to call back
* @param frame Frame instance (not JFrame)
*/
/**
* If the action has been performed
- *
+ * <p>
* @param e The performed action event
*/
@Override
* Class for "cancel address" button
*/
private static class CancelActionListener extends BaseFrameworkSystem implements ActionListener {
+
/**
* Dialog instance
*/
/**
* Constructor for action listener
- *
+ * <p>
* @param dialog Dialog instance to call back
* @param frame Frame instance (not JFrame)
*/
/**
* If the action has been performed
- *
+ * <p>
* @param e The performed action event
*/
@Override
/**
* Constructor with an Application instance.
- *
+ * <p>
* @param application Application instance
*/
public SwingClient (final Application application) {
/**
* Shows dialog to enter new contact
- *
+ * <p>
* @return Returns finished Contact instance
*/
@Override
/**
* Returns a Swing menu item
- *
+ * <p>
* @param accessKey Key to access the menu
* @param text Text to show to user
* @return A SelectableMenuItem
/**
* Thrown if the given Contact instance is already added
- *
+ * <p>
* @author Roland Haeder
*/
public class ContactAlreadyAddedException extends Exception {
+
/**
* Serial number
*/
/**
* Constructor with a Contact instance
- *
+ * <p>
* @param contact Contact that is already added
*/
public ContactAlreadyAddedException (final Contact contact) {
public ContactAlreadyAddedException () {
super("Contact already added");
}
-
+
}
/**
* A manager for contacts.
- *
+ * <p>
* @author Roland Haeder
* @version 0.0
*/
/**
* Constructor which accepts maxContacts for maximum (initial) contacts and
* a client instance.
- *
+ * <p>
* @param client Client instance to use
* @throws java.sql.SQLException If an SQL error occurs
*/
/**
* Adds given Contact instance to list
- *
+ * <p>
* @param contact Contact instance to add
*/
@Override
- public void addContact (final Contact contact) throws ContactAlreadyAddedException {
+ public void addContact (final Contact contact) throws ContactAlreadyAddedException {
// Trace message
this.getLogger().trace(MessageFormat.format("contact={0} - CALLED!", contact)); //NOI18N
/**
* Let the user change address data
- *
+ * <p>
* @param contact Instance to change data
*/
@Override
if (null == contact) {
// Abort here
throw new NullPointerException("contact is null"); //NOI18N
- } if (!(this.getClient() instanceof AddressbookClient)) {
+ }
+ if (!(this.getClient() instanceof AddressbookClient)) {
// Cannot cast
throw new IllegalArgumentException(MessageFormat.format("this.getClient()={0} does not implement AddressbookClient", this.getClient())); //NOI18N
}
/**
* Let the user change "name data"
- *
+ * <p>
* @param contact Instance to change data
*/
@Override
/**
* Let the user change other data
- *
- * @param contact Instance to change data
- * TODO Didn't handle birthday
+ * <p>
+ * @param contact Instance to change data TODO Didn't handle birthday
*/
@Override
public void doChangeOtherData (final Contact contact) {
* Allows the user to change his/her own data
*/
@Override
- public void doChangeOwnData () throws IOException, SQLException, NoSuchMethodException, IllegalAccessException, InvocationTargetException{
+ public void doChangeOwnData () throws IOException, SQLException, NoSuchMethodException, IllegalAccessException, InvocationTargetException {
// Trace message
this.getLogger().trace("CALLED!"); //NOI18N
/**
* Shuts down this contact manager
- *
+ * <p>
* @throws java.sql.SQLException If an SQL error occurs
* @throws java.io.IOException If an IO error occurs
*/
/**
* Asks the user for his/her cellphone number
- *
+ * <p>
* @return User's cellphone number
*/
@Override
/**
* Asks the user for his/her city's name
- *
+ * <p>
* @return City's name of the user
*/
@Override
/**
* Asks the user for his/her city's name
- *
+ * <p>
* @return City's name of the user
*/
@Override
/**
* Asks the user for his/her company name
- *
+ * <p>
* @return User's company name
*/
@Override
/**
* Asks user for his/her own country code
- *
+ * <p>
* @return User's own country code
*/
@Override
/**
* Asks user for his/her own country code
- *
+ * <p>
* @return User's own country code
*/
@Override
/**
* Asks the user for family name
- *
+ * <p>
* @return Family name of the user
*/
@Override
/**
* Asks the user for family name
- *
+ * <p>
* @return Family name of the user
*/
@Override
/**
* Asks the user for surname
- *
+ * <p>
* @return Surname of the user
*/
@Override
public String enterOwnFirstName () {
// Trace message
this.getLogger().trace("CALLED!"); //NOI18N
-
+
// Get and cast client instance
AddressbookClient client = (AddressbookClient) this.getClient();
-
+
return client.enterString(2, 50, "Bitte geben Sie Ihren Vornamen ein: ", false);
}
/**
* Asks the user for gender, until a valid has been entered
- *
+ * <p>
* @return Gender of the user
*/
@Override
/**
* Asks the user for phone number
- *
+ * <p>
* @return Phone number of the user
*/
@Override
/**
* Asks the user for own street (including number)
- *
+ * <p>
* @return Own street an number
*/
@Override
/**
* Asks the user for own ZIP code
- *
+ * <p>
* @return ZIP code
*/
@Override
/**
* Checks whether own contact is already added by checking all entries for
* isOwnContact flag
- *
+ * <p>
* @return Whether own contact is already added
*/
@Override
/**
* Adds given contact to address book and flushes all entries to database
- *
- * @param contact Contact being added
- * TODO Add check for book size
+ * <p>
+ * @param contact Contact being added TODO Add check for book size
*/
@Override
public void registerContact (final Contact contact) {
throw new NullPointerException("contact is null"); //NOI18N
}
try {
+
// Debug message
- /* NOISY-DEBUG: */ this.getLogger().debug(MessageFormat.format("Adding '{0}' '{1}' at pos '{2}' ...", contact.getFirstName(), contact.getFamilyName(), this.size())); //NOI18N
+ /*
+ * NOISY-DEBUG:
+ */ this.getLogger().debug(MessageFormat.format("Adding '{0}' '{1}' at pos '{2}' ...", contact.getFirstName(), contact.getFamilyName(), this.size())); //NOI18N
- // Check if contact is found
+ // Check if contact is found
if (((AddressbookContactFrontend) this.getFrontend()).isContactFound(contact)) {
// Contact already added
// TODO Do something here
String[] tokens = this.getArrayFromString(key, "."); //NOI18N
// Token array must contain 4 elements (AddressbookContactManager.columnName.foo.text)
- assert(tokens.length == 4) : MessageFormat.format("Array tokens contains not 4 elements: {0}", Arrays.toString(tokens)); //NOI18N
+ assert (tokens.length == 4) : MessageFormat.format("Array tokens contains not 4 elements: {0}", Arrays.toString(tokens)); //NOI18N
// Get pre-last element
String columnName = tokens[tokens.length - 2];
/**
* "Getter" for own contact instance or null if not found
- *
+ * <p>
* @return Contact instance or null
* @throws java.sql.SQLException If an SQL error occurs
* @throws java.io.IOException If an IO error occurs
/**
* An interface for addressbook contact manager
- *
+ * <p>
* @author Roland Haeder
*/
public interface ManageableContactAddressbook extends Manageable {
+
/**
* Allows the user to enter own cellphone number.
- *
+ * <p>
* @return Cellphone number
*/
public String enterOwnCellNumber ();
/**
* Allows the user to enter own city name.
- *
+ * <p>
* @return City name
*/
public String enterOwnCity ();
/**
* Allows the user to enter comment for own entry.
- *
+ * <p>
* @return Comment
*/
public String enterOwnComment ();
/**
* Allows the user to enter own company name.
- *
+ * <p>
* @return Company name
*/
public String enterOwnCompanyName ();
/**
* Allows the user to enter own country code.
- *
+ * <p>
* @return Country code
*/
public String enterOwnCountryCode ();
/**
* Allows the user to enter own email address.
- *
+ * <p>
* @return Email address
*/
public String enterOwnEmailAddress ();
/**
* Allows the user to enter own family name.
- *
+ * <p>
* @return Family name
*/
public String enterOwnFamilyName ();
/**
* Allows the user to enter own fax number.
- *
+ * <p>
* @return Fax number
*/
public String enterOwnFaxNumber ();
/**
* Allows the user to enter own gender.
- *
+ * <p>
* @return Gender
*/
public Gender enterOwnGender ();
/**
* Allows the user to enter own phone number.
- *
+ * <p>
* @return Phone number
*/
public String enterOwnPhoneNumber ();
/**
* Allows the user to enter own street and house number.
- *
+ * <p>
* @return Street and house number
*/
public String enterOwnStreet ();
/**
* Allows the user to enter own surname.
- *
+ * <p>
* @return Surname
*/
public String enterOwnFirstName ();
/**
* Allows the user to enter own ZIP code.
- *
+ * <p>
* @return ZIP code
*/
public int enterOwnZipCode ();
/**
* Adds given contact to address book
- *
- * @param contact Contact being added
- * TODO Add check for book size
+ * <p>
+ * @param contact Contact being added TODO Add check for book size
*/
public void registerContact (final Contact contact);
/**
* Adds given Contact instance to list
- *
+ * <p>
* @param contact Contact instance to add
- * @throws org.mxchange.addressbook.exceptions.ContactAlreadyAddedException If the contact is already added
+ * @throws org.mxchange.addressbook.exceptions.ContactAlreadyAddedException
+ * If the contact is already added
*/
public void addContact (final Contact contact) throws ContactAlreadyAddedException;
/**
* The user can change address data, like street, ZIP code, city and country
* of given Contact instance.
- *
+ * <p>
* @param contact Instance to change data
*/
public void doChangeAddressData (final Contact contact);
/**
* The user can change name data, like gender, surname, family name and
* company name (if business contact).
- *
+ * <p>
* @param contact Instance to change data
*/
public void doChangeNameData (final Contact contact);
/**
* The user can change other data, like phone numbers or comments.
- *
+ * <p>
* @param contact Instance to change data
*/
public void doChangeOtherData (final Contact contact);
/**
* Let the user change own data
+ * <p>
* @throws java.sql.SQLException If an SQL error occurs
* @throws java.io.IOException If an IO error occurs
* @throws java.lang.NoSuchMethodException If a method cannot be found
* @throws java.lang.IllegalAccessException If a method is not accessible
* @throws java.lang.reflect.InvocationTargetException Any other problems?
*/
- public void doChangeOwnData () throws IOException , SQLException, NoSuchMethodException, IllegalAccessException, InvocationTargetException;
+ public void doChangeOwnData () throws IOException, SQLException, NoSuchMethodException, IllegalAccessException, InvocationTargetException;
/**
* Let the user delete other address
/**
* Asks user for own data
- * @throws org.mxchange.addressbook.exceptions.ContactAlreadyAddedException If own contact is already added
+ * <p>
+ * @throws org.mxchange.addressbook.exceptions.ContactAlreadyAddedException
+ * If own contact is already added
* @throws java.io.IOException If an IO error was found
*/
public void doEnterOwnData () throws ContactAlreadyAddedException, IOException;
/**
* Checks whether own contact is already added by checking all entries for
* isOwnContact flag
- *
+ * <p>
* @return Whether own contact is already added
* @throws java.io.IOException If an IO error occurs
*/
/**
* Getter for translated column name at given index.
- *
+ * <p>
* @param columnIndex Column index
- * @return Human-readable column name
- * TODO: This is needed for TableModel in Swing
+ * @return Human-readable column name TODO: This is needed for TableModel in
+ * Swing
*/
public String getTranslatedColumnName (final int columnIndex);
/**
* Somewhat "getter" for value from given row and column index
- *
+ * <p>
* @param rowIndex Row index
* @param columnIndex Column index
* @return Value from given row/column
* @throws java.lang.NoSuchMethodException If the method was not found
- * @throws java.lang.IllegalAccessException If the accessed method was not public
- * @throws java.lang.reflect.InvocationTargetException Something else happened?
- * TODO: This is needed for TableModel in Swing
+ * @throws java.lang.IllegalAccessException If the accessed method was not
+ * public
+ * @throws java.lang.reflect.InvocationTargetException Something else
+ * happened? TODO: This is needed for TableModel in Swing
*/
public Object getValueFromRowColumn (final int rowIndex, final int columnIndex) throws NoSuchMethodException, IllegalAccessException, InvocationTargetException;
/**
* Getter for column name at given index.
- *
+ * <p>
* @param columnIndex Column index
- * @return Database column name
- * TODO: This is needed for TableModel in Swing
+ * @return Database column name TODO: This is needed for TableModel in Swing
*/
public String getColumnName (final int columnIndex);
/**
* Getter for column count
- * @return Column count
- * TODO: This is needed for TableModel in Swing
+ * <p>
+ * @return Column count TODO: This is needed for TableModel in Swing
*/
public int getColumnCount ();
}
/**
* Utility class for menu structure
- *
+ * <p>
* @author Roland Haeder
*/
public class AddressbookMenu extends BaseMenu {
/**
* Copies entries for given type into the menu list
- *
+ * <p>
* @param menuList Menu list for later showing
* @param menuType Type of menu
* @param client Client instance to call back
/**
* Size of menu items
- *
+ * <p>
* @return Count of menu items
*/
public int getMenuItemsCount () {
/**
* "Getter" for an iterator of this menu's items
- *
+ * <p>
* @return An iterator of all menu items
*/
public Iterator<SelectableMenuItem> getMenuItemsIterator () {
/**
* Shows this menu
- *
+ * <p>
* @param client Client instance to call back
*/
public void show (final Client client) {
/**
* Getter for menu list
- *
+ * <p>
* @return menuList List of menu entries
*/
protected final List<SelectableMenuItem> getMenuList () {
/**
* Initializes menu
- *
+ * <p>
* @param menuType Menu type to initialize
* @param client CLient to call back
*/
/**
*
- * @author Roland Haeder
- * TODO find better name
+ * @author Roland Haeder TODO find better name
*/
public interface Menu {
/**
* "Getter" for an iterator on all menu items of the current menu
- *
+ * <p>
* @return Iterator on all menu items
*/
public Iterator<SelectableMenuItem> getMenuItemsIterator ();
/**
* Shows this menu
- *
+ * <p>
* @param client Client instance
*/
public void show (final Client client);
/**
* Size of all menu items
- *
+ * <p>
* @return
*/
public int getMenuItemsCount ();
/**
* Gets an array with all available access keys back from given menu map.
* This can later be handle to the client's enterChar() method.
- *
+ * <p>
* @param menus A Map with all menus and their entries
* @param menuType Menu type
* @return An array with available access chars
/**
* Constructor for this menu
- *
+ * <p>
* @param menuType Menu type to initialize
* @param client CLient to call back
*/
/**
* Shows this menu item
- *
+ * <p>
* @param client Client instance
*/
public void show (final Client client);
/**
* Access key
- *
+ * <p>
* @return the accessKey
*/
public char getAccessKey ();
/**
* Text to user
- *
+ * <p>
* @return the text
*/
public String getText ();
/**
* Constructor for building a console menu with access key and text
- *
+ * <p>
* @param accessKey Access key for this menu entry
* @param text Text to show to user
*/
/**
* Access key
- *
+ * <p>
* @return the accessKey
*/
@Override
/**
* Access key
- *
+ * <p>
* @param accessKey the accessKey to set
*/
private void setAccessKey (char accessKey) {
/**
* Text to user
- *
+ * <p>
* @return the text
*/
@Override
/**
* Text to user
- *
+ * <p>
* @param text the text to set
*/
private void setText (String text) {