Mercurial > projects > dwt-addons
comparison dwtx/jface/text/DocumentRewriteSessionEvent.d @ 129:eb30df5ca28b
Added JFace Text sources
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Sat, 23 Aug 2008 19:10:48 +0200 |
parents | |
children | c4fb132a086c |
comparison
equal
deleted
inserted
replaced
128:8df1d4193877 | 129:eb30df5ca28b |
---|---|
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 * Port to the D programming language: | |
11 * Frank Benoit <benoit@tionex.de> | |
12 *******************************************************************************/ | |
13 module dwtx.jface.text.DocumentRewriteSessionEvent; | |
14 | |
15 import dwt.dwthelper.utils; | |
16 | |
17 import dwtx.core.runtime.Assert; | |
18 | |
19 | |
20 /** | |
21 * Description of the state of document rewrite sessions. | |
22 * | |
23 * @see dwtx.jface.text.IDocument | |
24 * @see dwtx.jface.text.IDocumentExtension4 | |
25 * @see dwtx.jface.text.IDocumentRewriteSessionListener | |
26 * @since 3.1 | |
27 */ | |
28 public class DocumentRewriteSessionEvent { | |
29 | |
30 public final static Object SESSION_START= new Object(); | |
31 public final static Object SESSION_STOP= new Object(); | |
32 | |
33 /** The changed document */ | |
34 public IDocument fDocument; | |
35 /** The session */ | |
36 public DocumentRewriteSession fSession; | |
37 /** The change type */ | |
38 public Object fChangeType; | |
39 | |
40 /** | |
41 * Creates a new document event. | |
42 * | |
43 * @param doc the changed document | |
44 * @param session the session | |
45 * @param changeType the change type. This is either | |
46 * {@link DocumentRewriteSessionEvent#SESSION_START} or | |
47 * {@link DocumentRewriteSessionEvent#SESSION_STOP}. | |
48 */ | |
49 public DocumentRewriteSessionEvent(IDocument doc, DocumentRewriteSession session, Object changeType) { | |
50 Assert.isNotNull(doc); | |
51 Assert.isNotNull(session); | |
52 | |
53 fDocument= doc; | |
54 fSession= session; | |
55 fChangeType= changeType; | |
56 } | |
57 | |
58 /** | |
59 * Returns the changed document. | |
60 * | |
61 * @return the changed document | |
62 */ | |
63 public IDocument getDocument() { | |
64 return fDocument; | |
65 } | |
66 | |
67 /** | |
68 * Returns the change type of this event. This is either | |
69 * {@link DocumentRewriteSessionEvent#SESSION_START}or | |
70 * {@link DocumentRewriteSessionEvent#SESSION_STOP}. | |
71 * | |
72 * @return the change type of this event | |
73 */ | |
74 public Object getChangeType() { | |
75 return fChangeType; | |
76 } | |
77 | |
78 /** | |
79 * Returns the rewrite session. | |
80 * | |
81 * @return the rewrite session | |
82 */ | |
83 public DocumentRewriteSession getSession() { | |
84 return fSession; | |
85 } | |
86 } |