Mercurial > projects > dwt-addons
comparison dwtx/jface/text/source/ILineDiffInfo.d @ 129:eb30df5ca28b
Added JFace Text sources
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Sat, 23 Aug 2008 19:10:48 +0200 |
parents | |
children | c4fb132a086c |
comparison
equal
deleted
inserted
replaced
128:8df1d4193877 | 129:eb30df5ca28b |
---|---|
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 dwtx.jface.text.source.ILineDiffInfo; | |
14 | |
15 import dwt.dwthelper.utils; | |
16 | |
17 | |
18 /** | |
19 * Describes the change state of one line, which consists of the state of the line itself, which | |
20 * can be <code>UNCHANGED</code>, <code>CHANGED</code> or <code>ADDED</code>, and the number of | |
21 * deleted lines before and after this line. | |
22 * <p> | |
23 * This interface may be implemented by clients. | |
24 * </p> | |
25 * | |
26 * @since 3.0 | |
27 */ | |
28 public interface ILineDiffInfo { | |
29 | |
30 /** Denotes an unchanged line. */ | |
31 static final int UNCHANGED= 0; | |
32 | |
33 /** Denotes an added line. */ | |
34 static final int ADDED= 1; | |
35 | |
36 /** Denotes a changed line. */ | |
37 static final int CHANGED= 2; | |
38 | |
39 /** | |
40 * Returns the number of deleted lines after this line. | |
41 * | |
42 * @return the number of lines after this line. | |
43 */ | |
44 int getRemovedLinesBelow(); | |
45 | |
46 /** | |
47 * Returns the number of deleted lines before this line. | |
48 * | |
49 * @return the number of lines before this line. | |
50 */ | |
51 int getRemovedLinesAbove(); | |
52 | |
53 /** | |
54 * Returns the type of this line, one out of <code>UNCHANGED</code>, <code>CHANGED</code> or | |
55 * <code>ADDED</code>. | |
56 * | |
57 * @return the type of this line. | |
58 */ | |
59 int getChangeType(); | |
60 | |
61 /** | |
62 * Returns whether this line has any changes (to itself, or any deletions before or after it). | |
63 * | |
64 * @return <code>true</code>, if the line's state (as returned by <code>getType</code>) is | |
65 * either <code>CHANGED</code> or <code>ADDED</code> or either of <code>getRemovedLinesBelow</code> | |
66 * and <code>getRemovedLinesAbove</code> would return a number > 0 | |
67 */ | |
68 bool hasChanges(); | |
69 | |
70 /** | |
71 * Returns the original text of this changed region | |
72 * | |
73 * @return the original text of this changed region, including any deleted lines. The returned | |
74 * value and its elements may not be <code>null/code>, it may however be of zero length | |
75 */ | |
76 String[] getOriginalText(); | |
77 } |