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 target publishing the required functions to modify a document that is displayed 16 * in a text viewer. It provides access to the document and control 17 * over the redraw behavior and the grouping of document changes into undo commands. 18 * 19 * @see org.eclipse.jface.text.ITextViewer 20 * @see org.eclipse.jface.text.IDocument 21 * @see org.eclipse.jface.text.IUndoManager 22 * @since 2.0 23 */ 24 public interface IRewriteTarget { 25 26 /** 27 * Returns the document of this target. 28 * 29 * @return the document of this target 30 */ 31 IDocument getDocument(); 32 33 /** 34 * Disables/enables redrawing while modifying the target's document. 35 * 36 * @param redraw <code>true</code> if the document's visible presentation 37 * should be updated, <code>false</code> otherwise 38 */ 39 void setRedraw(boolean redraw); 40 41 /** 42 * If an undo manager is connected to the document's visible presentation, 43 * this method tells the undo manager to fold all subsequent changes into 44 * one single undo command until <code>endCompoundChange</code> is called. 45 */ 46 void beginCompoundChange(); 47 48 /** 49 * If an undo manager is connected to the document's visible presentation, 50 * this method tells the undo manager to stop the folding of changes into a 51 * single undo command. After this call, all subsequent changes are 52 * considered to be individually undo-able. 53 */ 54 void endCompoundChange(); 55 } 56 57