KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > jface > text > DocumentRewriteSessionEvent


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.text;
12
13 import org.eclipse.core.runtime.Assert;
14
15
16 /**
17  * Description of the state of document rewrite sessions.
18  *
19  * @see org.eclipse.jface.text.IDocument
20  * @see org.eclipse.jface.text.IDocumentExtension4
21  * @see org.eclipse.jface.text.IDocumentRewriteSessionListener
22  * @since 3.1
23  */

24 public class DocumentRewriteSessionEvent {
25
26     public final static Object JavaDoc SESSION_START= new Object JavaDoc();
27     public final static Object JavaDoc SESSION_STOP= new Object JavaDoc();
28
29     /** The changed document */
30     public IDocument fDocument;
31     /** The session */
32     public DocumentRewriteSession fSession;
33     /** The change type */
34     public Object JavaDoc fChangeType;
35
36     /**
37      * Creates a new document event.
38      *
39      * @param doc the changed document
40      * @param session the session
41      * @param changeType the change type. This is either
42      * {@link DocumentRewriteSessionEvent#SESSION_START} or
43      * {@link DocumentRewriteSessionEvent#SESSION_STOP}.
44      */

45     public DocumentRewriteSessionEvent(IDocument doc, DocumentRewriteSession session, Object JavaDoc changeType) {
46         Assert.isNotNull(doc);
47         Assert.isNotNull(session);
48
49         fDocument= doc;
50         fSession= session;
51         fChangeType= changeType;
52     }
53
54     /**
55      * Returns the changed document.
56      *
57      * @return the changed document
58      */

59     public IDocument getDocument() {
60         return fDocument;
61     }
62
63     /**
64      * Returns the change type of this event. This is either
65      * {@link DocumentRewriteSessionEvent#SESSION_START}or
66      * {@link DocumentRewriteSessionEvent#SESSION_STOP}.
67      *
68      * @return the change type of this event
69      */

70     public Object JavaDoc getChangeType() {
71         return fChangeType;
72     }
73
74     /**
75      * Returns the rewrite session.
76      *
77      * @return the rewrite session
78      */

79     public DocumentRewriteSession getSession() {
80         return fSession;
81     }
82 }
83
Popular Tags