comparison org.eclipse.jface.text/src/org/eclipse/jface/text/revisions/RevisionRange.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 6f068362a363
comparison
equal deleted inserted replaced
11:43904fec5dca 12:bc29606a740c
1 /*******************************************************************************
2 * Copyright (c) 2006, 2008 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.jface.text.revisions.RevisionRange;
14
15 import org.eclipse.jface.text.revisions.IRevisionListener; // packageimport
16 import org.eclipse.jface.text.revisions.IRevisionRulerColumnExtension; // packageimport
17 import org.eclipse.jface.text.revisions.IRevisionRulerColumn; // packageimport
18 import org.eclipse.jface.text.revisions.RevisionEvent; // packageimport
19 import org.eclipse.jface.text.revisions.RevisionInformation; // packageimport
20 import org.eclipse.jface.text.revisions.Revision; // packageimport
21
22
23 import java.lang.all;
24 import tango.text.convert.Format;
25
26 import org.eclipse.core.runtime.Assert;
27 import org.eclipse.jface.text.source.ILineRange;
28
29
30 /**
31 * An unmodifiable line range that belongs to a {@link Revision}.
32 *
33 * @since 3.3
34 * @noinstantiate This class is not intended to be instantiated by clients.
35 */
36 public final class RevisionRange : ILineRange {
37 private const Revision fRevision;
38 private const int fStartLine;
39 private const int fNumberOfLines;
40
41 this(Revision revision, ILineRange range) {
42 Assert.isLegal(revision !is null);
43 fRevision= revision;
44 fStartLine= range.getStartLine();
45 fNumberOfLines= range.getNumberOfLines();
46 }
47
48 /**
49 * Returns the revision that this range belongs to.
50 *
51 * @return the revision that this range belongs to
52 */
53 public Revision getRevision() {
54 return fRevision;
55 }
56
57 /*
58 * @see org.eclipse.jface.text.source.ILineRange#getStartLine()
59 */
60 public int getStartLine() {
61 return fStartLine;
62 }
63
64 /*
65 * @see org.eclipse.jface.text.source.ILineRange#getNumberOfLines()
66 */
67 public int getNumberOfLines() {
68 return fNumberOfLines;
69 }
70
71 /*
72 * @see java.lang.Object#toString()
73 */
74 public override String toString() {
75 return Format("RevisionRange [{}, [{}+{})]", fRevision.toString(), getStartLine(), getNumberOfLines()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
76 }
77 }