Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndre Weinand2004-03-18 13:44:53 +0000
committerAndre Weinand2004-03-18 13:44:53 +0000
commit839eade41ced9be1261535ffe96d7d1fdffe9ddc (patch)
tree12bca52acde18cd888ad12dfe8ff0e4db83e201f
parenta6fa2e5b31b26aafc5212de67f1282bcf325d700 (diff)
downloadeclipse.platform.team-839eade41ced9be1261535ffe96d7d1fdffe9ddc.tar.gz
eclipse.platform.team-839eade41ced9be1261535ffe96d7d1fdffe9ddc.tar.xz
eclipse.platform.team-839eade41ced9be1261535ffe96d7d1fdffe9ddc.zip
fixed 20914
-rw-r--r--bundles/org.eclipse.compare/buildnotes_compare.html10
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/TextMergeViewer.java25
-rw-r--r--bundles/org.eclipse.compare/plugin.properties15
-rw-r--r--bundles/org.eclipse.compare/plugin.xml46
-rw-r--r--bundles/org.eclipse.compare/plugins/org.eclipse.compare/buildnotes_compare.html10
-rw-r--r--bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/TextMergeViewer.java25
-rw-r--r--bundles/org.eclipse.compare/plugins/org.eclipse.compare/plugin.properties15
-rw-r--r--bundles/org.eclipse.compare/plugins/org.eclipse.compare/plugin.xml46
8 files changed, 170 insertions, 22 deletions
diff --git a/bundles/org.eclipse.compare/buildnotes_compare.html b/bundles/org.eclipse.compare/buildnotes_compare.html
index 87a3f88a2..c943fb192 100644
--- a/bundles/org.eclipse.compare/buildnotes_compare.html
+++ b/bundles/org.eclipse.compare/buildnotes_compare.html
@@ -9,11 +9,17 @@
<body>
-
-
<h1>
Eclipse Platform Build Notes<br>
Compare</h1>
+Eclipse Build Input March 23rd 2004 (M8)
+
+<h2>
+Problem reports fixed</h2>
+<a href="http://dev.eclipse.org/bugs/show_bug.cgi?id=20914">#20914</a>: Colorized Diff/compare output<br>
+
+<h1>
+<hr WIDTH="100%"></h1>
Eclipse Build Input March 9th 2004
<h2>
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/TextMergeViewer.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/TextMergeViewer.java
index d63c17964..92e1525aa 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/TextMergeViewer.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/TextMergeViewer.java
@@ -35,6 +35,7 @@ import org.eclipse.swt.widgets.*;
import org.eclipse.swt.custom.*;
import org.eclipse.jface.action.*;
+import org.eclipse.jface.resource.ColorRegistry;
import org.eclipse.jface.resource.JFaceResources;
import org.eclipse.jface.text.*;
import org.eclipse.jface.util.PropertyChangeEvent;
@@ -141,7 +142,13 @@ public class TextMergeViewer extends ContentMergeViewer {
};
private static final String BUNDLE_NAME= "org.eclipse.compare.contentmergeviewer.TextMergeViewerResources"; //$NON-NLS-1$
-
+
+ // the following symbolic constants must match the IDs in Compare's plugin.xml
+ private static final String INCOMING_COLOR= "INCOMING_COLOR"; //$NON-NLS-1$
+ private static final String OUTGOING_COLOR= "OUTGOING_COLOR"; //$NON-NLS-1$
+ private static final String CONFLICTING_COLOR= "CONFLICTING_COLOR"; //$NON-NLS-1$
+ private static final String RESOLVED_COLOR= "RESOLVED_COLOR"; //$NON-NLS-1$
+
// constants
/** Width of left and right vertical bar */
private static final int MARGIN_WIDTH= 6;
@@ -697,6 +704,7 @@ public class TextMergeViewer extends ContentMergeViewer {
fBirdsEyeCursor= new Cursor(parent.getDisplay(), SWT.CURSOR_HAND);
JFaceResources.getFontRegistry().addListener(fPreferenceChangeListener);
+ JFaceResources.getColorRegistry().addListener(fPreferenceChangeListener);
updateFont();
}
@@ -785,20 +793,22 @@ public class TextMergeViewer extends ContentMergeViewer {
if (fRight != null)
fRight.setBackgroundColor(color);
+ ColorRegistry registry= JFaceResources.getColorRegistry();
+
RGB bg= getBackground(display);
- SELECTED_INCOMING= new RGB(0, 0, 255);
+ SELECTED_INCOMING= registry.getRGB(INCOMING_COLOR);
INCOMING= interpolate(SELECTED_INCOMING, bg, 0.6);
INCOMING_FILL= interpolate(SELECTED_INCOMING, bg, 0.97);
- SELECTED_CONFLICT= new RGB(255, 0, 0);
+ SELECTED_CONFLICT= registry.getRGB(CONFLICTING_COLOR);
CONFLICT= interpolate(SELECTED_CONFLICT, bg, 0.6);
CONFLICT_FILL= interpolate(SELECTED_CONFLICT, bg, 0.97);
- SELECTED_OUTGOING= getForeground(display);
+ SELECTED_OUTGOING= registry.getRGB(OUTGOING_COLOR);
OUTGOING= interpolate(SELECTED_OUTGOING, bg, 0.6);
OUTGOING_FILL= interpolate(SELECTED_OUTGOING, bg, 0.97);
- RESOLVED= new RGB(0, 255, 0);
+ RESOLVED= registry.getRGB(RESOLVED_COLOR);
refreshBirdsEyeView();
invalidateLines();
@@ -902,6 +912,7 @@ public class TextMergeViewer extends ContentMergeViewer {
if (fPreferenceChangeListener != null) {
JFaceResources.getFontRegistry().removeListener(fPreferenceChangeListener);
+ JFaceResources.getColorRegistry().removeListener(fPreferenceChangeListener);
if (fPreferenceStore != null)
fPreferenceStore.removePropertyChangeListener(fPreferenceChangeListener);
fPreferenceChangeListener= null;
@@ -3006,6 +3017,10 @@ public class TextMergeViewer extends ContentMergeViewer {
} else if (key.equals(fSymbolicFontName)) {
updateFont();
invalidateLines();
+
+ } else if (key.equals(INCOMING_COLOR) || key.equals(OUTGOING_COLOR) || key.equals(CONFLICTING_COLOR) || key.equals(RESOLVED_COLOR)) {
+ updateColors(null);
+ invalidateLines();
} else if (key.equals(ComparePreferencePage.SYNCHRONIZE_SCROLLING)) {
diff --git a/bundles/org.eclipse.compare/plugin.properties b/bundles/org.eclipse.compare/plugin.properties
index 10dcadb36..694484aa7 100644
--- a/bundles/org.eclipse.compare/plugin.properties
+++ b/bundles/org.eclipse.compare/plugin.properties
@@ -129,8 +129,19 @@ ComparePreferencePage.previewAncestor= 1\n2\n3\nconflict\n4\n5
ComparePreferencePage.previewLeft= 1\n2\noutgoing addition\n3\noutgoing change\n4\npseudo conflict\n5
ComparePreferencePage.previewRight= 1\nincoming addition\nincoming addition\n2\n3\nincoming change\n4\npseudo conflict\n5
-compareFontDefiniton.label= Compare Text Font
-compareFontDefiniton.description= The compare text font is used by textual compare/merge editors.
+textCompareAppearance.label=Text Compare Appearance
+
+compareIncomingColor.label= Incoming change color
+compareIncomingColor.description= The color used to indicate an incoming change in compare and merge tools.
+compareOutgoingColor.label= Outgoing change color
+compareOutgoingColor.description= The color used to indicate an outgoing change in compare and merge tools.
+compareConflictColor.label= Conflicting change color
+compareConflictColor.description= The color used to indicate a conflicting change in compare and merge tools.
+compareResolvedColor.label= Resolved change color
+compareResolvedColor.description= The color used to indicate a resolved change in merge tools.
+
+compareFontDefiniton.label= Compare text font
+compareFontDefiniton.description= The compare text font is used by textual compare/merge tools.
# New UI
#ComparePreferencePage.useSplines.label= Use splines in center panel
diff --git a/bundles/org.eclipse.compare/plugin.xml b/bundles/org.eclipse.compare/plugin.xml
index 622776501..fb3f5186f 100644
--- a/bundles/org.eclipse.compare/plugin.xml
+++ b/bundles/org.eclipse.compare/plugin.xml
@@ -32,16 +32,58 @@
<!-- Extensions -->
<extension
- point="org.eclipse.ui.fontDefinitions">
+ point="org.eclipse.ui.themes">
+ <themeElementCategory
+ label="%textCompareAppearance.label"
+ id="org.eclipse.compare.contentmergeviewer.TextMergeViewer">
+ </themeElementCategory>
+ <colorDefinition
+ label="%compareIncomingColor.label"
+ categoryId="org.eclipse.compare.contentmergeviewer.TextMergeViewer"
+ value="COLOR_BLUE"
+ id="INCOMING_COLOR">
+ <description>
+ %compareIncomingColor.description
+ </description>
+ </colorDefinition>
+ <colorDefinition
+ label="%compareOutgoingColor.label"
+ categoryId="org.eclipse.compare.contentmergeviewer.TextMergeViewer"
+ value="COLOR_BLACK"
+ id="OUTGOING_COLOR">
+ <description>
+ %compareOutgoingColor.description
+ </description>
+ </colorDefinition>
+ <colorDefinition
+ label="%compareConflictColor.label"
+ categoryId="org.eclipse.compare.contentmergeviewer.TextMergeViewer"
+ value="COLOR_RED"
+ id="CONFLICTING_COLOR">
+ <description>
+ %compareConflictColor.description
+ </description>
+ </colorDefinition>
+ <colorDefinition
+ label="%compareResolvedColor.label"
+ categoryId="org.eclipse.compare.contentmergeviewer.TextMergeViewer"
+ value="COLOR_GREEN"
+ id="RESOLVED_COLOR">
+ <description>
+ %compareResolvedColor.description
+ </description>
+ </colorDefinition>
<fontDefinition
label="%compareFontDefiniton.label"
defaultsTo="org.eclipse.jface.textfont"
+ categoryId="org.eclipse.compare.contentmergeviewer.TextMergeViewer"
id="org.eclipse.compare.contentmergeviewer.TextMergeViewer">
- <description>
+ <description>
%compareFontDefiniton.description
</description>
</fontDefinition>
</extension>
+
<extension
id="rejectedPatchMarker"
name="%rejectedPatchMarker.name"
diff --git a/bundles/org.eclipse.compare/plugins/org.eclipse.compare/buildnotes_compare.html b/bundles/org.eclipse.compare/plugins/org.eclipse.compare/buildnotes_compare.html
index 87a3f88a2..c943fb192 100644
--- a/bundles/org.eclipse.compare/plugins/org.eclipse.compare/buildnotes_compare.html
+++ b/bundles/org.eclipse.compare/plugins/org.eclipse.compare/buildnotes_compare.html
@@ -9,11 +9,17 @@
<body>
-
-
<h1>
Eclipse Platform Build Notes<br>
Compare</h1>
+Eclipse Build Input March 23rd 2004 (M8)
+
+<h2>
+Problem reports fixed</h2>
+<a href="http://dev.eclipse.org/bugs/show_bug.cgi?id=20914">#20914</a>: Colorized Diff/compare output<br>
+
+<h1>
+<hr WIDTH="100%"></h1>
Eclipse Build Input March 9th 2004
<h2>
diff --git a/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/TextMergeViewer.java b/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/TextMergeViewer.java
index d63c17964..92e1525aa 100644
--- a/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/TextMergeViewer.java
+++ b/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/TextMergeViewer.java
@@ -35,6 +35,7 @@ import org.eclipse.swt.widgets.*;
import org.eclipse.swt.custom.*;
import org.eclipse.jface.action.*;
+import org.eclipse.jface.resource.ColorRegistry;
import org.eclipse.jface.resource.JFaceResources;
import org.eclipse.jface.text.*;
import org.eclipse.jface.util.PropertyChangeEvent;
@@ -141,7 +142,13 @@ public class TextMergeViewer extends ContentMergeViewer {
};
private static final String BUNDLE_NAME= "org.eclipse.compare.contentmergeviewer.TextMergeViewerResources"; //$NON-NLS-1$
-
+
+ // the following symbolic constants must match the IDs in Compare's plugin.xml
+ private static final String INCOMING_COLOR= "INCOMING_COLOR"; //$NON-NLS-1$
+ private static final String OUTGOING_COLOR= "OUTGOING_COLOR"; //$NON-NLS-1$
+ private static final String CONFLICTING_COLOR= "CONFLICTING_COLOR"; //$NON-NLS-1$
+ private static final String RESOLVED_COLOR= "RESOLVED_COLOR"; //$NON-NLS-1$
+
// constants
/** Width of left and right vertical bar */
private static final int MARGIN_WIDTH= 6;
@@ -697,6 +704,7 @@ public class TextMergeViewer extends ContentMergeViewer {
fBirdsEyeCursor= new Cursor(parent.getDisplay(), SWT.CURSOR_HAND);
JFaceResources.getFontRegistry().addListener(fPreferenceChangeListener);
+ JFaceResources.getColorRegistry().addListener(fPreferenceChangeListener);
updateFont();
}
@@ -785,20 +793,22 @@ public class TextMergeViewer extends ContentMergeViewer {
if (fRight != null)
fRight.setBackgroundColor(color);
+ ColorRegistry registry= JFaceResources.getColorRegistry();
+
RGB bg= getBackground(display);
- SELECTED_INCOMING= new RGB(0, 0, 255);
+ SELECTED_INCOMING= registry.getRGB(INCOMING_COLOR);
INCOMING= interpolate(SELECTED_INCOMING, bg, 0.6);
INCOMING_FILL= interpolate(SELECTED_INCOMING, bg, 0.97);
- SELECTED_CONFLICT= new RGB(255, 0, 0);
+ SELECTED_CONFLICT= registry.getRGB(CONFLICTING_COLOR);
CONFLICT= interpolate(SELECTED_CONFLICT, bg, 0.6);
CONFLICT_FILL= interpolate(SELECTED_CONFLICT, bg, 0.97);
- SELECTED_OUTGOING= getForeground(display);
+ SELECTED_OUTGOING= registry.getRGB(OUTGOING_COLOR);
OUTGOING= interpolate(SELECTED_OUTGOING, bg, 0.6);
OUTGOING_FILL= interpolate(SELECTED_OUTGOING, bg, 0.97);
- RESOLVED= new RGB(0, 255, 0);
+ RESOLVED= registry.getRGB(RESOLVED_COLOR);
refreshBirdsEyeView();
invalidateLines();
@@ -902,6 +912,7 @@ public class TextMergeViewer extends ContentMergeViewer {
if (fPreferenceChangeListener != null) {
JFaceResources.getFontRegistry().removeListener(fPreferenceChangeListener);
+ JFaceResources.getColorRegistry().removeListener(fPreferenceChangeListener);
if (fPreferenceStore != null)
fPreferenceStore.removePropertyChangeListener(fPreferenceChangeListener);
fPreferenceChangeListener= null;
@@ -3006,6 +3017,10 @@ public class TextMergeViewer extends ContentMergeViewer {
} else if (key.equals(fSymbolicFontName)) {
updateFont();
invalidateLines();
+
+ } else if (key.equals(INCOMING_COLOR) || key.equals(OUTGOING_COLOR) || key.equals(CONFLICTING_COLOR) || key.equals(RESOLVED_COLOR)) {
+ updateColors(null);
+ invalidateLines();
} else if (key.equals(ComparePreferencePage.SYNCHRONIZE_SCROLLING)) {
diff --git a/bundles/org.eclipse.compare/plugins/org.eclipse.compare/plugin.properties b/bundles/org.eclipse.compare/plugins/org.eclipse.compare/plugin.properties
index 10dcadb36..694484aa7 100644
--- a/bundles/org.eclipse.compare/plugins/org.eclipse.compare/plugin.properties
+++ b/bundles/org.eclipse.compare/plugins/org.eclipse.compare/plugin.properties
@@ -129,8 +129,19 @@ ComparePreferencePage.previewAncestor= 1\n2\n3\nconflict\n4\n5
ComparePreferencePage.previewLeft= 1\n2\noutgoing addition\n3\noutgoing change\n4\npseudo conflict\n5
ComparePreferencePage.previewRight= 1\nincoming addition\nincoming addition\n2\n3\nincoming change\n4\npseudo conflict\n5
-compareFontDefiniton.label= Compare Text Font
-compareFontDefiniton.description= The compare text font is used by textual compare/merge editors.
+textCompareAppearance.label=Text Compare Appearance
+
+compareIncomingColor.label= Incoming change color
+compareIncomingColor.description= The color used to indicate an incoming change in compare and merge tools.
+compareOutgoingColor.label= Outgoing change color
+compareOutgoingColor.description= The color used to indicate an outgoing change in compare and merge tools.
+compareConflictColor.label= Conflicting change color
+compareConflictColor.description= The color used to indicate a conflicting change in compare and merge tools.
+compareResolvedColor.label= Resolved change color
+compareResolvedColor.description= The color used to indicate a resolved change in merge tools.
+
+compareFontDefiniton.label= Compare text font
+compareFontDefiniton.description= The compare text font is used by textual compare/merge tools.
# New UI
#ComparePreferencePage.useSplines.label= Use splines in center panel
diff --git a/bundles/org.eclipse.compare/plugins/org.eclipse.compare/plugin.xml b/bundles/org.eclipse.compare/plugins/org.eclipse.compare/plugin.xml
index 622776501..fb3f5186f 100644
--- a/bundles/org.eclipse.compare/plugins/org.eclipse.compare/plugin.xml
+++ b/bundles/org.eclipse.compare/plugins/org.eclipse.compare/plugin.xml
@@ -32,16 +32,58 @@
<!-- Extensions -->
<extension
- point="org.eclipse.ui.fontDefinitions">
+ point="org.eclipse.ui.themes">
+ <themeElementCategory
+ label="%textCompareAppearance.label"
+ id="org.eclipse.compare.contentmergeviewer.TextMergeViewer">
+ </themeElementCategory>
+ <colorDefinition
+ label="%compareIncomingColor.label"
+ categoryId="org.eclipse.compare.contentmergeviewer.TextMergeViewer"
+ value="COLOR_BLUE"
+ id="INCOMING_COLOR">
+ <description>
+ %compareIncomingColor.description
+ </description>
+ </colorDefinition>
+ <colorDefinition
+ label="%compareOutgoingColor.label"
+ categoryId="org.eclipse.compare.contentmergeviewer.TextMergeViewer"
+ value="COLOR_BLACK"
+ id="OUTGOING_COLOR">
+ <description>
+ %compareOutgoingColor.description
+ </description>
+ </colorDefinition>
+ <colorDefinition
+ label="%compareConflictColor.label"
+ categoryId="org.eclipse.compare.contentmergeviewer.TextMergeViewer"
+ value="COLOR_RED"
+ id="CONFLICTING_COLOR">
+ <description>
+ %compareConflictColor.description
+ </description>
+ </colorDefinition>
+ <colorDefinition
+ label="%compareResolvedColor.label"
+ categoryId="org.eclipse.compare.contentmergeviewer.TextMergeViewer"
+ value="COLOR_GREEN"
+ id="RESOLVED_COLOR">
+ <description>
+ %compareResolvedColor.description
+ </description>
+ </colorDefinition>
<fontDefinition
label="%compareFontDefiniton.label"
defaultsTo="org.eclipse.jface.textfont"
+ categoryId="org.eclipse.compare.contentmergeviewer.TextMergeViewer"
id="org.eclipse.compare.contentmergeviewer.TextMergeViewer">
- <description>
+ <description>
%compareFontDefiniton.description
</description>
</fontDefinition>
</extension>
+
<extension
id="rejectedPatchMarker"
name="%rejectedPatchMarker.name"

Back to the top