comparison org.eclipse.text/src/org/eclipse/text/edits/ISourceModifier.d @ 12:bc29606a740c

Added dwt-addons in original directory structure of eclipse.org
author Frank Benoit <benoit@tionex.de>
date Sat, 14 Mar 2009 18:23:29 +0100
parents
children 5feec68b4556
comparison
equal deleted inserted replaced
11:43904fec5dca 12:bc29606a740c
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 * Port to the D programming language:
11 * Frank Benoit <benoit@tionex.de>
12 *******************************************************************************/
13 module org.eclipse.text.edits.ISourceModifier;
14
15 import org.eclipse.text.edits.ReplaceEdit; // packageimport
16
17 import java.lang.all;
18 import java.util.Set;
19
20 /**
21 * A source modifier can be used to modify the source of
22 * a move or copy edit before it gets inserted at the target
23 * position. This is useful if the text to be copied has to
24 * be modified before it is inserted without changing the
25 * original source.
26 *
27 * @since 3.0
28 */
29 public interface ISourceModifier {
30 /**
31 * Returns the modification to be done to the passed
32 * string in form of replace edits. The set of returned
33 * replace edits must modify disjoint text regions.
34 * Violating this requirement will result in a <code>
35 * BadLocationException</code> while executing the
36 * associated move or copy edit.
37 * <p>
38 * The caller of this method is responsible to apply
39 * the returned edits to the passed source.
40 *
41 * @param source the source to be copied or moved
42 * @return an array of <code>ReplaceEdits</code>
43 * describing the modifications.
44 */
45 public ReplaceEdit[] getModifications(String source);
46
47 /**
48 * Creates a copy of this source modifier object. The copy will
49 * be used in a different text edit object. So it should be
50 * created in a way that is doesn't conflict with other text edits
51 * referring to this source modifier.
52 *
53 * @return the copy of the source modifier
54 */
55 public ISourceModifier copy();
56 }