KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > jface > text > revisions > IRevisionRulerColumnExtension


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  *******************************************************************************/

11 package org.eclipse.jface.text.revisions;
12
13 import org.eclipse.core.runtime.Assert;
14
15 import org.eclipse.jface.viewers.ISelectionProvider;
16
17
18 /**
19  * Extension interface for {@link IRevisionRulerColumn}.
20  * <p>
21  * Introduces the ability to register a selection listener on revisions and configurable rendering
22  * modes.
23  * </p>
24  *
25  * @see IRevisionRulerColumn
26  * @since 3.3
27  */

28 public interface IRevisionRulerColumnExtension {
29     
30     /**
31      * Rendering mode type-safe enum.
32      */

33     final class RenderingMode {
34         private final String JavaDoc fName;
35         private RenderingMode(String JavaDoc name) {
36             Assert.isLegal(name != null);
37             fName= name;
38         }
39         /**
40          * Returns the name of the rendering mode.
41          * @return the name of the rendering mode
42          */

43         public String JavaDoc name() {
44             return fName;
45         }
46     }
47     
48     /**
49      * Rendering mode that assigns a unique color to each revision author.
50      */

51     RenderingMode AUTHOR= new RenderingMode("Author"); //$NON-NLS-1$
52
/**
53      * Rendering mode that assigns colors to revisions by their age.
54      * <p>
55      * Currently the most recent revision is red, the oldest is a faint yellow.
56      * The coloring scheme can change in future releases.
57      * </p>
58      */

59     RenderingMode AGE= new RenderingMode("Age"); //$NON-NLS-1$
60
/**
61      * Rendering mode that assigns unique colors per revision author and
62      * uses different color intensity depending on the age.
63      * <p>
64      * Currently it selects lighter colors for older revisions and more intense
65      * colors for more recent revisions.
66      * The coloring scheme can change in future releases.
67      * </p>
68      */

69     RenderingMode AUTHOR_SHADED_BY_AGE= new RenderingMode("Both"); //$NON-NLS-1$
70

71     /**
72      * Changes the rendering mode and triggers redrawing if needed.
73      *
74      * @param mode the rendering mode
75      */

76     void setRevisionRenderingMode(RenderingMode mode);
77     
78     /**
79      * Enables showing the revision id.
80      *
81      * @param show <code>true</code> to show the revision, <code>false</code> to hide it
82      */

83     void showRevisionId(boolean show);
84     
85     /**
86      * Enables showing the revision author.
87      *
88      * @param show <code>true</code> to show the author, <code>false</code> to hide it
89      */

90     void showRevisionAuthor(boolean show);
91     
92     /**
93      * Returns the revision selection provider.
94      *
95      * @return the revision selection provider
96      */

97     ISelectionProvider getRevisionSelectionProvider();
98     
99     /**
100      * Adds a revision listener that will be notified when the displayed revision information
101      * changes.
102      *
103      * @param listener the listener to add
104      */

105     void addRevisionListener(IRevisionListener listener);
106     
107     /**
108      * Removes a previously registered revision listener; nothing happens if <code>listener</code>
109      * was not registered with the receiver.
110      *
111      * @param listener the listener to remove
112      */

113     void removeRevisionListener(IRevisionListener listener);
114 }
115
Popular Tags