corny.addressbook.gui.PeoplePicker.PeoplePickerPanel
Class PeoplePickerPanel

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JPanel
                  extended by corny.addressbook.gui.PeoplePicker.PeoplePickerPanel.PeoplePickerPanel
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible

public class PeoplePickerPanel
extends javax.swing.JPanel

Panel which lets you select one or multiple Contacts from the Address Book. Contains a GroupTable, a ContactTable and a tool bar. From the tool bar you can search the contacts, open a ContactDisplayOverlay, go to the "Me" Contact and reveal the current Contact in Apple's Address Book interface.

Author:
Corny
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Component
java.awt.Component.BaselineResizeBehavior
 
Field Summary
static int SHOW_BIRTHDAY_COLUMN
          Column which displays the birthday
static int SHOW_FIRST_ADDRESS_COLUMN
          Column which displays the first address
static int SHOW_FIRST_EMAIL_COLUMN
          Column which displays the first email address
static int SHOW_FIRST_PHONE_COLUMN
          Column which displays the first phone number
static int SHOW_HOME_ADDRESS_COLUMN
          Column which displays the first home address
static int SHOW_HOME_EMAIL_COLUMN
          Column which displays the first home email address
static int SHOW_HOME_PHONE_COLUMN
          Column which displays the first home phone number
static int SHOW_MOBILE_PHONE_COLUMN
          Column which displays the first mobile phone number
static int SHOW_ONLY_NAME_COLUMN
          Indicates that the GroupTable should only display the name column.
static int SHOW_WORK_ADDRESS_COLUMN
          Column which displays the first work address
static int SHOW_WORK_EMAIL_COLUMN
          Column which displays the first work address
static int SHOW_WORK_PHONE_COLUMN
          Column which displays the first work phone number
 
Fields inherited from class javax.swing.JComponent
TOOL_TIP_TEXT_KEY, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
PeoplePickerPanel(Filter filter, int columns, int listSelectionModel)
          Creates a new PeoplePickerPanel.
PeoplePickerPanel(int columns)
          Creates a new PeoplePickerPanel without Filter and with multiple interval selection mode.
PeoplePickerPanel(int columns, int listSelectionModel)
          Creates a new PeoplePickerPanel without Filter.
 
Method Summary
 void addContactListSelectionListener(javax.swing.event.ListSelectionListener l)
          Adds a ListSelectionListener to receive notifications when the Contact selection changes.
 ContactDisplayOverlay getContactDisplay()
          Returns the ContactDisplayOverlay
 ContactTable getContactTable()
          Returns the ContactTable
 GroupTable getGroupTable()
          Returns the GroupTable
 PeoplePickerPanelHandler getHandler()
           
 javax.swing.JTextField getSearchField()
          Returns the search field
 javax.swing.JSplitPane getSplitPane()
          Returns the SplitPane
 void setVisible(boolean aFlag)
           
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, setUI, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintImmediately, paintImmediately, print, printAll, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setVerifyInputWhenFocusTarget, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusBackward, transferFocusDownCycle, validate
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, contains, createImage, createImage, createVolatileImage, createVolatileImage, dispatchEvent, enable, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

SHOW_ONLY_NAME_COLUMN

public static final int SHOW_ONLY_NAME_COLUMN
Indicates that the GroupTable should only display the name column.

See Also:
Constant Field Values

SHOW_FIRST_PHONE_COLUMN

public static final int SHOW_FIRST_PHONE_COLUMN
Column which displays the first phone number

See Also:
Constant Field Values

SHOW_HOME_PHONE_COLUMN

public static final int SHOW_HOME_PHONE_COLUMN
Column which displays the first home phone number

See Also:
Constant Field Values

SHOW_WORK_PHONE_COLUMN

public static final int SHOW_WORK_PHONE_COLUMN
Column which displays the first work phone number

See Also:
Constant Field Values

SHOW_MOBILE_PHONE_COLUMN

public static final int SHOW_MOBILE_PHONE_COLUMN
Column which displays the first mobile phone number

