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.dialogs;
11:
12: import java.util.EventObject;
13:
14: import org.eclipse.core.runtime.Assert;
15:
16: /**
17: * Event object describing a page selection change. The source of these events
18: * is a page change provider.
19: *
20: * @see IPageChangeProvider
21: * @see IPageChangedListener
22: *
23: * @since 3.1
24: */
25: public class PageChangedEvent extends EventObject {
26:
27: /**
28: * Generated serial version UID for this class.
29: *
30: * @since 3.1
31: */
32: private static final long serialVersionUID = 3835149545519723574L;
33:
34: /**
35: * The selected page.
36: */
37: protected Object selectedPage;
38:
39: /**
40: * Creates a new event for the given source and selected page.
41: *
42: * @param source
43: * the page change provider
44: * @param selectedPage
45: * the selected page. In the JFace provided dialogs this
46: * will be an <code>IDialogPage</code>.
47: */
48: public PageChangedEvent(IPageChangeProvider source,
49: Object selectedPage) {
50: super (source);
51: Assert.isNotNull(selectedPage);
52: this .selectedPage = selectedPage;
53: }
54:
55: /**
56: * Returns the selected page.
57: *
58: * @return the selected page. In dialogs implemented by JFace,
59: * this will be an <code>IDialogPage</code>.
60: */
61: public Object getSelectedPage() {
62: return selectedPage;
63: }
64:
65: /**
66: * Returns the page change provider that is the source of this event.
67: *
68: * @return the originating page change provider
69: */
70: public IPageChangeProvider getPageChangeProvider() {
71: return (IPageChangeProvider) getSource();
72: }
73: }
|