KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > jface > dialogs > PageChangedEvent


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.dialogs;
12
13 import java.util.EventObject JavaDoc;
14
15 import org.eclipse.core.runtime.Assert;
16
17 /**
18  * Event object describing a page selection change. The source of these events
19  * is a page change provider.
20  *
21  * @see IPageChangeProvider
22  * @see IPageChangedListener
23  *
24  * @since 3.1
25  */

26 public class PageChangedEvent extends EventObject JavaDoc {
27
28     /**
29      * Generated serial version UID for this class.
30      *
31      * @since 3.1
32      */

33     private static final long serialVersionUID = 3835149545519723574L;
34
35     /**
36      * The selected page.
37      */

38     protected Object JavaDoc selectedPage;
39
40     /**
41      * Creates a new event for the given source and selected page.
42      *
43      * @param source
44      * the page change provider
45      * @param selectedPage
46      * the selected page. In the JFace provided dialogs this
47      * will be an <code>IDialogPage</code>.
48      */

49     public PageChangedEvent(IPageChangeProvider source,
50             Object JavaDoc selectedPage) {
51         super(source);
52         Assert.isNotNull(selectedPage);
53         this.selectedPage = selectedPage;
54     }
55
56     /**
57      * Returns the selected page.
58      *
59      * @return the selected page. In dialogs implemented by JFace,
60      * this will be an <code>IDialogPage</code>.
61      */

62     public Object JavaDoc getSelectedPage() {
63         return selectedPage;
64     }
65
66     /**
67      * Returns the page change provider that is the source of this event.
68      *
69      * @return the originating page change provider
70      */

71     public IPageChangeProvider getPageChangeProvider() {
72         return (IPageChangeProvider) getSource();
73     }
74 }
75
Popular Tags