corny.addressbook.gui.ContactTable
Class ContactTableHandler

java.lang.Object
  extended by corny.addressbook.gui.ContactTable.ContactTableHandler

public class ContactTableHandler
extends java.lang.Object

Handler class for ContactTable.

Author:
Corny

Method Summary
 boolean addColumn(ContactProperty prop, java.lang.String label)
          Adds a new column with the given content.
 boolean addColumn(int columnContent)
          Adds a column with the given content.
 void fetchContacts(Group group, Filter filter, boolean preserveSelection)
          Replaces the content of the Table with the Contacts of the given Group.
 Contact[] getSelectedContacts()
           
 boolean isLastNameFirst()
           
 boolean removeColumn(ContactProperty prop, java.lang.String label)
          Removes the column with the given content.
 boolean removeColumn(int columnContent)
          Removes the column with the given content.
 void removeSelectedContacts()
          Removes the currently selected Contacts from the Address Book.
 void selectContact(Contact c)
          Selects a given Contact.
 void setEditingEnabled(boolean editing)
          Specifies whether the Table can be edited or not.
 void setLastNameFirst(boolean lastNameFirst)
          Specifies whether the name column of the ContactTable should display the last name first or not.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

isLastNameFirst

public boolean isLastNameFirst()
Returns:
true, if the lastNameFirst property is set to true, false otherwise
See Also:
setLastNameFirst(boolean)

setLastNameFirst

public void setLastNameFirst(boolean lastNameFirst)
Specifies whether the name column of the ContactTable should display the last name first or not. If the table is sorted by this column, the sort order modifies according to this property.

Parameters:
lastNameFirst - true to display the last name first, false to display the first name first

selectContact

public void selectContact(Contact c)
Selects a given Contact. If the Contact is not contained in the table, the selection won't change.

Parameters:
c - Contact to select

fetchContacts

public void fetchContacts(Group group,
                          Filter filter,
                          boolean preserveSelection)
Replaces the content of the Table with the Contacts of the given Group.

Parameters:
group - Group to fetch Contacts from
filter - Filter to apply on the Contacts or null to not filter the Contacts
preserveSelection - true to restore the Contact selection after replacing the content of the table.

removeColumn

public boolean removeColumn(int columnContent)
Removes the column with the given content. Does nothing if no column with this content exists.

Parameters:
columnContent - Can be one or more of the following:
Returns:
false, if the column still exists, false otherwise

removeColumn

public boolean removeColumn(ContactProperty prop,
                            java.lang.String label)
Removes the column with the given content. Does nothing if no column with this content exists.

Parameters:
prop - Displayed content
label - Specific label for multi value properties
Returns:
false, if the column still exists, false otherwise

addColumn

public boolean addColumn(int columnContent)
Adds a column with the given content. Does nothing if a column with this content already exists.

Parameters:
columnContent - Can be one or more of the following:
Returns:
true if the column now exists, false otherwise

addColumn

public boolean addColumn(ContactProperty prop,
                         java.lang.String label)
Adds a new column with the given content.

Parameters:
prop - ContactProperty to display
label - Specific label for multi value properties or null to display the first available value.
Returns:
true if the column now exists, false otherwise

getSelectedContacts

public Contact[] getSelectedContacts()
Returns:
All selected Groups

removeSelectedContacts

public void removeSelectedContacts()
Removes the currently selected Contacts from the Address Book.


setEditingEnabled

public void setEditingEnabled(boolean editing)
Specifies whether the Table can be edited or not.

Parameters:
editing - true to enable editing, false to disable editing