aboutsummaryrefslogtreecommitdiffstats
path: root/src/net/java/sip/communicator/service/gui/UIGroup.java
blob: 9bdfa07f25fa8c051784a66355faaa17c1d08872 (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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
/*
 * 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.service.gui;

import java.awt.*;

/**
 * The <tt>UIGroup</tt> represents the user interface contact list group.
 *
 * @author Yana Stamcheva
 */
public abstract class UIGroup
{
    /**
     * The preferred height of this group in the contact list.
     */
    private int preferredGroupHeight = -1;

    /**
     * The display details of this group.
     */
    private String displayDetails = "";

    /**
     * Returns the descriptor of the group. This would be the underlying object
     * that should provide all other necessary information for the group.
     *
     * @return the descriptor of the group
     */
    public abstract Object getDescriptor();

    /**
     * The display name of the group. The display name is the name to be shown
     * in the contact list group row.
     *
     * @return the display name of the group
     */
    public abstract String getDisplayName();

    /**
     * Returns the display details of this contact. These would be shown
     * whenever the contact is selected. The display details aren't obligatory,
     * so we return an empty string.
     *
     * @return the display details of this contact
     */
    public String getDisplayDetails()
    {
        return displayDetails;
    }

    /**
     * Sets the display details of this group.
     *
     * @return the display details of this group
     */
    public void setDisplayDetails(String displayDetails)
    {
        this.displayDetails = displayDetails;
    }

    /**
     * Returns the index of this group in its source. In other words this is
     * the descriptor index.
     *
     * @return the index of this group in its source
     */
    public abstract int getSourceIndex();

    /**
     * Returns the parent group.
     *
     * @return the parent group
     */
    public abstract UIGroup getParentGroup();

    /**
     * Indicates if the group is collapsed or expanded.
     *
     * @return <tt>true</tt> to indicate that the group is collapsed,
     * <tt>false</tt> to indicate that it's expanded
     */
    public abstract boolean isGroupCollapsed();

    /**
     * Returns the count of online child contacts.
     *
     * @return the count of online child contacts
     */
    public abstract int countOnlineChildContacts();

    /**
     * Returns the child contacts count.
     *
     * @return child contacts count
     */
    public abstract int countChildContacts();

    /**
     * Returns the identifier of this group.
     *
     * @return the identifier of this group
     */
    public abstract String getId();

    /**
     * Returns the right button menu for this group.
     *
     * @return the right button menu component for this group
     */
    public abstract Component getRightButtonMenu();

    /**
     * Returns the preferred height of this group in the contact list.
     *
     * @return the preferred height of this group in the contact list
     */
    public int getPreferredHeight()
    {
        return preferredGroupHeight;
    }

    /**
     * Sets the preferred height of this group in the contact list.
     *
     * @param preferredHeight the preferred height of this group in the contact
     * list
     */
    public void setPreferredHeight(int preferredHeight)
    {
        this.preferredGroupHeight = preferredHeight;
    }
}