Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Sawicki2011-07-15 20:48:44 +0000
committerKevin Sawicki2011-07-15 20:48:44 +0000
commitf0c73bb6d96ec3501307b8d4505ca872d5abe015 (patch)
tree5880bc50c692e550e63039b41845e7839af2ec26 /org.eclipse.mylyn.github.ui
parentc27267e0075bc3e818e6f5116fc4f4c039ba735e (diff)
downloadegit-github-f0c73bb6d96ec3501307b8d4505ca872d5abe015.tar.gz
egit-github-f0c73bb6d96ec3501307b8d4505ca872d5abe015.tar.xz
egit-github-f0c73bb6d96ec3501307b8d4505ca872d5abe015.zip
Remove code duplicated in Gist and Issue packages.
Add base classes for attributes, connectors, and data handlers. These new base classes will also be used by the forthcoming Pull Request connector. Change-Id: I1812fede3752bb85ec65cdedcba8ad078767455b Signed-off-by: Kevin Sawicki <kevin@github.com>
Diffstat (limited to 'org.eclipse.mylyn.github.ui')
-rw-r--r--org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/GitHubUi.java9
-rw-r--r--org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/TaskDataHandler.java85
-rw-r--r--org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/gist/CloneGistHandler.java64
-rw-r--r--org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/gist/GistTaskEditorPage.java19
-rw-r--r--org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/issue/IssueAttributePart.java14
-rw-r--r--org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/issue/IssueConnectorUi.java44
-rw-r--r--org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/issue/IssueRepositorySettingsPage.java2
-rw-r--r--org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/issue/IssueSummaryPart.java8
-rw-r--r--org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/issue/IssueTaskEditorPage.java7
9 files changed, 139 insertions, 113 deletions
diff --git a/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/GitHubUi.java b/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/GitHubUi.java
index 09070924..4d5296be 100644
--- a/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/GitHubUi.java
+++ b/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/GitHubUi.java
@@ -141,7 +141,7 @@ public class GitHubUi extends AbstractUIPlugin {
* @return avatar store
*/
public AvatarStore getStore() {
- return this.store;
+ return store;
}
/**
@@ -165,7 +165,7 @@ public class GitHubUi extends AbstractUIPlugin {
ObjectInputStream stream = null;
try {
stream = new ObjectInputStream(new FileInputStream(file));
- this.store = (AvatarStore) stream.readObject();
+ store = (AvatarStore) stream.readObject();
} catch (IOException e) {
logError("Error reading avatar store", e); //$NON-NLS-1$
} catch (ClassNotFoundException cnfe) {
@@ -179,8 +179,8 @@ public class GitHubUi extends AbstractUIPlugin {
}
}
}
- if (this.store == null)
- this.store = new AvatarStore();
+ if (store == null)
+ store = new AvatarStore();
}
/**
@@ -217,5 +217,4 @@ public class GitHubUi extends AbstractUIPlugin {
INSTANCE = null;
saveAvatars(context);
}
-
}
diff --git a/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/TaskDataHandler.java b/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/TaskDataHandler.java
new file mode 100644
index 00000000..e9f37ccb
--- /dev/null
+++ b/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/TaskDataHandler.java
@@ -0,0 +1,85 @@
+/******************************************************************************
+ * Copyright (c) 2011 GitHub Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Kevin Sawicki (GitHub Inc.) - initial API and implementation
+ *****************************************************************************/
+package org.eclipse.mylyn.internal.github.ui;
+
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.mylyn.tasks.core.ITask;
+import org.eclipse.mylyn.tasks.core.data.TaskData;
+import org.eclipse.mylyn.tasks.ui.TasksUi;
+import org.eclipse.ui.IWorkbenchSite;
+import org.eclipse.ui.handlers.HandlerUtil;
+import org.eclipse.ui.progress.IWorkbenchSiteProgressService;
+
+/**
+ * Base handler for working with a {@link TaskData} selection
+ */
+public abstract class TaskDataHandler extends AbstractHandler {
+
+ /**
+ * Get task data from event
+ *
+ * @param event
+ * @return task data
+ */
+ protected TaskData getTaskData(ExecutionEvent event) {
+ ISelection selection = HandlerUtil.getCurrentSelection(event);
+ if (selection == null || selection.isEmpty())
+ selection = HandlerUtil.getActiveMenuSelection(event);
+
+ if (selection instanceof IStructuredSelection && !selection.isEmpty()) {
+ Object first = ((IStructuredSelection) selection).getFirstElement();
+ if (first instanceof TaskData)
+ return (TaskData) first;
+ else if (first instanceof ITask)
+ try {
+ return TasksUi.getTaskDataManager().getTaskData(
+ (ITask) first);
+ } catch (CoreException e) {
+ return null;
+ }
+ }
+ return null;
+ }
+
+ /**
+ * Should this handler be enabled for the given task data?
+ *
+ * Always returns true by default, sub-classes should override
+ *
+ * @param data
+ * @return true is enabled, false otherwise
+ */
+ protected boolean isEnabled(TaskData data) {
+ return true;
+ }
+
+ /**
+ * Schedule job
+ *
+ * @param job
+ * @param event
+ */
+ protected void schedule(Job job, ExecutionEvent event) {
+ IWorkbenchSite activeSite = HandlerUtil.getActiveSite(event);
+ IWorkbenchSiteProgressService service = (IWorkbenchSiteProgressService) activeSite
+ .getService(IWorkbenchSiteProgressService.class);
+ if (service != null)
+ service.schedule(job);
+ else
+ job.schedule();
+ }
+
+}
diff --git a/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/gist/CloneGistHandler.java b/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/gist/CloneGistHandler.java
index 7a6bfaa5..f7a6df42 100644
--- a/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/gist/CloneGistHandler.java
+++ b/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/gist/CloneGistHandler.java
@@ -14,13 +14,10 @@ import java.io.File;
import java.io.IOException;
import java.net.URISyntaxException;
import java.text.MessageFormat;
-import java.util.Collections;
-import org.eclipse.core.commands.AbstractHandler;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.core.commands.HandlerEvent;
-import org.eclipse.core.expressions.IEvaluationContext;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IProjectDescription;
import org.eclipse.core.resources.IResource;
@@ -40,8 +37,6 @@ import org.eclipse.egit.core.op.ConnectProviderOperation;
import org.eclipse.egit.ui.Activator;
import org.eclipse.egit.ui.UIPreferences;
import org.eclipse.jface.dialogs.ErrorDialog;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jgit.lib.Constants;
import org.eclipse.jgit.lib.Repository;
import org.eclipse.jgit.transport.URIish;
@@ -50,21 +45,19 @@ import org.eclipse.mylyn.commons.net.AuthenticationCredentials;
import org.eclipse.mylyn.commons.net.AuthenticationType;
import org.eclipse.mylyn.internal.github.core.gist.GistAttribute;
import org.eclipse.mylyn.internal.github.core.gist.GistConnector;
-import org.eclipse.mylyn.tasks.core.ITask;
+import org.eclipse.mylyn.internal.github.ui.TaskDataHandler;
import org.eclipse.mylyn.tasks.core.TaskRepository;
import org.eclipse.mylyn.tasks.core.data.TaskData;
import org.eclipse.mylyn.tasks.ui.TasksUi;
-import org.eclipse.ui.IWorkbenchSite;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.handlers.HandlerUtil;
-import org.eclipse.ui.progress.IWorkbenchSiteProgressService;
/**
* Clone Gist handler class.
*
* @author Kevin Sawicki (kevin@github.com)
*/
-public class CloneGistHandler extends AbstractHandler {
+public class CloneGistHandler extends TaskDataHandler {
/**
* Get gist name for task data used to create projects and Git repositories
@@ -89,25 +82,8 @@ public class CloneGistHandler extends AbstractHandler {
*/
public static final String ID = "org.eclipse.mylyn.github.ui.command.cloneGist"; //$NON-NLS-1$
- private IEvaluationContext context;
-
- @Override
- public void setEnabled(Object evaluationContext) {
- context = evaluationContext instanceof IEvaluationContext ? (IEvaluationContext) evaluationContext
- : null;
- }
-
@Override
- public boolean isEnabled() {
- if (!super.isEnabled())
- return false;
- if (context == null)
- return false;
- ExecutionEvent event = new ExecutionEvent(null, Collections.EMPTY_MAP,
- null, context);
- TaskData data = getTaskData(event);
- if (data == null)
- return false;
+ public boolean isEnabled(TaskData data) {
String id = getGistName(data);
return !getWorkspaceRoot().getProject(id).exists()
&& !getRepoUtil().getConfiguredRepositories().contains(id);
@@ -156,7 +132,8 @@ public class CloneGistHandler extends AbstractHandler {
private CloneOperation createCloneOperation(TaskData data, String name)
throws IOException, URISyntaxException {
String pullUrl = data.getRoot()
- .getAttribute(GistAttribute.CLONE_URL.getId()).getValue();
+ .getAttribute(GistAttribute.CLONE_URL.getMetadata().getId())
+ .getValue();
URIish uri = new URIish(pullUrl);
int timeout = Activator.getDefault().getPreferenceStore()
.getInt(UIPreferences.REMOTE_CONNECTION_TIMEOUT);
@@ -256,41 +233,12 @@ public class CloneGistHandler extends AbstractHandler {
}
/**
- * Get task data from event
- *
- * @param event
- * @return task data
- */
- protected TaskData getTaskData(ExecutionEvent event) {
- ISelection selection = HandlerUtil.getCurrentSelection(event);
- if (selection == null || selection.isEmpty())
- selection = HandlerUtil.getActiveMenuSelection(event);
-
- if (selection instanceof IStructuredSelection && !selection.isEmpty()) {
- Object first = ((IStructuredSelection) selection).getFirstElement();
- if (first instanceof TaskData)
- return (TaskData) first;
- else if (first instanceof ITask)
- try {
- return TasksUi.getTaskDataManager().getTaskData(
- (ITask) first);
- } catch (CoreException e) {
- return null;
- }
- }
- return null;
- }
-
- /**
* @see org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.ExecutionEvent)
*/
public Object execute(ExecutionEvent event) throws ExecutionException {
- IWorkbenchSite activeSite = HandlerUtil.getActiveSite(event);
- IWorkbenchSiteProgressService service = (IWorkbenchSiteProgressService) activeSite
- .getService(IWorkbenchSiteProgressService.class);
TaskData data = getTaskData(event);
if (data != null)
- service.schedule(createCloneJob(event, data));
+ schedule(createCloneJob(event, data), event);
return null;
}
}
diff --git a/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/gist/GistTaskEditorPage.java b/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/gist/GistTaskEditorPage.java
index ed22d510..a7cd49ed 100644
--- a/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/gist/GistTaskEditorPage.java
+++ b/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/gist/GistTaskEditorPage.java
@@ -13,21 +13,7 @@ package org.eclipse.mylyn.internal.github.ui.gist;
import java.util.Iterator;
import java.util.Set;
-import org.eclipse.core.commands.Command;
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.commands.NotEnabledException;
-import org.eclipse.core.commands.NotHandledException;
-import org.eclipse.core.commands.common.NotDefinedException;
-import org.eclipse.core.expressions.IEvaluationContext;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.egit.core.Activator;
-import org.eclipse.egit.github.core.Gist;
-import org.eclipse.egit.ui.UIIcons;
-import org.eclipse.jface.action.Action;
import org.eclipse.jface.action.IToolBarManager;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.mylyn.internal.github.core.gist.GistAttribute;
import org.eclipse.mylyn.internal.github.core.gist.GistConnector;
import org.eclipse.mylyn.internal.github.ui.issue.IssueSummaryPart;
@@ -38,10 +24,7 @@ import org.eclipse.mylyn.tasks.ui.editors.AbstractTaskEditorPart;
import org.eclipse.mylyn.tasks.ui.editors.TaskEditor;
import org.eclipse.mylyn.tasks.ui.editors.TaskEditorPartDescriptor;
import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.ISources;
-import org.eclipse.ui.commands.ICommandService;
import org.eclipse.ui.forms.widgets.FormToolkit;
-import org.eclipse.ui.handlers.IHandlerService;
import org.eclipse.ui.menus.CommandContributionItem;
import org.eclipse.ui.menus.CommandContributionItemParameter;
@@ -104,7 +87,7 @@ public class GistTaskEditorPage extends AbstractTaskEditorPage {
public AbstractTaskEditorPart createPart() {
return new IssueSummaryPart(GistAttribute.AUTHOR_GRAVATAR
- .getId(), null);
+ .getMetadata().getId(), null);
}
}.setPath(PATH_HEADER));
partDescriptors.add(new TaskEditorPartDescriptor(
diff --git a/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/issue/IssueAttributePart.java b/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/issue/IssueAttributePart.java
index e467b493..a7498e25 100644
--- a/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/issue/IssueAttributePart.java
+++ b/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/issue/IssueAttributePart.java
@@ -64,12 +64,12 @@ public class IssueAttributePart extends AbstractTaskEditorSection {
@Override
protected AbstractAttributeEditor createAttributeEditor(
TaskAttribute attribute) {
- if (IssueAttribute.LABELS.getId().equals(attribute.getId())) {
+ if (IssueAttribute.LABELS.getMetadata().getId()
+ .equals(attribute.getId()))
return new IssueLabelAttributeEditor(getModel(), attribute);
- } else if (IssueAttribute.MILESTONE.getId().equals(
- attribute.getId())) {
+ if (IssueAttribute.MILESTONE.getMetadata().getId()
+ .equals(attribute.getId()))
return super.createAttributeEditor(attribute);
- }
return null;
}
@@ -194,13 +194,13 @@ public class IssueAttributePart extends AbstractTaskEditorSection {
TaskAttribute root = getTaskData().getRoot();
List<TaskAttribute> attributes = new LinkedList<TaskAttribute>();
- TaskAttribute milestones = root
- .getAttribute(IssueAttribute.MILESTONE.getId());
+ TaskAttribute milestones = root.getAttribute(IssueAttribute.MILESTONE
+ .getMetadata().getId());
if (milestones != null)
attributes.add(milestones);
TaskAttribute labels = root.getAttribute(IssueAttribute.LABELS
- .getId());
+ .getMetadata().getId());
if (labels != null)
attributes.add(labels);
diff --git a/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/issue/IssueConnectorUi.java b/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/issue/IssueConnectorUi.java
index 8a346fed..cc5d9f0d 100644
--- a/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/issue/IssueConnectorUi.java
+++ b/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/issue/IssueConnectorUi.java
@@ -44,7 +44,8 @@ import org.eclipse.mylyn.tasks.ui.wizards.RepositoryQueryWizard;
*/
public class IssueConnectorUi extends AbstractRepositoryConnectorUi {
- private final Pattern issuePattern = Pattern.compile("(?:([a-zA-Z0-9_\\.-]+)(?:/([a-zA-Z0-9_\\.-]+))?)?\\#(\\d+)"); //$NON-NLS-1$
+ private final Pattern issuePattern = Pattern
+ .compile("(?:([a-zA-Z0-9_\\.-]+)(?:/([a-zA-Z0-9_\\.-]+))?)?\\#(\\d+)"); //$NON-NLS-1$
/**
* Get core repository connector
@@ -116,16 +117,18 @@ public class IssueConnectorUi extends AbstractRepositoryConnectorUi {
return wizard;
}
- public IHyperlink[] findHyperlinks(TaskRepository repository, String text, int index, int textOffset) {
+ public IHyperlink[] findHyperlinks(TaskRepository repository, String text,
+ int index, int textOffset) {
List<IHyperlink> hyperlinks = new ArrayList<IHyperlink>();
-
+
Matcher matcher = issuePattern.matcher(text);
while (matcher.find()) {
- if (index == -1 || (index >= matcher.start() && index <= matcher.end())) {
+ if (index == -1
+ || (index >= matcher.start() && index <= matcher.end())) {
String user = matcher.group(1);
String project = matcher.group(2);
String taskId = matcher.group(3);
-
+
if (project == null && user != null) {
// same project name, different user
String url = repository.getUrl();
@@ -133,24 +136,32 @@ public class IssueConnectorUi extends AbstractRepositoryConnectorUi {
if (repo != null)
project = repo.getName();
}
-
+
TaskRepository taskRepository = null;
- if (user == null && project == null) {
+ if (user == null && project == null) {
taskRepository = repository;
} else if (user != null && project != null) {
- String repositoryUrl = GitHub.createGitHubUrl(user,project);
- taskRepository = TasksUi.getRepositoryManager().getRepository(GitHub.CONNECTOR_KIND, repositoryUrl);
+ String repositoryUrl = GitHub
+ .createGitHubUrl(user, project);
+ taskRepository = TasksUi
+ .getRepositoryManager()
+ .getRepository(GitHub.CONNECTOR_KIND, repositoryUrl);
if (taskRepository == null) {
- repositoryUrl = GitHub.createGitHubUrlAlternate(user,project);
- taskRepository = TasksUi.getRepositoryManager().getRepository(GitHub.CONNECTOR_KIND, repositoryUrl);
+ repositoryUrl = GitHub.createGitHubUrlAlternate(user,
+ project);
+ taskRepository = TasksUi.getRepositoryManager()
+ .getRepository(GitHub.CONNECTOR_KIND,
+ repositoryUrl);
}
}
if (taskRepository != null) {
Region region = createRegion(textOffset, matcher);
- hyperlinks.add(new TaskHyperlink(region, repository, taskId));
+ hyperlinks
+ .add(new TaskHyperlink(region, repository, taskId));
} else if (user != null && project != null) {
Region region = createRegion(textOffset, matcher);
- String url = GitHub.createGitHubUrl(user, project)+"/issues/issue/"+taskId;
+ String url = GitHub.createGitHubUrl(user, project)
+ + "/issues/issue/" + taskId;
hyperlinks.add(new URLHyperlink(region, url));
}
}
@@ -159,7 +170,8 @@ public class IssueConnectorUi extends AbstractRepositoryConnectorUi {
}
private Region createRegion(int textOffset, Matcher matcher) {
- return new Region(matcher.start()+textOffset,matcher.end()-matcher.start());
+ return new Region(matcher.start() + textOffset, matcher.end()
+ - matcher.start());
}
/**
@@ -173,8 +185,8 @@ public class IssueConnectorUi extends AbstractRepositoryConnectorUi {
@Override
public String getTaskKindLabel(ITask task) {
- return task.getAttribute(IssueAttribute.PULL_REQUEST_DIFF.getId()) == null ? Messages.IssueConnectorUi_LabelIssueKind
+ return task.getAttribute(IssueAttribute.PULL_REQUEST_DIFF.getMetadata()
+ .getId()) == null ? Messages.IssueConnectorUi_LabelIssueKind
: Messages.IssueConnectorUi_LabelPullRequestKind;
}
-
}
diff --git a/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/issue/IssueRepositorySettingsPage.java b/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/issue/IssueRepositorySettingsPage.java
index efc61eab..755b6124 100644
--- a/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/issue/IssueRepositorySettingsPage.java
+++ b/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/issue/IssueRepositorySettingsPage.java
@@ -87,7 +87,7 @@ public class IssueRepositorySettingsPage extends AbstractRepositorySettingsPage
RepositoryId repo = GitHub.getRepository(url);
if (repo != null)
repositoryLabelEditor.setStringValue(repo.getOwner() + '/'
- + repo.getName());
+ + repo.getName() + " issues");
}
}
diff --git a/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/issue/IssueSummaryPart.java b/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/issue/IssueSummaryPart.java
index 4ef94e01..f07c1cd5 100644
--- a/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/issue/IssueSummaryPart.java
+++ b/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/issue/IssueSummaryPart.java
@@ -128,7 +128,7 @@ public class IssueSummaryPart extends AbstractTaskEditorPart {
}
private TaskAttribute getAttribute(IssueAttribute attribute) {
- return getAttribute(attribute.getId());
+ return getAttribute(attribute.getMetadata().getId());
}
private TaskAttribute getAttribute(String id) {
@@ -162,13 +162,13 @@ public class IssueSummaryPart extends AbstractTaskEditorPart {
layout.verticalSpacing = 3;
composite.setLayout(layout);
- TaskAttribute reporter = getAttribute(IssueAttribute.REPORTER);
+ TaskAttribute reporter = getAttribute(TaskAttribute.USER_REPORTER);
if (reporter != null) {
IRepositoryPerson person = getTaskData().getAttributeMapper()
.getRepositoryPerson(reporter);
- if (this.reporterAvatarId != null
+ if (reporterAvatarId != null
&& addAvatarPart(composite, toolkit,
- getAttribute(this.reporterAvatarId), person))
+ getAttribute(reporterAvatarId), person))
layout.numColumns++;
}
addSummaryText(composite, toolkit);
diff --git a/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/issue/IssueTaskEditorPage.java b/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/issue/IssueTaskEditorPage.java
index 0641a25b..e200e7f2 100644
--- a/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/issue/IssueTaskEditorPage.java
+++ b/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/issue/IssueTaskEditorPage.java
@@ -54,9 +54,9 @@ public class IssueTaskEditorPage extends AbstractTaskEditorPage {
partDescriptors.add(new TaskEditorPartDescriptor(ID_PART_SUMMARY) {
public AbstractTaskEditorPart createPart() {
- return new IssueSummaryPart(
- IssueAttribute.REPORTER_GRAVATAR.getId(),
- IssueAttribute.ASSIGNEE_GRAVATAR.getId());
+ return new IssueSummaryPart(IssueAttribute.REPORTER_GRAVATAR
+ .getMetadata().getId(),
+ IssueAttribute.ASSIGNEE_GRAVATAR.getMetadata().getId());
}
}.setPath(PATH_HEADER));
partDescriptors.add(new TaskEditorPartDescriptor(ID_PART_ATTRIBUTES) {
@@ -67,5 +67,4 @@ public class IssueTaskEditorPage extends AbstractTaskEditorPage {
}.setPath(PATH_ATTRIBUTES));
return partDescriptors;
}
-
}

Back to the top