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
|
|
29
|
|
30 /**
|
|
31 * Extension interface for {@link IRevisionRulerColumn}.
|
|
32 * <p>
|
|
33 * Introduces the ability to register a selection listener on revisions and configurable rendering
|
|
34 * modes.
|
|
35 * </p>
|
|
36 *
|
|
37 * @see IRevisionRulerColumn
|
|
38 * @since 3.3
|
|
39 */
|
|
40 public interface IRevisionRulerColumnExtension {
|
|
41
|
|
42 /**
|
|
43 * Rendering mode type-safe enum.
|
|
44 */
|
|
45 final class RenderingMode {
|
|
46 private final String fName;
|
|
47 private RenderingMode(String name) {
|
|
48 Assert.isLegal(name !is null);
|
|
49 fName= name;
|
|
50 }
|
|
51 /**
|
|
52 * Returns the name of the rendering mode.
|
|
53 * @return the name of the rendering mode
|
|
54 */
|
|
55 public String name() {
|
|
56 return fName;
|
|
57 }
|
|
58 }
|
|
59
|
|
60 /**
|
|
61 * Rendering mode that assigns a unique color to each revision author.
|
|
62 */
|
|
63 RenderingMode AUTHOR= new RenderingMode("Author"); //$NON-NLS-1$
|
|
64 /**
|
|
65 * Rendering mode that assigns colors to revisions by their age.
|
|
66 * <p>
|
|
67 * Currently the most recent revision is red, the oldest is a faint yellow.
|
|
68 * The coloring scheme can change in future releases.
|
|
69 * </p>
|
|
70 */
|
|
71 RenderingMode AGE= new RenderingMode("Age"); //$NON-NLS-1$
|
|
72 /**
|
|
73 * Rendering mode that assigns unique colors per revision author and
|
|
74 * uses different color intensity depending on the age.
|
|
75 * <p>
|
|
76 * Currently it selects lighter colors for older revisions and more intense
|
|
77 * colors for more recent revisions.
|
|
78 * The coloring scheme can change in future releases.
|
|
79 * </p>
|
|
80 */
|
|
81 RenderingMode AUTHOR_SHADED_BY_AGE= new RenderingMode("Both"); //$NON-NLS-1$
|
|
82
|
|
83 /**
|
|
84 * Changes the rendering mode and triggers redrawing if needed.
|
|
85 *
|
|
86 * @param mode the rendering mode
|
|
87 */
|
|
88 void setRevisionRenderingMode(RenderingMode mode);
|
|
89
|
|
90 /**
|
|
91 * Enables showing the revision id.
|
|
92 *
|
|
93 * @param show <code>true</code> to show the revision, <code>false</code> to hide it
|
|
94 */
|
|
95 void showRevisionId(bool show);
|
|
96
|
|
97 /**
|
|
98 * Enables showing the revision author.
|
|
99 *
|
|
100 * @param show <code>true</code> to show the author, <code>false</code> to hide it
|
|
101 */
|
|
102 void showRevisionAuthor(bool show);
|
|
103
|
|
104 /**
|
|
105 * Returns the revision selection provider.
|
|
106 *
|
|
107 * @return the revision selection provider
|
|
108 */
|
|
109 ISelectionProvider getRevisionSelectionProvider();
|
|
110
|
|
111 /**
|
|
112 * Adds a revision listener that will be notified when the displayed revision information
|
|
113 * changes.
|
|
114 *
|
|
115 * @param listener the listener to add
|
|
116 */
|
|
117 void addRevisionListener(IRevisionListener listener);
|
|
118
|
|
119 /**
|
|
120 * Removes a previously registered revision listener; nothing happens if <code>listener</code>
|
|
121 * was not registered with the receiver.
|
|
122 *
|
|
123 * @param listener the listener to remove
|
|
124 */
|
|
125 void removeRevisionListener(IRevisionListener listener);
|
|
126 }
|