Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorspingel2010-07-02 18:40:41 +0000
committerspingel2010-07-02 18:40:41 +0000
commitdb9de8db7fb54bccc235858236adfcca554fb9ec (patch)
tree9e41b7f2688a19373de1b6234b43a8a240cc7817
parent948c5821b2c4993900cc9f9ce5bd86c0919a4597 (diff)
downloadorg.eclipse.mylyn.tasks-db9de8db7fb54bccc235858236adfcca554fb9ec.tar.gz
org.eclipse.mylyn.tasks-db9de8db7fb54bccc235858236adfcca554fb9ec.tar.xz
org.eclipse.mylyn.tasks-db9de8db7fb54bccc235858236adfcca554fb9ec.zip
NEW - bug 318505: [patch] Display author icons in attachment section of task editor
https://bugs.eclipse.org/bugs/show_bug.cgi?id=318505
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/AttachmentTableLabelProvider.java22
1 files changed, 21 insertions, 1 deletions
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/AttachmentTableLabelProvider.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/AttachmentTableLabelProvider.java
index 141996ebb..04bf7d107 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/AttachmentTableLabelProvider.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/AttachmentTableLabelProvider.java
@@ -8,6 +8,7 @@
* Contributors:
* Tasktop Technologies - initial API and implementation
* Frank Becker - indicate deprecated attachments, bug 215549
+ * Perforce - fixes for bug 318505
*******************************************************************************/
package org.eclipse.mylyn.internal.tasks.ui.editors;
@@ -18,7 +19,9 @@ import org.eclipse.jface.viewers.ViewerCell;
import org.eclipse.mylyn.internal.provisional.commons.ui.CommonImages;
import org.eclipse.mylyn.internal.provisional.commons.ui.CommonThemes;
import org.eclipse.mylyn.internal.tasks.ui.util.AttachmentUtil;
+import org.eclipse.mylyn.tasks.core.IRepositoryPerson;
import org.eclipse.mylyn.tasks.core.ITaskAttachment;
+import org.eclipse.mylyn.tasks.core.TaskRepository;
import org.eclipse.mylyn.tasks.core.data.TaskDataModel;
import org.eclipse.mylyn.tasks.ui.TasksUiImages;
import org.eclipse.mylyn.tasks.ui.editors.AttributeEditorToolkit;
@@ -73,11 +76,27 @@ public class AttachmentTableLabelProvider extends ColumnLabelProvider {
}
return WorkbenchImages.getImage(ISharedImages.IMG_OBJ_FILE);
}
- } else {
+ } else if (columnIndex == 3) {
+ return getAuthorImage(attachment.getAuthor(), attachment.getTaskRepository());
}
return null;
}
+ /**
+ * Get author image for a specified repository person and task repository
+ *
+ * @param person
+ * @param repository
+ * @return author image
+ */
+ protected Image getAuthorImage(IRepositoryPerson person, TaskRepository repository) {
+ if (repository != null && person != null && person.getPersonId().equals(repository.getUserName())) {
+ return CommonImages.getImage(CommonImages.PERSON_ME);
+ } else {
+ return CommonImages.getImage(CommonImages.PERSON);
+ }
+ }
+
public String getColumnText(Object element, int columnIndex) {
ITaskAttachment attachment = (ITaskAttachment) element;
switch (columnIndex) {
@@ -192,4 +211,5 @@ public class AttachmentTableLabelProvider extends ColumnLabelProvider {
return null;
}
}
+
} \ No newline at end of file

Back to the top