Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndre Weinand2003-02-04 18:36:31 +0000
committerAndre Weinand2003-02-04 18:36:31 +0000
commitfbeef225bbd76ba0eea30a8f82a7f6dab68747b5 (patch)
treebe058b5f46150430c2f4773622aa9dc8d970a1ab
parentc0631dd343dd0810af62b081a0291d20580a4f28 (diff)
downloadeclipse.platform.team-fbeef225bbd76ba0eea30a8f82a7f6dab68747b5.tar.gz
eclipse.platform.team-fbeef225bbd76ba0eea30a8f82a7f6dab68747b5.tar.xz
eclipse.platform.team-fbeef225bbd76ba0eea30a8f82a7f6dab68747b5.zip
added icon support for resolved indicator
-rw-r--r--bundles/org.eclipse.compare/buildnotes_compare.html1
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/TextMergeViewer.java72
-rw-r--r--bundles/org.eclipse.compare/icons/full/obj16/NOT_OK.gifbin0 -> 846 bytes
-rw-r--r--bundles/org.eclipse.compare/icons/full/obj16/OK.gifbin0 -> 839 bytes
-rw-r--r--bundles/org.eclipse.compare/plugins/org.eclipse.compare/buildnotes_compare.html1
-rw-r--r--bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/TextMergeViewer.java72
-rw-r--r--bundles/org.eclipse.compare/plugins/org.eclipse.compare/icons/full/obj16/NOT_OK.gifbin0 -> 846 bytes
-rw-r--r--bundles/org.eclipse.compare/plugins/org.eclipse.compare/icons/full/obj16/OK.gifbin0 -> 839 bytes
8 files changed, 104 insertions, 42 deletions
diff --git a/bundles/org.eclipse.compare/buildnotes_compare.html b/bundles/org.eclipse.compare/buildnotes_compare.html
index f66c63574..947cd0bd3 100644
--- a/bundles/org.eclipse.compare/buildnotes_compare.html
+++ b/bundles/org.eclipse.compare/buildnotes_compare.html
@@ -18,6 +18,7 @@ Problem reports fixed</h2>
<a href="http://dev.eclipse.org/bugs/show_bug.cgi?id=30525">#30525</a>: "Team" menu item missing accelerator<br>
<a href="http://dev.eclipse.org/bugs/show_bug.cgi?id=28202">#28202</a>: contentmergeviewers do not work with mixed-case extensions<br>
<a href="http://dev.eclipse.org/bugs/show_bug.cgi?id=19114">#19114</a>: Restore Java Element from Local History should also provide check boxes [compare]<br>
+<a href="http://dev.eclipse.org/bugs/show_bug.cgi?id=28436">#28436</a>: Overview rule green only after focus change<br>
<h1>
<hr WIDTH="100%"></h1>
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 a2a9bca27..778f5df33 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
@@ -34,6 +34,7 @@ import org.eclipse.swt.widgets.*;
import org.eclipse.swt.custom.*;
import org.eclipse.jface.action.*;
+import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.text.*;
import org.eclipse.jface.util.PropertyChangeEvent;
import org.eclipse.jface.util.IPropertyChangeListener;
@@ -50,6 +51,7 @@ import org.eclipse.ui.IActionBars;
import org.eclipse.ui.IWorkbenchActionConstants;
import org.eclipse.compare.*;
+import org.eclipse.compare.internal.CompareUIPlugin;
import org.eclipse.compare.internal.MergeSourceViewer;
import org.eclipse.compare.internal.BufferedCanvas;
import org.eclipse.compare.internal.Utilities;
@@ -252,13 +254,15 @@ public class TextMergeViewer extends ContentMergeViewer {
private Canvas fScrollCanvas;
private ScrollBar fVScrollBar;
private Canvas fBirdsEyeCanvas;
- private Canvas fSummaryCanvas;
+ private Label fSummaryCanvas;
// SWT resources to be disposed
private Map fColors;
private Font fFont;
private Cursor fBirdsEyeCursor;
-
+ private Image fOKImage;
+ private Image fNOTOKImage;
+
// points for center curves
private double[] fBasicCenterCurve;
@@ -483,15 +487,7 @@ public class TextMergeViewer extends ContentMergeViewer {
return false;
}
- private boolean isUnresolvedIncoming() {
- if (fResolved)
- return false;
- return isIncoming();
- }
-
- private boolean isUnresolvedIncomingOrConflicting() {
- if (fResolved)
- return false;
+ private boolean isIncomingOrConflicting() {
switch (fDirection) {
case RangeDifference.RIGHT:
if (fLeftIsLocal)
@@ -506,6 +502,18 @@ public class TextMergeViewer extends ContentMergeViewer {
}
return false;
}
+
+ private boolean isUnresolvedIncoming() {
+ if (fResolved)
+ return false;
+ return isIncoming();
+ }
+
+ private boolean isUnresolvedIncomingOrConflicting() {
+ if (fResolved)
+ return false;
+ return isIncomingOrConflicting();
+ }
Position getPosition(MergeSourceViewer w) {
if (w == fLeft)
@@ -852,6 +860,15 @@ public class TextMergeViewer extends ContentMergeViewer {
fBirdsEyeCursor= null;
}
+ if (fOKImage != null) {
+ fOKImage.dispose();
+ fOKImage= null;
+ }
+ if (fNOTOKImage != null) {
+ fNOTOKImage.dispose();
+ fNOTOKImage= null;
+ }
+
super.handleDispose(event);
}
@@ -884,7 +901,9 @@ public class TextMergeViewer extends ContentMergeViewer {
fAncestor= createPart(composite);
fAncestor.setEditable(false);
- fSummaryCanvas= new Canvas(composite, SWT.NONE);
+ fSummaryCanvas= new Label(composite, SWT.NONE);
+ /*
+ new Canvas(composite, SWT.NONE);
fSummaryCanvas.addPaintListener(
new PaintListener() {
public void paintControl(PaintEvent e) {
@@ -893,6 +912,7 @@ public class TextMergeViewer extends ContentMergeViewer {
}
}
);
+ */
updateResolveStatus();
// 2nd row
@@ -2546,15 +2566,15 @@ public class TextMergeViewer extends ContentMergeViewer {
}
private void updateResolveStatus() {
- Color c= null;
+ Image c= null;
if (showResolveUI()) {
- boolean hasIncoming= false; // we only show red or gree if there is at least one incoming change
+ boolean hasIncoming= false; // we only show red or green if there is at least one incoming or conflicting change
boolean unresolved= false;
if (fChangeDiffs != null) {
Iterator e= fChangeDiffs.iterator();
while (e.hasNext()) {
Diff d= (Diff) e.next();
- if (d.isIncoming()) {
+ if (d.isIncomingOrConflicting()) {
hasIncoming= true;
if (!d.fResolved) {
unresolved= true;
@@ -2564,14 +2584,24 @@ public class TextMergeViewer extends ContentMergeViewer {
}
}
if (hasIncoming) {
- Display d= fSummaryCanvas.getDisplay();
- if (unresolved)
- c= d.getSystemColor(SWT.COLOR_RED);
- else
- c= d.getSystemColor(SWT.COLOR_GREEN);
+ if (unresolved) {
+ if (fNOTOKImage == null) {
+ ImageDescriptor id= CompareUIPlugin.getImageDescriptor("obj16/NOT_OK.gif"); //$NON-NLS-1$
+ if (id != null)
+ fNOTOKImage= id.createImage(fSummaryCanvas.getDisplay());
+ }
+ c= fNOTOKImage;
+ } else {
+ if (fOKImage == null) {
+ ImageDescriptor id= CompareUIPlugin.getImageDescriptor("obj16/OK.gif"); //$NON-NLS-1$
+ if (id != null)
+ fOKImage= id.createImage(fSummaryCanvas.getDisplay());
+ }
+ c= fOKImage;
+ }
}
}
- fSummaryCanvas.setBackground(c);
+ fSummaryCanvas.setImage(c);
}
private void updateStatus(Diff diff) {
diff --git a/bundles/org.eclipse.compare/icons/full/obj16/NOT_OK.gif b/bundles/org.eclipse.compare/icons/full/obj16/NOT_OK.gif
new file mode 100644
index 000000000..8021f77e2
--- /dev/null
+++ b/bundles/org.eclipse.compare/icons/full/obj16/NOT_OK.gif
Binary files differ
diff --git a/bundles/org.eclipse.compare/icons/full/obj16/OK.gif b/bundles/org.eclipse.compare/icons/full/obj16/OK.gif
new file mode 100644
index 000000000..3adb798fc
--- /dev/null
+++ b/bundles/org.eclipse.compare/icons/full/obj16/OK.gif
Binary files differ
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 f66c63574..947cd0bd3 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
@@ -18,6 +18,7 @@ Problem reports fixed</h2>
<a href="http://dev.eclipse.org/bugs/show_bug.cgi?id=30525">#30525</a>: "Team" menu item missing accelerator<br>
<a href="http://dev.eclipse.org/bugs/show_bug.cgi?id=28202">#28202</a>: contentmergeviewers do not work with mixed-case extensions<br>
<a href="http://dev.eclipse.org/bugs/show_bug.cgi?id=19114">#19114</a>: Restore Java Element from Local History should also provide check boxes [compare]<br>
+<a href="http://dev.eclipse.org/bugs/show_bug.cgi?id=28436">#28436</a>: Overview rule green only after focus change<br>
<h1>
<hr WIDTH="100%"></h1>
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 a2a9bca27..778f5df33 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
@@ -34,6 +34,7 @@ import org.eclipse.swt.widgets.*;
import org.eclipse.swt.custom.*;
import org.eclipse.jface.action.*;
+import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.text.*;
import org.eclipse.jface.util.PropertyChangeEvent;
import org.eclipse.jface.util.IPropertyChangeListener;
@@ -50,6 +51,7 @@ import org.eclipse.ui.IActionBars;
import org.eclipse.ui.IWorkbenchActionConstants;
import org.eclipse.compare.*;
+import org.eclipse.compare.internal.CompareUIPlugin;
import org.eclipse.compare.internal.MergeSourceViewer;
import org.eclipse.compare.internal.BufferedCanvas;
import org.eclipse.compare.internal.Utilities;
@@ -252,13 +254,15 @@ public class TextMergeViewer extends ContentMergeViewer {
private Canvas fScrollCanvas;
private ScrollBar fVScrollBar;
private Canvas fBirdsEyeCanvas;
- private Canvas fSummaryCanvas;
+ private Label fSummaryCanvas;
// SWT resources to be disposed
private Map fColors;
private Font fFont;
private Cursor fBirdsEyeCursor;
-
+ private Image fOKImage;
+ private Image fNOTOKImage;
+
// points for center curves
private double[] fBasicCenterCurve;
@@ -483,15 +487,7 @@ public class TextMergeViewer extends ContentMergeViewer {
return false;
}
- private boolean isUnresolvedIncoming() {
- if (fResolved)
- return false;
- return isIncoming();
- }
-
- private boolean isUnresolvedIncomingOrConflicting() {
- if (fResolved)
- return false;
+ private boolean isIncomingOrConflicting() {
switch (fDirection) {
case RangeDifference.RIGHT:
if (fLeftIsLocal)
@@ -506,6 +502,18 @@ public class TextMergeViewer extends ContentMergeViewer {
}
return false;
}
+
+ private boolean isUnresolvedIncoming() {
+ if (fResolved)
+ return false;
+ return isIncoming();
+ }
+
+ private boolean isUnresolvedIncomingOrConflicting() {
+ if (fResolved)
+ return false;
+ return isIncomingOrConflicting();
+ }
Position getPosition(MergeSourceViewer w) {
if (w == fLeft)
@@ -852,6 +860,15 @@ public class TextMergeViewer extends ContentMergeViewer {
fBirdsEyeCursor= null;
}
+ if (fOKImage != null) {
+ fOKImage.dispose();
+ fOKImage= null;
+ }
+ if (fNOTOKImage != null) {
+ fNOTOKImage.dispose();
+ fNOTOKImage= null;
+ }
+
super.handleDispose(event);
}
@@ -884,7 +901,9 @@ public class TextMergeViewer extends ContentMergeViewer {
fAncestor= createPart(composite);
fAncestor.setEditable(false);
- fSummaryCanvas= new Canvas(composite, SWT.NONE);
+ fSummaryCanvas= new Label(composite, SWT.NONE);
+ /*
+ new Canvas(composite, SWT.NONE);
fSummaryCanvas.addPaintListener(
new PaintListener() {
public void paintControl(PaintEvent e) {
@@ -893,6 +912,7 @@ public class TextMergeViewer extends ContentMergeViewer {
}
}
);
+ */
updateResolveStatus();
// 2nd row
@@ -2546,15 +2566,15 @@ public class TextMergeViewer extends ContentMergeViewer {
}
private void updateResolveStatus() {
- Color c= null;
+ Image c= null;
if (showResolveUI()) {
- boolean hasIncoming= false; // we only show red or gree if there is at least one incoming change
+ boolean hasIncoming= false; // we only show red or green if there is at least one incoming or conflicting change
boolean unresolved= false;
if (fChangeDiffs != null) {
Iterator e= fChangeDiffs.iterator();
while (e.hasNext()) {
Diff d= (Diff) e.next();
- if (d.isIncoming()) {
+ if (d.isIncomingOrConflicting()) {
hasIncoming= true;
if (!d.fResolved) {
unresolved= true;
@@ -2564,14 +2584,24 @@ public class TextMergeViewer extends ContentMergeViewer {
}
}
if (hasIncoming) {
- Display d= fSummaryCanvas.getDisplay();
- if (unresolved)
- c= d.getSystemColor(SWT.COLOR_RED);
- else
- c= d.getSystemColor(SWT.COLOR_GREEN);
+ if (unresolved) {
+ if (fNOTOKImage == null) {
+ ImageDescriptor id= CompareUIPlugin.getImageDescriptor("obj16/NOT_OK.gif"); //$NON-NLS-1$
+ if (id != null)
+ fNOTOKImage= id.createImage(fSummaryCanvas.getDisplay());
+ }
+ c= fNOTOKImage;
+ } else {
+ if (fOKImage == null) {
+ ImageDescriptor id= CompareUIPlugin.getImageDescriptor("obj16/OK.gif"); //$NON-NLS-1$
+ if (id != null)
+ fOKImage= id.createImage(fSummaryCanvas.getDisplay());
+ }
+ c= fOKImage;
+ }
}
}
- fSummaryCanvas.setBackground(c);
+ fSummaryCanvas.setImage(c);
}
private void updateStatus(Diff diff) {
diff --git a/bundles/org.eclipse.compare/plugins/org.eclipse.compare/icons/full/obj16/NOT_OK.gif b/bundles/org.eclipse.compare/plugins/org.eclipse.compare/icons/full/obj16/NOT_OK.gif
new file mode 100644
index 000000000..8021f77e2
--- /dev/null
+++ b/bundles/org.eclipse.compare/plugins/org.eclipse.compare/icons/full/obj16/NOT_OK.gif
Binary files differ
diff --git a/bundles/org.eclipse.compare/plugins/org.eclipse.compare/icons/full/obj16/OK.gif b/bundles/org.eclipse.compare/plugins/org.eclipse.compare/icons/full/obj16/OK.gif
new file mode 100644
index 000000000..3adb798fc
--- /dev/null
+++ b/bundles/org.eclipse.compare/plugins/org.eclipse.compare/icons/full/obj16/OK.gif
Binary files differ

Back to the top