01: /*******************************************************************************
02: * Copyright (c) 2000, 2006 IBM Corporation and others.
03: * All rights reserved. This program and the accompanying materials
04: * are made available under the terms of the Eclipse Public License v1.0
05: * which accompanies this distribution, and is available at
06: * http://www.eclipse.org/legal/epl-v10.html
07: *
08: * Contributors:
09: * IBM Corporation - initial API and implementation
10: *******************************************************************************/package org.eclipse.jface.viewers;
11:
12: import java.util.EventObject;
13:
14: import org.eclipse.core.runtime.Assert;
15:
16: /**
17: * Event object describing a double-click. The source of these
18: * events is a viewer.
19: *
20: * @see IDoubleClickListener
21: */
22: public class DoubleClickEvent extends EventObject {
23:
24: /**
25: * Generated serial version UID for this class.
26: * @since 3.1
27: */
28: private static final long serialVersionUID = 3258408443605038133L;
29:
30: /**
31: * The selection.
32: */
33: protected ISelection selection;
34:
35: /**
36: * Creates a new event for the given source and selection.
37: *
38: * @param source the viewer
39: * @param selection the selection
40: */
41: public DoubleClickEvent(Viewer source, ISelection selection) {
42: super (source);
43: Assert.isNotNull(selection);
44: this .selection = selection;
45: }
46:
47: /**
48: * Returns the selection.
49: *
50: * @return the selection
51: */
52: public ISelection getSelection() {
53: return selection;
54: }
55:
56: /**
57: * Returns the viewer that is the source of this event.
58: *
59: * @return the originating viewer
60: */
61: public Viewer getViewer() {
62: return (Viewer) getSource();
63: }
64: }
|