aboutsummaryrefslogtreecommitdiffstats
path: root/src/net/java/sip/communicator/service/gui/event/ContainerEvent.java
blob: e0ccea97fcfdb14d853649e29447ef2c4377d68a (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
/*
 * 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.event;

import java.util.*;

/**
 * The <tt>ContainerEvent</tt> indicates that a change in a <tt>container</tt>
 * such a <tt>Comonent</tt> added or removed.
 */
public class ContainerEvent
    extends EventObject
{
    /**
     * Serial version UID.
     */
    private static final long serialVersionUID = 0L;

    /**
     * ID of the event.
     */
    private int eventID = -1;

    /**
     * Indicates that the ContainerEvent instance was triggered by
     * adding a new container to the list of supported containers.
     */
    public static final int CONTAINER_ADDED = 1;

    /**
     * Indicates that the ContainerEvent instance was triggered by the
     * removal of an existing container from the list of supported containers.
     */
    public static final int CONTAINER_REMOVED = 2;

    /**
     * Creates a new ContainerEvent according to the specified parameters.
     * @param source The containerID of the container that is added to supported
     * containers.
     * @param eventID one of the CONTAINER_XXX static fields indicating the
     * nature of the event.
     */
    public ContainerEvent(Object source, int eventID)
    {
        super(source);
        this.eventID = eventID;
    }

    /**
     * Returns an event id specifying whether the type of this event
     * (CONTAINER_ADDED or CONTAINER_REMOVED)
     * @return one of the CONTAINER_XXX int fields of this class.
     */
    public int getEventID()
    {
        return eventID;
    }
}