2
* @(#)HelpSetEvent.java 1.13 06/10/30
4
* Copyright (c) 2006 Sun Microsystems, Inc. All Rights Reserved.
5
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
7
* This code is free software; you can redistribute it and/or modify it
8
* under the terms of the GNU General Public License version 2 only, as
9
* published by the Free Software Foundation. Sun designates this
10
* particular file as subject to the "Classpath" exception as provided
11
* by Sun in the LICENSE file that accompanied this code.
13
* This code is distributed in the hope that it will be useful, but WITHOUT
14
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
15
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
16
* version 2 for more details (a copy is included in the LICENSE file that
17
* accompanied this code).
19
* You should have received a copy of the GNU General Public License version
20
* 2 along with this work; if not, write to the Free Software Foundation,
21
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
23
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
24
* CA 95054 USA or visit www.sun.com if you need additional information or
28
package javax.help.event;
30
import javax.help.HelpSet;
33
* Conveys information when a HelpSet is added/removed.
35
* @author Eduardo Pelegri-Llopart
36
* @version 1.10 03/10/99
39
public class HelpSetEvent extends java.util.EventObject {
42
* Creates a HelpSetEvent.
44
* @param source Source of this Event.
45
* @param helpset The HelpSet being added/removed.
46
* @param action HELPSET_ADDED or HELPSET_REMOVED.
47
* @throws IllegalArgumentException if source is null or if action is not
50
public HelpSetEvent(Object source, HelpSet helpset, int action) {
52
this.helpset = helpset;
53
if (helpset == null) {
54
throw new NullPointerException("helpset");
57
if (action < 0 || action > 1) {
58
throw new IllegalArgumentException("invalid action");
65
public static final int HELPSET_ADDED = 0;
68
* A HelpSet was removed
70
public static final int HELPSET_REMOVED = 1;
73
* @return The HelpSet.
75
public HelpSet getHelpSet() {
82
public int getAction() {
87
* Returns textual about the instance.
89
public String toString() {
90
if (action==HELPSET_ADDED) {
91
return "HelpSetEvent("+source+", "+helpset+"; added";
93
return "HelpSetEvent("+source+", "+helpset+"; removed";
97
private HelpSet helpset;