public class ContactGroup extends CollapsiblePane implements java.awt.event.MouseListener
javax.swing.JPanel.AccessibleJPanel
javax.swing.JComponent.AccessibleJComponent
Modifier and Type | Field and Description |
---|---|
protected java.util.Comparator<ContactItem> |
itemComparator
Sorts ContactItems.
|
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
Constructor and Description |
---|
ContactGroup(java.lang.String groupName)
Create a new ContactGroup.
|
Modifier and Type | Method and Description |
---|---|
void |
addContactGroup(ContactGroup contactGroup)
Adds a sub group to this Contact group.
|
void |
addContactGroupListener(ContactGroupListener listener)
Add a
ContactGroupListener . |
void |
addContactItem(ContactItem item)
Adds a
ContactItem to the ContactGroup. |
void |
addOfflineContactItem(java.lang.String alias,
java.lang.String nickname,
java.lang.String jid,
java.lang.String status)
Adds a new offline contact.
|
void |
clearSelection()
Clears all selections within this group.
|
void |
fireContactGroupUpdated()
Call whenever the UI needs to be updated.
|
ContactGroup |
getContactGroup(java.lang.String groupName)
Returns a ContactGroup based on it's name.
|
java.util.Collection<ContactGroup> |
getContactGroups() |
ContactItem |
getContactItemByDisplayName(java.lang.String displayName)
Returns a
ContactItem by the displayed name the user has been assigned. |
ContactItem |
getContactItemByDisplayName(java.lang.String displayName,
boolean searchInOffline)
Returns a
ContactItem by the displayed name the user has been assigned. |
ContactItem |
getContactItemByJID(java.lang.String bareJID)
Returns a
ContactItem by the users bare bareJID. |
ContactItem |
getContactItemByJID(java.lang.String bareJID,
boolean searchInOffline)
Returns a
ContactItem by the users bare bareJID. |
protected javax.swing.JList |
getContactItemList() |
java.util.List<ContactItem> |
getContactItems()
Returns all
ContactItems in the ContactGroup. |
javax.swing.JPanel |
getContainerPanel() |
java.lang.String |
getGroupName()
Returns the name of the ContactGroup.
|
java.lang.String |
getGroupTitle(java.lang.String title)
Returns the "pretty" title of the ContactGroup.
|
javax.swing.JList |
getList()
Returns the containing
JList of the ContactGroup. |
javax.swing.JPanel |
getListPanel()
Returns the underlying container for the JList.
|
protected javax.swing.DefaultListModel |
getModel() |
ContactItem |
getOfflineContactItemByDisplayName(java.lang.String displayName)
Returns a
ContactItem from offlineContacts by the displayed name the user has been assigned. |
ContactItem |
getOfflineContactItemByJID(java.lang.String bareJID)
Returns a
ContactItem from offlineContacts by the users bare bareJID. |
java.util.Collection<ContactItem> |
getOfflineContacts() |
java.awt.Dimension |
getPreferredSize()
Lets make sure that the panel doesn't stretch past the
scrollpane view pane.
|
java.util.List<ContactItem> |
getSelectedContacts()
Returns all Selected Contacts within the ContactGroup.
|
boolean |
hasAvailableContacts()
Returns true if the ContactGroup contains available users.
|
void |
insertOfflineContactItem(ContactItem offlineItem)
Inserts a new offline
ContactItem into the ui model. |
boolean |
isOfflineGroup()
Returns true if this ContactGroup is the Offline Group.
|
boolean |
isSharedGroup()
Returns true if ContactGroup is a Shared Group.
|
boolean |
isSubGroup()
Returns true if this group is nested.
|
boolean |
isSubGroup(java.lang.String groupName)
Returns true if the group is nested.
|
boolean |
isUnfiledGroup()
Returns true if this ContactGroup is the Unfiled Group.
|
void |
mouseClicked(java.awt.event.MouseEvent e) |
void |
mouseEntered(java.awt.event.MouseEvent e) |
void |
mouseExited(java.awt.event.MouseEvent e) |
void |
mousePressed(java.awt.event.MouseEvent e) |
void |
mouseReleased(java.awt.event.MouseEvent e) |
void |
removeAllContacts() |
void |
removeContactGroup(ContactGroup contactGroup)
Removes a child ContactGroup.
|
void |
removeContactGroupListener(ContactGroupListener listener)
Removes a
ContactGroupListener . |
void |
removeContactItem(ContactItem item)
Removes a
ContactItem . |
void |
removeOfflineContactItem(ContactItem item)
Removes an offline
ContactItem from the Offline contact
model and ui. |
void |
removeOfflineContactItem(java.lang.String jid)
Removes an offline
ContactItem from the offline contact model and ui. |
void |
setGroupName(java.lang.String groupName)
Sets the name of group.
|
protected void |
setOfflineGroupNameFont(ContactItem item) |
void |
setPanelBackground(java.awt.Color color) |
protected void |
setSharedGroup(boolean sharedGroup)
Set to true if this ContactGroup is a shared Group.
|
void |
toggleOfflineVisibility(boolean show)
Toggles the visibility of Offline Contacts.
|
java.lang.String |
toString() |
addCollapsiblePaneListener, getTitlePane, isCollapsed, isSubPane, removeCollapsiblePaneListener, setCollapsed, setContentPane, setIcon, setSubPane, setTitle, setTitlePane
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, 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, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
add, add, add, add, add, addContainerListener, addImpl, 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, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTree
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, 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, 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, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, 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, transferFocus, transferFocusBackward, transferFocusUpCycle
protected final java.util.Comparator<ContactItem> itemComparator
public ContactGroup(java.lang.String groupName)
groupName
- the name of the new ContactGroup.public void addOfflineContactItem(java.lang.String alias, java.lang.String nickname, java.lang.String jid, java.lang.String status)
alias
- the alias of the offline contact.nickname
- the nickname of the offline contact.jid
- the jid of the offline contact.status
- the current status of the offline contact.public void insertOfflineContactItem(ContactItem offlineItem)
ContactItem
into the ui model.offlineItem
- the ContactItem to add.public void removeOfflineContactItem(ContactItem item)
ContactItem
from the Offline contact
model and ui.item
- the offline contact item to remove.public void removeOfflineContactItem(java.lang.String jid)
ContactItem
from the offline contact model and ui.jid
- the offline contact item to remove.public void toggleOfflineVisibility(boolean show)
show
- true if offline contacts should be shown, otherwise false.public void addContactItem(ContactItem item)
ContactItem
to the ContactGroup.item
- the ContactItem.protected void setOfflineGroupNameFont(ContactItem item)
public void fireContactGroupUpdated()
public void addContactGroup(ContactGroup contactGroup)
contactGroup
- that should be the new subgrouppublic void removeContactGroup(ContactGroup contactGroup)
contactGroup
- the contact group to remove.public void setPanelBackground(java.awt.Color color)
public ContactGroup getContactGroup(java.lang.String groupName)
groupName
- the name of the group.public void removeContactItem(ContactItem item)
ContactItem
.item
- the ContactItem to remove.public ContactItem getContactItemByDisplayName(java.lang.String displayName)
ContactItem
by the displayed name the user has been assigned.displayName
- the displayed name of the user.public ContactItem getOfflineContactItemByDisplayName(java.lang.String displayName)
ContactItem
from offlineContacts by the displayed name the user has been assigned.displayName
- the displayed name of the user.public ContactItem getContactItemByDisplayName(java.lang.String displayName, boolean searchInOffline)
ContactItem
by the displayed name the user has been assigned.displayName
- the displayed name of the user.searchInOffline
- should we search ContactItem
in offline contactspublic ContactItem getContactItemByJID(java.lang.String bareJID)
ContactItem
by the users bare bareJID.bareJID
- the bareJID of the user.public ContactItem getOfflineContactItemByJID(java.lang.String bareJID)
ContactItem
from offlineContacts by the users bare bareJID.bareJID
- the bareJID of the user.public ContactItem getContactItemByJID(java.lang.String bareJID, boolean searchInOffline)
ContactItem
by the users bare bareJID.bareJID
- the bareJID of the user.searchInOffline
- should we search ContactItem
in offline contactspublic java.util.List<ContactItem> getContactItems()
ContactItems in the ContactGroup.
public java.lang.String getGroupName()
public void mouseClicked(java.awt.event.MouseEvent e)
mouseClicked
in interface java.awt.event.MouseListener
public void mouseEntered(java.awt.event.MouseEvent e)
mouseEntered
in interface java.awt.event.MouseListener
public void mouseExited(java.awt.event.MouseEvent e)
mouseExited
in interface java.awt.event.MouseListener
public void mousePressed(java.awt.event.MouseEvent e)
mousePressed
in interface java.awt.event.MouseListener
public void mouseReleased(java.awt.event.MouseEvent e)
mouseReleased
in interface java.awt.event.MouseListener
public void addContactGroupListener(ContactGroupListener listener)
ContactGroupListener
.listener
- the ContactGroupListener.public void removeContactGroupListener(ContactGroupListener listener)
ContactGroupListener
.listener
- the ContactGroupListener.public javax.swing.JList getList()
JList
of the ContactGroup.public void clearSelection()
public void removeAllContacts()
public boolean hasAvailableContacts()
public java.util.Collection<ContactItem> getOfflineContacts()
public boolean isOfflineGroup()
public boolean isUnfiledGroup()
public java.lang.String toString()
toString
in class java.awt.Component
public boolean isSharedGroup()
protected void setSharedGroup(boolean sharedGroup)
sharedGroup
- true if shared group.public java.util.List<ContactItem> getSelectedContacts()
public javax.swing.JPanel getContainerPanel()
public java.util.Collection<ContactGroup> getContactGroups()
public java.awt.Dimension getPreferredSize()
getPreferredSize
in class javax.swing.JComponent
public void setGroupName(java.lang.String groupName)
groupName
- the contact group name.public java.lang.String getGroupTitle(java.lang.String title)
title
- the title.public boolean isSubGroup(java.lang.String groupName)
groupName
- the name of the group.public boolean isSubGroup()
public javax.swing.JPanel getListPanel()
protected javax.swing.DefaultListModel getModel()
protected javax.swing.JList getContactItemList()