comparison dwtx/jface/dialogs/PageChangingEvent.d @ 20:d1f4edab3f34

Page Change
author Frank Benoit <benoit@tionex.de>
date Thu, 03 Apr 2008 00:33:43 +0200
parents
children
comparison
equal deleted inserted replaced
19:2b36428a5ce4 20:d1f4edab3f34
1 /*******************************************************************************
2 * Copyright (c) 2006, 2007 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 * Chris Gross (schtoo@schtoo.com) - initial API and implementation for bug 16179
10 * IBM Corporation - revisions to initial contribution
11 * Port to the D programming language:
12 * Frank Benoit <benoit@tionex.de>
13 *******************************************************************************/
14 module dwtx.jface.dialogs.PageChangingEvent;
15
16
17 import dwtx.core.runtime.Assert;
18
19 import dwt.dwthelper.utils;
20
21 /**
22 * Event object describing an <code>IDialogPage</code> in the midst of changing.
23 *
24 * @see IPageChangingListener
25 * @since 3.3
26 */
27 public class PageChangingEvent : EventObject {
28
29
30 private static const long serialVersionUID = 1L;
31
32 private Object currentPage;
33
34 private Object targetPage;
35
36 /**
37 * Public field that dictates if the page change will successfully change.
38 *
39 * Set this field to <code>false</code> to prevent the page from changing.
40 *
41 * Default value is <code>true</code>.
42 */
43 public bool doit = true;
44
45 /**
46 * Creates a new event for the given source, selected (current) page and
47 * direction.
48 *
49 * @param source
50 * the page changing provider (the source of this event)
51 * @param currentPage
52 * the current page. In the JFace provided dialogs this will be
53 * an <code>IDialogPage</code>.
54 * @param targetPage
55 * the target page. In the JFace provided dialogs this will be an
56 * <code>IDialogPage</code>.
57 */
58 public this(Object source, Object currentPage, Object targetPage) {
59 super(source);
60 Assert.isNotNull(currentPage);
61 Assert.isNotNull(targetPage);
62 this.currentPage = currentPage;
63 this.targetPage = targetPage;
64 }
65
66 /**
67 * Returns the current page from which the page change originates.
68 *
69 * @return the current page. In dialogs implemented by JFace,
70 * this will be an <code>IDialogPage</code>.
71 */
72 public Object getCurrentPage() {
73 return currentPage;
74 }
75
76 /**
77 * Returns the target page to change to.
78 *
79 * @return the target page. In dialogs implemented by JFace,
80 * this will be an <code>IDialogPage</code>.
81 */
82 public Object getTargetPage() {
83 return targetPage;
84 }
85
86 }