public class ContactItem
extends javax.swing.JPanel
ContactList
.javax.swing.JPanel.AccessibleJPanel
javax.swing.JComponent.AccessibleJComponent
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
Constructor and Description |
---|
ContactItem(java.lang.String alias,
java.lang.String nickname,
java.lang.String fullyQualifiedJID) |
ContactItem(java.lang.String alias,
java.lang.String nickname,
java.lang.String fullyQualifiedJID,
boolean initUi)
Creates a new instance of a contact.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getAlias()
Returns the alias of the contact.
|
java.net.URL |
getAvatarURL()
Returns the url of the avatar belonging to this contact.
|
javax.swing.JLabel |
getDescriptionLabel()
Returns the
JLabel representing the description. |
java.lang.String |
getDisplayName()
Returns the name that should be displayed to represent the the contact.
|
protected javax.swing.JLabel |
getDisplayNameLabel() |
protected java.lang.String |
getFullyQualifiedJID() |
java.lang.String |
getGroupName()
Returns the name of the
ContactGroup that this contact belongs to. |
javax.swing.Icon |
getIcon()
Returns the icon showing the contacts current state or presence.
|
java.lang.String |
getJID()
Returns the fully qualified JID of the contact.
|
java.lang.String |
getNickname()
Returns the nickname of the contact.
|
javax.swing.JLabel |
getNicknameLabel()
Returns the
JLabel showing the users nickname. |
org.jivesoftware.smack.packet.Presence |
getPresence()
Returns the current presence of the contact.
|
javax.swing.JLabel |
getSideIcon() |
javax.swing.JLabel |
getSpecialImageLabel() |
java.lang.String |
getStatus()
Returns the contacts current status based on their presence.
|
boolean |
isAvailable() |
void |
setAlias(java.lang.String alias)
Sets the alias of the contact.
|
void |
setAvailable(boolean available) |
protected void |
setDescriptionLabel(javax.swing.JLabel descriptionLabel) |
protected void |
setDisplayName()
Updates the displayed name for the contact.
|
protected void |
setDisplayNameLabel(javax.swing.JLabel displayNameLabel) |
void |
setGroupName(java.lang.String groupName)
Sets the name of the
ContactGrouop that this contact belongs to. |
void |
setIcon(javax.swing.Icon icon)
Sets the current icon to use.
|
void |
setNickname(java.lang.String nickname)
Sets the nickname of the contact.
|
void |
setPresence(org.jivesoftware.smack.packet.Presence presence)
Sets the current presence on this contact item.
|
void |
setSideIcon(javax.swing.Icon icon)
The icon should only be used to display avatars in contact list.
|
void |
setSpecialIcon(javax.swing.Icon icon)
The icon to use to show extra information about this contact.
|
protected void |
setSpecialImageLabel(javax.swing.JLabel specialImageLabel) |
void |
setStatus(java.lang.String status)
Sets the contacts current status.
|
void |
setStatusText(java.lang.String status)
Sets the status label text based on the users status.
|
void |
showUserComingOnline()
Shows that the user is coming online.
|
void |
showUserGoingOfflineOnline()
Shows that the user is going offline.
|
java.lang.String |
toString() |
void |
updateAvatarInSideIcon()
Update avatar icon.
|
void |
updatePresenceIcon(org.jivesoftware.smack.packet.Presence presence)
Updates the icon of the user based on their presence.
|
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, getPreferredSize, 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
public ContactItem(java.lang.String alias, java.lang.String nickname, java.lang.String fullyQualifiedJID)
public ContactItem(java.lang.String alias, java.lang.String nickname, java.lang.String fullyQualifiedJID, boolean initUi)
alias
- the alias of the contactnickname
- the nickname of the contact.fullyQualifiedJID
- the fully-qualified jid of the contact (ex. derek@jivesoftware.com)public java.lang.String getDisplayName()
public java.lang.String getNickname()
getDisplayName()
instead.public void setNickname(java.lang.String nickname)
nickname
- the contact nickname.public java.lang.String getAlias()
getDisplayName()
instead.public void setAlias(java.lang.String alias)
alias
- the contact alias.protected void setDisplayName()
public java.lang.String getJID()
public javax.swing.Icon getIcon()
public void setIcon(javax.swing.Icon icon)
icon
- the current icon to use.public java.lang.String getStatus()
public void setStatus(java.lang.String status)
status
- the contacts current status.public java.lang.String getGroupName()
ContactGroup
that this contact belongs to.ContactGroup
.public void setGroupName(java.lang.String groupName)
ContactGrouop
that this contact belongs to.groupName
- the name of the ContactGroup.public boolean isAvailable()
public void setAvailable(boolean available)
public javax.swing.JLabel getNicknameLabel()
JLabel
showing the users nickname.public javax.swing.JLabel getDescriptionLabel()
JLabel
representing the description.public org.jivesoftware.smack.packet.Presence getPresence()
public void setPresence(org.jivesoftware.smack.packet.Presence presence)
presence
- the presence.public java.net.URL getAvatarURL() throws java.net.MalformedURLException
java.net.MalformedURLException
- thrown if the address is invalid.public java.lang.String toString()
toString
in class java.awt.Component
public void updatePresenceIcon(org.jivesoftware.smack.packet.Presence presence)
presence
- the users presence.public void setStatusText(java.lang.String status)
status
- the users status.public void setSideIcon(javax.swing.Icon icon)
icon
- the icon to use.public void setSpecialIcon(javax.swing.Icon icon)
icon
- the icon to use.public void showUserComingOnline()
public void showUserGoingOfflineOnline()
public void updateAvatarInSideIcon()
protected javax.swing.JLabel getDisplayNameLabel()
protected java.lang.String getFullyQualifiedJID()
protected void setDisplayNameLabel(javax.swing.JLabel displayNameLabel)
protected void setDescriptionLabel(javax.swing.JLabel descriptionLabel)
public javax.swing.JLabel getSpecialImageLabel()
protected void setSpecialImageLabel(javax.swing.JLabel specialImageLabel)
public javax.swing.JLabel getSideIcon()