Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorspingel2011-05-17 20:50:34 +0000
committerspingel2011-05-17 20:50:34 +0000
commit77bf6d0fb57540117cb8321e7a6e4c8350347a9a (patch)
tree5ba3a8433c1299c3a8881bab14f812671c7517ba /org.eclipse.mylyn.tasks.ui
parentd533df8a379abd520c7e6527fe636d519eab0caf (diff)
downloadorg.eclipse.mylyn.tasks-77bf6d0fb57540117cb8321e7a6e4c8350347a9a.tar.gz
org.eclipse.mylyn.tasks-77bf6d0fb57540117cb8321e7a6e4c8350347a9a.tar.xz
org.eclipse.mylyn.tasks-77bf6d0fb57540117cb8321e7a6e4c8350347a9a.zip
NEW - bug 345826: show Gravatar images in task editor
https://bugs.eclipse.org/bugs/show_bug.cgi?id=345826
Diffstat (limited to 'org.eclipse.mylyn.tasks.ui')
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/UserAttributeEditor.java7
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/util/TasksUiInternal.java14
2 files changed, 16 insertions, 5 deletions
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/UserAttributeEditor.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/UserAttributeEditor.java
index b8842f428..0655aa346 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/UserAttributeEditor.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/UserAttributeEditor.java
@@ -23,6 +23,7 @@ import org.eclipse.mylyn.commons.identity.IProfileImage;
import org.eclipse.mylyn.commons.identity.spi.ProfileImage;
import org.eclipse.mylyn.internal.provisional.commons.ui.CommonImages;
import org.eclipse.mylyn.internal.tasks.ui.TasksUiPlugin;
+import org.eclipse.mylyn.internal.tasks.ui.util.TasksUiInternal;
import org.eclipse.mylyn.tasks.core.IRepositoryPerson;
import org.eclipse.mylyn.tasks.core.data.TaskAttribute;
import org.eclipse.mylyn.tasks.core.data.TaskDataModel;
@@ -124,19 +125,15 @@ public class UserAttributeEditor extends AbstractAttributeEditor {
if (identity != null) {
identity.removePropertyChangeListener(imageListener);
}
- Account account;
if (TaskAttribute.TYPE_PERSON.equals(getTaskAttribute().getMetaData().getType())) {
IRepositoryPerson person = getTaskAttribute().getTaskData()
.getAttributeMapper()
.getRepositoryPerson(getTaskAttribute());
- account = Account.id(person.getPersonId()).name(person.getName());
label.setToolTipText(getLabel() + " " + person.toString()); //$NON-NLS-1$
} else {
- account = Account.id(getTaskAttribute().getValue());
label.setToolTipText(getDescription());
}
- account = account.kind(getModel().getTaskRepository().getConnectorKind()).url(
- getModel().getTaskRepository().getRepositoryUrl());
+ Account account = TasksUiInternal.getAccount(getTaskAttribute());
identity = TasksUiPlugin.getDefault().getIdentityModel().getIdentity(account);
identity.addPropertyChangeListener(imageListener);
Future<IProfileImage> result = identity.requestImage(IMAGE_SIZE, IMAGE_SIZE);
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/util/TasksUiInternal.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/util/TasksUiInternal.java
index 44f3ade84..3954cfd76 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/util/TasksUiInternal.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/util/TasksUiInternal.java
@@ -60,6 +60,7 @@ import org.eclipse.jface.wizard.IWizard;
import org.eclipse.jface.wizard.WizardDialog;
import org.eclipse.mylyn.commons.core.CoreUtil;
import org.eclipse.mylyn.commons.core.StatusHandler;
+import org.eclipse.mylyn.commons.identity.Account;
import org.eclipse.mylyn.internal.monitor.ui.MonitorUiPlugin;
import org.eclipse.mylyn.internal.provisional.commons.ui.CommonImages;
import org.eclipse.mylyn.internal.provisional.commons.ui.CommonUiUtil;
@@ -91,6 +92,7 @@ import org.eclipse.mylyn.internal.tasks.ui.wizards.TaskAttachmentWizard;
import org.eclipse.mylyn.tasks.core.AbstractRepositoryConnector;
import org.eclipse.mylyn.tasks.core.IRepositoryElement;
import org.eclipse.mylyn.tasks.core.IRepositoryManager;
+import org.eclipse.mylyn.tasks.core.IRepositoryPerson;
import org.eclipse.mylyn.tasks.core.IRepositoryQuery;
import org.eclipse.mylyn.tasks.core.ITask;
import org.eclipse.mylyn.tasks.core.ITask.PriorityLevel;
@@ -1425,4 +1427,16 @@ public class TasksUiInternal {
return connector.canGetTaskHistory(repository, task);
}
+ public static Account getAccount(TaskAttribute attribute) {
+ Account account;
+ if (TaskAttribute.TYPE_PERSON.equals(attribute.getMetaData().getType())) {
+ IRepositoryPerson person = attribute.getTaskData().getAttributeMapper().getRepositoryPerson(attribute);
+ account = Account.id(person.getPersonId()).name(person.getName());
+ } else {
+ account = Account.id(attribute.getValue());
+ }
+ TaskRepository repository = attribute.getTaskData().getAttributeMapper().getTaskRepository();
+ return account.kind(repository.getConnectorKind()).url(repository.getRepositoryUrl());
+ }
+
}

Back to the top