01: /*******************************************************************************
02: * Copyright (c) 2000, 2004 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.jdt.internal.ui.examples.jspeditor;
11:
12: import org.eclipse.jface.text.IDocument;
13: import org.eclipse.jface.text.reconciler.IReconcilableModel;
14:
15: /**
16: * Adapts an <code>IDocument</code> to a <code>IReconcilableModel</code>.
17: *
18: * @since 3.0
19: */
20: public class DocumentAdapter implements IReconcilableModel {
21:
22: private IDocument fDocument;
23:
24: /**
25: * Creates a text model adapter for the given document.
26: *
27: * @param document
28: */
29: public DocumentAdapter(IDocument document) {
30: fDocument = document;
31: }
32:
33: /**
34: * Returns this model's document.
35: *
36: * @return the model's input document
37: */
38: public IDocument getDocument() {
39: return fDocument;
40: }
41: }
|