75
|
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 * Port to the D programming language:
|
|
11 * Frank Benoit <benoit@tionex.de>
|
|
12 *******************************************************************************/
|
|
13 module dwtx.ui.forms.events.HyperlinkEvent;
|
|
14 import dwt.events.TypedEvent;
|
|
15 import dwt.widgets.Widget;
|
|
16 import dwt.dwthelper.utils;
|
|
17 /**
|
|
18 * Notifies listeners about a hyperlink change.
|
|
19 *
|
|
20 * @since 3.0
|
|
21 */
|
|
22 public final class HyperlinkEvent : TypedEvent {
|
|
23 private static const long serialVersionUID = 6009335074727417445L;
|
|
24 private String label;
|
|
25 private int stateMask;
|
|
26 /**
|
|
27 * Creates a new hyperlink
|
|
28 *
|
|
29 * @param widget
|
|
30 * event source
|
|
31 * @param href
|
|
32 * the hyperlink reference that will be followed upon when the
|
|
33 * hyperlink is activated.
|
|
34 * @param label
|
|
35 * the name of the hyperlink (the text that is rendered as a
|
|
36 * link in the source widget).
|
|
37 * @param stateMask
|
|
38 * the given state mask
|
|
39 */
|
|
40 public this(Widget widget, Object href, String label, int stateMask) {
|
|
41 super(widget);
|
|
42 this.widget = widget;
|
|
43 this.data = href;
|
|
44 this.label = label;
|
|
45 this.stateMask = stateMask;
|
|
46 }
|
|
47 /**
|
|
48 * The hyperlink reference that will be followed when the hyperlink is
|
|
49 * activated.
|
|
50 *
|
|
51 * @return the hyperlink reference object
|
|
52 */
|
|
53 public Object getHref() {
|
|
54 return this.data;
|
|
55 }
|
|
56 /**
|
|
57 * The text of the hyperlink rendered in the source widget.
|
|
58 *
|
|
59 * @return the hyperlink label
|
|
60 */
|
|
61 public String getLabel() {
|
|
62 return label;
|
|
63 }
|
|
64 /**
|
|
65 * Returns the value of the keyboard state mask present when
|
|
66 * the event occured, or DWT.NULL for no modifiers.
|
|
67 * @return the keyboard state mask or <code>DWT.NULL</code>.
|
|
68 */
|
|
69 public int getStateMask() {
|
|
70 return stateMask;
|
|
71 }
|
|
72 }
|