summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLei Zhu2013-04-06 00:58:22 (EDT)
committer Gerrit Code Review @ Eclipse.org2013-05-03 15:55:36 (EDT)
commit77e45ce4079b34fea75b743fb8fd9222fc69f306 (patch)
treec0c923df6b8264489fc8022293f58594ad364671
parentc7e9c1e9cf72f32264806aa80ccc03dcef096fee (diff)
downloadorg.eclipse.mylyn.reviews-77e45ce4079b34fea75b743fb8fd9222fc69f306.zip
org.eclipse.mylyn.reviews-77e45ce4079b34fea75b743fb8fd9222fc69f306.tar.gz
org.eclipse.mylyn.reviews-77e45ce4079b34fea75b743fb8fd9222fc69f306.tar.bz2
383359: indicate whether each file is ... PT2 Adding support for renamesrefs/changes/99/11699/10
and tooltips Change-Id: I4ac38385aca729675258a4a5042af30df5fc1cc7 Task-Url: https://bugs.eclipse.org/bugs/show_bug.cgi?id=383359
-rw-r--r--org.eclipse.mylyn.reviews.ui/icons/ovr/renamed.gifbin0 -> 3452 bytes
-rw-r--r--org.eclipse.mylyn.reviews.ui/src/org/eclipse/mylyn/internal/reviews/ui/ReviewsImages.java2
-rw-r--r--org.eclipse.mylyn.reviews.ui/src/org/eclipse/mylyn/internal/reviews/ui/providers/ReviewsLabelProvider.java17
-rw-r--r--org.eclipse.mylyn.reviews.ui/src/org/eclipse/mylyn/reviews/ui/spi/editor/ReviewSetContentSection.java17
4 files changed, 31 insertions, 5 deletions
diff --git a/org.eclipse.mylyn.reviews.ui/icons/ovr/renamed.gif b/org.eclipse.mylyn.reviews.ui/icons/ovr/renamed.gif
new file mode 100644
index 0000000..d94adf5
--- /dev/null
+++ b/org.eclipse.mylyn.reviews.ui/icons/ovr/renamed.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 df9da96..fca6ac7 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
@@ -33,6 +33,8 @@ public class ReviewsImages {
public static final ImageDescriptor OVERLAY_REMOVED = create("ovr/removed.gif"); //$NON-NLS-1$
+ public static final ImageDescriptor OVERLAY_RENAMED = create("ovr/renamed.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 7a32585..d42b035 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
@@ -128,6 +128,11 @@ public abstract class ReviewsLabelProvider extends TableStyledLabelProvider {
} else if (base.getPath() != null && target.getPath() == null) {
ImageDescriptor overlay = ReviewsImages.OVERLAY_REMOVED;
image = CommonImages.getImageWithOverlay(baseImage, overlay, false, false);
+ } else if (base.getPath() != null && target.getPath() != null) {
+ if (!base.getPath().equals(target.getPath())) {
+ ImageDescriptor overlay = ReviewsImages.OVERLAY_RENAMED;
+ image = CommonImages.getImageWithOverlay(baseImage, overlay, false, false);
+ }
}
}
}
@@ -250,7 +255,17 @@ public abstract class ReviewsLabelProvider extends TableStyledLabelProvider {
}
if (element instanceof IFileItem) {
IFileItem fileItem = (IFileItem) element;
- return fileItem.getTarget().getPath() + " Revision: " + fileItem.getTarget().getDescription();
+ IFileVersion base = fileItem.getBase();
+ IFileVersion target = fileItem.getTarget();
+ if (target.getPath() != null && base.getPath() == null) {
+ return target.getPath() + " Revision: " + target.getDescription();
+ } else if (target.getPath() == null && base.getPath() != null) {
+ return base.getPath() + " Revision: " + target.getDescription();
+ } else if (!target.getPath().equals(base.getPath())) {
+ return target.getPath() + "\n renamed from: " + base.getPath() + " " + target.getDescription();
+ } else {
+ return target.getPath() + " Revision: " + target.getDescription();
+ }
}
if (element instanceof IUser) {
IUser user = (IUser) element;
diff --git a/org.eclipse.mylyn.reviews.ui/src/org/eclipse/mylyn/reviews/ui/spi/editor/ReviewSetContentSection.java b/org.eclipse.mylyn.reviews.ui/src/org/eclipse/mylyn/reviews/ui/spi/editor/ReviewSetContentSection.java
index d23aeba..17825a6 100644
--- a/org.eclipse.mylyn.reviews.ui/src/org/eclipse/mylyn/reviews/ui/spi/editor/ReviewSetContentSection.java
+++ b/org.eclipse.mylyn.reviews.ui/src/org/eclipse/mylyn/reviews/ui/spi/editor/ReviewSetContentSection.java
@@ -20,6 +20,7 @@ import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.jface.layout.GridDataFactory;
import org.eclipse.jface.layout.GridLayoutFactory;
+import org.eclipse.jface.viewers.ColumnViewerToolTipSupport;
import org.eclipse.jface.viewers.DelegatingStyledCellLabelProvider;
import org.eclipse.jface.viewers.IOpenListener;
import org.eclipse.jface.viewers.IStructuredContentProvider;
@@ -27,6 +28,7 @@ import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.OpenEvent;
import org.eclipse.jface.viewers.TableViewer;
import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.jface.window.ToolTip;
import org.eclipse.mylyn.commons.core.StatusHandler;
import org.eclipse.mylyn.internal.reviews.ui.providers.ReviewsLabelProvider;
import org.eclipse.mylyn.internal.tasks.ui.TasksUiPlugin;
@@ -60,8 +62,6 @@ public class ReviewSetContentSection implements IRemoteEmfObserver<IReviewItemSe
private static final int MAXIMUM_ITEMS_SHOWN = 30;
- protected ReviewsLabelProvider labelProvider;
-
private final ReviewSetSection parentSection;
private final IReviewItemSet set;
@@ -236,8 +236,17 @@ public class ReviewSetContentSection implements IRemoteEmfObserver<IReviewItemSe
public void inputChanged(final Viewer viewer, Object oldInput, Object newInput) {
}
});
- labelProvider = new ReviewsLabelProvider.Simple();
- viewer.setLabelProvider(new DelegatingStyledCellLabelProvider(labelProvider));
+ ColumnViewerToolTipSupport.enableFor(viewer, ToolTip.NO_RECREATE);
+
+ final DelegatingStyledCellLabelProvider styledLabelProvider = new DelegatingStyledCellLabelProvider(
+ new ReviewsLabelProvider.Simple()) {
+ @Override
+ public String getToolTipText(Object element) {
+ //For some reason tooltips are not delegated..
+ return ReviewsLabelProvider.ITEMS_COLUMN.getToolTipText(element);
+ };
+ };
+ viewer.setLabelProvider(styledLabelProvider);
viewer.addOpenListener(new IOpenListener() {
public void open(OpenEvent event) {
IStructuredSelection selection = (IStructuredSelection) event.getSelection();