See Also:
Constant Field Values

SHOW_FIRST_EMAIL_COLUMN

public static final int SHOW_FIRST_EMAIL_COLUMN
Column which displays the first email address

See Also:
Constant Field Values

SHOW_HOME_EMAIL_COLUMN

public static final int SHOW_HOME_EMAIL_COLUMN
Column which displays the first home email address

See Also:
Constant Field Values

SHOW_WORK_EMAIL_COLUMN

public static final int SHOW_WORK_EMAIL_COLUMN
Column which displays the first work address

See Also:
Constant Field Values

SHOW_BIRTHDAY_COLUMN

public static final int SHOW_BIRTHDAY_COLUMN
Column which displays the birthday

See Also:
Constant Field Values

SHOW_FIRST_ADDRESS_COLUMN

public static final int SHOW_FIRST_ADDRESS_COLUMN
Column which displays the first address

See Also:
Constant Field Values

SHOW_HOME_ADDRESS_COLUMN

public static final int SHOW_HOME_ADDRESS_COLUMN
Column which displays the first home address

See Also:
Constant Field Values

SHOW_WORK_ADDRESS_COLUMN

public static final int SHOW_WORK_ADDRESS_COLUMN
Column which displays the first work address

See Also:
Constant Field Values
Constructor Detail

PeoplePickerPanel

public PeoplePickerPanel(Filter filter,
                         int columns,
                         int listSelectionModel)
Creates a new PeoplePickerPanel. Columns can be one or more of the following: To show multiple columns, combine them by |, like SHOW_FIRST_PHONE_COLUMN | SHOW_FIRST_EMAIL_COLUMN. To display more columns, see ContactTableHandler.addColumn(ContactProperty, String).

Parameters:
filter - Filter to display only certain Contacts or null to display all Contacts
columns - Columns to display
listSelectionModel - List selection model. See ListModel for details.

PeoplePickerPanel

public PeoplePickerPanel(int columns,
                         int listSelectionModel)
Creates a new PeoplePickerPanel without Filter. All Contacts will be shown. Columns can be one or more of the following: To show multiple columns, combine them by |, like SHOW_FIRST_PHONE_COLUMN | SHOW_FIRST_EMAIL_COLUMN. To display more columns, see ContactTableHandler.addColumn(ContactProperty, String).

Parameters:
columns - Columns to display
listSelectionModel - List selection model. See ListModel for details.

PeoplePickerPanel

public PeoplePickerPanel(int columns)
Creates a new PeoplePickerPanel without Filter and with multiple interval selection mode. All Contacts will be shown. Columns can be one or more of the following: To show multiple columns, combine them by |, like SHOW_FIRST_PHONE_COLUMN | SHOW_FIRST_EMAIL_COLUMN. To display more columns, see ContactTableHandler.addColumn(ContactProperty, String).

Parameters:
columns - Columns to display
Method Detail

getGroupTable

public GroupTable getGroupTable()
Returns the GroupTable

Returns:
The GroupTable

getContactTable

public ContactTable getContactTable()
Returns the ContactTable

Returns:
The ContactTable

getSplitPane

public javax.swing.JSplitPane getSplitPane()
Returns the SplitPane

Returns:
The SplitPane

getContactDisplay

public ContactDisplayOverlay getContactDisplay()
Returns the ContactDisplayOverlay

Returns:
The ContactDisplayOverlay

getSearchField

public javax.swing.JTextField getSearchField()
Returns the search field

Returns:
The search field

addContactListSelectionListener

public void addContactListSelectionListener(javax.swing.event.ListSelectionListener l)
Adds a ListSelectionListener to receive notifications when the Contact selection changes.

Parameters:
l - ListSelectionListener to add

getHandler

public PeoplePickerPanelHandler getHandler()
Returns:
Handler to perform actions on the PeoplePickerPanel.

setVisible

public void setVisible(boolean aFlag)
Overrides:
setVisible in class javax.swing.JComponent