Skip to main content
summaryrefslogtreecommitdiffstats
blob: 0f698dc777aa05a8f991c7fd7ab75b3dc19e32b6 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
/*******************************************************************************
 * Copyright (c) 2000, 2005 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/
package org.eclipse.jface.text;


 /**
  * A target publishing the required functions to modify a document that is displayed
  * in a text viewer. It provides access to the document and control
  * over the redraw behavior and the grouping of document changes into undo commands.
  *
  * @see org.eclipse.jface.text.ITextViewer
  * @see org.eclipse.jface.text.IDocument
  * @see org.eclipse.jface.text.IUndoManager
  * @since 2.0
  */
public interface IRewriteTarget {

	/**
	 * Returns the document of this target.
	 *
	 * @return the document of this target
	 */
	IDocument getDocument();

	/**
	 * Disables/enables redrawing while modifying the target's document.
	 *
	 * @param redraw <code>true</code> if the document's visible presentation
	 *            should be updated, <code>false</code> otherwise
	 */
	void setRedraw(boolean redraw);

	/**
	 * If an undo manager is connected to the document's visible presentation,
	 * this method tells the undo manager to fold all subsequent changes into
	 * one single undo command until <code>endCompoundChange</code> is called.
	 */
	void beginCompoundChange();

	/**
	 * If an undo manager is connected to the document's visible presentation,
	 * this method tells the undo manager to stop the folding of changes into a
	 * single undo command. After this call, all subsequent changes are
	 * considered to be individually undo-able.
	 */
	void endCompoundChange();
}

Back to the top