diff options
author | relves | 2006-06-12 23:01:29 +0000 |
---|---|---|
committer | relves | 2006-06-12 23:01:29 +0000 |
commit | eff37b3871339dcc3f8373f422cf225982b8432c (patch) | |
tree | e1de4e738ff51d56435f3f0ec8bd079633f118e9 /org.eclipse.mylyn.tasks.ui | |
parent | 511a2b43b8e96fe718e274fdfb5e3d65240084fe (diff) | |
download | org.eclipse.mylyn.tasks-eff37b3871339dcc3f8373f422cf225982b8432c.tar.gz org.eclipse.mylyn.tasks-eff37b3871339dcc3f8373f422cf225982b8432c.tar.xz org.eclipse.mylyn.tasks-eff37b3871339dcc3f8373f422cf225982b8432c.zip |
Progress on: 146381: Open Corresponding Task from Sync view does not work
https://bugs.eclipse.org/bugs/show_bug.cgi?id=146381
Diffstat (limited to 'org.eclipse.mylyn.tasks.ui')
2 files changed, 56 insertions, 50 deletions
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasklist/ui/editors/AbstractRepositoryTaskEditor.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasklist/ui/editors/AbstractRepositoryTaskEditor.java index 73b4bf1ae..747d435b0 100644 --- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasklist/ui/editors/AbstractRepositoryTaskEditor.java +++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasklist/ui/editors/AbstractRepositoryTaskEditor.java @@ -510,7 +510,7 @@ public abstract class AbstractRepositoryTaskEditor extends EditorPart { toolkit.createLabel(headerInfoComposite, " Modified: ").setFont(TITLE_FONT); String lastModifiedDateString = ""; - if (getRepositoryTaskData().getLastModified(null) != null) { + if (getRepositoryTaskData().getLastModified(repository.getTimeZoneId()) != null) { lastModifiedDateString = simpleDateFormat.format(getRepositoryTaskData().getLastModified(repository.getTimeZoneId())); } toolkit.createText(headerInfoComposite, lastModifiedDateString, SWT.FLAT | SWT.READ_ONLY); diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasklist/ui/editors/ExistingBugEditorInput.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasklist/ui/editors/ExistingBugEditorInput.java index 35a296580..22d545a7f 100644 --- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasklist/ui/editors/ExistingBugEditorInput.java +++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasklist/ui/editors/ExistingBugEditorInput.java @@ -14,7 +14,6 @@ import java.io.IOException; import java.net.Proxy; import java.security.GeneralSecurityException; -import org.eclipse.mylar.internal.core.util.MylarStatusHandler; import org.eclipse.mylar.internal.tasklist.OfflineTaskManager; import org.eclipse.mylar.internal.tasklist.RepositoryTaskData; import org.eclipse.mylar.provisional.tasklist.AbstractRepositoryTask; @@ -34,9 +33,11 @@ public class ExistingBugEditorInput extends AbstractBugEditorInput { private TaskRepository repository; protected int bugId; - protected AbstractRepositoryTask repositoryTask; + + protected AbstractRepositoryTask repositoryTask = null; + protected RepositoryTaskData repositoryTaskData; - + // Called for new bug reports public ExistingBugEditorInput(TaskRepository repository, RepositoryTaskData bug) { this.repositoryTaskData = bug; @@ -48,21 +49,18 @@ public class ExistingBugEditorInput extends AbstractBugEditorInput { this.bugId = bugId; this.repository = repository; this.repositoryTaskData = getOfflineTaskData(repository, proxySettings, bugId); - - + String handle = AbstractRepositoryTask.getHandle(repository.getUrl(), bugId); ITask task = MylarTaskListPlugin.getTaskListManager().getTaskList().getTask(handle); - if(task != null && task instanceof AbstractRepositoryTask) { - this.repositoryTask = (AbstractRepositoryTask)task; - } else { - MylarStatusHandler.log("Could not locate repository task", this); + if (task != null && task instanceof AbstractRepositoryTask) { + this.repositoryTask = (AbstractRepositoryTask) task; } } public AbstractRepositoryTask getRepositoryTask() { return repositoryTask; } - + @Override public RepositoryTaskData getRepositoryTaskData() { return repositoryTaskData; @@ -83,45 +81,54 @@ public class ExistingBugEditorInput extends AbstractBugEditorInput { result = (RepositoryTaskData) bug; } } - } - + } + // If a suitable offline report was not found, get it from the server -// if(result == null) { -// try { -// result = BugzillaRepositoryUtil.getBug(repository.getUrl(), repository.getUserName(), repository.getPassword(), proxySettings, repository.getCharacterEncoding(), id); -// } catch (final LoginException e) { -// PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() { -// public void run() { -// MessageDialog.openError(Display.getDefault().getActiveShell(), "Report Download Failed", -// "Ensure proper repository configuration of " + repository.getUrl() + " in " -// + TaskRepositoriesView.NAME + "."); -// } -// }); -// } catch (final UnrecognizedBugzillaError e) { -// PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() { -// public void run() { -// WebBrowserDialog.openAcceptAgreement(null, "Report Download Failed", "Unrecognized response from " -// + repository.getUrl(), e.getMessage()); -// } -// }); -// } catch (final Exception e) { -// if (PlatformUI.getWorkbench() != null && !PlatformUI.getWorkbench().isClosing()) { -// PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() { -// public void run() { -// if (e instanceof FileNotFoundException) { -// MessageDialog.openError(PlatformUI.getWorkbench().getDisplay().getActiveShell(), "Report Download Failed", -// "Resource not found: " + e.getMessage()); -// -// } else { -// MessageDialog.openError(PlatformUI.getWorkbench().getDisplay().getActiveShell(), "Report Download Failed", -// "Report "+id+" did not download correctly from " + repository.getUrl()); -// -// } -// } -// }); -// } -// } -// } + // if(result == null) { + // try { + // result = BugzillaRepositoryUtil.getBug(repository.getUrl(), + // repository.getUserName(), repository.getPassword(), proxySettings, + // repository.getCharacterEncoding(), id); + // } catch (final LoginException e) { + // PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() { + // public void run() { + // MessageDialog.openError(Display.getDefault().getActiveShell(), + // "Report Download Failed", + // "Ensure proper repository configuration of " + repository.getUrl() + + // " in " + // + TaskRepositoriesView.NAME + "."); + // } + // }); + // } catch (final UnrecognizedBugzillaError e) { + // PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() { + // public void run() { + // WebBrowserDialog.openAcceptAgreement(null, "Report Download Failed", + // "Unrecognized response from " + // + repository.getUrl(), e.getMessage()); + // } + // }); + // } catch (final Exception e) { + // if (PlatformUI.getWorkbench() != null && + // !PlatformUI.getWorkbench().isClosing()) { + // PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() { + // public void run() { + // if (e instanceof FileNotFoundException) { + // MessageDialog.openError(PlatformUI.getWorkbench().getDisplay().getActiveShell(), + // "Report Download Failed", + // "Resource not found: " + e.getMessage()); + // + // } else { + // MessageDialog.openError(PlatformUI.getWorkbench().getDisplay().getActiveShell(), + // "Report Download Failed", + // "Report "+id+" did not download correctly from " + + // repository.getUrl()); + // + // } + // } + // }); + // } + // } + // } return result; } @@ -136,7 +143,6 @@ public class ExistingBugEditorInput extends AbstractBugEditorInput { return bugId; } - /** * @return <code>true</code> if the argument is a bug report editor input * on the same bug id. |