aboutsummaryrefslogtreecommitdiffstats
path: root/src/net/java/sip/communicator/plugin/desktoputil/UIContactDetailImpl.java
blob: 1b870f98cb3197161bb2934831d49e8a2addb8e1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
/*
 * Jitsi, the OpenSource Java VoIP and Instant Messaging client.
 *
 * Distributable under LGPL license.
 * See terms of license at gnu.org.
 */
package net.java.sip.communicator.plugin.desktoputil;

import java.util.*;

import javax.swing.*;

import net.java.sip.communicator.service.gui.*;
import net.java.sip.communicator.service.protocol.*;

/**
 * The <tt>UIContactDetail</tt> implementation
 *
 * @author Yana Stamcheva
 */
public class UIContactDetailImpl
    extends UIContactDetail
{
    /**
     * The status icon of this contact detail.
     */
    private ImageIcon statusIcon;

    /**
     * Creates a <tt>UIContactDetailImpl</tt> by specifying the contact
     * <tt>address</tt>, the <tt>displayName</tt> and <tt>preferredProvider</tt>.
     *
     * @param address the contact address
     * @param displayName the contact display name
     * @param statusIcon the status icon of this contact detail
     * @param descriptor the underlying object that this class is wrapping
     */
    public UIContactDetailImpl(
        String address,
        String displayName,
        ImageIcon statusIcon,
        Object descriptor)
    {
        super(  address,
                displayName,
                null,
                null,
                null,
                null,
                descriptor);

        setStatusIcon(statusIcon);
    }

    /**
     * Creates a <tt>UIContactDetailImpl</tt> by specifying the contact
     * <tt>address</tt>, the <tt>displayName</tt> and <tt>preferredProvider</tt>.
     * @param address the contact address
     * @param displayName the contact display name
     * @param category the category of the underlying contact detail
     * @param labels the collection of labels associated with this detail
     * @param statusIcon the status icon of this contact detail
     * @param preferredProviders the preferred protocol providers
     * @param preferredProtocols the preferred protocols if no protocol provider
     * is set
     * @param descriptor the underlying object that this class is wrapping
     */
    public UIContactDetailImpl(
        String address,
        String displayName,
        String category,
        Collection<String> labels,
        ImageIcon statusIcon,
        Map<Class<? extends OperationSet>, ProtocolProviderService>
                                                        preferredProviders,
        Map<Class<? extends OperationSet>, String> preferredProtocols,
        Object descriptor)
    {
        super(address, displayName, category, labels, preferredProviders,
            preferredProtocols, descriptor);

        setStatusIcon(statusIcon);
    }

    /**
     * Sets the given status icon.
     *
     * @param statusIcon the status icon to set
     */
    public void setStatusIcon(ImageIcon statusIcon)
    {
        this.statusIcon = statusIcon;
    }

    /**
     * Returns the status icon of this contact detail.
     *
     * @return the status icon of this contact detail
     */
    public ImageIcon getStatusIcon()
    {
        return statusIcon;
    }

    @Override
    public PresenceStatus getPresenceStatus()
    {
        return null;
    }
}