From: Roland Haeder Date: Thu, 23 Jul 2015 06:19:55 +0000 (+0200) Subject: Fixed call + introduced getColumnCount() X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=8d35a116334371547bb805d3b1648866d8c7f667;p=addressbook-lib.git Fixed call + introduced getColumnCount() Signed-off-by:Roland Häder --- diff --git a/src/org/mxchange/addressbook/contact/BaseContact.java b/src/org/mxchange/addressbook/contact/BaseContact.java index 2a1ecb7..78d4f07 100644 --- a/src/org/mxchange/addressbook/contact/BaseContact.java +++ b/src/org/mxchange/addressbook/contact/BaseContact.java @@ -28,6 +28,11 @@ import org.mxchange.addressbook.client.Client; * @since 0.0 */ public class BaseContact extends BaseFrameworkSystem { + /** + * Amount of columns + */ + public static final int COLUMN_COUNT = 14; + /** * Birth day */ diff --git a/src/org/mxchange/addressbook/manager/contact/ContactManager.java b/src/org/mxchange/addressbook/manager/contact/ContactManager.java index 69a9a62..e89b708 100644 --- a/src/org/mxchange/addressbook/manager/contact/ContactManager.java +++ b/src/org/mxchange/addressbook/manager/contact/ContactManager.java @@ -23,6 +23,7 @@ import java.util.Iterator; import java.util.List; import org.mxchange.addressbook.UnhandledUserChoiceException; import org.mxchange.addressbook.client.Client; +import org.mxchange.addressbook.contact.BaseContact; import org.mxchange.addressbook.contact.Contact; import org.mxchange.addressbook.database.frontend.contact.ContactDatabaseFrontend; import org.mxchange.addressbook.database.frontend.contact.ContactWrapper; @@ -34,7 +35,6 @@ import org.mxchange.addressbook.manager.BaseManager; * * @author Roland Haeder * @version 0.0 - * @since 0.0 */ public class ContactManager extends BaseManager implements ManageableContact { @@ -354,6 +354,7 @@ public class ContactManager extends BaseManager implements ManageableContact { /** * Asks the user for own ZIP code + * * @return ZIP code */ @Override @@ -361,6 +362,15 @@ public class ContactManager extends BaseManager implements ManageableContact { return this.getClient().enterInt(0, 99_999, "Bitte geben Sie Ihre Postleitzahl ein: "); } + @Override + public int getColumnCount () { + /* + * Return constant, may look useful. But without this, e.g. the + * AddressTableModel have a hard-coded value. + */ + return BaseContact.COLUMN_COUNT; + } + /** * Getter for whole contact list * diff --git a/src/org/mxchange/addressbook/manager/contact/ManageableContact.java b/src/org/mxchange/addressbook/manager/contact/ManageableContact.java index 5a824c3..736053d 100644 --- a/src/org/mxchange/addressbook/manager/contact/ManageableContact.java +++ b/src/org/mxchange/addressbook/manager/contact/ManageableContact.java @@ -123,6 +123,13 @@ public interface ManageableContact extends Manageable { */ public int enterOwnZipCode (); + /** + * Getter for column count + * + * @return Column count + */ + public int getColumnCount (); + /** * List all contacts */ diff --git a/src/org/mxchange/addressbook/model/address/AddressTableModel.java b/src/org/mxchange/addressbook/model/address/AddressTableModel.java index 0019773..d386b95 100644 --- a/src/org/mxchange/addressbook/model/address/AddressTableModel.java +++ b/src/org/mxchange/addressbook/model/address/AddressTableModel.java @@ -47,7 +47,7 @@ public class AddressTableModel extends BaseModel implements TableModel { @Override public int getColumnCount () { // Deligate this call to the contact manager - return this.getClient().getContactManager().size(); + return this.getClient().getContactManager().getColumnCount(); } @Override