Mercurial > projects > dwt-addons
annotate dwtx/jface/text/revisions/IRevisionRulerColumnExtension.d @ 158:25f1f92fa3df
...
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Tue, 26 Aug 2008 02:46:34 +0200 |
parents | 75302ef3f92f |
children | 1a5b8f8129df |
rev | line source |
---|---|
129 | 1 /******************************************************************************* |
2 * Copyright (c) 2006, 2007 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.revisions.IRevisionRulerColumnExtension; | |
14 | |
131 | 15 import dwtx.jface.text.revisions.IRevisionListener; // packageimport |
16 import dwtx.jface.text.revisions.RevisionRange; // packageimport | |
17 import dwtx.jface.text.revisions.IRevisionRulerColumn; // packageimport | |
18 import dwtx.jface.text.revisions.RevisionEvent; // packageimport | |
19 import dwtx.jface.text.revisions.RevisionInformation; // packageimport | |
20 import dwtx.jface.text.revisions.Revision; // packageimport | |
21 | |
22 | |
129 | 23 import dwt.dwthelper.utils; |
24 | |
25 | |
26 import dwtx.core.runtime.Assert; | |
27 import dwtx.jface.viewers.ISelectionProvider; | |
28 | |
158 | 29 static this(){ |
30 IRevisionRulerColumnExtension.AUTHOR= new IRevisionRulerColumnExtension.RenderingMode("Author"); //$NON-NLS-1$ | |
31 IRevisionRulerColumnExtension.AGE= new IRevisionRulerColumnExtension.RenderingMode("Age"); //$NON-NLS-1$ | |
32 IRevisionRulerColumnExtension.AUTHOR_SHADED_BY_AGE= new IRevisionRulerColumnExtension.RenderingMode("Both"); //$NON-NLS-1$ | |
33 } | |
129 | 34 |
35 /** | |
36 * Extension interface for {@link IRevisionRulerColumn}. | |
37 * <p> | |
38 * Introduces the ability to register a selection listener on revisions and configurable rendering | |
39 * modes. | |
40 * </p> | |
158 | 41 * |
129 | 42 * @see IRevisionRulerColumn |
43 * @since 3.3 | |
44 */ | |
45 public interface IRevisionRulerColumnExtension { | |
158 | 46 |
129 | 47 /** |
48 * Rendering mode type-safe enum. | |
49 */ | |
50 final class RenderingMode { | |
146 | 51 private const String fName; |
133
7d818bd32d63
Fix ctors to this with gvim regexp
Frank Benoit <benoit@tionex.de>
parents:
131
diff
changeset
|
52 private this(String name) { |
129 | 53 Assert.isLegal(name !is null); |
54 fName= name; | |
55 } | |
56 /** | |
57 * Returns the name of the rendering mode. | |
58 * @return the name of the rendering mode | |
59 */ | |
60 public String name() { | |
61 return fName; | |
62 } | |
63 } | |
158 | 64 |
129 | 65 /** |
66 * Rendering mode that assigns a unique color to each revision author. | |
67 */ | |
158 | 68 static const RenderingMode AUTHOR; |
129 | 69 /** |
70 * Rendering mode that assigns colors to revisions by their age. | |
71 * <p> | |
72 * Currently the most recent revision is red, the oldest is a faint yellow. | |
73 * The coloring scheme can change in future releases. | |
74 * </p> | |
75 */ | |
158 | 76 static const RenderingMode AGE; |
129 | 77 /** |
78 * Rendering mode that assigns unique colors per revision author and | |
158 | 79 * uses different color intensity depending on the age. |
129 | 80 * <p> |
81 * Currently it selects lighter colors for older revisions and more intense | |
82 * colors for more recent revisions. | |
83 * The coloring scheme can change in future releases. | |
84 * </p> | |
85 */ | |
158 | 86 static const RenderingMode AUTHOR_SHADED_BY_AGE; |
129 | 87 |
88 /** | |
89 * Changes the rendering mode and triggers redrawing if needed. | |
158 | 90 * |
129 | 91 * @param mode the rendering mode |
92 */ | |
93 void setRevisionRenderingMode(RenderingMode mode); | |
158 | 94 |
129 | 95 /** |
96 * Enables showing the revision id. | |
158 | 97 * |
129 | 98 * @param show <code>true</code> to show the revision, <code>false</code> to hide it |
99 */ | |
100 void showRevisionId(bool show); | |
158 | 101 |
129 | 102 /** |
103 * Enables showing the revision author. | |
158 | 104 * |
129 | 105 * @param show <code>true</code> to show the author, <code>false</code> to hide it |
106 */ | |
107 void showRevisionAuthor(bool show); | |
158 | 108 |
129 | 109 /** |
110 * Returns the revision selection provider. | |
158 | 111 * |
129 | 112 * @return the revision selection provider |
113 */ | |
114 ISelectionProvider getRevisionSelectionProvider(); | |
158 | 115 |
129 | 116 /** |
117 * Adds a revision listener that will be notified when the displayed revision information | |
118 * changes. | |
158 | 119 * |
129 | 120 * @param listener the listener to add |
121 */ | |
122 void addRevisionListener(IRevisionListener listener); | |
158 | 123 |
129 | 124 /** |
125 * Removes a previously registered revision listener; nothing happens if <code>listener</code> | |
126 * was not registered with the receiver. | |
158 | 127 * |
129 | 128 * @param listener the listener to remove |
129 */ | |
130 void removeRevisionListener(IRevisionListener listener); | |
131 } |