Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiles Parker2013-04-26 20:51:17 -0400
committerMiles Parker2013-05-01 22:39:20 -0400
commit59c39b8be99242e31be2887b59609650d937dcaf (patch)
treecea8299d3918a253782203cad566e8032e156532 /org.eclipse.mylyn.reviews.edit
parent2bd0f9e8011e4ee970caa764a058baca00bab4f8 (diff)
downloadorg.eclipse.mylyn.reviews-59c39b8be99242e31be2887b59609650d937dcaf.tar.gz
org.eclipse.mylyn.reviews-59c39b8be99242e31be2887b59609650d937dcaf.tar.xz
org.eclipse.mylyn.reviews-59c39b8be99242e31be2887b59609650d937dcaf.zip
400270: [model] [editor] Provide EMF Edit Support for Review Editor
•Add better text for items, other minor improvements. Change-Id: I309be71f0c94b4c914e812aca42baa7018689a8e Task-Url: https://bugs.eclipse.org/bugs/show_bug.cgi?id=400270
Diffstat (limited to 'org.eclipse.mylyn.reviews.edit')
-rw-r--r--org.eclipse.mylyn.reviews.edit/src/org/eclipse/mylyn/reviews/edit/provider/ApprovalTypeItemProvider.java8
-rw-r--r--org.eclipse.mylyn.reviews.edit/src/org/eclipse/mylyn/reviews/edit/provider/ApprovalValueMapItemProvider.java10
-rw-r--r--org.eclipse.mylyn.reviews.edit/src/org/eclipse/mylyn/reviews/edit/provider/FileItemItemProvider.java8
-rw-r--r--org.eclipse.mylyn.reviews.edit/src/org/eclipse/mylyn/reviews/edit/provider/FileVersionItemProvider.java10
-rw-r--r--org.eclipse.mylyn.reviews.edit/src/org/eclipse/mylyn/reviews/edit/provider/ReviewItemProvider.java36
-rw-r--r--org.eclipse.mylyn.reviews.edit/src/org/eclipse/mylyn/reviews/edit/provider/ReviewRequirementsMapItemProvider.java21
-rw-r--r--org.eclipse.mylyn.reviews.edit/src/org/eclipse/mylyn/reviews/edit/provider/UserApprovalsMapItemProvider.java23
-rw-r--r--org.eclipse.mylyn.reviews.edit/src/org/eclipse/mylyn/reviews/edit/provider/UserItemProvider.java10
8 files changed, 66 insertions, 60 deletions
diff --git a/org.eclipse.mylyn.reviews.edit/src/org/eclipse/mylyn/reviews/edit/provider/ApprovalTypeItemProvider.java b/org.eclipse.mylyn.reviews.edit/src/org/eclipse/mylyn/reviews/edit/provider/ApprovalTypeItemProvider.java
index 4fbcdc50..06433f78 100644
--- a/org.eclipse.mylyn.reviews.edit/src/org/eclipse/mylyn/reviews/edit/provider/ApprovalTypeItemProvider.java
+++ b/org.eclipse.mylyn.reviews.edit/src/org/eclipse/mylyn/reviews/edit/provider/ApprovalTypeItemProvider.java
@@ -15,9 +15,7 @@ import java.util.List;
import org.eclipse.emf.common.notify.AdapterFactory;
import org.eclipse.emf.common.notify.Notification;
-
import org.eclipse.emf.common.util.ResourceLocator;
-
import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
import org.eclipse.emf.edit.provider.IItemLabelProvider;
@@ -28,9 +26,7 @@ import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
import org.eclipse.emf.edit.provider.ItemPropertyDescriptor;
import org.eclipse.emf.edit.provider.ItemProviderAdapter;
import org.eclipse.emf.edit.provider.ViewerNotification;
-
import org.eclipse.mylyn.reviews.core.model.IApprovalType;
-
import org.eclipse.mylyn.reviews.internal.core.model.ReviewsPackage;
/**
@@ -110,13 +106,13 @@ public class ApprovalTypeItemProvider extends ItemProviderAdapter implements IEd
/**
* This returns the label text for the adapted class. <!-- begin-user-doc --> <!-- end-user-doc -->
*
- * @generated
+ * @generated NOT
*/
@Override
public String getText(Object object) {
String label = ((IApprovalType) object).getName();
return label == null || label.length() == 0 ? getString("_UI_ApprovalType_type") : //$NON-NLS-1$
- getString("_UI_ApprovalType_type") + " " + label; //$NON-NLS-1$ //$NON-NLS-2$
+ label;
}
/**
diff --git a/org.eclipse.mylyn.reviews.edit/src/org/eclipse/mylyn/reviews/edit/provider/ApprovalValueMapItemProvider.java b/org.eclipse.mylyn.reviews.edit/src/org/eclipse/mylyn/reviews/edit/provider/ApprovalValueMapItemProvider.java
index fa47cc0f..bfc37de6 100644
--- a/org.eclipse.mylyn.reviews.edit/src/org/eclipse/mylyn/reviews/edit/provider/ApprovalValueMapItemProvider.java
+++ b/org.eclipse.mylyn.reviews.edit/src/org/eclipse/mylyn/reviews/edit/provider/ApprovalValueMapItemProvider.java
@@ -16,9 +16,7 @@ import java.util.Map;
import org.eclipse.emf.common.notify.AdapterFactory;
import org.eclipse.emf.common.notify.Notification;
-
import org.eclipse.emf.common.util.ResourceLocator;
-
import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
import org.eclipse.emf.edit.provider.IItemLabelProvider;
@@ -29,7 +27,7 @@ import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
import org.eclipse.emf.edit.provider.ItemPropertyDescriptor;
import org.eclipse.emf.edit.provider.ItemProviderAdapter;
import org.eclipse.emf.edit.provider.ViewerNotification;
-
+import org.eclipse.mylyn.reviews.internal.core.model.ApprovalType;
import org.eclipse.mylyn.reviews.internal.core.model.ReviewsPackage;
/**
@@ -109,12 +107,12 @@ public class ApprovalValueMapItemProvider extends ItemProviderAdapter implements
/**
* This returns the label text for the adapted class. <!-- begin-user-doc --> <!-- end-user-doc -->
*
- * @generated
+ * @generated NOT
*/
@Override
public String getText(Object object) {
- Map.Entry<?, ?> approvalValueMap = (Map.Entry<?, ?>) object;
- return "" + approvalValueMap.getKey() + " -> " + approvalValueMap.getValue(); //$NON-NLS-1$ //$NON-NLS-2$
+ Map.Entry<ApprovalType, Integer> approvalValueMap = (Map.Entry<ApprovalType, Integer>) object;
+ return "" + approvalValueMap.getKey().getName() + " -> " + approvalValueMap.getValue(); //$NON-NLS-1$ //$NON-NLS-2$
}
/**
diff --git a/org.eclipse.mylyn.reviews.edit/src/org/eclipse/mylyn/reviews/edit/provider/FileItemItemProvider.java b/org.eclipse.mylyn.reviews.edit/src/org/eclipse/mylyn/reviews/edit/provider/FileItemItemProvider.java
index c3ae15d8..9cad4568 100644
--- a/org.eclipse.mylyn.reviews.edit/src/org/eclipse/mylyn/reviews/edit/provider/FileItemItemProvider.java
+++ b/org.eclipse.mylyn.reviews.edit/src/org/eclipse/mylyn/reviews/edit/provider/FileItemItemProvider.java
@@ -15,7 +15,7 @@ import java.util.List;
import org.eclipse.emf.common.notify.AdapterFactory;
import org.eclipse.emf.common.notify.Notification;
-
+import org.eclipse.emf.ecore.EStructuralFeature;
import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
import org.eclipse.emf.edit.provider.IItemLabelProvider;
@@ -23,9 +23,7 @@ import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
import org.eclipse.emf.edit.provider.IItemPropertySource;
import org.eclipse.emf.edit.provider.IStructuredItemContentProvider;
import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
-
import org.eclipse.mylyn.reviews.core.model.IFileItem;
-
import org.eclipse.mylyn.reviews.internal.core.model.ReviewsPackage;
/**
@@ -100,13 +98,13 @@ public class FileItemItemProvider extends ReviewItemItemProvider implements IEdi
/**
* This returns the label text for the adapted class. <!-- begin-user-doc --> <!-- end-user-doc -->
*
- * @generated
+ * @generated NOT
*/
@Override
public String getText(Object object) {
String label = ((IFileItem) object).getName();
return label == null || label.length() == 0 ? getString("_UI_FileItem_type") : //$NON-NLS-1$
- getString("_UI_FileItem_type") + " " + label; //$NON-NLS-1$ //$NON-NLS-2$
+ label;
}
/**
diff --git a/org.eclipse.mylyn.reviews.edit/src/org/eclipse/mylyn/reviews/edit/provider/FileVersionItemProvider.java b/org.eclipse.mylyn.reviews.edit/src/org/eclipse/mylyn/reviews/edit/provider/FileVersionItemProvider.java
index 84b3caa6..a834153b 100644
--- a/org.eclipse.mylyn.reviews.edit/src/org/eclipse/mylyn/reviews/edit/provider/FileVersionItemProvider.java
+++ b/org.eclipse.mylyn.reviews.edit/src/org/eclipse/mylyn/reviews/edit/provider/FileVersionItemProvider.java
@@ -15,7 +15,6 @@ import java.util.List;
import org.eclipse.emf.common.notify.AdapterFactory;
import org.eclipse.emf.common.notify.Notification;
-
import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
import org.eclipse.emf.edit.provider.IItemLabelProvider;
@@ -25,9 +24,7 @@ import org.eclipse.emf.edit.provider.IStructuredItemContentProvider;
import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
import org.eclipse.emf.edit.provider.ItemPropertyDescriptor;
import org.eclipse.emf.edit.provider.ViewerNotification;
-
import org.eclipse.mylyn.reviews.core.model.IFileVersion;
-
import org.eclipse.mylyn.reviews.internal.core.model.ReviewsPackage;
/**
@@ -156,13 +153,14 @@ public class FileVersionItemProvider extends ReviewItemItemProvider implements I
/**
* This returns the label text for the adapted class. <!-- begin-user-doc --> <!-- end-user-doc -->
*
- * @generated
+ * @generated NOT
*/
@Override
public String getText(Object object) {
- String label = ((IFileVersion) object).getName();
+ IFileVersion version = (IFileVersion) object;
+ String label = version.getId();
return label == null || label.length() == 0 ? getString("_UI_FileVersion_type") : //$NON-NLS-1$
- getString("_UI_FileVersion_type") + " " + label; //$NON-NLS-1$ //$NON-NLS-2$
+ label;
}
/**
diff --git a/org.eclipse.mylyn.reviews.edit/src/org/eclipse/mylyn/reviews/edit/provider/ReviewItemProvider.java b/org.eclipse.mylyn.reviews.edit/src/org/eclipse/mylyn/reviews/edit/provider/ReviewItemProvider.java
index c88ec921..edd0b5ee 100644
--- a/org.eclipse.mylyn.reviews.edit/src/org/eclipse/mylyn/reviews/edit/provider/ReviewItemProvider.java
+++ b/org.eclipse.mylyn.reviews.edit/src/org/eclipse/mylyn/reviews/edit/provider/ReviewItemProvider.java
@@ -99,21 +99,6 @@ public class ReviewItemProvider extends CommentContainerItemProvider implements
}
/**
- * This adds a property descriptor for the Id feature. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- protected void addIdPropertyDescriptor(Object object) {
- itemPropertyDescriptors.add(createItemPropertyDescriptor(
- ((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(),
- getResourceLocator(),
- getString("_UI_Change_id_feature"), //$NON-NLS-1$
- getString("_UI_PropertyDescriptor_description", "_UI_Change_id_feature", "_UI_Change_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- ReviewsPackage.Literals.CHANGE__ID, true, false, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
- null, null));
- }
-
- /**
* This adds a property descriptor for the Key feature. <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
@@ -172,6 +157,21 @@ public class ReviewItemProvider extends CommentContainerItemProvider implements
}
/**
+ * This adds a property descriptor for the Id feature. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected void addIdPropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add(createItemPropertyDescriptor(
+ ((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(),
+ getResourceLocator(),
+ getString("_UI_Change_id_feature"), //$NON-NLS-1$
+ getString("_UI_PropertyDescriptor_description", "_UI_Change_id_feature", "_UI_Change_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ ReviewsPackage.Literals.CHANGE__ID, true, false, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
+ null, null));
+ }
+
+ /**
* This specifies how to implement {@link #getChildren} and is used to deduce an appropriate feature for an
* {@link org.eclipse.emf.edit.command.AddCommand}, {@link org.eclipse.emf.edit.command.RemoveCommand} or
* {@link org.eclipse.emf.edit.command.MoveCommand} in {@link #createCommand}. <!-- begin-user-doc --> <!--
@@ -219,13 +219,13 @@ public class ReviewItemProvider extends CommentContainerItemProvider implements
/**
* This returns the label text for the adapted class. <!-- begin-user-doc --> <!-- end-user-doc -->
*
- * @generated
+ * @generated NOT
*/
@Override
public String getText(Object object) {
- String label = ((IReview) object).getId();
+ String label = ((IReview) object).getId() + " / " + ((IReview) object).getMessage();
return label == null || label.length() == 0 ? getString("_UI_Review_type") : //$NON-NLS-1$
- getString("_UI_Review_type") + " " + label; //$NON-NLS-1$ //$NON-NLS-2$
+ label;
}
/**
diff --git a/org.eclipse.mylyn.reviews.edit/src/org/eclipse/mylyn/reviews/edit/provider/ReviewRequirementsMapItemProvider.java b/org.eclipse.mylyn.reviews.edit/src/org/eclipse/mylyn/reviews/edit/provider/ReviewRequirementsMapItemProvider.java
index 907fca29..3d0172f7 100644
--- a/org.eclipse.mylyn.reviews.edit/src/org/eclipse/mylyn/reviews/edit/provider/ReviewRequirementsMapItemProvider.java
+++ b/org.eclipse.mylyn.reviews.edit/src/org/eclipse/mylyn/reviews/edit/provider/ReviewRequirementsMapItemProvider.java
@@ -16,9 +16,8 @@ import java.util.Map;
import org.eclipse.emf.common.notify.AdapterFactory;
import org.eclipse.emf.common.notify.Notification;
-
import org.eclipse.emf.common.util.ResourceLocator;
-
+import org.eclipse.emf.ecore.EStructuralFeature;
import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
import org.eclipse.emf.edit.provider.IItemLabelProvider;
@@ -27,7 +26,11 @@ import org.eclipse.emf.edit.provider.IItemPropertySource;
import org.eclipse.emf.edit.provider.IStructuredItemContentProvider;
import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
import org.eclipse.emf.edit.provider.ItemProviderAdapter;
-
+import org.eclipse.emf.edit.provider.ViewerNotification;
+import org.eclipse.mylyn.reviews.core.model.IApprovalType;
+import org.eclipse.mylyn.reviews.core.model.IRequirementEntry;
+import org.eclipse.mylyn.reviews.core.model.IReviewsFactory;
+import org.eclipse.mylyn.reviews.core.model.IUser;
import org.eclipse.mylyn.reviews.internal.core.model.ReviewsPackage;
/**
@@ -106,12 +109,18 @@ public class ReviewRequirementsMapItemProvider extends ItemProviderAdapter imple
/**
* This returns the label text for the adapted class. <!-- begin-user-doc --> <!-- end-user-doc -->
*
- * @generated
+ * @generated NOT
*/
@Override
public String getText(Object object) {
- Map.Entry<?, ?> reviewRequirementsMap = (Map.Entry<?, ?>) object;
- return "" + reviewRequirementsMap.getKey() + " -> " + reviewRequirementsMap.getValue(); //$NON-NLS-1$ //$NON-NLS-2$
+ Map.Entry<IApprovalType, IRequirementEntry> reviewRequirementsMap = (Map.Entry<IApprovalType, IRequirementEntry>) object;
+ String text = "";
+ IUser user = reviewRequirementsMap.getValue().getBy();
+ if (user != null) {
+ text += user.getDisplayName();
+ }
+ return text
+ + ": " + reviewRequirementsMap.getKey().getName() + " " + reviewRequirementsMap.getValue().getStatus().getName(); //$NON-NLS-1$ //$NON-NLS-2$
}
/**
diff --git a/org.eclipse.mylyn.reviews.edit/src/org/eclipse/mylyn/reviews/edit/provider/UserApprovalsMapItemProvider.java b/org.eclipse.mylyn.reviews.edit/src/org/eclipse/mylyn/reviews/edit/provider/UserApprovalsMapItemProvider.java
index fda7c210..e60b50e0 100644
--- a/org.eclipse.mylyn.reviews.edit/src/org/eclipse/mylyn/reviews/edit/provider/UserApprovalsMapItemProvider.java
+++ b/org.eclipse.mylyn.reviews.edit/src/org/eclipse/mylyn/reviews/edit/provider/UserApprovalsMapItemProvider.java
@@ -13,12 +13,12 @@ package org.eclipse.mylyn.reviews.edit.provider;
import java.util.Collection;
import java.util.List;
import java.util.Map;
+import java.util.Map.Entry;
import org.eclipse.emf.common.notify.AdapterFactory;
import org.eclipse.emf.common.notify.Notification;
-
import org.eclipse.emf.common.util.ResourceLocator;
-
+import org.eclipse.emf.ecore.EStructuralFeature;
import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
import org.eclipse.emf.edit.provider.IItemLabelProvider;
@@ -27,7 +27,11 @@ import org.eclipse.emf.edit.provider.IItemPropertySource;
import org.eclipse.emf.edit.provider.IStructuredItemContentProvider;
import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
import org.eclipse.emf.edit.provider.ItemProviderAdapter;
-
+import org.eclipse.emf.edit.provider.ViewerNotification;
+import org.eclipse.mylyn.reviews.core.model.IApprovalType;
+import org.eclipse.mylyn.reviews.core.model.IReviewerEntry;
+import org.eclipse.mylyn.reviews.core.model.IReviewsFactory;
+import org.eclipse.mylyn.reviews.core.model.IUser;
import org.eclipse.mylyn.reviews.internal.core.model.ReviewsPackage;
/**
@@ -106,12 +110,19 @@ public class UserApprovalsMapItemProvider extends ItemProviderAdapter implements
/**
* This returns the label text for the adapted class. <!-- begin-user-doc --> <!-- end-user-doc -->
*
- * @generated
+ * @generated NOT
*/
@Override
public String getText(Object object) {
- Map.Entry<?, ?> userApprovalsMap = (Map.Entry<?, ?>) object;
- return "" + userApprovalsMap.getKey() + " -> " + userApprovalsMap.getValue(); //$NON-NLS-1$ //$NON-NLS-2$
+ Map.Entry<IUser, IReviewerEntry> userApprovalsMap = (Map.Entry<IUser, IReviewerEntry>) object;
+ Map<IApprovalType, Integer> approvals = userApprovalsMap.getValue().getApprovals();
+ String approvalDescs = "";
+ int i = 0;
+ for (Entry<IApprovalType, Integer> approval : approvals.entrySet()) {
+ approvalDescs += approval.getKey().getName() + ": " + approval.getValue();
+ approvalDescs += (i++ > 0 ? ", " : "");
+ }
+ return "" + userApprovalsMap.getKey().getDisplayName() + " -> " + approvalDescs; //$NON-NLS-1$ //$NON-NLS-2$
}
/**
diff --git a/org.eclipse.mylyn.reviews.edit/src/org/eclipse/mylyn/reviews/edit/provider/UserItemProvider.java b/org.eclipse.mylyn.reviews.edit/src/org/eclipse/mylyn/reviews/edit/provider/UserItemProvider.java
index 94a893ae..1c6dc5fa 100644
--- a/org.eclipse.mylyn.reviews.edit/src/org/eclipse/mylyn/reviews/edit/provider/UserItemProvider.java
+++ b/org.eclipse.mylyn.reviews.edit/src/org/eclipse/mylyn/reviews/edit/provider/UserItemProvider.java
@@ -15,9 +15,7 @@ import java.util.List;
import org.eclipse.emf.common.notify.AdapterFactory;
import org.eclipse.emf.common.notify.Notification;
-
import org.eclipse.emf.common.util.ResourceLocator;
-
import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
import org.eclipse.emf.edit.provider.IItemLabelProvider;
@@ -28,9 +26,7 @@ import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
import org.eclipse.emf.edit.provider.ItemPropertyDescriptor;
import org.eclipse.emf.edit.provider.ItemProviderAdapter;
import org.eclipse.emf.edit.provider.ViewerNotification;
-
import org.eclipse.mylyn.reviews.core.model.IUser;
-
import org.eclipse.mylyn.reviews.internal.core.model.ReviewsPackage;
/**
@@ -125,13 +121,13 @@ public class UserItemProvider extends ItemProviderAdapter implements IEditingDom
/**
* This returns the label text for the adapted class. <!-- begin-user-doc --> <!-- end-user-doc -->
*
- * @generated
+ * @generated NOT
*/
@Override
public String getText(Object object) {
- String label = ((IUser) object).getId();
+ String label = ((IUser) object).getDisplayName();
return label == null || label.length() == 0 ? getString("_UI_User_type") : //$NON-NLS-1$
- getString("_UI_User_type") + " " + label; //$NON-NLS-1$ //$NON-NLS-2$
+ label;
}
/**

Back to the top