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