KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > ui > forms > events > HyperlinkEvent


1 /*******************************************************************************
2  * Copyright (c) 2000, 2005 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.ui.forms.events;
12 import org.eclipse.swt.events.TypedEvent;
13 import org.eclipse.swt.widgets.Widget;
14 /**
15  * Notifies listeners about a hyperlink change.
16  *
17  * @since 3.0
18  */

19 public final class HyperlinkEvent extends TypedEvent {
20     private static final long serialVersionUID = 6009335074727417445L;
21     private String JavaDoc label;
22     private int stateMask;
23     /**
24      * Creates a new hyperlink
25      *
26      * @param widget
27      * event source
28      * @param href
29      * the hyperlink reference that will be followed upon when the
30      * hyperlink is activated.
31      * @param label
32      * the name of the hyperlink (the text that is rendered as a
33      * link in the source widget).
34      * @param stateMask
35      * the given state mask
36      */

37     public HyperlinkEvent(Widget widget, Object JavaDoc href, String JavaDoc label, int stateMask) {
38         super(widget);
39         this.widget = widget;
40         this.data = href;
41         this.label = label;
42         this.stateMask = stateMask;
43     }
44     /**
45      * The hyperlink reference that will be followed when the hyperlink is
46      * activated.
47      *
48      * @return the hyperlink reference object
49      */

50     public Object JavaDoc getHref() {
51         return this.data;
52     }
53     /**
54      * The text of the hyperlink rendered in the source widget.
55      *
56      * @return the hyperlink label
57      */

58     public String JavaDoc getLabel() {
59         return label;
60     }
61     /**
62      * Returns the value of the keyboard state mask present when
63      * the event occured, or SWT.NULL for no modifiers.
64      * @return the keyboard state mask or <code>SWT.NULL</code>.
65      */

66     public int getStateMask() {
67         return stateMask;
68     }
69 }
70
Popular Tags