1 /*******************************************************************************
2 * Copyright (c) 2000, 2004 IBM Corporation and others.
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Common Public License v1.0
5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/cpl-v10.html
9 * IBM Corporation - initial API and implementation
10 *******************************************************************************/
12 package net.sourceforge.phpdt.internal.ui.text;
14 import org.eclipse.jface.text.IDocument;
15 import org.eclipse.jface.text.IRegion;
16 import org.eclipse.jface.text.TextPresentation;
17 import org.eclipse.jface.text.presentation.PresentationReconciler;
21 * Presentation reconciler, adding functionality for operation without a viewer.
25 public class JavaPresentationReconciler extends PresentationReconciler {
27 /** Last used document */
28 private IDocument fLastDocument;
31 * Constructs a "repair description" for the given damage and returns
32 * this description as a text presentation.
34 * NOTE: Should not be used if this reconciler is installed on a viewer.
37 * @param damage the damage to be repaired
38 * @param document the document whose presentation must be repaired
39 * @return the presentation repair description as text presentation
41 public TextPresentation createRepairDescription(IRegion damage, IDocument document) {
42 if (document != fLastDocument) {
43 setDocumentToDamagers(document);
44 setDocumentToRepairers(document);
46 return createPresentation(damage, document);