]> git.mxchange.org Git - jbonuscard-lib.git/commitdiff
Implemented getColumnName() + added it to ContactManager as this class holds the...
authorRoland Haeder <roland@mxchange.org>
Fri, 24 Jul 2015 10:41:00 +0000 (12:41 +0200)
committerRoland Haeder <roland@mxchange.org>
Fri, 24 Jul 2015 10:41:45 +0000 (12:41 +0200)
Signed-off-by:Roland Häder <roland@mxchange.org>

Addressbook/src/org/mxchange/addressbook/localization/bundle_de_DE.properties
Addressbook/src/org/mxchange/addressbook/localization/bundle_en_US.properties
Addressbook/src/org/mxchange/addressbook/manager/contact/ContactManager.java
Addressbook/src/org/mxchange/addressbook/manager/contact/ManageableContact.java
Addressbook/src/org/mxchange/addressbook/model/address/AddressTableModel.java

index e6907eebc1919ffe64996e82197ed1194dd7b5fa..1239e9791d9bbda41a373e87e2e50aa8f822a69c 100644 (file)
@@ -24,3 +24,10 @@ AddressbookFrame.menuItem.addOwnData.text=Eigene Adresse hinzuf\u00fcgen
 AddressbookFrame.menuItem.addOwnData.toolTipText=Erlaubt das Hinzuf\u00fcgen eigener Daten.
 AddressbookFrame.menuItem.editOwnData.text=Eigene Adresse \u00e4ndern
 AddressbookFrame.menuItem.editOwnData.toolTipText=Erlaubt das \u00c4ndern eigener Daten.
+ContactManager.columnName.gender.text=Anrede
+ContactManager.columnName.surname.text=Vorname
+ContactManager.columnName.familyName.text=Nachname
+ContactManager.columnName.street.text=Strasse
+ContactManager.columnName.houseNumber.text=Hausnummer
+ContactManager.columnName.zipCode.text=Postleitzahl
+ContactManager.columnName.city.text=Stadt
index c9295322597d58fadb3a3ee5728b55805b8d42d5..e8c1bf4a7c3ba0b5086375ad627b3a159eae145b 100644 (file)
@@ -24,3 +24,10 @@ AddressbookFrame.menuItem.addOwnData.text=Add own address
 AddressbookFrame.menuItem.addOwnData.toolTipText=Allows the user to add own address data
 AddressbookFrame.menuItem.editOwnData.text=Edit own data
 AddressbookFrame.menuItem.editOwnData.toolTipText=Allows the user to edit own address data
+ContactManager.columnName.gender.text=Gender
+ContactManager.columnName.surname.text=Surname
+ContactManager.columnName.familyName.text=Family name
+ContactManager.columnName.street.text=Street
+ContactManager.columnName.houseNumber.text=House number
+ContactManager.columnName.zipCode.text=ZIP code
+ContactManager.columnName.city.text=City
index e950e42ca89059ae32e567579fedadebbda1d95e..c958c1de9b82084a782f2fd2de821b06cb514be2 100644 (file)
@@ -485,7 +485,7 @@ public class ContactManager extends BaseManager implements ManageableContact {
            String key = iterator.next();
 
            // Does the key start with ContactManager.columnName ?
-           if (key.startsWith("ContactM,anager.columnName")) {
+           if (key.startsWith("ContactManager.columnName")) {
                // This is the wanted entry.
                this.getLogger().debug(MessageFormat.format("key={0}", key));
 
@@ -498,6 +498,18 @@ public class ContactManager extends BaseManager implements ManageableContact {
        this.getLogger().trace(MessageFormat.format("getColumnCount()={0}: EXIT!", this.getColumnCount()));
     }
 
+    /**
+     * Getter for column name at given index.
+     * 
+     * @param columnIndex Column index
+     * @return Human-readable column name
+     */
+    @Override
+    public String getColumnName (final int columnIndex) {
+       // Get column name at index
+       return this.columnNames.get(columnIndex);
+    }
+
     /**
      * Flushes all entries by calling database backend
      */
index 6914a261b5e1ca72e76463e0de16fa3f931c9895..928df17dc8032373502cdb9cc24f27f7bfc91a9e 100644 (file)
@@ -135,6 +135,14 @@ public interface ManageableContact extends Manageable {
      */
     public void doListContacts ();
 
+    /**
+     * Getter for column name at given index.
+     * 
+     * @param columnIndex Column index
+     * @return Human-readable column name
+     */
+    public String getColumnName (final int columnIndex);
+
     /**
      * Adds given contact to address book
      *
index c3fcbc680a92e0baf476786964922b4d50dce415..0041637c1ed243454f26673c6fcb0314060bb7ef 100644 (file)
@@ -46,17 +46,19 @@ public class AddressTableModel extends BaseModel implements TableModel {
 
     @Override
     public int getColumnCount () {
-       // Deligate this call to the contact manager
+       // Deligate this call to contact manager
        return this.getClient().getContactManager().getColumnCount();
     }
 
     @Override
     public String getColumnName (final int columnIndex) {
-       throw new UnsupportedOperationException("Not supported yet. columnIndex=" + columnIndex); //To change body of generated methods, choose Tools | Templates.
+       // Deligate this call to contact manager
+       return this.getClient().getContactManager().getColumnName(columnIndex);
     }
 
     @Override
     public int getRowCount () {
+       // Deligate this call to contact manager
        return this.getClient().getContactManager().size();
     }