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