]> git.mxchange.org Git - jbonuscard-lib.git/commitdiff
Fixed call + introduced getColumnCount()
authorRoland Haeder <roland@mxchange.org>
Thu, 23 Jul 2015 06:19:55 +0000 (08:19 +0200)
committerRoland Haeder <roland@mxchange.org>
Thu, 23 Jul 2015 06:19:55 +0000 (08:19 +0200)
Signed-off-by:Roland Häder <roland@mxchange.org>

src/org/mxchange/addressbook/contact/BaseContact.java
src/org/mxchange/addressbook/manager/contact/ContactManager.java
src/org/mxchange/addressbook/manager/contact/ManageableContact.java
src/org/mxchange/addressbook/model/address/AddressTableModel.java

index 2a1ecb73ffd0bbf9d1f3605b063a71355379bf39..78d4f0790bf582be22c1d40726c03c295b3f69f1 100644 (file)
@@ -28,6 +28,11 @@ import org.mxchange.addressbook.client.Client;
  * @since 0.0\r
  */\r
 public class BaseContact extends BaseFrameworkSystem {\r
+    /**\r
+     * Amount of columns\r
+     */\r
+    public static final int COLUMN_COUNT = 14;\r
+\r
     /**\r
      * Birth day\r
      */\r
index 69a9a6247fa36014accae62eb1c81eb6f6024e7e..e89b7081d72838f5fa4b38b23a3e3101be8a23d0 100644 (file)
@@ -23,6 +23,7 @@ import java.util.Iterator;
 import java.util.List;\r
 import org.mxchange.addressbook.UnhandledUserChoiceException;\r
 import org.mxchange.addressbook.client.Client;\r
+import org.mxchange.addressbook.contact.BaseContact;\r
 import org.mxchange.addressbook.contact.Contact;\r
 import org.mxchange.addressbook.database.frontend.contact.ContactDatabaseFrontend;\r
 import org.mxchange.addressbook.database.frontend.contact.ContactWrapper;\r
@@ -34,7 +35,6 @@ import org.mxchange.addressbook.manager.BaseManager;
  *\r
  * @author Roland Haeder\r
  * @version 0.0\r
- * @since 0.0\r
  */\r
 public class ContactManager extends BaseManager implements ManageableContact {\r
 \r
@@ -354,6 +354,7 @@ public class ContactManager extends BaseManager implements ManageableContact {
 \r
     /**\r
      * Asks the user for own ZIP code\r
+     * \r
      * @return ZIP code\r
      */\r
     @Override\r
@@ -361,6 +362,15 @@ public class ContactManager extends BaseManager implements ManageableContact {
        return this.getClient().enterInt(0, 99_999, "Bitte geben Sie Ihre Postleitzahl ein: ");\r
     }\r
 \r
+    @Override\r
+    public int getColumnCount () {\r
+       /*\r
+        * Return constant, may look useful. But without this, e.g. the\r
+        * AddressTableModel have a hard-coded value.\r
+        */\r
+       return BaseContact.COLUMN_COUNT;\r
+    }\r
+\r
     /**\r
      * Getter for whole contact list\r
      *\r
index 5a824c328c9a9c747b349464b756fb8ca95a6368..736053d21f9850a6c7d879a6ddaa2b6bf2ced91d 100644 (file)
@@ -123,6 +123,13 @@ public interface ManageableContact extends Manageable {
      */\r
     public int enterOwnZipCode ();\r
 \r
+    /**\r
+     * Getter for column count\r
+     * \r
+     * @return Column count\r
+     */\r
+    public int getColumnCount ();\r
+\r
     /**\r
      * List all contacts\r
      */\r
index 0019773d2985bb1732bd7637127c4584408976af..d386b95131117352d126670c6ee80a8806e8d12d 100644 (file)
@@ -47,7 +47,7 @@ public class AddressTableModel extends BaseModel implements TableModel {
     @Override\r
     public int getColumnCount () {\r
        // Deligate this call to the contact manager\r
-       return this.getClient().getContactManager().size();\r
+       return this.getClient().getContactManager().getColumnCount();\r
     }\r
 \r
     @Override\r