summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLei Zhu2013-02-21 01:47:06 (EST)
committer Gerrit Code Review @ Eclipse.org2013-03-21 20:07:49 (EDT)
commit40a159e0878feee657a61e8697b36d2e3bc28df6 (patch)
treefa7f042106efa4bddc6bb1d4d77b2adab05288d7
parentce2a551398e3512b407be893417726a2ff99ee1c (diff)
downloadorg.eclipse.mylyn.reviews-40a159e0878feee657a61e8697b36d2e3bc28df6.zip
org.eclipse.mylyn.reviews-40a159e0878feee657a61e8697b36d2e3bc28df6.tar.gz
org.eclipse.mylyn.reviews-40a159e0878feee657a61e8697b36d2e3bc28df6.tar.bz2
383359: indicate whether each file is modified, deleted, or renamedrefs/changes/14/9414/9
Change-Id: Ie4cc0a9d9d1906637269738fec435d525157927d Task-Url: https://bugs.eclipse.org/bugs/show_bug.cgi?id=383359
-rw-r--r--org.eclipse.mylyn.reviews.ui/icons/ovr/added.gifbin0 -> 169 bytes
-rw-r--r--org.eclipse.mylyn.reviews.ui/icons/ovr/removed.gifbin0 -> 176 bytes
-rw-r--r--org.eclipse.mylyn.reviews.ui/src/org/eclipse/mylyn/internal/reviews/ui/ReviewsImages.java5
-rw-r--r--org.eclipse.mylyn.reviews.ui/src/org/eclipse/mylyn/internal/reviews/ui/providers/ReviewsLabelProvider.java23
4 files changed, 25 insertions, 3 deletions
diff --git a/org.eclipse.mylyn.reviews.ui/icons/ovr/added.gif b/org.eclipse.mylyn.reviews.ui/icons/ovr/added.gif
new file mode 100644
index 0000000..c65d16a
--- /dev/null
+++ b/org.eclipse.mylyn.reviews.ui/icons/ovr/added.gif
Binary files differ
diff --git a/org.eclipse.mylyn.reviews.ui/icons/ovr/removed.gif b/org.eclipse.mylyn.reviews.ui/icons/ovr/removed.gif
new file mode 100644
index 0000000..8aaadfb
--- /dev/null
+++ b/org.eclipse.mylyn.reviews.ui/icons/ovr/removed.gif
Binary files differ
diff --git a/org.eclipse.mylyn.reviews.ui/src/org/eclipse/mylyn/internal/reviews/ui/ReviewsImages.java b/org.eclipse.mylyn.reviews.ui/src/org/eclipse/mylyn/internal/reviews/ui/ReviewsImages.java
index c8c9807..e542436 100644
--- a/org.eclipse.mylyn.reviews.ui/src/org/eclipse/mylyn/internal/reviews/ui/ReviewsImages.java
+++ b/org.eclipse.mylyn.reviews.ui/src/org/eclipse/mylyn/internal/reviews/ui/ReviewsImages.java
@@ -21,6 +21,7 @@ import org.eclipse.jface.resource.ImageDescriptor;
* @author Steffen Pingel
* @author Sascha Scholz
* @author Miles Parker
+ * @author Lei Zhu
*/
public class ReviewsImages {
@@ -28,6 +29,10 @@ public class ReviewsImages {
public static final ImageDescriptor OVERLAY_REVIEW = create("eview16/overlay-review.png"); //$NON-NLS-1$
+ public static final ImageDescriptor OVERLAY_ADDED = create("ovr/added.gif"); //$NON-NLS-1$
+
+ public static final ImageDescriptor OVERLAY_REMOVED = create("ovr/removed.gif"); //$NON-NLS-1$
+
public static final ImageDescriptor REFRESH = create("elcl16/refresh.gif"); //$NON-NLS-1$
public static final ImageDescriptor FLAT_LAYOUT = create("elcl16/flatLayout.gif"); //$NON-NLS-1$
diff --git a/org.eclipse.mylyn.reviews.ui/src/org/eclipse/mylyn/internal/reviews/ui/providers/ReviewsLabelProvider.java b/org.eclipse.mylyn.reviews.ui/src/org/eclipse/mylyn/internal/reviews/ui/providers/ReviewsLabelProvider.java
index 6437f82..4565606 100644
--- a/org.eclipse.mylyn.reviews.ui/src/org/eclipse/mylyn/internal/reviews/ui/providers/ReviewsLabelProvider.java
+++ b/org.eclipse.mylyn.reviews.ui/src/org/eclipse/mylyn/internal/reviews/ui/providers/ReviewsLabelProvider.java
@@ -22,6 +22,7 @@ import java.util.List;
import org.apache.commons.lang.StringUtils;
import org.eclipse.jface.preference.JFacePreferences;
import org.eclipse.jface.resource.ColorRegistry;
+import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.resource.JFaceResources;
import org.eclipse.jface.viewers.StyledString;
import org.eclipse.jface.viewers.StyledString.Styler;
@@ -55,6 +56,7 @@ import org.eclipse.swt.widgets.Display;
* @author Miles Parker
* @author Steffen Pingel
* @author Kevin Sawicki
+ * @author Lei Zhu
*/
public abstract class ReviewsLabelProvider extends TableStyledLabelProvider {
@@ -116,7 +118,23 @@ public abstract class ReviewsLabelProvider extends TableStyledLabelProvider {
}
if (element instanceof IReviewItem) {
IReviewItem item = (IReviewItem) element;
- return ReviewsUiPlugin.getDefault().getImageManager().getFileImage(item.getName());
+ Image image = ReviewsUiPlugin.getDefault().getImageManager().getFileImage(item.getName());
+ if (element instanceof IFileItem) {
+ ImageDescriptor baseImage = ImageDescriptor.createFromImage(image);
+ IFileItem fileItem = (IFileItem) element;
+ IFileRevision base = fileItem.getBase();
+ IFileRevision target = fileItem.getTarget();
+ if (base != null && target != null) {
+ if (base.getPath() == null && target.getPath() != null) {
+ ImageDescriptor overlay = ReviewsImages.OVERLAY_ADDED;
+ image = CommonImages.getImageWithOverlay(baseImage, overlay, false, false);
+ } else if (base.getPath() != null && target.getPath() == null) {
+ ImageDescriptor overlay = ReviewsImages.OVERLAY_REMOVED;
+ image = CommonImages.getImageWithOverlay(baseImage, overlay, false, false);
+ }
+ }
+ }
+ return image;
}
if (element instanceof IComment) {
//See https://bugs.eclipse.org/bugs/show_bug.cgi?id=334967#c16
@@ -508,8 +526,7 @@ public abstract class ReviewsLabelProvider extends TableStyledLabelProvider {
@Override
public Image getImage(Object element) {
if (element instanceof IReviewItem) {
- IReviewItem item = (IReviewItem) element;
- return ReviewsUiPlugin.getDefault().getImageManager().getFileImage(item.getName());
+ return super.getImage(element);
}
return null;
}