KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > jface > viewers > DoubleClickEvent


1 /*******************************************************************************
2  * Copyright (c) 2000, 2006 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.jface.viewers;
12
13 import java.util.EventObject JavaDoc;
14
15 import org.eclipse.core.runtime.Assert;
16
17 /**
18  * Event object describing a double-click. The source of these
19  * events is a viewer.
20  *
21  * @see IDoubleClickListener
22  */

23 public class DoubleClickEvent extends EventObject JavaDoc {
24
25     /**
26      * Generated serial version UID for this class.
27      * @since 3.1
28      */

29     private static final long serialVersionUID = 3258408443605038133L;
30     
31     /**
32      * The selection.
33      */

34     protected ISelection selection;
35
36     /**
37      * Creates a new event for the given source and selection.
38      *
39      * @param source the viewer
40      * @param selection the selection
41      */

42     public DoubleClickEvent(Viewer source, ISelection selection) {
43         super(source);
44         Assert.isNotNull(selection);
45         this.selection = selection;
46     }
47
48     /**
49      * Returns the selection.
50      *
51      * @return the selection
52      */

53     public ISelection getSelection() {
54         return selection;
55     }
56
57     /**
58      * Returns the viewer that is the source of this event.
59      *
60      * @return the originating viewer
61      */

62     public Viewer getViewer() {
63         return (Viewer) getSource();
64     }
65 }
66
Popular Tags