01: /*******************************************************************************
02: * Copyright (c) 2000, 2005 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.text;
11:
12: /**
13: * A slave document event represents a master document event as a slave-relative
14: * document event. It also carries the master document event.
15: */
16: public class SlaveDocumentEvent extends DocumentEvent {
17:
18: /** The master document event */
19: private DocumentEvent fMasterEvent;
20:
21: /**
22: * Creates a new slave document event.
23: *
24: * @param doc the slave document
25: * @param offset the offset in the slave document
26: * @param length the length in the slave document
27: * @param text the substitution text
28: * @param masterEvent the master document event
29: */
30: public SlaveDocumentEvent(IDocument doc, int offset, int length,
31: String text, DocumentEvent masterEvent) {
32: super (doc, offset, length, text);
33: fMasterEvent = masterEvent;
34: }
35:
36: /**
37: * Returns this event's master event.
38: *
39: * @return this event's master event
40: */
41: public DocumentEvent getMasterEvent() {
42: return fMasterEvent;
43: }
44: }
|