KickJava   Java API By Example, From Geeks To Geeks.

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


1 /*******************************************************************************
2  * Copyright (c) 2000, 2005 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
14 /**
15  * A slave document event represents a master document event as a slave-relative
16  * document event. It also carries the master document event.
17  */

18 public class SlaveDocumentEvent extends DocumentEvent {
19
20     /** The master document event */
21     private DocumentEvent fMasterEvent;
22
23     /**
24      * Creates a new slave document event.
25      *
26      * @param doc the slave document
27      * @param offset the offset in the slave document
28      * @param length the length in the slave document
29      * @param text the substitution text
30      * @param masterEvent the master document event
31      */

32     public SlaveDocumentEvent(IDocument doc, int offset, int length, String JavaDoc text, DocumentEvent masterEvent) {
33         super(doc, offset, length, text);
34         fMasterEvent= masterEvent;
35     }
36
37     /**
38      * Returns this event's master event.
39      *
40      * @return this event's master event
41      */

42     public DocumentEvent getMasterEvent() {
43         return fMasterEvent;
44     }
45 }
46
Popular Tags