title" are being used.
Signed-off-by: Roland Häder <roland@mxchange.org>
Version 1.0+:
- Single-user local application
- Fields:
- + Gender
+ + Personal title
+ Surname
+ Family name
+ Company name
</node>
<node TEXT="Click the link to enter some personal data" ID="ID_1966993495" CREATED="1443604585327" MODIFIED="1443614745419">
<font NAME="Liberation Sans"/>
-<node TEXT="First name, family name and gender" ID="ID_467871831" CREATED="1443604604023" MODIFIED="1443614745419">
+<node TEXT="First name, family name and title" ID="ID_467871831" CREATED="1443604604023" MODIFIED="1443614745419">
<font NAME="Liberation Sans"/>
</node>
<node TEXT="To make sure the user is really him/her" ID="ID_1598650071" CREATED="1443604615575" MODIFIED="1443614745420">
<font NAME="Liberation Sans"/>
<node TEXT="Enter personal data" ID="ID_1304960332" CREATED="1443605949952" MODIFIED="1443614745427">
<font NAME="Liberation Sans"/>
-<node TEXT="Gender" ID="ID_946054746" CREATED="1443605987049" MODIFIED="1443615261408">
+<node TEXT="Personal title" ID="ID_946054746" CREATED="1443605987049" MODIFIED="1443615261408">
<icon BUILTIN="fema"/>
<font NAME="Liberation Sans"/>
</node>
-<node TEXT="Titles (Dr., Prof.)" ID="ID_1117613838" CREATED="1443613582457" MODIFIED="1443614745428">
+<node TEXT="Academic titles (Dr., Prof.)" ID="ID_1117613838" CREATED="1443613582457" MODIFIED="1443614745428">
<font NAME="Liberation Sans"/>
</node>
<node TEXT="First name" ID="ID_592998632" CREATED="1443605980762" MODIFIED="1443614745428">
<icon BUILTIN="idea"/>
<font NAME="Liberation Sans"/>
</node>
-<node TEXT="Gender" ID="ID_1074968827" CREATED="1443613341685" MODIFIED="1443615261409">
+<node TEXT="Personal title" ID="ID_1074968827" CREATED="1443613341685" MODIFIED="1443615261409">
<icon BUILTIN="fema"/>
<font NAME="Liberation Sans"/>
</node>
// Is the bundle initialized?
if (!isBundledInitialized()) {
// Temporary initialize default bundle
- // TODO The enum Gender uses this
+ // TODO The enum PersonalTitle uses this
this.initBundle();
}
}
import org.mxchange.addressbook.menu.item.SelectableMenuItem;
import org.mxchange.jcontacts.contact.Contact;
-import org.mxchange.jcontacts.contact.gender.Gender;
+import org.mxchange.jcontacts.contact.title.PersonalTitle;
import org.mxchange.jcore.client.Client;
import org.mxchange.jcore.exceptions.MenuInitializationException;
import org.mxchange.jcore.exceptions.UnhandledUserChoiceException;
char enterChar (final char[] validChars, final String message);
/**
- * Asks the user to enter his/her gender (M=Male, F=Female, C=Company)
+ * Asks the user to enter his/her personal title (M=Male, F=Female, C=Company)
* <p>
* @param message Message to output
* <p>
- * @return Gender enum
+ * @return PersonalTitle enum
*/
- Gender enterGender (final String message);
+ PersonalTitle enterPersonalTitle (final String message);
/**
* Reads an integer (int) from the user
import org.mxchange.addressbook.menu.item.console.ConsoleMenuItem;
import org.mxchange.jcontacts.contact.Contact;
import org.mxchange.jcontacts.contact.UserContact;
-import org.mxchange.jcontacts.contact.gender.Gender;
-import org.mxchange.jcontacts.contact.gender.GenderUtils;
+import org.mxchange.jcontacts.contact.title.PersonalTitle;
+import org.mxchange.jcontacts.contact.title.PersonalTitleUtils;
import org.mxchange.jcontactsbusiness.exceptions.BusinessContactAlreadyAddedException;
import org.mxchange.jcore.application.Application;
import org.mxchange.jcore.exceptions.MenuInitializationException;
throw new NullPointerException("contact is null"); //NOI18N
}
- // Get translated gender as the user may want to see "Mr.", "Mrs."
- String gender = GenderUtils.getTranslatedGender(contact);
+ // Get translated title as the user may want to see "Mr.", "Mrs."
+ String title = PersonalTitleUtils.getTranslatedPersonalTitle(contact);
- // Now put all together: gender, surname, family name
- this.outputMessage(MessageFormat.format("Anrede, Vorname, Name: {0} {1} {2}", gender, contact.getContactFirstName(), contact.getContactFamilyName()));
+ // Now put all together: title, surname, family name
+ this.outputMessage(MessageFormat.format("Anrede, Vorname, Name: {0} {1} {2}", title, contact.getContactFirstName(), contact.getContactFamilyName()));
// Trace message
this.getLoggerBeanLocal().logTrace("EXIT!"); //NOI18N
// Get manager and cast it
ContactFacade manager = (ContactFacade) this.getFacade();
- // Gender:
- Gender gender = manager.enterOwnGender();
+ // PersonalTitle:
+ PersonalTitle title = manager.enterOwnPersonalTitle();
// Surname
String firstName = manager.enterOwnFirstName();
String familyName = manager.enterOwnFamilyName();
// Update contact instance
- contact.setContactGender(gender);
+ contact.setContactPersonalTitle(title);
contact.setContactFirstName(firstName);
contact.setContactFamilyName(familyName);
// Get manager and cast it
ContactFacade manager = (ContactFacade) this.getFacade();
- // First ask for gender
- Gender gender = manager.enterOwnGender();
+ // First ask for title
+ PersonalTitle title = manager.enterOwnPersonalTitle();
// 2nd for first name
String firstName = manager.enterOwnFirstName();
String familyName = manager.enterOwnFamilyName();
// Construct UserContact instance
- Contact contact = new UserContact(gender, firstName, familyName);
+ Contact contact = new UserContact(title, firstName, familyName);
// Trace message
this.getLoggerBeanLocal().logTrace(MessageFormat.format("contact={0} - EXIT!", contact)); //NOI18N
}
@Override
- public Gender enterGender (final String message) {
+ public PersonalTitle enterPersonalTitle (final String message) {
// Trace message
this.getLoggerBeanLocal().logTrace(MessageFormat.format("message={0} - CALLED!", message)); //NOI18N
// Get valid chars
- char[] validChars = Gender.validChars();
+ char[] validChars = PersonalTitle.validChars();
// Debug message
//* NOISY-DEBUG: */ System.out.println(validChars);
// Call inner method
- char gender = this.enterChar(validChars, message);
+ char title = this.enterChar(validChars, message);
- // Now get a Gender instance back
- Gender g = Gender.fromChar(gender);
+ // Now get a PersonalTitle instance back
+ PersonalTitle g = PersonalTitle.fromChar(title);
// g must not be null
- assert (g instanceof Gender) : "g is not set."; //NOI18N
+ assert (g instanceof PersonalTitle) : "g is not set."; //NOI18N
// Trace message
this.getLoggerBeanLocal().logTrace(MessageFormat.format("g={0} - EXIT!", g)); //NOI18N
import org.mxchange.addressbook.application.AddressbookApplication;
import org.mxchange.addressbook.facade.contact.ContactFacade;
import org.mxchange.jcontacts.contact.Contact;
-import org.mxchange.jcontacts.contact.gender.Gender;
+import org.mxchange.jcontacts.contact.title.PersonalTitle;
import org.mxchange.jcontacts.exceptions.ContactAlreadyAddedException;
import org.mxchange.jcore.application.Application;
import org.mxchange.jcore.client.Client;
// Set border to titled version
namePanel.setBorder(new TitledBorder(this.generateBorderTitle("name"))); //NOI18N
- // Gender text field
- JLabel gLabel = new JLabel(this.getBundle().getString("AddressbookFrame.gender.text"));
+ // PersonalTitle text field
+ JLabel gLabel = new JLabel(this.getBundle().getString("AddressbookFrame.title.text"));
- // Get all genders
- Gender[] genders = Gender.values();
+ // Get all titles
+ PersonalTitle[] titles = PersonalTitle.values();
- // Init gender combo box with tool tip
- JComboBox<Gender> gender = new JComboBox<>(new DefaultComboBoxModel<>(genders));
- gender.setToolTipText(this.getBundle().getString("AddressbookFrame.gender.toolTipText"));
+ // Init title combo box with tool tip
+ JComboBox<PersonalTitle> title = new JComboBox<>(new DefaultComboBoxModel<>(titles));
+ title.setToolTipText(this.getBundle().getString("AddressbookFrame.title.toolTipText"));
- // Add both to gender panel
+ // Add both to title panel
namePanel.add(gLabel);
- namePanel.add(gender);
+ namePanel.add(title);
// Add text field for surname
this.addTextFieldWithLabelToPanel(namePanel, "surname", 20); //NOI18N
import org.mxchange.addressbook.client.BaseAddressbookClient;
import org.mxchange.addressbook.menu.item.SelectableMenuItem;
import org.mxchange.jcontacts.contact.Contact;
-import org.mxchange.jcontacts.contact.gender.Gender;
+import org.mxchange.jcontacts.contact.title.PersonalTitle;
import org.mxchange.jcore.application.Application;
import org.mxchange.jcore.exceptions.FrameAlreadyInitializedException;
import org.mxchange.jcore.exceptions.UnhandledUserChoiceException;
}
@Override
- public Gender enterGender (final String message) {
+ public PersonalTitle enterPersonalTitle (final String message) {
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. //NOI18N
}
import java.util.List;
import org.mxchange.addressbook.client.AddressbookClient;
import org.mxchange.jcontacts.contact.Contact;
-import org.mxchange.jcontacts.contact.gender.Gender;
+import org.mxchange.jcontacts.contact.title.PersonalTitle;
import org.mxchange.jcontactsbusiness.exceptions.BusinessContactAlreadyAddedException;
import org.mxchange.jcore.client.Client;
import org.mxchange.jcore.exceptions.UnhandledUserChoiceException;
}
@Override
- public Gender enterOwnGender () {
+ public PersonalTitle enterOwnPersonalTitle () {
// Trace message
this.getLoggerBeanLocal().logTrace("CALLED!"); //NOI18N
// Get and cast client instance
AddressbookClient client = (AddressbookClient) this.getClient();
- return client.enterGender("Bitte geben Sie die Anrede ein: (M=Herr, F=Frau, C=Firma): ");
+ return client.enterPersonalTitle("Bitte geben Sie die Anrede ein: (M=Herr, F=Frau, C=Firma): ");
}
@Override
import java.io.IOException;
import org.mxchange.jcontacts.contact.Contact;
-import org.mxchange.jcontacts.contact.gender.Gender;
+import org.mxchange.jcontacts.contact.title.PersonalTitle;
import org.mxchange.jcontactsbusiness.exceptions.BusinessContactAlreadyAddedException;
import org.mxchange.jcore.facade.Facade;
import org.mxchange.jcountry.data.Country;
void doChangeAddressData (final Contact contact);
/**
- * The user can change name data, like gender, surname, family name and
+ * The user can change name data, like title, surname, family name and
* company name (if business contact).
* <p>
* @param contact Instance to change data
String enterOwnFirstName ();
/**
- * Allows the user to enter own gender.
+ * Allows the user to enter own title.
* <p>
- * @return Gender
+ * @return PersonalTitle
*/
- Gender enterOwnGender ();
+ PersonalTitle enterOwnPersonalTitle ();
/**
* Allows the user to enter own phone number.
AddressbookFrame.menuItem.addNewContact.toolTipText=Eine neue Adresse hinzuf\u00fcgen.
AddressbookFrame.dialog.addContact.title.text=Neue Adresse hinzuf\u00fcgen
AddressbookFrame.main.title.text=Adressen auflisten
-AddressbookFrame.gender.text=Anrede:
-AddressbookFrame.gender.toolTipText=W\u00e4hlen Sie die Anrede aus.
+AddressbookFrame.title.text=Anrede:
+AddressbookFrame.title.toolTipText=W\u00e4hlen Sie die Anrede aus.
AddressbookFrame.surname.text=Vorname:
AddressbookFrame.surname.toolTipText=Geben Sie den Vornamen ein.
AddressbookFrame.familyName.text=Nachname:
AddressbookFrame.faxNumber.toolTipText=Geben Sie die Faxnummer ein.
AddressbookFrame.comment.text=Anmerkungen:
AddressbookFrame.comment.toolTipText=Geben Sie eine Anmerkung (Freifeld) ein.
-GENDER_MALE=Herr
-GENDER_FEMALE=Frau
-GENDER_COMPANY=Firma
-ContactManager.columnName.gender.text=Anrede
+PERSONAL_TITLE_MR=Herr
+PERSONAL_TITLE_MRS=Frau
+ContactManager.columnName.title.text=Anrede
ContactManager.columnName.surname.text=Vorname
ContactManager.columnName.familyName.text=Nachname
ContactManager.columnName.street.text=Strasse
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-AddressbookFrame.border.name.title.text=Gender, surname, family name:
+AddressbookFrame.border.name.title.text=Title, surname, family name:
AddressbookFrame.border.address.title.text=Address:
AddressbookFrame.border.other.title.text=Other data:
AddressbookFrame.button.addAddress.text=Add address
AddressbookFrame.menuItem.addNewContact.toolTipText=Add a new address.
AddressbookFrame.dialog.addContact.title.text=Add new address
AddressbookFrame.main.title.text=List addresses
-AddressbookFrame.gender.text=Gender:
-AddressbookFrame.gender.toolTipText=Choose gender.
+AddressbookFrame.title.text=Title:
+AddressbookFrame.title.toolTipText=Choose title.
AddressbookFrame.surname.text=Surname:
AddressbookFrame.surname.toolTipText=Enter surname.
AddressbookFrame.familyName.text=Family name:
AddressbookFrame.faxNumber.toolTipText=Enter fax number.
AddressbookFrame.comment.text=Note:
AddressbookFrame.comment.toolTipText=Enter a note (free field).
-GENDER_MALE=Mr.
-GENDER_FEMALE=Mrs.
-GENDER_COMPANY=Company
-ContactManager.columnName.gender.text=Gender
+PERSONAL_TITLE_MR=Mr.
+PERSONAL_TITLE_MRS=Mrs.
+ContactManager.columnName.title.text=Title
ContactManager.columnName.surname.text=Surname
ContactManager.columnName.familyName.text=Family name
ContactManager.columnName.street.text=Street