Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorcvs2git2005-06-23 17:02:24 -0400
committercvs2git2005-06-23 17:02:24 -0400
commited45756fcd34e8d66d20d2ba3eff04dc348dd872 (patch)
treeebed695f65fd6f85436f8c46283280d75c88e5a8
parent5a6a38d78ae8448c2f3a1fc3c221a9b367c57ef9 (diff)
downloadorg.eclipse.mylyn.tasks-ed45756fcd34e8d66d20d2ba3eff04dc348dd872.tar.gz
org.eclipse.mylyn.tasks-ed45756fcd34e8d66d20d2ba3eff04dc348dd872.tar.xz
org.eclipse.mylyn.tasks-ed45756fcd34e8d66d20d2ba3eff04dc348dd872.zip
This commit was manufactured by cvs2svn to create tag 'R_1_7_3'.R_1_7_3
Sprout from master 2005-06-23 21:02:23 UTC sminto 'prepare for bugzilla 1.7.3 release' Delete: org.eclipse.mylyn-feature/.project org.eclipse.mylyn-feature/build.properties org.eclipse.mylyn-feature/epl-v10.html org.eclipse.mylyn-feature/feature.xml org.eclipse.mylyn-feature/license.html org.eclipse.mylyn.help.ui/.classpath org.eclipse.mylyn.help.ui/.cvsignore org.eclipse.mylyn.help.ui/.project org.eclipse.mylyn.help.ui/META-INF/MANIFEST.MF org.eclipse.mylyn.help.ui/about.html org.eclipse.mylyn.help.ui/build.properties org.eclipse.mylyn.help.ui/plugin.xml org.eclipse.mylyn.help.ui/src/org/eclipse/mylyn/doc/MylarDocPlugin.java org.eclipse.mylyn.help.ui/toc.xml org.eclipse.mylyn.tasks.tests/.classpath org.eclipse.mylyn.tasks.tests/.cvsignore org.eclipse.mylyn.tasks.tests/.project org.eclipse.mylyn.tasks.tests/META-INF/MANIFEST.MF org.eclipse.mylyn.tasks.tests/about.html org.eclipse.mylyn.tasks.tests/build.properties org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/bugzilla/tests/BugzillaSearchPluginTest.java org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/bugzilla/tests/BugzillaStackTraceTest.java org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/bugzilla/tests/MylarBugzillaTestsPlugin.java org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/Job.java org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/MylarTasksTestsPlugin.java org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/People.java org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/Person.java org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskListManagerTest.java org.eclipse.mylyn.tasks.ui/.classpath org.eclipse.mylyn.tasks.ui/.cvsignore org.eclipse.mylyn.tasks.ui/.project org.eclipse.mylyn.tasks.ui/META-INF/MANIFEST.MF org.eclipse.mylyn.tasks.ui/about.html org.eclipse.mylyn.tasks.ui/build.properties org.eclipse.mylyn.tasks.ui/icons/elcl16/delete.gif org.eclipse.mylyn.tasks.ui/icons/elcl16/refresh.gif org.eclipse.mylyn.tasks.ui/icons/elcl16/remove.gif org.eclipse.mylyn.tasks.ui/icons/elcl16/synched.gif org.eclipse.mylyn.tasks.ui/icons/elcl16/task-bugzilla.gif org.eclipse.mylyn.tasks.ui/icons/elcl16/task-category-new.gif org.eclipse.mylyn.tasks.ui/icons/elcl16/task-category.gif org.eclipse.mylyn.tasks.ui/icons/elcl16/task.gif org.eclipse.mylyn.tasks.ui/icons/eview16/tasklist.gif org.eclipse.mylyn.tasks.ui/plugin.xml org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/BugzillaTask.java org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/Category.java org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ITask.java org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ITaskActivityListener.java org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ITaskInfo.java org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/MylarTasksPlugin.java org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/RelatedLinks.java org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/Task.java org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/TaskList.java org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/TaskListManager.java org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/bugzilla/BugzillaCacheFile.java org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/bugzilla/BugzillaContentProvider.java org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/bugzilla/BugzillaEditingMonitor.java org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/bugzilla/BugzillaMylarBridge.java org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/bugzilla/BugzillaReferencesProvider.java org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/bugzilla/BugzillaReportNode.java org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/bugzilla/BugzillaStructureBridge.java org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/bugzilla/StackTrace.java org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/bugzilla/Util.java org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/bugzilla/search/BugzillaMylarSearch.java org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/bugzilla/search/BugzillaMylarSearchJob.java org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/bugzilla/search/BugzillaMylarSearchOperation.java org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/bugzilla/search/BugzillaResultCollector.java org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/bugzilla/ui/BugzillaNodeLabelProvider.java org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/bugzilla/ui/BugzillaUiBridge.java org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/BugzillaTaskEditor.java org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/BugzillaTaskEditorInput.java org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/TaskEditor.java org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/TaskEditorCopyAction.java org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/TaskEditorInput.java org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/TaskSummaryEditor.java org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/actions/ToggleIntersectionModeAction.java org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/views/TaskListLabelProvider.java org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/views/TaskListView.java org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/views/ToolTipHandler.java org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/util/RelativePathUtil.java org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/util/TaskTest.java org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/util/XmlUtil.java
-rw-r--r--org.eclipse.mylyn-feature/.project17
-rw-r--r--org.eclipse.mylyn-feature/build.properties12
-rw-r--r--org.eclipse.mylyn-feature/epl-v10.html328
-rw-r--r--org.eclipse.mylyn-feature/feature.xml279
-rw-r--r--org.eclipse.mylyn-feature/license.html73
-rw-r--r--org.eclipse.mylyn.help.ui/.classpath7
-rw-r--r--org.eclipse.mylyn.help.ui/.cvsignore1
-rw-r--r--org.eclipse.mylyn.help.ui/.project28
-rw-r--r--org.eclipse.mylyn.help.ui/META-INF/MANIFEST.MF14
-rw-r--r--org.eclipse.mylyn.help.ui/about.html22
-rw-r--r--org.eclipse.mylyn.help.ui/build.properties22
-rw-r--r--org.eclipse.mylyn.help.ui/plugin.xml15
-rw-r--r--org.eclipse.mylyn.help.ui/src/org/eclipse/mylyn/doc/MylarDocPlugin.java66
-rw-r--r--org.eclipse.mylyn.help.ui/toc.xml5
-rw-r--r--org.eclipse.mylyn.tasks.tests/.classpath11
-rw-r--r--org.eclipse.mylyn.tasks.tests/.cvsignore1
-rw-r--r--org.eclipse.mylyn.tasks.tests/.project28
-rw-r--r--org.eclipse.mylyn.tasks.tests/META-INF/MANIFEST.MF20
-rw-r--r--org.eclipse.mylyn.tasks.tests/about.html22
-rw-r--r--org.eclipse.mylyn.tasks.tests/build.properties15
-rw-r--r--org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/bugzilla/tests/BugzillaSearchPluginTest.java329
-rw-r--r--org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/bugzilla/tests/BugzillaStackTraceTest.java170
-rw-r--r--org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/bugzilla/tests/MylarBugzillaTestsPlugin.java49
-rw-r--r--org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/Job.java87
-rw-r--r--org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/MylarTasksTestsPlugin.java49
-rw-r--r--org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/People.java67
-rw-r--r--org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/Person.java106
-rw-r--r--org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskListManagerTest.java50
-rw-r--r--org.eclipse.mylyn.tasks.ui/.classpath11
-rw-r--r--org.eclipse.mylyn.tasks.ui/.cvsignore1
-rw-r--r--org.eclipse.mylyn.tasks.ui/.project30
-rw-r--r--org.eclipse.mylyn.tasks.ui/META-INF/MANIFEST.MF33
-rw-r--r--org.eclipse.mylyn.tasks.ui/about.html22
-rw-r--r--org.eclipse.mylyn.tasks.ui/build.properties24
-rw-r--r--org.eclipse.mylyn.tasks.ui/icons/elcl16/delete.gifbin351 -> 0 bytes
-rw-r--r--org.eclipse.mylyn.tasks.ui/icons/elcl16/refresh.gifbin216 -> 0 bytes
-rw-r--r--org.eclipse.mylyn.tasks.ui/icons/elcl16/remove.gifbin163 -> 0 bytes
-rw-r--r--org.eclipse.mylyn.tasks.ui/icons/elcl16/synched.gifbin160 -> 0 bytes
-rw-r--r--org.eclipse.mylyn.tasks.ui/icons/elcl16/task-bugzilla.gifbin358 -> 0 bytes
-rw-r--r--org.eclipse.mylyn.tasks.ui/icons/elcl16/task-category-new.gifbin239 -> 0 bytes
-rw-r--r--org.eclipse.mylyn.tasks.ui/icons/elcl16/task-category.gifbin161 -> 0 bytes
-rw-r--r--org.eclipse.mylyn.tasks.ui/icons/elcl16/task.gifbin375 -> 0 bytes
-rw-r--r--org.eclipse.mylyn.tasks.ui/icons/eview16/tasklist.gifbin594 -> 0 bytes
-rw-r--r--org.eclipse.mylyn.tasks.ui/plugin.xml47
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/BugzillaTask.java459
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/Category.java67
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ITask.java104
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ITaskActivityListener.java30
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ITaskInfo.java23
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/MylarTasksPlugin.java237
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/RelatedLinks.java37
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/Task.java367
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/TaskList.java150
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/TaskListManager.java169
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/bugzilla/BugzillaCacheFile.java131
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/bugzilla/BugzillaContentProvider.java59
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/bugzilla/BugzillaEditingMonitor.java46
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/bugzilla/BugzillaMylarBridge.java142
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/bugzilla/BugzillaReferencesProvider.java142
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/bugzilla/BugzillaReportNode.java184
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/bugzilla/BugzillaStructureBridge.java278
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/bugzilla/StackTrace.java375
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/bugzilla/Util.java226
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/bugzilla/search/BugzillaMylarSearch.java148
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/bugzilla/search/BugzillaMylarSearchJob.java109
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/bugzilla/search/BugzillaMylarSearchOperation.java526
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/bugzilla/search/BugzillaResultCollector.java182
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/bugzilla/ui/BugzillaNodeLabelProvider.java67
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/bugzilla/ui/BugzillaUiBridge.java141
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/BugzillaTaskEditor.java291
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/BugzillaTaskEditorInput.java135
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/TaskEditor.java161
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/TaskEditorCopyAction.java33
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/TaskEditorInput.java113
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/TaskSummaryEditor.java1238
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/actions/ToggleIntersectionModeAction.java42
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/views/TaskListLabelProvider.java213
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/views/TaskListView.java1432
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/views/ToolTipHandler.java240
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/util/RelativePathUtil.java41
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/util/TaskTest.java146
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/util/XmlUtil.java366
82 files changed, 0 insertions, 10911 deletions
diff --git a/org.eclipse.mylyn-feature/.project b/org.eclipse.mylyn-feature/.project
deleted file mode 100644
index 11fcd6a03..000000000
--- a/org.eclipse.mylyn-feature/.project
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.mylar-feature</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.pde.FeatureBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.FeatureNature</nature>
- </natures>
-</projectDescription>
diff --git a/org.eclipse.mylyn-feature/build.properties b/org.eclipse.mylyn-feature/build.properties
deleted file mode 100644
index e2a3d457d..000000000
--- a/org.eclipse.mylyn-feature/build.properties
+++ /dev/null
@@ -1,12 +0,0 @@
-###############################################################################
-# Copyright (c) 2004 - 2005 University Of British Columbia and others.
-# 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:
-# University Of British Columbia - initial API and implementation
-###############################################################################
-bin.includes = feature.xml
-src.includes = feature.xml
diff --git a/org.eclipse.mylyn-feature/epl-v10.html b/org.eclipse.mylyn-feature/epl-v10.html
deleted file mode 100644
index ed4b19665..000000000
--- a/org.eclipse.mylyn-feature/epl-v10.html
+++ /dev/null
@@ -1,328 +0,0 @@
-<html xmlns:o="urn:schemas-microsoft-com:office:office"
-xmlns:w="urn:schemas-microsoft-com:office:word"
-xmlns="http://www.w3.org/TR/REC-html40">
-
-<head>
-<meta http-equiv=Content-Type content="text/html; charset=windows-1252">
-<meta name=ProgId content=Word.Document>
-<meta name=Generator content="Microsoft Word 9">
-<meta name=Originator content="Microsoft Word 9">
-<link rel=File-List
-href="./Eclipse%20EPL%202003_11_10%20Final_files/filelist.xml">
-<title>Eclipse Public License - Version 1.0</title>
-<!--[if gte mso 9]><xml>
- <o:DocumentProperties>
- <o:Revision>2</o:Revision>
- <o:TotalTime>3</o:TotalTime>
- <o:Created>2004-03-05T23:03:00Z</o:Created>
- <o:LastSaved>2004-03-05T23:03:00Z</o:LastSaved>
- <o:Pages>4</o:Pages>
- <o:Words>1626</o:Words>
- <o:Characters>9270</o:Characters>
- <o:Lines>77</o:Lines>
- <o:Paragraphs>18</o:Paragraphs>
- <o:CharactersWithSpaces>11384</o:CharactersWithSpaces>
- <o:Version>9.4402</o:Version>
- </o:DocumentProperties>
-</xml><![endif]--><!--[if gte mso 9]><xml>
- <w:WordDocument>
- <w:TrackRevisions/>
- </w:WordDocument>
-</xml><![endif]-->
-<style>
-<!--
- /* Font Definitions */
-@font-face
- {font-family:Tahoma;
- panose-1:2 11 6 4 3 5 4 4 2 4;
- mso-font-charset:0;
- mso-generic-font-family:swiss;
- mso-font-pitch:variable;
- mso-font-signature:553679495 -2147483648 8 0 66047 0;}
- /* Style Definitions */
-p.MsoNormal, li.MsoNormal, div.MsoNormal
- {mso-style-parent:"";
- margin:0in;
- margin-bottom:.0001pt;
- mso-pagination:widow-orphan;
- font-size:12.0pt;
- font-family:"Times New Roman";
- mso-fareast-font-family:"Times New Roman";}
-p
- {margin-right:0in;
- mso-margin-top-alt:auto;
- mso-margin-bottom-alt:auto;
- margin-left:0in;
- mso-pagination:widow-orphan;
- font-size:12.0pt;
- font-family:"Times New Roman";
- mso-fareast-font-family:"Times New Roman";}
-p.BalloonText, li.BalloonText, div.BalloonText
- {mso-style-name:"Balloon Text";
- margin:0in;
- margin-bottom:.0001pt;
- mso-pagination:widow-orphan;
- font-size:8.0pt;
- font-family:Tahoma;
- mso-fareast-font-family:"Times New Roman";}
-@page Section1
- {size:8.5in 11.0in;
- margin:1.0in 1.25in 1.0in 1.25in;
- mso-header-margin:.5in;
- mso-footer-margin:.5in;
- mso-paper-source:0;}
-div.Section1
- {page:Section1;}
--->
-</style>
-</head>
-
-<body lang=EN-US style='tab-interval:.5in'>
-
-<div class=Section1>
-
-<p align=center style='text-align:center'><b>Eclipse Public License - v 1.0</b>
-</p>
-
-<p><span style='font-size:10.0pt'>THE ACCOMPANYING PROGRAM IS PROVIDED UNDER
-THE TERMS OF THIS ECLIPSE PUBLIC LICENSE (&quot;AGREEMENT&quot;). ANY USE,
-REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE
-OF THIS AGREEMENT.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>1. DEFINITIONS</span></b> </p>
-
-<p><span style='font-size:10.0pt'>&quot;Contribution&quot; means:</span> </p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-in the case of the initial Contributor, the initial code and documentation
-distributed under this Agreement, and<br clear=left>
-b) in the case of each subsequent Contributor:</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>i)
-changes to the Program, and</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>ii)
-additions to the Program;</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>where
-such changes and/or additions to the Program originate from and are distributed
-by that particular Contributor. A Contribution 'originates' from a Contributor
-if it was added to the Program by such Contributor itself or anyone acting on
-such Contributor's behalf. Contributions do not include additions to the
-Program which: (i) are separate modules of software distributed in conjunction
-with the Program under their own license agreement, and (ii) are not derivative
-works of the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>&quot;Contributor&quot; means any person or
-entity that distributes the Program.</span> </p>
-
-<p><span style='font-size:10.0pt'>&quot;Licensed Patents &quot; mean patent
-claims licensable by a Contributor which are necessarily infringed by the use
-or sale of its Contribution alone or when combined with the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>&quot;Program&quot; means the Contributions
-distributed in accordance with this Agreement.</span> </p>
-
-<p><span style='font-size:10.0pt'>&quot;Recipient&quot; means anyone who
-receives the Program under this Agreement, including all Contributors.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>2. GRANT OF RIGHTS</span></b> </p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-Subject to the terms of this Agreement, each Contributor hereby grants Recipient
-a non-exclusive, worldwide, royalty-free copyright license to<span
-style='color:red'> </span>reproduce, prepare derivative works of, publicly
-display, publicly perform, distribute and sublicense the Contribution of such
-Contributor, if any, and such derivative works, in source code and object code
-form.</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b)
-Subject to the terms of this Agreement, each Contributor hereby grants
-Recipient a non-exclusive, worldwide,<span style='color:green'> </span>royalty-free
-patent license under Licensed Patents to make, use, sell, offer to sell, import
-and otherwise transfer the Contribution of such Contributor, if any, in source
-code and object code form. This patent license shall apply to the combination
-of the Contribution and the Program if, at the time the Contribution is added
-by the Contributor, such addition of the Contribution causes such combination
-to be covered by the Licensed Patents. The patent license shall not apply to
-any other combinations which include the Contribution. No hardware per se is
-licensed hereunder. </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>c)
-Recipient understands that although each Contributor grants the licenses to its
-Contributions set forth herein, no assurances are provided by any Contributor
-that the Program does not infringe the patent or other intellectual property
-rights of any other entity. Each Contributor disclaims any liability to Recipient
-for claims brought by any other entity based on infringement of intellectual
-property rights or otherwise. As a condition to exercising the rights and
-licenses granted hereunder, each Recipient hereby assumes sole responsibility
-to secure any other intellectual property rights needed, if any. For example,
-if a third party patent license is required to allow Recipient to distribute
-the Program, it is Recipient's responsibility to acquire that license before
-distributing the Program.</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>d)
-Each Contributor represents that to its knowledge it has sufficient copyright
-rights in its Contribution, if any, to grant the copyright license set forth in
-this Agreement. </span></p>
-
-<p><b><span style='font-size:10.0pt'>3. REQUIREMENTS</span></b> </p>
-
-<p><span style='font-size:10.0pt'>A Contributor may choose to distribute the
-Program in object code form under its own license agreement, provided that:</span>
-</p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-it complies with the terms and conditions of this Agreement; and</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b)
-its license agreement:</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>i)
-effectively disclaims on behalf of all Contributors all warranties and
-conditions, express and implied, including warranties or conditions of title
-and non-infringement, and implied warranties or conditions of merchantability
-and fitness for a particular purpose; </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>ii)
-effectively excludes on behalf of all Contributors all liability for damages,
-including direct, indirect, special, incidental and consequential damages, such
-as lost profits; </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>iii)
-states that any provisions which differ from this Agreement are offered by that
-Contributor alone and not by any other party; and</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>iv)
-states that source code for the Program is available from such Contributor, and
-informs licensees how to obtain it in a reasonable manner on or through a
-medium customarily used for software exchange.<span style='color:blue'> </span></span></p>
-
-<p><span style='font-size:10.0pt'>When the Program is made available in source
-code form:</span> </p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-it must be made available under this Agreement; and </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b) a
-copy of this Agreement must be included with each copy of the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>Contributors may not remove or alter any
-copyright notices contained within the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>Each Contributor must identify itself as the
-originator of its Contribution, if any, in a manner that reasonably allows
-subsequent Recipients to identify the originator of the Contribution. </span></p>
-
-<p><b><span style='font-size:10.0pt'>4. COMMERCIAL DISTRIBUTION</span></b> </p>
-
-<p><span style='font-size:10.0pt'>Commercial distributors of software may
-accept certain responsibilities with respect to end users, business partners
-and the like. While this license is intended to facilitate the commercial use
-of the Program, the Contributor who includes the Program in a commercial
-product offering should do so in a manner which does not create potential
-liability for other Contributors. Therefore, if a Contributor includes the
-Program in a commercial product offering, such Contributor (&quot;Commercial
-Contributor&quot;) hereby agrees to defend and indemnify every other
-Contributor (&quot;Indemnified Contributor&quot;) against any losses, damages and
-costs (collectively &quot;Losses&quot;) arising from claims, lawsuits and other
-legal actions brought by a third party against the Indemnified Contributor to
-the extent caused by the acts or omissions of such Commercial Contributor in
-connection with its distribution of the Program in a commercial product
-offering. The obligations in this section do not apply to any claims or Losses
-relating to any actual or alleged intellectual property infringement. In order
-to qualify, an Indemnified Contributor must: a) promptly notify the Commercial
-Contributor in writing of such claim, and b) allow the Commercial Contributor
-to control, and cooperate with the Commercial Contributor in, the defense and
-any related settlement negotiations. The Indemnified Contributor may participate
-in any such claim at its own expense.</span> </p>
-
-<p><span style='font-size:10.0pt'>For example, a Contributor might include the
-Program in a commercial product offering, Product X. That Contributor is then a
-Commercial Contributor. If that Commercial Contributor then makes performance
-claims, or offers warranties related to Product X, those performance claims and
-warranties are such Commercial Contributor's responsibility alone. Under this
-section, the Commercial Contributor would have to defend claims against the
-other Contributors related to those performance claims and warranties, and if a
-court requires any other Contributor to pay any damages as a result, the
-Commercial Contributor must pay those damages.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>5. NO WARRANTY</span></b> </p>
-
-<p><span style='font-size:10.0pt'>EXCEPT AS EXPRESSLY SET FORTH IN THIS
-AGREEMENT, THE PROGRAM IS PROVIDED ON AN &quot;AS IS&quot; BASIS, WITHOUT
-WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING,
-WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT,
-MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely
-responsible for determining the appropriateness of using and distributing the
-Program and assumes all risks associated with its exercise of rights under this
-Agreement , including but not limited to the risks and costs of program errors,
-compliance with applicable laws, damage to or loss of data, programs or
-equipment, and unavailability or interruption of operations. </span></p>
-
-<p><b><span style='font-size:10.0pt'>6. DISCLAIMER OF LIABILITY</span></b> </p>
-
-<p><span style='font-size:10.0pt'>EXCEPT AS EXPRESSLY SET FORTH IN THIS
-AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR
-ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY
-OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF
-THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF
-THE POSSIBILITY OF SUCH DAMAGES.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>7. GENERAL</span></b> </p>
-
-<p><span style='font-size:10.0pt'>If any provision of this Agreement is invalid
-or unenforceable under applicable law, it shall not affect the validity or
-enforceability of the remainder of the terms of this Agreement, and without
-further action by the parties hereto, such provision shall be reformed to the
-minimum extent necessary to make such provision valid and enforceable.</span> </p>
-
-<p><span style='font-size:10.0pt'>If Recipient institutes patent litigation
-against any entity (including a cross-claim or counterclaim in a lawsuit)
-alleging that the Program itself (excluding combinations of the Program with
-other software or hardware) infringes such Recipient's patent(s), then such
-Recipient's rights granted under Section 2(b) shall terminate as of the date
-such litigation is filed. </span></p>
-
-<p><span style='font-size:10.0pt'>All Recipient's rights under this Agreement
-shall terminate if it fails to comply with any of the material terms or
-conditions of this Agreement and does not cure such failure in a reasonable
-period of time after becoming aware of such noncompliance. If all Recipient's
-rights under this Agreement terminate, Recipient agrees to cease use and
-distribution of the Program as soon as reasonably practicable. However,
-Recipient's obligations under this Agreement and any licenses granted by
-Recipient relating to the Program shall continue and survive. </span></p>
-
-<p><span style='font-size:10.0pt'>Everyone is permitted to copy and distribute
-copies of this Agreement, but in order to avoid inconsistency the Agreement is
-copyrighted and may only be modified in the following manner. The Agreement
-Steward reserves the right to publish new versions (including revisions) of
-this Agreement from time to time. No one other than the Agreement Steward has
-the right to modify this Agreement. The Eclipse Foundation is the initial
-Agreement Steward. The Eclipse Foundation may assign the responsibility to
-serve as the Agreement Steward to a suitable separate entity. Each new version
-of the Agreement will be given a distinguishing version number. The Program
-(including Contributions) may always be distributed subject to the version of
-the Agreement under which it was received. In addition, after a new version of
-the Agreement is published, Contributor may elect to distribute the Program
-(including its Contributions) under the new version. Except as expressly stated
-in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to
-the intellectual property of any Contributor under this Agreement, whether
-expressly, by implication, estoppel or otherwise. All rights in the Program not
-expressly granted under this Agreement are reserved.</span> </p>
-
-<p><span style='font-size:10.0pt'>This Agreement is governed by the laws of the
-State of New York and the intellectual property laws of the United States of
-America. No party to this Agreement will bring a legal action under this
-Agreement more than one year after the cause of action arose. Each party waives
-its rights to a jury trial in any resulting litigation.</span> </p>
-
-<p class=MsoNormal><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></p>
-
-</div>
-
-</body>
-
-</html> \ No newline at end of file
diff --git a/org.eclipse.mylyn-feature/feature.xml b/org.eclipse.mylyn-feature/feature.xml
deleted file mode 100644
index 68e98acb6..000000000
--- a/org.eclipse.mylyn-feature/feature.xml
+++ /dev/null
@@ -1,279 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<feature
- id="org.eclipse.mylar_feature"
- label="org.eclipse.mylar-feature"
- version="0.2.4"
- provider-name="University of British Columbia">
-
- <description url="http://www.cs.ubc.ca/~mylar">
- Mylar Plugin
- </description>
-
- <license url="http://www.eclipse.org/legal/epl-v10.html">
- Eclipse Public License - v 1.0
-THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS
-ECLIPSE PUBLIC LICENSE (&quot;AGREEMENT&quot;). ANY USE, REPRODUCTION OR
-DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT&apos;S ACCEPTANCE
-OF THIS AGREEMENT.
-1. DEFINITIONS
-&quot;Contribution&quot; means:
-a) in the case of the initial Contributor, the initial code and
-documentation distributed under this Agreement, and
-b) in the case of each subsequent Contributor:
-i) changes to the Program, and
-ii) additions to the Program;
-where such changes and/or additions to the Program originate
-from and are distributed by that particular Contributor. A Contribution
-&apos;originates&apos; from a Contributor if it was added to the Program
-by such Contributor itself or anyone acting on such Contributor&apos;s
-behalf. Contributions do not include additions to the Program
-which: (i) are separate modules of software distributed in conjunction
-with the Program under their own license agreement, and (ii)
-are not derivative works of the Program.
-&quot;Contributor&quot; means any person or entity that distributes the
-Program.
-&quot;Licensed Patents &quot; mean patent claims licensable by a Contributor
-which are necessarily infringed by the use or sale of its Contribution
-alone or when combined with the Program.
-&quot;Program&quot; means the Contributions distributed in accordance with
-this Agreement.
-&quot;Recipient&quot; means anyone who receives the Program under this
-Agreement, including all Contributors.
-2. GRANT OF RIGHTS
-a) Subject to the terms of this Agreement, each Contributor hereby
-grants Recipient a non-exclusive, worldwide, royalty-free copyright
-license to reproduce, prepare derivative works of, publicly display,
-publicly perform, distribute and sublicense the Contribution
-of such Contributor, if any, and such derivative works, in source
-code and object code form.
-b) Subject to the terms of this Agreement, each Contributor hereby
-grants Recipient a non-exclusive, worldwide, royalty-free patent
-license under Licensed Patents to make, use, sell, offer to sell,
-import and otherwise transfer the Contribution of such Contributor,
-if any, in source code and object code form. This patent license
-shall apply to the combination of the Contribution and the Program
-if, at the time the Contribution is added by the Contributor,
-such addition of the Contribution causes such combination to
-be covered by the Licensed Patents. The patent license shall
-not apply to any other combinations which include the Contribution.
-No hardware per se is licensed hereunder.
-c) Recipient understands that although each Contributor grants
-the licenses to its Contributions set forth herein, no assurances
-are provided by any Contributor that the Program does not infringe
-the patent or other intellectual property rights of any other
-entity. Each Contributor disclaims any liability to Recipient
-for claims brought by any other entity based on infringement
-of intellectual property rights or otherwise. As a condition
-to exercising the rights and licenses granted hereunder, each
-Recipient hereby assumes sole responsibility to secure any other
-intellectual property rights needed, if any. For example, if
-a third party patent license is required to allow Recipient to
-distribute the Program, it is Recipient&apos;s responsibility to acquire
-that license before distributing the Program.
-d) Each Contributor represents that to its knowledge it has sufficient
-copyright rights in its Contribution, if any, to grant the copyright
-license set forth in this Agreement.
-3. REQUIREMENTS
-A Contributor may choose to distribute the Program in object
-code form under its own license agreement, provided that:
-a) it complies with the terms and conditions of this Agreement;
-and
-b) its license agreement:
-i) effectively disclaims on behalf of all Contributors all warranties
-and conditions, express and implied, including warranties or
-conditions of title and non-infringement, and implied warranties
-or conditions of merchantability and fitness for a particular
-purpose;
-ii) effectively excludes on behalf of all Contributors all liability
-for damages, including direct, indirect, special, incidental
-and consequential damages, such as lost profits;
-iii) states that any provisions which differ from this Agreement
-are offered by that Contributor alone and not by any other party;
-and
-iv) states that source code for the Program is available from
-such Contributor, and informs licensees how to obtain it in a
-reasonable manner on or through a medium customarily used for
-software exchange.
-When the Program is made available in source code form:
-a) it must be made available under this Agreement; and
-b) a copy of this Agreement must be included with each copy of
-the Program.
-Contributors may not remove or alter any copyright notices contained
-within the Program.
-Each Contributor must identify itself as the originator of its
-Contribution, if any, in a manner that reasonably allows subsequent
-Recipients to identify the originator of the Contribution.
-4. COMMERCIAL DISTRIBUTION
-Commercial distributors of software may accept certain responsibilities
-with respect to end users, business partners and the like. While
-this license is intended to facilitate the commercial use of
-the Program, the Contributor who includes the Program in a commercial
-product offering should do so in a manner which does not create
-potential liability for other Contributors. Therefore, if a Contributor
-includes the Program in a commercial product offering, such Contributor
-(&quot;Commercial Contributor&quot;) hereby agrees to defend and indemnify
-every other Contributor (&quot;Indemnified Contributor&quot;) against any
-losses, damages and costs (collectively &quot;Losses&quot;) arising from
-claims, lawsuits and other legal actions brought by a third party
-against the Indemnified Contributor to the extent caused by the
-acts or omissions of such Commercial Contributor in connection
-with its distribution of the Program in a commercial product
-offering. The obligations in this section do not apply to any
-claims or Losses relating to any actual or alleged intellectual
-property infringement. In order to qualify, an Indemnified Contributor
-must: a) promptly notify the Commercial Contributor in writing
-of such claim, and b) allow the Commercial Contributor to control,
-and cooperate with the Commercial Contributor in, the defense
-and any related settlement negotiations. The Indemnified Contributor
-may participate in any such claim at its own expense.
-For example, a Contributor might include the Program in a commercial
-product offering, Product X. That Contributor is then a Commercial
-Contributor. If that Commercial Contributor then makes performance
-claims, or offers warranties related to Product X, those performance
-claims and warranties are such Commercial Contributor&apos;s responsibility
-alone. Under this section, the Commercial Contributor would have
-to defend claims against the other Contributors related to those
-performance claims and warranties, and if a court requires any
-other Contributor to pay any damages as a result, the Commercial
-Contributor must pay those damages.
-5. NO WARRANTY
-EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM
-IS PROVIDED ON AN &quot;AS IS&quot; BASIS, WITHOUT WARRANTIES OR CONDITIONS
-OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION,
-ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY
-OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely
-responsible for determining the appropriateness of using and
-distributing the Program and assumes all risks associated with
-its exercise of rights under this Agreement , including but not
-limited to the risks and costs of program errors, compliance
-with applicable laws, damage to or loss of data, programs or
-equipment, and unavailability or interruption of operations.
-6. DISCLAIMER OF LIABILITY
-EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT
-NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT,
-INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
-OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE
-OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY
-OF SUCH DAMAGES.
-7. GENERAL
-If any provision of this Agreement is invalid or unenforceable
-under applicable law, it shall not affect the validity or enforceability
-of the remainder of the terms of this Agreement, and without
-further action by the parties hereto, such provision shall be
-reformed to the minimum extent necessary to make such provision
-valid and enforceable.
-If Recipient institutes patent litigation against any entity
-(including a cross-claim or counterclaim in a lawsuit) alleging
-that the Program itself (excluding combinations of the Program
-with other software or hardware) infringes such Recipient&apos;s patent(s),
-then such Recipient&apos;s rights granted under Section 2(b) shall
-terminate as of the date such litigation is filed.
-All Recipient&apos;s rights under this Agreement shall terminate if
-it fails to comply with any of the material terms or conditions
-of this Agreement and does not cure such failure in a reasonable
-period of time after becoming aware of such noncompliance. If
-all Recipient&apos;s rights under this Agreement terminate, Recipient
-agrees to cease use and distribution of the Program as soon as
-reasonably practicable. However, Recipient&apos;s obligations under
-this Agreement and any licenses granted by Recipient relating
-to the Program shall continue and survive.
-Everyone is permitted to copy and distribute copies of this Agreement,
-but in order to avoid inconsistency the Agreement is copyrighted
-and may only be modified in the following manner. The Agreement
-Steward reserves the right to publish new versions (including
-revisions) of this Agreement from time to time. No one other
-than the Agreement Steward has the right to modify this Agreement.
-The Eclipse Foundation is the initial Agreement Steward. The
-Eclipse Foundation may assign the responsibility to serve as
-the Agreement Steward to a suitable separate entity. Each new
-version of the Agreement will be given a distinguishing version
-number. The Program (including Contributions) may always be distributed
-subject to the version of the Agreement under which it was received.
-In addition, after a new version of the Agreement is published,
-Contributor may elect to distribute the Program (including its
-Contributions) under the new version. Except as expressly stated
-in Sections 2(a) and 2(b) above, Recipient receives no rights
-or licenses to the intellectual property of any Contributor under
-this Agreement, whether expressly, by implication, estoppel or
-otherwise. All rights in the Program not expressly granted under
-this Agreement are reserved.
-This Agreement is governed by the laws of the State of New York
-and the intellectual property laws of the United States of America.
-No party to this Agreement will bring a legal action under this
-Agreement more than one year after the cause of action arose.
-Each party waives its rights to a jury trial in any resulting
-litigation.
- </license>
-
- <includes
- id="org.eclipse.mylar.bugzilla_feature"
- version="1.7.2"/>
-
- <includes
- id="org.eclipse.mylar.monitor_feature"
- version="0.2.4"/>
-
- <requires>
- <import plugin="org.eclipse.ui" version="0.0.0" match="greaterOrEqual"/>
- <import plugin="org.eclipse.core.runtime" version="0.0.0" match="greaterOrEqual"/>
- <import plugin="org.eclipse.core.resources" version="0.0.0" match="greaterOrEqual"/>
- <import plugin="org.eclipse.jdt" version="0.0.0" match="greaterOrEqual"/>
- <import plugin="org.eclipse.jdt.core" version="0.0.0" match="greaterOrEqual"/>
- <import plugin="org.eclipse.jdt.ui" version="0.0.0" match="greaterOrEqual"/>
- <import plugin="org.eclipse.ui.editors" version="0.0.0" match="greaterOrEqual"/>
- <import plugin="org.eclipse.jface.text" version="0.0.0" match="greaterOrEqual"/>
- <import plugin="org.eclipse.ui.workbench.texteditor" version="0.0.0" match="greaterOrEqual"/>
- <import plugin="org.eclipse.search" version="0.0.0" match="greaterOrEqual"/>
- <import plugin="org.eclipse.ui.views" version="0.0.0" match="greaterOrEqual"/>
- <import plugin="org.eclipse.ui.ide" version="0.0.0" match="greaterOrEqual"/>
- <import plugin="org.eclipse.ui.console" version="0.0.0" match="greaterOrEqual"/>
- <import plugin="org.eclipse.ui.forms" version="0.0.0" match="greaterOrEqual"/>
- <import plugin="org.eclipse.osgi.util" version="0.0.0" match="greaterOrEqual"/>
- <import plugin="org.eclipse.osgi.services" version="0.0.0" match="greaterOrEqual"/>
- <import plugin="org.eclipse.pde.ui" version="0.0.0" match="greaterOrEqual"/>
- <import plugin="org.eclipse.ant.ui" version="0.0.0" match="greaterOrEqual"/>
- <import plugin="org.eclipse.ant.core" version="0.0.0" match="greaterOrEqual"/>
- <import plugin="org.eclipse.pde.core" version="0.0.0" match="greaterOrEqual"/>
- <import plugin="org.eclipse.mylar.core"/>
- <import plugin="org.eclipse.mylar.bugzilla"/>
- </requires>
-
- <plugin
- id="org.eclipse.mylar.doc"
- download-size="0"
- install-size="0"
- version="0.2.4"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.mylar.java"
- download-size="0"
- install-size="0"
- version="0.2.4"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.mylar.ui"
- download-size="0"
- install-size="0"
- version="0.2.4"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.mylar.xml"
- download-size="0"
- install-size="0"
- version="0.2.4"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.mylar.tasks"
- download-size="0"
- install-size="0"
- version="0.2.4"
- unpack="false"/>
-
-</feature>
diff --git a/org.eclipse.mylyn-feature/license.html b/org.eclipse.mylyn-feature/license.html
deleted file mode 100644
index 3259fb996..000000000
--- a/org.eclipse.mylyn-feature/license.html
+++ /dev/null
@@ -1,73 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<html>
-<head>
-<meta http-equiv=Content-Type content="text/html; charset=iso-8859-1">
-<title>Eclipse.org Software User Agreement</title>
-</head>
-
-<body lang="EN-US" link=blue vlink=purple>
-<h2>Eclipse Foundation Software User Agreement</h2>
-<p>January 28, 2005</p>
-
-<h3>Usage Of Content</h3>
-
-<p>THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR OTHER MATERIALS FOR OPEN SOURCE PROJECTS
- (COLLECTIVELY &quot;CONTENT&quot;). USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS AGREEMENT AND/OR THE TERMS AND
- CONDITIONS OF LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU AGREE THAT YOUR USE
- OF THE CONTENT IS GOVERNED BY THIS AGREEMENT AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR
- NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND
- CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW, THEN YOU MAY NOT USE THE CONTENT.</p>
-
-<h3>Applicable Licenses</h3>
-
-<p>Unless otherwise indicated, all Content made available by the Eclipse Foundation is provided to you under the terms and conditions of the Eclipse Public License Version 1.0
- (&quot;EPL&quot;). A copy of the EPL is provided with this Content and is also available at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
- For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
-
-<p>Content includes, but is not limited to, source code, object code, documentation and other files maintained in the Eclipse.org CVS repository (&quot;Repository&quot;) in CVS
- modules (&quot;Modules&quot;) and made available as downloadable archives (&quot;Downloads&quot;).</p>
-
-<p>Content may be apportioned into plug-ins (&quot;Plug-ins&quot;), plug-in fragments (&quot;Fragments&quot;), and features (&quot;Features&quot;). A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material. Files named &quot;feature.xml&quot; may contain a list of the names and version numbers of the Plug-ins and/or Fragments associated with a Feature. Plug-ins and Fragments are located in directories
- named &quot;plugins&quot; and Features are located in directories named &quot;features&quot;.</p>
-
-<p>Features may also include other Features (&quot;Included Features&quot;). Files named &quot;feature.xml&quot; may contain a list of the names and version numbers of Included Features.</p>
-
-<p>The terms and conditions governing Plug-ins and Fragments should be contained in files named &quot;about.html&quot; (&quot;Abouts&quot;). The terms and conditions governing Features and
-Included Features should be contained in files named &quot;license.html&quot; (&quot;Feature Licenses&quot;). Abouts and Feature Licenses may be located in any directory of a Download or Module
-including, but not limited to the following locations:</p>
-
-<ul>
- <li>The top-level (root) directory</li>
- <li>Plug-in and Fragment directories</li>
- <li>Subdirectories of the directory named &quot;src&quot; of certain Plug-ins</li>
- <li>Feature directories</li>
-</ul>
-
-<p>Note: if a Feature made available by the Eclipse Foundation is installed using the Eclipse Update Manager, you must agree to a license (&quot;Feature Update License&quot;) during the
-installation process. If the Feature contains Included Features, the Feature Update License should either provide you with the terms and conditions governing the Included Features or
-inform you where you can locate them. Feature Update Licenses may be found in the &quot;license&quot; property of files named &quot;feature.properties&quot;.
-Such Abouts, Feature Licenses and Feature Update Licenses contain the terms and conditions (or references to such terms and conditions) that govern your use of the associated Content in
-that directory.</p>
-
-<p>THE ABOUTS, FEATURE LICENSES AND FEATURE UPDATE LICENSES MAY REFER TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS. SOME OF THESE
-OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):</p>
-
-<ul>
- <li>Common Public License Version 1.0 (available at <a href="http://www.eclipse.org/legal/cpl-v10.html">http://www.eclipse.org/legal/cpl-v10.html</a>)</li>
- <li>Apache Software License 1.1 (available at <a href="http://www.apache.org/licenses/LICENSE">http://www.apache.org/licenses/LICENSE</a>)</li>
- <li>Apache Software License 2.0 (available at <a href="http://www.apache.org/licenses/LICENSE-2.0">http://www.apache.org/licenses/LICENSE-2.0</a>)</li>
- <li>IBM Public License 1.0 (available at <a href="http://oss.software.ibm.com/developerworks/opensource/license10.html">http://oss.software.ibm.com/developerworks/opensource/license10.html</a>)</li>
- <li>Metro Link Public License 1.00 (available at <a href="http://www.opengroup.org/openmotif/supporters/metrolink/license.html">http://www.opengroup.org/openmotif/supporters/metrolink/license.html</a>)</li>
- <li>Mozilla Public License Version 1.1 (available at <a href="http://www.mozilla.org/MPL/MPL-1.1.html">http://www.mozilla.org/MPL/MPL-1.1.html</a>)</li>
-</ul>
-
-<p>IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR TO USE OF THE CONTENT. If no About, Feature License or Feature Update License is provided, please
-contact the Eclipse Foundation to determine what terms and conditions govern that particular Content.</p>
-
-<h3>Cryptography</h3>
-
-<p>Content may contain encryption software. The country in which you are currently may have restrictions on the import, possession, and use, and/or re-export to
- another country, of encryption software. BEFORE using any encryption software, please check the country's laws, regulations and policies concerning the import,
- possession, or use, and re-export of encryption software, to see if this is permitted.</p>
-</body>
-</html>
diff --git a/org.eclipse.mylyn.help.ui/.classpath b/org.eclipse.mylyn.help.ui/.classpath
deleted file mode 100644
index 9a0869b45..000000000
--- a/org.eclipse.mylyn.help.ui/.classpath
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
- <classpathentry kind="output" path="bin"/>
- <classpathentry kind="src" path="src"/>
-</classpath>
diff --git a/org.eclipse.mylyn.help.ui/.cvsignore b/org.eclipse.mylyn.help.ui/.cvsignore
deleted file mode 100644
index ba077a403..000000000
--- a/org.eclipse.mylyn.help.ui/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-bin
diff --git a/org.eclipse.mylyn.help.ui/.project b/org.eclipse.mylyn.help.ui/.project
deleted file mode 100644
index cc9ad6c69..000000000
--- a/org.eclipse.mylyn.help.ui/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.mylar.doc</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
diff --git a/org.eclipse.mylyn.help.ui/META-INF/MANIFEST.MF b/org.eclipse.mylyn.help.ui/META-INF/MANIFEST.MF
deleted file mode 100644
index f818c9802..000000000
--- a/org.eclipse.mylyn.help.ui/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,14 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: Mylar Documentation Plugin
-Bundle-SymbolicName: org.eclipse.mylar.doc; singleton:=true
-Bundle-Version: 0.2.4
-Bundle-Activator: org.eclipse.mylar.doc.MylarDocPlugin
-Bundle-Localization: plugin
-Require-Bundle: org.eclipse.ui,
- org.eclipse.core.runtime,
- org.eclipse.core.resources
-Eclipse-AutoStart: true
-Bundle-Vendor: University of British Columbia
-Export-Package: org.eclipse.mylar.doc
-Bundle-ClassPath: mylar-doc.jar
diff --git a/org.eclipse.mylyn.help.ui/about.html b/org.eclipse.mylyn.help.ui/about.html
deleted file mode 100644
index 60ca57b4b..000000000
--- a/org.eclipse.mylyn.help.ui/about.html
+++ /dev/null
@@ -1,22 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd">
-<!-- saved from url=(0043)http://www.eclipse.org/legal/epl/about.html -->
-<HTML><HEAD><TITLE>About</TITLE>
-<META http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
-<META content="MSHTML 6.00.2900.2627" name=GENERATOR></HEAD>
-<BODY lang=EN-US>
-<H2>About This Content</H2>
-<P>February 24, 2005</P>
-<H3>License</H3>
-<P>The Eclipse Foundation makes available all content in this plug-in
-("Content"). Unless otherwise indicated below, the Content is provided to you
-under the terms and conditions of the Eclipse Public License Version 1.0
-("EPL"). A copy of the EPL is available at <A
-href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</A>.
-For purposes of the EPL, "Program" will mean the Content.</P>
-<P>If you did not receive this Content directly from the Eclipse Foundation, the
-Content is being redistributed by another party ("Redistributor") and different
-terms and conditions may apply to your use of any object code in the Content.
-Check the Redistributor's license that was provided with the Content. If no such
-license exists, contact the Redistributor. Unless otherwise indicated below, the
-terms and conditions of the EPL still apply to any source code in the
-Content.</P></BODY></HTML>
diff --git a/org.eclipse.mylyn.help.ui/build.properties b/org.eclipse.mylyn.help.ui/build.properties
deleted file mode 100644
index 1ff373b88..000000000
--- a/org.eclipse.mylyn.help.ui/build.properties
+++ /dev/null
@@ -1,22 +0,0 @@
-###############################################################################
-# Copyright (c) 2004 - 2005 University Of British Columbia and others.
-# 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:
-# University Of British Columbia - initial API and implementation
-###############################################################################
-source.mylar-doc.jar = src/
-output.mylar-doc.jar = bin/
-bin.includes = plugin.xml,\
- mylar-doc.jar,\
- META-INF/,\
- toc.xml,\
- about.html
-src.includes = META-INF/,\
- plugin.xml,\
- src/,\
- toc.xml,\
- about.html
diff --git a/org.eclipse.mylyn.help.ui/plugin.xml b/org.eclipse.mylyn.help.ui/plugin.xml
deleted file mode 100644
index 6bc9f066d..000000000
--- a/org.eclipse.mylyn.help.ui/plugin.xml
+++ /dev/null
@@ -1,15 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.0"?>
-<?eclipse version="3.0"?>
-<plugin>
-
- <extension
- id="org.eclipse.mylar.helpDocs"
- name="Mylar Help"
- point="org.eclipse.help.toc">
- <toc
- file="toc.xml"
- primary="true">
- </toc>
- </extension>
-</plugin>
diff --git a/org.eclipse.mylyn.help.ui/src/org/eclipse/mylyn/doc/MylarDocPlugin.java b/org.eclipse.mylyn.help.ui/src/org/eclipse/mylyn/doc/MylarDocPlugin.java
deleted file mode 100644
index 9b47f20d3..000000000
--- a/org.eclipse.mylyn.help.ui/src/org/eclipse/mylyn/doc/MylarDocPlugin.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 - 2005 University Of British Columbia and others.
- * 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:
- * University Of British Columbia - initial API and implementation
- *******************************************************************************/
-package org.eclipse.mylar.doc;
-
-import org.eclipse.ui.plugin.*;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.osgi.framework.BundleContext;
-
-/**
- * The main plugin class to be used in the desktop.
- */
-public class MylarDocPlugin extends AbstractUIPlugin {
- //The shared instance.
- private static MylarDocPlugin plugin;
-
- /**
- * The constructor.
- */
- public MylarDocPlugin() {
- super();
- plugin = this;
- }
-
- /**
- * This method is called upon plug-in activation
- */
- @Override
- public void start(BundleContext context) throws Exception {
- super.start(context);
- }
-
- /**
- * This method is called when the plug-in is stopped
- */
- @Override
- public void stop(BundleContext context) throws Exception {
- super.stop(context);
- plugin = null;
- }
-
- /**
- * Returns the shared instance.
- */
- public static MylarDocPlugin getDefault() {
- return plugin;
- }
-
- /**
- * Returns an image descriptor for the image file at the given
- * plug-in relative path.
- *
- * @param path the path
- * @return the image descriptor
- */
- public static ImageDescriptor getImageDescriptor(String path) {
- return AbstractUIPlugin.imageDescriptorFromPlugin("org.eclipse.mylar.doc", path);
- }
-}
diff --git a/org.eclipse.mylyn.help.ui/toc.xml b/org.eclipse.mylyn.help.ui/toc.xml
deleted file mode 100644
index 7f0d028c1..000000000
--- a/org.eclipse.mylyn.help.ui/toc.xml
+++ /dev/null
@@ -1,5 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?NLS TYPE="org.eclipse.help.toc"?>
-
-<toc label="Mylar" topic="docs/html/book.html">
-</toc>
diff --git a/org.eclipse.mylyn.tasks.tests/.classpath b/org.eclipse.mylyn.tasks.tests/.classpath
deleted file mode 100644
index a5424b27d..000000000
--- a/org.eclipse.mylyn.tasks.tests/.classpath
+++ /dev/null
@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins">
- <accessrules>
- <accessrule kind="accessible" pattern="**/internal/**"/>
- </accessrules>
- </classpathentry>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/org.eclipse.mylyn.tasks.tests/.cvsignore b/org.eclipse.mylyn.tasks.tests/.cvsignore
deleted file mode 100644
index ba077a403..000000000
--- a/org.eclipse.mylyn.tasks.tests/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-bin
diff --git a/org.eclipse.mylyn.tasks.tests/.project b/org.eclipse.mylyn.tasks.tests/.project
deleted file mode 100644
index 7bbb3bbd6..000000000
--- a/org.eclipse.mylyn.tasks.tests/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.mylar.tasks.tests</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
diff --git a/org.eclipse.mylyn.tasks.tests/META-INF/MANIFEST.MF b/org.eclipse.mylyn.tasks.tests/META-INF/MANIFEST.MF
deleted file mode 100644
index 1e20aa58b..000000000
--- a/org.eclipse.mylyn.tasks.tests/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,20 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: Mylar Tasklist Tests Plug-in
-Bundle-SymbolicName: org.eclipse.mylar.tasks.tests
-Bundle-Version: 1.0.0
-Bundle-Activator: org.eclipse.mylar.tasks.tests.MylarTasksTestsPlugin
-Bundle-Vendor: University of British Columbia
-Bundle-Localization: plugin
-Require-Bundle: org.eclipse.core.runtime,
- org.junit,
- org.eclipse.mylar.core,
- org.eclipse.mylar.core.tests,
- org.eclipse.mylar.tasks,
- org.eclipse.mylar.bugzilla,
- org.eclipse.jdt.core,
- org.eclipse.core.resources
-Eclipse-AutoStart: true
-Bundle-ClassPath: mylar-tasklist-tests.jar
-Export-Package: org.eclipse.mylar.tasks.bugzilla.tests,
- org.eclipse.mylar.tasks.tests
diff --git a/org.eclipse.mylyn.tasks.tests/about.html b/org.eclipse.mylyn.tasks.tests/about.html
deleted file mode 100644
index 60ca57b4b..000000000
--- a/org.eclipse.mylyn.tasks.tests/about.html
+++ /dev/null
@@ -1,22 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd">
-<!-- saved from url=(0043)http://www.eclipse.org/legal/epl/about.html -->
-<HTML><HEAD><TITLE>About</TITLE>
-<META http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
-<META content="MSHTML 6.00.2900.2627" name=GENERATOR></HEAD>
-<BODY lang=EN-US>
-<H2>About This Content</H2>
-<P>February 24, 2005</P>
-<H3>License</H3>
-<P>The Eclipse Foundation makes available all content in this plug-in
-("Content"). Unless otherwise indicated below, the Content is provided to you
-under the terms and conditions of the Eclipse Public License Version 1.0
-("EPL"). A copy of the EPL is available at <A
-href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</A>.
-For purposes of the EPL, "Program" will mean the Content.</P>
-<P>If you did not receive this Content directly from the Eclipse Foundation, the
-Content is being redistributed by another party ("Redistributor") and different
-terms and conditions may apply to your use of any object code in the Content.
-Check the Redistributor's license that was provided with the Content. If no such
-license exists, contact the Redistributor. Unless otherwise indicated below, the
-terms and conditions of the EPL still apply to any source code in the
-Content.</P></BODY></HTML>
diff --git a/org.eclipse.mylyn.tasks.tests/build.properties b/org.eclipse.mylyn.tasks.tests/build.properties
deleted file mode 100644
index 7ca24197e..000000000
--- a/org.eclipse.mylyn.tasks.tests/build.properties
+++ /dev/null
@@ -1,15 +0,0 @@
-###############################################################################
-# Copyright (c) 2004 - 2005 University Of British Columbia and others.
-# 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:
-# University Of British Columbia - initial API and implementation
-###############################################################################
-bin.includes = META-INF/,\
- mylar-tasklist-tests.jar
-jars.compile.order = mylar-tasklist-tests.jar
-source.mylar-tasklist-tests.jar = src/
-output.mylar-tasklist-tests.jar = bin/
diff --git a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/bugzilla/tests/BugzillaSearchPluginTest.java b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/bugzilla/tests/BugzillaSearchPluginTest.java
deleted file mode 100644
index ccb6e297b..000000000
--- a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/bugzilla/tests/BugzillaSearchPluginTest.java
+++ /dev/null
@@ -1,329 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 - 2005 University Of British Columbia and others.
- * 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:
- * University Of British Columbia - initial API and implementation
- *******************************************************************************/
-/*
- * Created on Nov 19, 2004
- */
-package org.eclipse.mylar.tasks.bugzilla.tests;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.IType;
-import org.eclipse.mylar.core.search.IActiveSearchListener;
-import org.eclipse.mylar.core.tests.support.WorkspaceSetupHelper;
-import org.eclipse.mylar.core.tests.support.search.SearchPluginTestHelper;
-import org.eclipse.mylar.tasks.BugzillaTask;
-import org.eclipse.mylar.tasks.ITask;
-import org.eclipse.mylar.tasks.MylarTasksPlugin;
-import org.eclipse.mylar.tasks.Task;
-import org.eclipse.mylar.tasks.TaskList;
-import org.eclipse.mylar.tasks.BugzillaTask.BugTaskState;
-import org.eclipse.mylar.tasks.bugzilla.BugzillaReportNode;
-import org.eclipse.mylar.tasks.bugzilla.search.BugzillaMylarSearch;
-
-/*TEST CASES TO HANDLE
- * 1. what is here
- * 2. different scopes ( local and remote )
- * 3. no bugs
- * 4. offline bugs
- *
- * DEGREE OF SEPARATIONS
- * 1 Local bug, qualified reference
- * 2 local bug, unqualified reference
- * 3 remote bug, qualified reference
- * 4 remote bug, unqualified reference
- * 5 NONE
- */
-
-/**
- * Test the bugzilla search functionality of the bridge
- * @author Shawn Minto
- */
-public class BugzillaSearchPluginTest extends TestCase{
-
- //SHAWNTODO Add tests for the different types of searches (local qual, local unqual, fully qual, unqual) and mock up a bugs db for testing
-
- /** The expected number of results when searching for astNode */
-// SHAWNTODO add back in when we have a test server mocked up
-// private static final int NUM_AST_RESULTS = 302;
-//
-// private static final int NUM_AST_SETSOURCERANGE_RESULTS = 15;
-
- /** list to add collectors to when notified */
- private List<List<?>> lists = new ArrayList<List<?>>();
-
- private IType astNodeType;
-
- @Override
- protected void setUp() throws Exception {
- WorkspaceSetupHelper.setupWorkspace();
- IJavaProject jp = WorkspaceSetupHelper.getJdtCoreDomProject();
- astNodeType = WorkspaceSetupHelper.getType(jp, "org.eclipse.jdt.core.dom.ASTNode");
- }
-
- @Override
- protected void tearDown() throws Exception {
- WorkspaceSetupHelper.clearDoiModel();
- }
-
- /**
- * Test adding and removing ISearchCompletedListeners
- */
- public void testSearchCompletedListenerAddAndRemove(){
- lists.clear();
-
- // create 2 listeners
- IActiveSearchListener l1 =new IActiveSearchListener() {
- private boolean gathered = false;
-
- public void searchCompleted(List<?> l)
- {
- lists.add(l);
- gathered = true;
- }
-
- public boolean resultsGathered() {
- return gathered;
- }
- };
- IActiveSearchListener l2 =new IActiveSearchListener() {
- private boolean gathered = false;
-
- public void searchCompleted(List<?> l)
- {
- lists.add(l);
- gathered = true;
- }
-
- public boolean resultsGathered() {
- return gathered;
- }
- };
-
- BugzillaMylarSearch s = new BugzillaMylarSearch(BugzillaMylarSearch.UNQUAL, astNodeType);
-
- // add the first listener
- s.addListener(l1);
- // remove the first listener
- s.removeListener(l1);
-
- // perform the search
- SearchPluginTestHelper.search(s, l2);
-
- // make sure that only the second listener added has any results left
- assertTrue("listener was not removed", lists.size() >= 1 && !l1.resultsGathered());
- assertTrue("listener was not added", lists.size() == 1);
-
- // display the time it took for the search
-// System.err.println("Search Took About " + time + " seconds");
- MylarTasksPlugin.getBridge().removeFromLandmarksHash(astNodeType);
- }
-
- /**
- * Tests that the bridge gets the right data for us
- * This test is wierd because it waits on results.
- */
- public void testBridge() {
- lists.clear();
- BugzillaMylarSearch s = new BugzillaMylarSearch(BugzillaMylarSearch.UNQUAL, astNodeType);
-
- IActiveSearchListener l = new IActiveSearchListener() {
- private boolean gathered = false;
-
- public void searchCompleted(List<?> results)
- {
- lists.add(results);
- gathered = true;
- }
-
- public boolean resultsGathered() {
- return gathered;
- }
- };
-
- // perform the search
- SearchPluginTestHelper.search(s, l);
-
- // make sure we got the right number of bugs back
- assertTrue("No collector returned", lists.size() != 0);
- List<?> c = lists.get(0);
- assertTrue("Results not the right size", c.size() > 0); // TODO should be assertEquals on expected size
-
- // display the time it took for the search and the results returned
-// System.err.println("Search Took About " + time + " seconds");
-// System.err.println(c);
- MylarTasksPlugin.getBridge().removeFromLandmarksHash(astNodeType);
-
- }
-
-
- /**
- * Tests that the bridge saves the results of a search so that it
- * can be used later
- */
- public void testSaveResults() {
- lists.clear();
- BugzillaMylarSearch s = new BugzillaMylarSearch(BugzillaMylarSearch.UNQUAL, astNodeType);
-
- IActiveSearchListener l = new IActiveSearchListener() {
- private boolean gathered = false;
-
- public void searchCompleted(List<?> results)
- {
- lists.add(results);
- gathered = true;
- }
-
- public boolean resultsGathered() {
- return gathered;
- }
- };
-
- // perform the search
- SearchPluginTestHelper.search(s, l);
-// System.err.println("Search Took About " + time + " seconds");
-
- // do an inital search
- assertTrue("No collectors returned", lists.size() != 0);
- List<?> c = lists.get(0);
- assertTrue("Results not the right size", c.size() > 0); // TODO should be assertEquals on expected size
-
- // check that the search has been saved
- List<BugzillaReportNode> saved = MylarTasksPlugin.getBridge().getFromLandmarksHash(astNodeType, BugzillaMylarSearch.UNQUAL);
- assertTrue("Results not cached", saved != null);
- assertTrue("Results not the right size", saved.size() > 0); // TODO should be assertEquals on expected size
-
- assertTrue(c.containsAll(saved) && saved.containsAll(c));
- MylarTasksPlugin.getBridge().removeFromLandmarksHash(astNodeType);
- }
-
- public void testLocalBugUnqual() throws InterruptedException {
- lists.clear();
-
- String bugPrefix = "Bugzilla-";
-
- TaskList t = MylarTasksPlugin.getTaskListManager().createNewTaskList();
- MylarTasksPlugin.getTaskListManager().setTaskList(t);
- ITask cat = new Task(MylarTasksPlugin.getTaskListManager().genUniqueTaskId(), "Testing Category");
- t.addRootTask(cat);
- BugzillaTask bugTask1 = new BugzillaTask(bugPrefix +94185, "<bugzilla info>");
- cat.addSubtask(bugTask1);
- while(bugTask1.getState() != BugTaskState.FREE){
- Thread.sleep(500);
- }
- BugzillaTask bugTask2 = new BugzillaTask(bugPrefix + 3692, "<bugzilla info>");
- bugTask1.addSubtask(bugTask2);
- while(bugTask2.getState() != BugTaskState.FREE){
- Thread.sleep(500);
- }
- BugzillaTask bugTask3 = new BugzillaTask(bugPrefix + 3693, "<bugzilla info>");
- cat.addSubtask(bugTask3);
- while(bugTask3.getState() != BugTaskState.FREE){
- Thread.sleep(500);
- }
-
- BugzillaTask bugTask4 = new BugzillaTask(bugPrefix + 9583, "<bugzilla info>");
- bugTask3.addSubtask(bugTask4);
- while(bugTask4.getState() != BugTaskState.FREE){
- Thread.sleep(500);
- }
-
- BugzillaMylarSearch s = new BugzillaMylarSearch(BugzillaMylarSearch.LOCAL_UNQUAL, astNodeType);
-
- IActiveSearchListener l = new IActiveSearchListener() {
- private boolean gathered = false;
-
- public void searchCompleted(List<?> results)
- {
- lists.add(results);
- gathered = true;
- }
-
- public boolean resultsGathered() {
- return gathered;
- }
- };
-
- // perform the search
- SearchPluginTestHelper.search(s, l);
-// System.err.println("Search Took About " + time + " seconds");
-
- // do an inital search
- assertTrue("No collectors returned", lists.size() != 0);
- List<?> c = lists.get(0);
- assertEquals("Results not the right size", 3, c.size());
-
- MylarTasksPlugin.getBridge().removeFromLandmarksHash(astNodeType);
- MylarTasksPlugin.getTaskListManager().deleteTask(cat);
- }
-
- //TODO need to test a bug that wraps...should fail since we can only search on a single line
- public void testLocalBugFullyQual() throws InterruptedException{
- lists.clear();
-
- String bugPrefix = "Bugzilla-";
-
-
- TaskList t = MylarTasksPlugin.getTaskListManager().createNewTaskList();
- MylarTasksPlugin.getTaskListManager().setTaskList(t);
- ITask cat = new Task(MylarTasksPlugin.getTaskListManager().genUniqueTaskId(), "Testing Category");
- t.addRootTask(cat);
- BugzillaTask bugTask1 = new BugzillaTask(bugPrefix + 94185, "<bugzilla info>");
- cat.addSubtask(bugTask1);
- while(bugTask1.getState() != BugTaskState.FREE){
- Thread.sleep(500);
- }
-
- BugzillaTask bugTask2 = new BugzillaTask(bugPrefix + 9583, "<bugzilla info>");
- bugTask1.addSubtask(bugTask2);
- while(bugTask2.getState() != BugTaskState.FREE){
- Thread.sleep(500);
- }
- BugzillaTask bugTask3 = new BugzillaTask(bugPrefix + 3693, "<bugzilla info>");
- cat.addSubtask(bugTask3);
- while(bugTask3.getState() != BugTaskState.FREE){
- Thread.sleep(500);
- }
-
-
- BugzillaMylarSearch s = new BugzillaMylarSearch(BugzillaMylarSearch.LOCAL_QUAL, astNodeType);
-
- IActiveSearchListener l = new IActiveSearchListener() {
- private boolean gathered = false;
-
- public void searchCompleted(List<?> results)
- {
- lists.add(results);
- gathered = true;
- }
-
- public boolean resultsGathered() {
- return gathered;
- }
- };
-
- // perform the search
- SearchPluginTestHelper.search(s, l);
-// System.err.println("Search Took About " + time + " seconds");
-
- // do an inital search
- assertTrue("No collectors returned", lists.size() != 0);
- List<?> c = lists.get(0);
- assertEquals("Results not the right size", 1, c.size());
-
- MylarTasksPlugin.getBridge().removeFromLandmarksHash(astNodeType);
- MylarTasksPlugin.getTaskListManager().deleteTask(cat);
- }
-
-}
diff --git a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/bugzilla/tests/BugzillaStackTraceTest.java b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/bugzilla/tests/BugzillaStackTraceTest.java
deleted file mode 100644
index 1ca6993e0..000000000
--- a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/bugzilla/tests/BugzillaStackTraceTest.java
+++ /dev/null
@@ -1,170 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 - 2005 University Of British Columbia and others.
- * 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:
- * University Of British Columbia - initial API and implementation
- *******************************************************************************/
-////Created on Oct 12, 2004
-package org.eclipse.mylar.tasks.bugzilla.tests;
-
-import java.io.File;
-import java.io.FileReader;
-import java.io.Reader;
-import java.util.ArrayList;
-import java.util.List;
-
-import junit.framework.TestCase;
-
-import org.eclipse.core.runtime.Path;
-import org.eclipse.mylar.bugzilla.core.internal.BugParser;
-import org.eclipse.mylar.bugzilla.search.BugzillaSearchHit;
-import org.eclipse.mylar.core.tests.MylarCoreTestsPlugin;
-import org.eclipse.mylar.core.tests.support.FileTool;
-import org.eclipse.mylar.tasks.bugzilla.BugzillaReportNode;
-import org.eclipse.mylar.tasks.bugzilla.StackTrace;
-import org.eclipse.mylar.tasks.bugzilla.search.BugzillaMylarSearchOperation;
-
-
-/**
- * Class to test the Bridge methods that do not require server queries
- * @author Shawn Minto
- */
-public class BugzillaStackTraceTest extends TestCase {
-
- private static final String TEST_FILE_LOC = "testdata/BugzillaBridgeData/";
-
- private static final String BUGZILLA_SERVER_NAME = "https://bugs.eclipse.org/bugs";
-
- /**
- * Test that the regular expression escaping mechanism works properly
- */
- public void testREGEX(){
- String r = ".*+(){}[]^$|?/\\";
- String r2 = StackTrace.escapeForRegex(r);
- String ans = "\\.\\*\\+\\(\\)\\{\\}\\[\\]\\^\\$\\|\\?\\/\\\\";
- String msg = "Regular Expression matching wrong:\nwas: " + r2 + "\nshould be:" + ans;
- assertTrue(msg, r2.equals(ans));
- }
-
- /**
- * Test parsing the bug for multiple stacks in in
- */
- public void testMultipleStacksDiffComments(){
- // BUG 4862 - 2 stack traces - 1 in description, 1 in comment - text before and after
- performParse(4862, "4862.html", 2, false);
-
- }
-
- /**
- * Test parsing the bug for a single stack in the description with some
- * text before it
- */
- public void testSingleStackCodeBeforeInDescription(){
-
- // BUG 76388 - 1 stack trace - description - text before and formatted ugly
- performParse(76388, "76388.html", 1, false);
- }
-
- /**
- * Test parsing the bug for a single stack trace in the description with
- * text before and after it
- */
- public void testSingleStackCodeBeforeAndAfterInDescription(){
-
- // BUG 76146 - 1 stack trace - description - text before and code after
- performParse(76146, "76146.html", 1, false);
- }
-
- /**
- * Test parsing a bug that has 1 stack trace in the description with no extra
- * text, but has lines in it that span 3 lines
- */
- public void testSingleStackPoorFormatInDescription(){
- // BUG 67395 - 1 stack trace - description - no extra text, 1 at line spans 3 lines
- performParse(67395, "67395.html", 1, false);
- }
-
- /**
- * Test parsing a bug with no stack traces and no qualified exception names
- */
- public void testNoStackNoQualified(){
- // BUG 4548 - no stack traces, no qualified reference to an exception
- performParse(4548, "4548.html", 0, false);
- }
-
- /**
- * Test parsing a bug with no stack traces, but a qualified reference to
- * an exception
- */
- public void testNoStackQual(){
- // BUG 1 - no stack traces, qualified reference to exception - made up bug
- performParse(1, "1.html", 0, false);
- }
-
-
- /**
- * Test parsing of a bug with 1 stack trace and multiple qualified references
- */
- public void testSingleStackQual(){
- // BUG 2 - 1 stack trace- 2 qual ref, stack trace, 1 qual ref - made up bug
- performParse(2, "2.html", 1, false);
- }
-
- /**
- * Test parsing of a bug with many stacks traces in a single comment
- */
- public void testMultipleStackSingleComment(){
- // BUG 40152 - 1 stack trace- 2 qual ref, stack trace, 1 qual ref - made up bug
- performParse(40152, "40152.html", 33, false);
- }
-
- /**
- * Print out the stack traces
- * @param l List of stack traces
- */
- private void printStackTraces(List<StackTrace> l){
- System.out.println("\n\n");
- for(int i = 0; i < l.size(); i++){
- StackTrace trace = l.get(i);
- System.out.println("*****************?????????????????*****************\n");
- System.out.println("OFFSET: " + trace.getOffset() + " LENGTH: " + trace.getLength());
- System.out.println(trace.getStackTrace());
- System.out.println("*****************?????????????????*****************\n\n");
- }
- }
-
- private void performParse(int bugNumber, String bugFileName, int numTracesExpected, boolean printStackTraces){
-
- BugzillaSearchHit hit = new BugzillaSearchHit(bugNumber,"","","","","","","","", "<TEST-SERVER>"); // stack trace in desc and com
-
- // create a new doi info
- BugzillaReportNode doi = new BugzillaReportNode(0, hit, false);
- try {
-
- // read the bug in from a file
- File f = FileTool.getFileInPlugin(MylarCoreTestsPlugin.getDefault(), new Path(TEST_FILE_LOC+bugFileName)); // used if run as a plugin test
-// File f = new File(TEST_FILE_LOC+bugFileName); // used if run as a standalone test
- Reader reader = new FileReader(f);
- doi.setBug(BugParser.parseBug(reader, hit.getId(), BUGZILLA_SERVER_NAME, true, null, null));
- reader.close();
- } catch (Exception e) {
- e.printStackTrace();
- }
-
- // do a second pass parse on the bug
- List<BugzillaReportNode> l = new ArrayList<BugzillaReportNode>();
- l.add(doi);
- BugzillaMylarSearchOperation.secondPassBugzillaParser(l);
-
- // make sure that we received the right number of stack traces back
-// System.out.println("*** BUG " + hit.getId() + " ***");
-// System.out.println("NumStackTraces = " + doi.getStackTraces().size());
- assertEquals("Wrong Number stack traces", numTracesExpected, doi.getStackTraces().size());
- if(printStackTraces)
- printStackTraces(doi.getStackTraces());
- }
-}
diff --git a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/bugzilla/tests/MylarBugzillaTestsPlugin.java b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/bugzilla/tests/MylarBugzillaTestsPlugin.java
deleted file mode 100644
index 87a99779a..000000000
--- a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/bugzilla/tests/MylarBugzillaTestsPlugin.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 - 2005 University Of British Columbia and others.
- * 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:
- * University Of British Columbia - initial API and implementation
- *******************************************************************************/
-package org.eclipse.mylar.tasks.bugzilla.tests;
-
-import org.eclipse.core.runtime.Plugin;
-import org.osgi.framework.BundleContext;
-
-/**
- * The main plugin class to be used in the desktop.
- */
-public class MylarBugzillaTestsPlugin extends Plugin {
- //The shared instance.
- private static MylarBugzillaTestsPlugin plugin;
-
- /**
- * The constructor.
- */
- public MylarBugzillaTestsPlugin() {
- super();
- plugin = this;
- }
-
- @Override
- public void start(BundleContext context) throws Exception {
- super.start(context);
- }
-
- @Override
- public void stop(BundleContext context) throws Exception {
- super.stop(context);
- plugin = null;
- }
-
- /**
- * Returns the shared instance.
- */
- public static MylarBugzillaTestsPlugin getDefault() {
- return plugin;
- }
-
-}
diff --git a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/Job.java b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/Job.java
deleted file mode 100644
index 62d95fcce..000000000
--- a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/Job.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 - 2005 University Of British Columbia and others.
- * 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:
- * University Of British Columbia - initial API and implementation
- *******************************************************************************/
-package org.eclipse.mylar.tasks.tests;
-
-public class Job {
- private String company;
- private String position;
- private int salary;
- private String email;
- private String supervisor;
-
- public static String foo = "TESTING STATIC FOR XSTREAM";
-
- public Job() {
- this.company = "Foo";
- this.position = "slave";
- this.salary = 100;
- this.email = "a@bc.com";
- //this.supervisor = "bill gates";
- }
-
- public Job(String comp, String pos, int salary, String email, String supervisor) {
- this.company = comp;
- this.position = pos;
- this.salary = salary;
- this.email = email;
- this.supervisor = supervisor;
- }
-
- public boolean equals(Job j) {
- boolean result = true;
- result = result && j.company == this.company;
- result = result && j.position == this.position;
- result = result && j.salary == this.salary;
- result = result && j.email == this.email;
- result = result && j.supervisor == this.supervisor;
- return result;
- }
-
- public String getCompany() {
- return company;
- }
-
- public void setCompany(String company) {
- this.company = company;
- }
-
- public String getEmail() {
- return email;
- }
-
- public void setEmail(String email) {
- this.email = email;
- }
-
- public String getPosition() {
- return position;
- }
-
- public void setPosition(String position) {
- this.position = position;
- }
-
- public int getSalary() {
- return salary;
- }
-
- public void setSalary(int salary) {
- this.salary = salary;
- }
-
- public String getSupervisor() {
- return supervisor;
- }
-
- public void setSupervisor(String supervisor) {
- this.supervisor = supervisor;
- }
-}
diff --git a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/MylarTasksTestsPlugin.java b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/MylarTasksTestsPlugin.java
deleted file mode 100644
index 7d420e1fd..000000000
--- a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/MylarTasksTestsPlugin.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 - 2005 University Of British Columbia and others.
- * 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:
- * University Of British Columbia - initial API and implementation
- *******************************************************************************/
-package org.eclipse.mylar.tasks.tests;
-
-import org.eclipse.core.runtime.Plugin;
-import org.osgi.framework.BundleContext;
-
-/**
- * The main plugin class to be used in the desktop.
- */
-public class MylarTasksTestsPlugin extends Plugin {
- //The shared instance.
- private static MylarTasksTestsPlugin plugin;
-
- /**
- * The constructor.
- */
- public MylarTasksTestsPlugin() {
- super();
- plugin = this;
- }
-
- @Override
- public void start(BundleContext context) throws Exception {
- super.start(context);
- }
-
- @Override
- public void stop(BundleContext context) throws Exception {
- super.stop(context);
- plugin = null;
- }
-
- /**
- * Returns the shared instance.
- */
- public static MylarTasksTestsPlugin getDefault() {
- return plugin;
- }
-
-}
diff --git a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/People.java b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/People.java
deleted file mode 100644
index 2e88dcca4..000000000
--- a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/People.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 - 2005 University Of British Columbia and others.
- * 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:
- * University Of British Columbia - initial API and implementation
- *******************************************************************************/
-package org.eclipse.mylar.tasks.tests;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-
-public class People {
- private List<Person> list = new ArrayList<Person>();
-
- public People() {
- // don't need to do any initialization
- }
-
- public void createDefault() {
- Person p = new Person("Ken Sueda", "ksueda@hotmail.com", "123-4567", 22, 1);
- Job j = new Job("UBCCS", "developer", 1000, "ksueda@cs.ubc.ca", "foo");
- p.setJob(j);
- list.add(p);
-
- p = new Person("Shawn Minto", "minto@hotmail.com", "798-1234", 23, 2);
- j = new Job("UBCCS", "grad student", 3000, "minto@cs.ubc.ca", "foo");
- p.setJob(j);
- list.add(p);
-
-
- p = new Person("Mik Kersten", "kersten@hotmail.com", "456-7891", 24, 3);
- j = new Job("UBCCS", "PhD", 1000000, "kersten@cs.ubc.ca", "foo");
- p.setJob(j);
- list.add(p);
-
- p = new Person("Gail Murphy", "murphy@hotmail.com", "987-6543", 25, 4);
- j = new Job("UBCCS", "Professor", 100000000, "", "");
- p.setJob(j);
- list.add(p);
- }
-
- public boolean equals(People people) {
- boolean result = true;
- if (list.size() == people.list.size()) {
- Iterator<Person> itr = list.iterator();
- Iterator<Person> itr2 = people.list.iterator();
-
- while(itr.hasNext()) {
- Person p = itr.next();
- Person p2 = itr2.next();
- result = result && p.equals(p2);
- if (!result) {
- break;
- }
- }
- } else {
- result = false;
- }
- return result;
- }
-}
diff --git a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/Person.java b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/Person.java
deleted file mode 100644
index b4064f1b1..000000000
--- a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/Person.java
+++ /dev/null
@@ -1,106 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 - 2005 University Of British Columbia and others.
- * 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:
- * University Of British Columbia - initial API and implementation
- *******************************************************************************/
-package org.eclipse.mylar.tasks.tests;
-
-import java.util.ArrayList;
-import java.util.List;
-
-public class Person {
- private String name;
- private String emailAddress;
- private String phoneNumber;
- private int age;
- private int id;
- private Job job;
-
- private List<Person> list = new ArrayList<Person>();
-
- public Person() {
- name = "Ken Sueda";
- id = 1;
- age = 22;
- emailAddress = "ksueda@hotmail.com";
- phoneNumber = "123-4567";
- job = null;
- }
-
- public Person(String name, String email, String phone, int age, int id) {
- this.name = name;
- this.emailAddress = email;
- this.phoneNumber = phone;
- this.age = age;
- this.id = id;
- this.job = null;
- }
-
- public void add(Person p) {
- list.add(p);
- }
-
- public boolean equals(Person p) {
- boolean result = true;
- result = result && p.name == this.name;
- result = result && p.emailAddress == this.emailAddress;
- result = result && p.phoneNumber == this.phoneNumber;
- result = result && p.age == this.age;
- result = result && p.id == this.id;
- result = result && p.job.equals(this.job);
- return result;
- }
-
- public int getAge() {
- return age;
- }
-
- public void setAge(int age) {
- this.age = age;
- }
-
- public int getId() {
- return id;
- }
-
- public void setId(int id) {
- this.id = id;
- }
-
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- public String getEmailAddress() {
- return emailAddress;
- }
-
- public void setEmailAddress(String emailAddress) {
- this.emailAddress = emailAddress;
- }
-
- public String getPhoneNumber() {
- return phoneNumber;
- }
-
- public void setPhoneNumber(String phoneNumber) {
- this.phoneNumber = phoneNumber;
- }
-
- public Job getJob() {
- return job;
- }
-
- public void setJob(Job job) {
- this.job = job;
- }
-}
diff --git a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskListManagerTest.java b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskListManagerTest.java
deleted file mode 100644
index c5ce152db..000000000
--- a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskListManagerTest.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 - 2005 University Of British Columbia and others.
- * 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:
- * University Of British Columbia - initial API and implementation
- *******************************************************************************/
-/*
- * Created on Dec 21, 2004
- */
-package org.eclipse.mylar.tasks.tests;
-
-import java.io.File;
-
-import junit.framework.TestCase;
-
-import org.eclipse.mylar.tasks.MylarTasksPlugin;
-import org.eclipse.mylar.tasks.Task;
-import org.eclipse.mylar.tasks.TaskListManager;
-
-/**
- * @author Mik Kersten
- */
-public class TaskListManagerTest extends TestCase {
-
- public void testCreationAndExternalization() {
- File file = new File("foo" + MylarTasksPlugin.FILE_EXTENSION);
- file.deleteOnExit();
- TaskListManager manager = new TaskListManager(file);
-
- manager.createNewTaskList();
-// Category category = taskList.createCategory("category");
- Task task1 = new Task(MylarTasksPlugin.getTaskListManager().genUniqueTaskId(), "task 1");
-// category.addTask(task1);
- task1.addSubtask(new Task(MylarTasksPlugin.getTaskListManager().genUniqueTaskId(), "sub task 1"));
- assertEquals(task1.getChildren().size(), 1);
-
- manager.saveTaskList();
- assertNotNull(manager.getTaskList());
- manager.setTaskList(null);
-// manager.readTaskList();
-// assertNotNull(manager.getTaskList());
-// assertEquals(manager.getTaskList().getCategories().size(), 1);
-// assertEquals(manager.getTaskList().findCategory("category").getTasks().size(), 1);
-// assertEquals(manager.getTaskList().findCategory("category").getTasks().get(0).getLabel(), "task 1");
- }
-}
diff --git a/org.eclipse.mylyn.tasks.ui/.classpath b/org.eclipse.mylyn.tasks.ui/.classpath
deleted file mode 100644
index 003e39624..000000000
--- a/org.eclipse.mylyn.tasks.ui/.classpath
+++ /dev/null
@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins">
- <accessrules>
- <accessrule kind="accessible" pattern="**/internal/**"/>
- </accessrules>
- </classpathentry>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/org.eclipse.mylyn.tasks.ui/.cvsignore b/org.eclipse.mylyn.tasks.ui/.cvsignore
deleted file mode 100644
index ba077a403..000000000
--- a/org.eclipse.mylyn.tasks.ui/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-bin
diff --git a/org.eclipse.mylyn.tasks.ui/.project b/org.eclipse.mylyn.tasks.ui/.project
deleted file mode 100644
index 2537de5d3..000000000
--- a/org.eclipse.mylyn.tasks.ui/.project
+++ /dev/null
@@ -1,30 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.mylar.tasks</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jem.beaninfo.BeanInfoNature</nature>
- </natures>
-</projectDescription>
diff --git a/org.eclipse.mylyn.tasks.ui/META-INF/MANIFEST.MF b/org.eclipse.mylyn.tasks.ui/META-INF/MANIFEST.MF
deleted file mode 100644
index fffccc8ea..000000000
--- a/org.eclipse.mylyn.tasks.ui/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,33 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: Mylar Task Plug-in
-Bundle-SymbolicName: org.eclipse.mylar.tasks; singleton:=true
-Bundle-Version: 0.2.4
-Bundle-Activator: org.eclipse.mylar.tasks.MylarTasksPlugin
-Bundle-Localization: plugin
-Require-Bundle: org.eclipse.ui,
- org.eclipse.core.runtime,
- org.eclipse.core.resources,
- org.eclipse.ui.views,
- org.eclipse.ui.forms,
- org.eclipse.ui.ide,
- org.eclipse.osgi.util,
- org.eclipse.osgi.services,
- org.eclipse.search,
- org.eclipse.jdt.ui,
- org.eclipse.pde.ui,
- org.eclipse.mylar.core,
- org.eclipse.mylar.ui,
- org.eclipse.mylar.bugzilla,
- org.eclipse.jdt.core
-Eclipse-AutoStart: true
-Bundle-Vendor: University of British Columbia
-Bundle-ClassPath: mylar-tasklist.jar
-Export-Package: org.eclipse.mylar.tasks,
- org.eclipse.mylar.tasks.bugzilla,
- org.eclipse.mylar.tasks.bugzilla.search,
- org.eclipse.mylar.tasks.bugzilla.ui,
- org.eclipse.mylar.tasks.ui,
- org.eclipse.mylar.tasks.ui.actions,
- org.eclipse.mylar.tasks.ui.views,
- org.eclipse.mylar.tasks.util
diff --git a/org.eclipse.mylyn.tasks.ui/about.html b/org.eclipse.mylyn.tasks.ui/about.html
deleted file mode 100644
index 60ca57b4b..000000000
--- a/org.eclipse.mylyn.tasks.ui/about.html
+++ /dev/null
@@ -1,22 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd">
-<!-- saved from url=(0043)http://www.eclipse.org/legal/epl/about.html -->
-<HTML><HEAD><TITLE>About</TITLE>
-<META http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
-<META content="MSHTML 6.00.2900.2627" name=GENERATOR></HEAD>
-<BODY lang=EN-US>
-<H2>About This Content</H2>
-<P>February 24, 2005</P>
-<H3>License</H3>
-<P>The Eclipse Foundation makes available all content in this plug-in
-("Content"). Unless otherwise indicated below, the Content is provided to you
-under the terms and conditions of the Eclipse Public License Version 1.0
-("EPL"). A copy of the EPL is available at <A
-href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</A>.
-For purposes of the EPL, "Program" will mean the Content.</P>
-<P>If you did not receive this Content directly from the Eclipse Foundation, the
-Content is being redistributed by another party ("Redistributor") and different
-terms and conditions may apply to your use of any object code in the Content.
-Check the Redistributor's license that was provided with the Content. If no such
-license exists, contact the Redistributor. Unless otherwise indicated below, the
-terms and conditions of the EPL still apply to any source code in the
-Content.</P></BODY></HTML>
diff --git a/org.eclipse.mylyn.tasks.ui/build.properties b/org.eclipse.mylyn.tasks.ui/build.properties
deleted file mode 100644
index c9d4ccc4a..000000000
--- a/org.eclipse.mylyn.tasks.ui/build.properties
+++ /dev/null
@@ -1,24 +0,0 @@
-###############################################################################
-# Copyright (c) 2004 - 2005 University Of British Columbia and others.
-# 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:
-# University Of British Columbia - initial API and implementation
-###############################################################################
-bin.includes = plugin.xml,\
- icons/,\
- lib/,\
- mylar-tasklist.jar,\
- META-INF/
-src.includes = icons/,\
- plugin.xml,\
- tasklist.jar,\
- src/,\
- lib/,\
- META-INF/
-jars.compile.order = mylar-tasklist.jar
-source.mylar-tasklist.jar = src/
-output.mylar-tasklist.jar = bin/
diff --git a/org.eclipse.mylyn.tasks.ui/icons/elcl16/delete.gif b/org.eclipse.mylyn.tasks.ui/icons/elcl16/delete.gif
deleted file mode 100644
index b6922ac11..000000000
--- a/org.eclipse.mylyn.tasks.ui/icons/elcl16/delete.gif
+++ /dev/null
Binary files differ
diff --git a/org.eclipse.mylyn.tasks.ui/icons/elcl16/refresh.gif b/org.eclipse.mylyn.tasks.ui/icons/elcl16/refresh.gif
deleted file mode 100644
index 634306d4c..000000000
--- a/org.eclipse.mylyn.tasks.ui/icons/elcl16/refresh.gif
+++ /dev/null
Binary files differ
diff --git a/org.eclipse.mylyn.tasks.ui/icons/elcl16/remove.gif b/org.eclipse.mylyn.tasks.ui/icons/elcl16/remove.gif
deleted file mode 100644
index 2cd9c5444..000000000
--- a/org.eclipse.mylyn.tasks.ui/icons/elcl16/remove.gif
+++ /dev/null
Binary files differ
diff --git a/org.eclipse.mylyn.tasks.ui/icons/elcl16/synched.gif b/org.eclipse.mylyn.tasks.ui/icons/elcl16/synched.gif
deleted file mode 100644
index 870934b69..000000000
--- a/org.eclipse.mylyn.tasks.ui/icons/elcl16/synched.gif
+++ /dev/null
Binary files differ
diff --git a/org.eclipse.mylyn.tasks.ui/icons/elcl16/task-bugzilla.gif b/org.eclipse.mylyn.tasks.ui/icons/elcl16/task-bugzilla.gif
deleted file mode 100644
index 8704e4df2..000000000
--- a/org.eclipse.mylyn.tasks.ui/icons/elcl16/task-bugzilla.gif
+++ /dev/null
Binary files differ
diff --git a/org.eclipse.mylyn.tasks.ui/icons/elcl16/task-category-new.gif b/org.eclipse.mylyn.tasks.ui/icons/elcl16/task-category-new.gif
deleted file mode 100644
index bcae2d487..000000000
--- a/org.eclipse.mylyn.tasks.ui/icons/elcl16/task-category-new.gif
+++ /dev/null
Binary files differ
diff --git a/org.eclipse.mylyn.tasks.ui/icons/elcl16/task-category.gif b/org.eclipse.mylyn.tasks.ui/icons/elcl16/task-category.gif
deleted file mode 100644
index 112cb65b4..000000000
--- a/org.eclipse.mylyn.tasks.ui/icons/elcl16/task-category.gif
+++ /dev/null
Binary files differ
diff --git a/org.eclipse.mylyn.tasks.ui/icons/elcl16/task.gif b/org.eclipse.mylyn.tasks.ui/icons/elcl16/task.gif
deleted file mode 100644
index a2948dff6..000000000
--- a/org.eclipse.mylyn.tasks.ui/icons/elcl16/task.gif
+++ /dev/null
Binary files differ
diff --git a/org.eclipse.mylyn.tasks.ui/icons/eview16/tasklist.gif b/org.eclipse.mylyn.tasks.ui/icons/eview16/tasklist.gif
deleted file mode 100644
index 3efb0536a..000000000
--- a/org.eclipse.mylyn.tasks.ui/icons/eview16/tasklist.gif
+++ /dev/null
Binary files differ
diff --git a/org.eclipse.mylyn.tasks.ui/plugin.xml b/org.eclipse.mylyn.tasks.ui/plugin.xml
deleted file mode 100644
index 2061a3803..000000000
--- a/org.eclipse.mylyn.tasks.ui/plugin.xml
+++ /dev/null
@@ -1,47 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.0"?>
-<plugin>
-
- <extension
- name="Mylar Tasks startup"
- point="org.eclipse.ui.startup">
- </extension>
-
- <extension point="org.eclipse.ui.views">
- <category name="Mylar Tools" id="org.eclipse.mylar"/>
-
- <view name="Mylar Tasks"
- icon="icons/eview16/tasklist.gif"
- category="org.eclipse.mylar"
- class="org.eclipse.mylar.tasks.ui.views.TaskListView"
- id="org.eclipse.mylar.tasks.ui.views.TaskListView" />
- </extension>
- <extension
- point="org.eclipse.ui.editors">
- <editor
- icon="icons/eview16/tasklist.gif"
- class="org.eclipse.mylar.tasks.ui.TaskEditor"
- name="Task Viewer"
- id="org.eclipse.mylar.tasks.ui.taskEditor"/>
- <editor
- icon="icons/eview16/tasklist.gif"
- name="Bugzilla task viewer"
- class="org.eclipse.mylar.tasks.ui.BugzillaTaskEditor"
- id="org.eclipse.mylar.tasks.ui.bugzillaTaskEditor"/>
- </extension>
-
- <extension point="org.eclipse.ui.commands">
- <command
- name="Interest filtering"
- description="Interest filtering"
- id="org.eclipse.mylar.ui.interest.filtering"
- categoryId="org.eclipse.mylar.ui">
- </command>
- <command
- name="Intersection mode"
- description="Intersection mode"
- id="org.eclipse.mylar.ui.interest.intersection"
- categoryId="org.eclipse.mylar.ui">
- </command>
- </extension>
-</plugin>
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/BugzillaTask.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/BugzillaTask.java
deleted file mode 100644
index f3af722dd..000000000
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/BugzillaTask.java
+++ /dev/null
@@ -1,459 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 - 2005 University Of British Columbia and others.
- * 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:
- * University Of British Columbia - initial API and implementation
- *******************************************************************************/
-/*
- * Created on 14-Jan-2005
- */
-package org.eclipse.mylar.tasks;
-
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.List;
-
-import javax.security.auth.login.LoginException;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.jobs.IJobChangeEvent;
-import org.eclipse.core.runtime.jobs.IJobChangeListener;
-import org.eclipse.core.runtime.jobs.ISchedulingRule;
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.mylar.bugzilla.BugzillaPlugin;
-import org.eclipse.mylar.bugzilla.core.BugReport;
-import org.eclipse.mylar.bugzilla.core.BugzillaRepository;
-import org.eclipse.mylar.bugzilla.core.IBugzillaBug;
-import org.eclipse.mylar.bugzilla.offlineReports.OfflineReportsFile;
-import org.eclipse.mylar.bugzilla.ui.OfflineView;
-import org.eclipse.mylar.core.MylarPlugin;
-import org.eclipse.mylar.tasks.ui.BugzillaTaskEditorInput;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.internal.Workbench;
-
-
-/**
- * @author Mik Kersten
- */
-public class BugzillaTask extends Task {
-
- /**
- * Comment for <code>serialVersionUID</code>
- */
- private static final long serialVersionUID = 3257007648544469815L;
-
- public static final String FILE_EXTENSION = ".bug_reports";
-
- public enum BugTaskState {FREE, WAITING, DOWNLOADING, COMPARING, OPENING}
- private transient BugTaskState state;
-
- /**
- * The bug report for this BugzillaTask. This is <code>null</code> if the
- * bug report with the specified ID was unable to download.
- */
- protected transient BugReport bugReport = null;
-
- /**
- * Value is <code>true</code> if the bug report has saved changes that
- * need synchronizing with the Bugzilla server.
- */
- private boolean isDirty;
-
- /** The last time this task's bug report was downloaded from the server. */
- protected Date lastRefresh;
-
- public static final ISchedulingRule rule = new ISchedulingRule() {
- public boolean isConflicting(ISchedulingRule schedulingRule) {
- return schedulingRule == this;
- }
- public boolean contains(ISchedulingRule schedulingRule) {
- return schedulingRule == this;
- }
- };
-
- public BugzillaTask(String id, String label) {
- super(id, label);
- isDirty = false;
- GetBugReportJob job = new GetBugReportJob("Downloading from Bugzilla server...");
- job.schedule();
- }
-
- public BugzillaTask(String id, String label, boolean noDownload) {
- super(id, label);
- isDirty = false;
- if (!noDownload) {
- GetBugReportJob job = new GetBugReportJob("Downloading from Bugzilla server...");
- job.schedule();
- }
- }
-
- @Override
- public String getLabel() {
- return MylarTasksPlugin.getDefault().getBugzillaProvider().getBugzillaDescription(this);
- }
-
- /**
- * @return Returns the bugReport.
- */
- public BugReport getBugReport() {
- return bugReport;
- }
-
- /**
- * @param bugReport The bugReport to set.
- */
- public void setBugReport(BugReport bugReport) {
- this.bugReport = bugReport;
- }
-
- /**
- * @return Returns the serialVersionUID.
- */
- public static long getSerialVersionUID() {
- return serialVersionUID;
- }
- /**
- * @return Returns the lastRefresh.
- */
- public Date getLastRefresh() {
- return lastRefresh;
- }
- /**
- * @param lastRefresh The lastRefresh to set.
- */
- public void setLastRefresh(Date lastRefresh) {
- this.lastRefresh = lastRefresh;
- }
- /**
- * @param state The state to set.
- */
- public void setState(BugTaskState state) {
- this.state = state;
- }
- /**
- * @return Returns <code>true</code> if the bug report has saved changes
- * that need synchronizing with the Bugzilla server.
- */
- public boolean isDirty() {
- return isDirty;
- }
-
- /**
- * @param isDirty The isDirty to set.
- */
- public void setDirty(boolean isDirty) {
- this.isDirty = isDirty;
- notifyTaskDataChange();
- }
-
- /**
- * @return Returns the state of the Bugzilla task.
- */
- public BugTaskState getState() {
- return state;
- }
-
- /**
- * Try to download the bug from the server.
- * @param bugId The ID of the bug report to download.
- *
- * @return The bug report, or <code>null</code> if it was unsuccessfully
- * downloaded.
- */
- public BugReport downloadReport() {
-// BugzillaTaskEditorInput input = new BugzillaTaskEditorInput(this);
- try {
- // XXX make sure to send in the server name if there are multiple repositories
- return BugzillaRepository.getInstance().getBug(getBugId(getHandle()));
- } catch (LoginException e) {
- MylarPlugin.log(e, "download failed");
- } catch (IOException e) {
- MylarPlugin.log(e, "download failed");
- }
- return null;
- }
-
- @Override
- public void openTaskInEditor(){
- openTask(-1);
- }
-
- /**
- * Opens this task's bug report in an editor revealing the selected comment.
- * @param commentNumber The comment number to reveal
- */
- public void openTask(int commentNumber) {
- if (state != BugTaskState.FREE) {
- return;
- }
-
- state = BugTaskState.OPENING;
- notifyTaskDataChange();
- OpenBugTaskJob job = new OpenBugTaskJob("Opening Bugzilla task in editor...", this);
- job.schedule();
- job.addJobChangeListener(new IJobChangeListener(){
-
- public void aboutToRun(IJobChangeEvent event) {
- // don't care about this event
- }
-
- public void awake(IJobChangeEvent event) {
- // don't care about this event
- }
-
- public void done(IJobChangeEvent event) {
- state = BugTaskState.FREE;
- notifyTaskDataChange();
- }
-
- public void running(IJobChangeEvent event) {
- // don't care about this event
- }
-
- public void scheduled(IJobChangeEvent event) {
- // don't care about this event
- }
-
- public void sleeping(IJobChangeEvent event) {
- // don't care about this event
- }
- });
- }
-
- /**
- * @return <code>true</code> if the bug report for this BugzillaTask was
- * successfully downloaded.
- */
- public boolean isBugDownloaded() {
- return bugReport != null;
- }
-
- @Override
- public String toString() {
- return "bugzilla report id: " + getHandle();
- }
-
- protected void openTaskEditor(final IEditorInput input) {
- if (isBugDownloaded()) {
-
- Workbench.getInstance().getDisplay().asyncExec(new Runnable() {
- public void run() {
- // get the active workbench page
- IWorkbenchPage page = MylarTasksPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getActivePage();
-
- // if we couldn't get the page, get out of here
- if (page == null)
- return;
-
- try {
- // try to open an editor on the input bug
- //page.openEditor(input, IBugzillaConstants.EXISTING_BUG_EDITOR_ID);
- page.openEditor(input, "org.eclipse.mylar.tasks.ui.bugzillaTaskEditor");
- }
- catch (PartInitException ex) {
- MylarPlugin.log(ex, "couldn't open");
- return;
- }
- }
- });
- }
- else {
- Workbench.getInstance().getDisplay().asyncExec(new Runnable() {
- public void run() {
- MessageDialog.openInformation(Workbench.getInstance().getActiveWorkbenchWindow().getShell(),
- "Could not open bug.", "Bug #" + getHandle()
- + " could not be read from the server. Try refreshing the bug task.");
- }
- });
- }
- }
-
- /**
- * @return Returns the last time this task's bug report was downloaded from
- * the server.
- */
- public Date getLastRefreshTime() {
- return lastRefresh;
- }
-
- /**
- * @return The number of seconds ago that this task's bug report was
- * downloaded from the server.
- */
- public long getTimeSinceLastRefresh() {
- Date timeNow = new Date();
- return (timeNow.getTime() - lastRefresh.getTime())/1000;
- }
-
- private class GetBugReportJob extends Job {
- public GetBugReportJob(String name) {
- super(name);
- setRule(rule);
- state = BugTaskState.WAITING;
- notifyTaskDataChange();
- }
-
- @Override
- protected IStatus run(IProgressMonitor monitor) {
- state = BugTaskState.DOWNLOADING;
- notifyTaskDataChange();
- // Update time this bugtask was last downloaded.
- lastRefresh = new Date();
- bugReport = downloadReport();
- state = BugTaskState.FREE;
- updateTaskDetails();
- notifyTaskDataChange();
- saveBugReport(true);
- return new Status(IStatus.OK, MylarPlugin.IDENTIFIER, IStatus.OK, "", null);
- }
- }
-
- public void updateTaskDetails() {
- setPriority(bugReport.getAttribute("Priority").getValue());
- String status = bugReport.getAttribute("Status").getValue();
- if (status.equals("RESOLVED")) {
- setCompleted(true);
- }
- }
-
- private class OpenBugTaskJob extends Job {
-
- protected BugzillaTask bugTask;
-
- public OpenBugTaskJob(String name, BugzillaTask bugTask) {
- super(name);
- this.bugTask = bugTask;
- }
-
- @Override
- protected IStatus run(IProgressMonitor monitor) {
- try{
- final IEditorInput input = new BugzillaTaskEditorInput(bugTask);
- state = BugTaskState.OPENING;
- notifyTaskDataChange();
- openTaskEditor(input);
-
- state = BugTaskState.FREE;
- notifyTaskDataChange();
- return new Status(IStatus.OK, MylarPlugin.IDENTIFIER, IStatus.OK, "", null);
- }catch(Exception e){
- MylarPlugin.log(e, "couldn't open");
- }
- return Status.CANCEL_STATUS;
- }
- }
-
- /**
- * Refreshes the bug report with the Bugzilla server.
- */
- public void refresh() {
- // The bug report must be untouched, and this task must not be busy.
- if (isDirty() || (state != BugTaskState.FREE)) {
- return;
- }
- GetBugReportJob job = new GetBugReportJob("Refreshing with Bugzilla server...");
- job.schedule();
- }
-
- @Override
- public String getToolTipText() {
- // Get the current time.
- Date timeNow = new Date();
-
- // Get the number of minutes between the current time
- // and the last time the bug report was downloaded
- long timeDifference = (timeNow.getTime() - lastRefresh.getTime())/60000;
-
- // Calculate the number of minutes and hours.
- // The amount left in "timeDifference" is the
- // days' difference.
- long minutes = timeDifference % 60;
- timeDifference /= 60;
- long hours = timeDifference % 24;
- timeDifference /= 24;
-
- // Gradually generate the tooltip string...
- String toolTip;
- if (bugReport == null) {
- toolTip = "Last attempted download ";
- }
- else {
- toolTip = "Last downloaded ";
- }
-
- if (timeDifference > 0) {
- toolTip += timeDifference + ((timeDifference == 1) ? " day " : " days ");
- }
- if (hours > 0 || timeDifference > 0) {
- toolTip += hours + ((hours == 1) ? " hour " : " hours ");
- }
- toolTip += minutes + ((minutes == 1) ? " minute " : " minutes ") + "ago";
-
- return toolTip;
- }
-
- public boolean readBugReport() {
- // XXX server name needs to be with the bug report
- int location = BugzillaPlugin.getDefault().getOfflineReports().find(getBugId(getHandle()));
- if(location == -1){
- bugReport = null;
- return true;
- }
- bugReport = (BugReport)BugzillaPlugin.getDefault().getOfflineReports().elements().get(location);
- return true;
- }
-
- public void saveBugReport(boolean refresh) {
- if(bugReport == null)
- return;
-
- // XXX use the server name for multiple repositories
- OfflineReportsFile offlineReports = BugzillaPlugin.getDefault().getOfflineReports();
- int location = offlineReports.find(getBugId(getHandle()));
- if(location != -1){
- IBugzillaBug tmpBugReport = offlineReports.elements().get(location);
- List<IBugzillaBug> l = new ArrayList<IBugzillaBug>(1);
- l.add(tmpBugReport);
- offlineReports.remove(l);
- }
- offlineReports.add(bugReport);
-
- if(refresh){
- final IWorkbench workbench = PlatformUI.getWorkbench();
- workbench.getDisplay().asyncExec(new Runnable() {
- public void run() {
- OfflineView.refresh();
- }
- });
- }
- }
-
- public static String getServerName(String handle) {
- int index = handle.lastIndexOf('-');
- if(index != -1){
- return handle.substring(0, index);
- }
- return null;
- }
-
- public static int getBugId(String handle) {
- int index = handle.lastIndexOf('-');
- if(index != -1){
- String id = handle.substring(index+1);
- return Integer.parseInt(id);
- }
- return -1;
- }
-}
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/Category.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/Category.java
deleted file mode 100644
index 2d1db62f9..000000000
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/Category.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 - 2005 University Of British Columbia and others.
- * 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:
- * University Of British Columbia - initial API and implementation
- *******************************************************************************/
-/*
- * Created on Dec 26, 2004
- */
-package org.eclipse.mylar.tasks;
-
-import java.io.Serializable;
-
-
-/**
- * @author Mik Kersten
- */
-public class Category implements Serializable {
-
- private static final long serialVersionUID = 3834024740813027380L;
-
-// private List<ITask> tasks = new ArrayList<ITask>();
- private String name = "";
-
- public Category(String name) {
- this.name = name;
- }
-
-// public void addTask(ITask task) {
-// tasks.add(task);
-// }
-//
-// public void removeTask(Task task) {
-// tasks.remove(task);
-// }
-//
-// public List<ITask> getTasks() {
-// return tasks;
-// }
-
- @Override
- public String toString() {
- return name;
- }
-
- public String getName() {
- return name;
- }
- public void setName(String label) {
- this.name = label;
- }
-
- @Override
- public boolean equals(Object object) {
- if (object == null) return false;
- if (object instanceof Category) {
- Category compare = (Category)object;
- return this.getName().equals(compare.getName());
- } else {
- return false;
- }
- }
-}
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ITask.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ITask.java
deleted file mode 100644
index d4dfc9034..000000000
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ITask.java
+++ /dev/null
@@ -1,104 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 - 2005 University Of British Columbia and others.
- * 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:
- * University Of British Columbia - initial API and implementation
- *******************************************************************************/
-/*
- * Created on Jan 13, 2005
- */
-package org.eclipse.mylar.tasks;
-
-import java.io.Serializable;
-import java.util.List;
-
-/**
- * @author Mik Kersten
- *
- * TODO: make IDs be handles
- */
-public interface ITask extends Serializable {
-
- @Override
- public abstract String toString();
-
- public abstract String getPath();
-
- public abstract void setPath(String path);
-
- public abstract List<ITask> getChildren();
-
- public abstract String getHandle();
-
- public abstract void setHandle(String id);
-
- public abstract String getLabel();
-
- public abstract void setLabel(String label);
-
- public abstract ITask getParent();
-
- public abstract void setParent(ITask parent);
-
- public abstract void removeSubtask(ITask task);
-
- public abstract void addSubtask(ITask task);
-
- public abstract boolean isActive();
-
- public abstract void setActive(boolean active);
-
- public abstract boolean isCompleted();
-
- public abstract void setCompleted(boolean completed);
-
- public abstract RelatedLinks getRelatedLinks();
-
- public abstract void setRelatedLinks(RelatedLinks relatedLinks);
-
- public abstract void addLink(String url);
-
- public abstract void removeLink(String url);
-
- public abstract String getNotes();
-
- public abstract void setNotes(String notes);
-
- public abstract String getElapsedTime();
-
- public abstract void setElapsedTime(String elapsed);
-
- public abstract String getEstimatedTime();
-
- public abstract void setEstimatedTime(String estimated);
-
- public abstract List<ITask> getSubTasksInProgress();
-
- public abstract List<ITask> getCompletedSubTasks();
-
- public abstract boolean hasCompletedSubTasks(boolean completed);
-
- public abstract int findLargestTaskHandle();
-
- public abstract boolean hasSubTaskWithPriority(String priority);
- /**
- * Opens this task in an editor
- */
- public abstract void openTaskInEditor();
-
- public abstract String getToolTipText();
-
- public abstract List<Category> getCategories();
-
- public abstract String getPriority();
-
- public abstract void setPriority(String priority);
-
- public abstract boolean isCategory();
-
- public abstract void setIsCategory(boolean b);
-} \ No newline at end of file
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ITaskActivityListener.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ITaskActivityListener.java
deleted file mode 100644
index 98abbe02a..000000000
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ITaskActivityListener.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 - 2005 University Of British Columbia and others.
- * 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:
- * University Of British Columbia - initial API and implementation
- *******************************************************************************/
-/*
- * Created on Jan 13, 2005
- */
-package org.eclipse.mylar.tasks;
-
-import java.util.List;
-
-/**
- * @author Mik Kersten
- */
-public interface ITaskActivityListener {
-
- public abstract void taskActivated(ITask task);
-
- public abstract void tasksActivated(List<ITask> tasks);
-
- public abstract void taskDeactivated(ITask task);
-
- public abstract void taskPropertyChanged(ITask updatedTask, String property);
-}
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ITaskInfo.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ITaskInfo.java
deleted file mode 100644
index e8fbc8de8..000000000
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ITaskInfo.java
+++ /dev/null
@@ -1,23 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 - 2005 University Of British Columbia and others.
- * 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:
- * University Of British Columbia - initial API and implementation
- *******************************************************************************/
-/*
- * Created on Jan 12, 2005
- */
-package org.eclipse.mylar.tasks;
-
-/**
- * @author Mik Kersten
- */
-public interface ITaskInfo {
-
- public String getHandle();
-
-}
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/MylarTasksPlugin.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/MylarTasksPlugin.java
deleted file mode 100644
index fe26e009c..000000000
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/MylarTasksPlugin.java
+++ /dev/null
@@ -1,237 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 - 2005 University Of British Columbia and others.
- * 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:
- * University Of British Columbia - initial API and implementation
- *******************************************************************************/
-package org.eclipse.mylar.tasks;
-
-import java.io.File;
-import java.util.List;
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-
-import org.eclipse.core.runtime.Preferences.IPropertyChangeListener;
-import org.eclipse.core.runtime.Preferences.PropertyChangeEvent;
-import org.eclipse.mylar.core.MylarPlugin;
-import org.eclipse.mylar.tasks.bugzilla.BugzillaContentProvider;
-import org.eclipse.mylar.tasks.bugzilla.BugzillaEditingMonitor;
-import org.eclipse.mylar.tasks.bugzilla.BugzillaMylarBridge;
-import org.eclipse.mylar.tasks.bugzilla.BugzillaReferencesProvider;
-import org.eclipse.mylar.tasks.bugzilla.BugzillaStructureBridge;
-import org.eclipse.mylar.tasks.bugzilla.ui.BugzillaUiBridge;
-import org.eclipse.mylar.ui.MylarUiPlugin;
-import org.eclipse.swt.events.ShellEvent;
-import org.eclipse.swt.events.ShellListener;
-import org.eclipse.ui.IStartup;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.internal.Workbench;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-import org.osgi.framework.BundleContext;
-
-/**
- * @author Mik Kersten
- */
-public class MylarTasksPlugin extends AbstractUIPlugin implements IStartup {
-
- private static MylarTasksPlugin plugin;
- private static TaskListManager taskListManager;
- private BugzillaContentProvider bugzillaProvider;
-
- public static final String FILE_EXTENSION = ".xml";
- public static final String TASK_ID = "org.eclipse.mylar.tasks.userid";
- public static final String DEFAULT_TASK_LIST_FILE = "tasklist" + FILE_EXTENSION;
- public static final String TASK_EDITOR_ID = "org.eclipse.mylar.tasks.ui.taskEditor";
- private ResourceBundle resourceBundle;
-
- /** The bridge between Bugzilla and mylar */
- private static BugzillaMylarBridge bridge = null;
-
- private BugzillaStructureBridge structureBridge;
-
- private static BugzillaReferencesProvider referencesProvider = new BugzillaReferencesProvider();
-
- private static ITaskActivityListener TASK_LIST_LISTENER = new ITaskActivityListener() {
-
- public void taskActivated(ITask task) {
- MylarPlugin.getTaskscapeManager().taskActivated(task.getHandle(), task.getPath());
- }
-
- public void tasksActivated(List<ITask> tasks) {
- for (ITask task : tasks) {
- MylarPlugin.getTaskscapeManager().taskActivated(task.getHandle(), task.getPath());
- }
- }
-
- public void taskDeactivated(ITask task) {
- MylarPlugin.getTaskscapeManager().taskDeactivated(task.getHandle(), task.getPath());
- }
-
- public void taskPropertyChanged(ITask updatedTask, String property) {
- // don't care about property change
- }
-
- };
-
- private static ShellListener SHELL_LISTENER = new ShellListener() {
- private void saveState() {
- taskListManager.saveTaskList();
- for(ITask task : taskListManager.getTaskList().getActiveTasks()) {
- MylarPlugin.getTaskscapeManager().saveTaskscape(task.getHandle(), task.getPath());
- }
- }
- public void shellClosed(ShellEvent arg0) {
- saveState();
- }
- public void shellDeactivated(ShellEvent arg0) {
- saveState();
- }
- public void shellActivated(ShellEvent arg0) { }
- public void shellDeiconified(ShellEvent arg0) { }
- public void shellIconified(ShellEvent arg0) { }
- };
-
- private static IPropertyChangeListener PREFERENCE_LISTENER = new IPropertyChangeListener() {
-
- public void propertyChange(PropertyChangeEvent event) {
- // TODO Auto-generated method stub
- if (event.getProperty().equals(MylarPlugin.MYLAR_DIR)) {
- if (event.getOldValue() instanceof String) {
- String prevDir = (String) event.getOldValue();
- MylarPlugin.getTaskscapeManager().updateMylarDirContents(prevDir);
- getTaskListManager().updateTaskscapeReference(prevDir);
-
- String path = MylarPlugin.getDefault().getUserDataDirectory() + File.separator + DEFAULT_TASK_LIST_FILE;
- getTaskListManager().setFile(new File(path));
- }
- } else {
- }
- }
- };
-
- public MylarTasksPlugin() {
- super();
- plugin = this;
- }
-
- public void earlyStartup() {
- final IWorkbench workbench = PlatformUI.getWorkbench();
- workbench.getDisplay().asyncExec(new Runnable() {
- public void run() {
-
- structureBridge = new BugzillaStructureBridge();
-
- MylarPlugin.getDefault().addBridge(structureBridge);
- MylarPlugin.getTaskscapeManager().addListener(referencesProvider);
- MylarUiPlugin.getDefault().addAdapter(BugzillaStructureBridge.EXTENSION, new BugzillaUiBridge());
- MylarPlugin.getDefault().getSelectionMonitors().add(new BugzillaEditingMonitor());
-
- IWorkbenchWindow window = workbench.getActiveWorkbenchWindow();
-
- Workbench.getInstance().getActiveWorkbenchWindow().getShell().addShellListener(SHELL_LISTENER);
- MylarPlugin.getDefault().getPluginPreferences().addPropertyChangeListener(PREFERENCE_LISTENER);
-
- if (window != null) {
- // create a new bridge and initialize it
- bridge = new BugzillaMylarBridge();
- }
- }
- });
- }
-
- @Override
- public void start(BundleContext context) throws Exception {
- bugzillaProvider = new BugzillaContentProvider();
- String path = MylarPlugin.getDefault().getUserDataDirectory() + File.separator + DEFAULT_TASK_LIST_FILE;
- File taskListFile = new File(path);
- taskListManager = new TaskListManager(taskListFile);
- taskListManager.addListener(TASK_LIST_LISTENER);
- taskListManager.readTaskList();
- if (taskListManager.getTaskList() == null) taskListManager.createNewTaskList();
-
- super.start(context);
- }
-
- @Override
- public void stop(BundleContext context) throws Exception {
- super.stop(context);
- plugin = null;
- resourceBundle = null;
- }
-
- /**
- * Get the bridge for this plugin
- *
- * @return The bugzilla mylar bridge
- */
- public static BugzillaMylarBridge getBridge() {
- // make sure that the bridge initialized, if not, make a new one
- if (bridge == null) {
- bridge = new BugzillaMylarBridge();
-// MylarPlugin.getTaskscapeManager().addRelationshipProvider(new BugzillaRelationshipProvider());
-// MylarUiPlugin.getDefault().getAdapters().put(ITaskscapeNode.Kind.Bugzilla, new BugzillaUiAdapter());
- }
- return bridge;
- }
-
-
- public static TaskListManager getTaskListManager() {
- return taskListManager;
- }
-
- /**
- * Returns the shared instance.
- */
- public static MylarTasksPlugin getDefault() {
- return plugin;
- }
-
- /**
- * Returns the string from the plugin's resource bundle,
- * or 'key' if not found.
- */
- public static String getResourceString(String key) {
- ResourceBundle bundle = MylarTasksPlugin.getDefault().getResourceBundle();
- try {
- return (bundle != null) ? bundle.getString(key) : key;
- } catch (MissingResourceException e) {
- return key;
- }
- }
-
- /**
- * Returns the plugin's resource bundle,
- */
- public ResourceBundle getResourceBundle() {
- try {
- if (resourceBundle == null)
- resourceBundle = ResourceBundle.getBundle("taskListPlugin.TaskListPluginPluginResources");
- } catch (MissingResourceException x) {
- resourceBundle = null;
- }
- return resourceBundle;
- }
-
- public BugzillaContentProvider getBugzillaProvider() {
- return bugzillaProvider;
- }
-
- public void setBugzillaProvider(BugzillaContentProvider bugzillaProvider) {
- this.bugzillaProvider = bugzillaProvider;
- }
-
- public BugzillaStructureBridge getStructureBridge() {
- return structureBridge;
- }
-
- public static BugzillaReferencesProvider getReferenceProvider() {
- return referencesProvider;
-
- }
-}
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/RelatedLinks.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/RelatedLinks.java
deleted file mode 100644
index 1e11116dc..000000000
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/RelatedLinks.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 - 2005 University Of British Columbia and others.
- * 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:
- * University Of British Columbia - initial API and implementation
- *******************************************************************************/
-package org.eclipse.mylar.tasks;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * Related links stored for each task used as input to the Table
- * used in the TaskSummaryEditor
- *
- * @author Ken Sueda
- */
-public class RelatedLinks {
- private List<String> links;
-
- public RelatedLinks() {
- links = new ArrayList<String>();
- }
- public void add(String link) {
- links.add(link);
- }
- public List<String> getLinks() {
- return links;
- }
- public void remove(String link) {
- links.remove(link);
- }
-}
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/Task.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/Task.java
deleted file mode 100644
index ae5f8b771..000000000
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/Task.java
+++ /dev/null
@@ -1,367 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 - 2005 University Of British Columbia and others.
- * 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:
- * University Of British Columbia - initial API and implementation
- *******************************************************************************/
-/*
- * Created on Dec 22, 2004
- */
-package org.eclipse.mylar.tasks;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.mylar.core.MylarPlugin;
-import org.eclipse.mylar.tasks.ui.TaskEditorInput;
-import org.eclipse.mylar.tasks.ui.views.TaskListView;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.internal.Workbench;
-
-
-/**
- * @author Mik Kersten
- */
-public class Task implements ITask {
-
- private static final long serialVersionUID = 3545518391537382197L;
- private boolean active = false;
- protected String handle = "-1";
- private boolean category = false;
-
-
- /**
- * Either to local resource or URL.
- * TODO: consider changing to java.net.URL
- */
- private String path;
- private String label;
- private String priority = "P3";
- private String notes = "";
- private String estimatedTime = "";
- private String elapsedTime = "";
- private boolean completed;
- private transient List<Category> categories = new ArrayList<Category>();
- private RelatedLinks links = new RelatedLinks();
-
- /**
- * null if root
- */
- private transient ITask parent;
-
- private List<ITask> children = new ArrayList<ITask>();
-
- @Override
- public String toString() {
- return label;
- }
-
- public String getPath() {
- // returns relative path Mylar Directory
- return path;
- }
-
-// public String getRelativePath() {
-// //returns relative path from Mylar Directory
-//
-// if (path.startsWith("..")) {
-// return "../" + path;
-// } else {
-// return path.substring(path.indexOf('/')+1, path.length());
-// }
-// }
-
- public void setPath(String path) {
- if (path.startsWith(".mylar")) {
- this.path = path.substring(path.lastIndexOf('/')+1, path.length());
- } else if (!path.equals("")) {
- this.path = path;
- }
- }
-
- public Task(String handle, String label) {
- this.handle = handle;
- this.label = label;
- this.path = handle;
- }
-
- public List<ITask> getChildren() {
- return children;
- }
-
- public String getHandle() {
- return handle;
- }
- public void setHandle(String id) {
- this.handle = id;
- }
- public String getLabel() {
- return label;
- }
- public void setLabel(String label) {
- this.label = label;
- }
- public ITask getParent() {
- return parent;
- }
- public void setParent(ITask parent) {
- this.parent = parent;
- }
- public Object getAdapter(Class adapter) {
- return null;
- }
-
- public void removeSubtask(ITask task) {
- children.remove(task);
- task.setParent(null); // HACK
- }
-
- public void addSubtask(ITask task) {
- children.add(task);
- task.setParent(this);
- }
-
- /**
- * Package visible in order to prevent sets that don't update the index.
- */
- public void setActive(boolean active) {
- this.active = active;
- }
-
- public boolean isActive() {
- return active;
- }
-
- public void openTaskInEditor() {
- Workbench.getInstance().getDisplay().asyncExec(new Runnable() {
- public void run() {
- openTaskEditor();
- }
- });
- }
-
- /**
- * Opens the task in an editor.
- * @return Resulting <code>IStatus</code> of the operation
- */
- protected void openTaskEditor() {
-
- // get the active page so that we can reuse it
- IWorkbenchPage page = MylarTasksPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getActivePage();
-
- // if we couldn't get a page, get out
- if (page == null) {
- return;
- }
-
- IEditorInput input = new TaskEditorInput(this);
- try
- {
- // try to open an editor on the input task
- page.openEditor(input, MylarTasksPlugin.TASK_EDITOR_ID);
-
- }
- catch (PartInitException ex)
- {
- MylarPlugin.log(ex, "open failed");
- }
- }
-
- /**
- * Refreshes the tasklist viewer.
- */
- public void notifyTaskDataChange() {
- final Task task = this;
- Workbench.getInstance().getDisplay().asyncExec(new Runnable() {
- public void run() {
- if (TaskListView.getDefault() != null) TaskListView.getDefault().notifyTaskDataChanged(task);
- }
- });
- }
-
- public String getToolTipText() {
- // No tool-tip used for a general task as of yet.
- return null;
- }
- public List<Category> getCategories() {
- return categories;
- }
-
- @Override
- public boolean equals(Object obj) {
- if (obj instanceof Task && obj != null) {
- return this.getHandle() == ((Task)obj).getHandle();
- } else {
- return false;
- }
- }
-
- @Override
- public int hashCode() {
- return this.getHandle().hashCode();
- }
- public boolean isCompleted() {
- return completed;
- }
- public void setCompleted(boolean completed) {
- this.completed = completed;
- }
-
- public boolean isCategory() {
- return category;
- }
-
- public void setIsCategory(boolean category) {
- this.category = category;
- }
-
- public String getPriority() {
- return priority;
- }
-
- public void setPriority(String priority) {
- this.priority = priority;
- }
-
- public RelatedLinks getRelatedLinks() {
- // TODO: removed check for null once xml updated.
- if (links == null) {
- links = new RelatedLinks();
- }
- return links;
- }
-
- public void setRelatedLinks(RelatedLinks relatedLinks) {
- this.links = relatedLinks;
- }
-
- public void addLink(String url) {
- links.add(url);
- }
-
- public void removeLink(String url) {
- links.remove(url);
- }
-
- public String getNotes() {
- // TODO: removed check for null once xml updated.
- if (notes == null) {
- notes = "";
- }
- return notes;
- }
-
- public void setNotes(String notes) {
- this.notes = notes;
- }
-
- public String getElapsedTime() {
- // TODO: removed check for null once xml updated.
- if (elapsedTime == null) {
- elapsedTime = "";
- }
- return elapsedTime;
- }
-
- public void setElapsedTime(String elapsed) {
- this.elapsedTime = elapsed;
- }
-
- public String getEstimatedTime() {
- // TODO: removed check for null once xml updated.
- if (estimatedTime == null) {
- estimatedTime = "";
- }
- return estimatedTime;
- }
-
- public void setEstimatedTime(String estimated) {
- this.estimatedTime = estimated;
- }
-
- public List<ITask> getSubTasksInProgress() {
- List<ITask> inprogress = new ArrayList<ITask>();
- for (ITask task : children) {
- if (!task.isCompleted()) {
- inprogress.add(task);
- }
- }
- return inprogress;
- }
-
- public List<ITask> getCompletedSubTasks() {
- List<ITask> complete = new ArrayList<ITask>();
- for (ITask task : children) {
- if (task.isCompleted()) {
- complete.add(task);
- }
- }
- return complete;
- }
-
- public boolean hasCompletedSubTasks(boolean completed) {
- return findCompletedSubtask(getChildren(), completed);
- }
-
- private boolean findCompletedSubtask(List<ITask> subtasks, boolean completed) {
- for(ITask t : subtasks) {
- if (t.isCompleted() == completed) {
- return true;
- }
- findCompletedSubtask(t.getChildren(), completed);
- }
- return false;
- }
-
- public int findLargestTaskHandle() {
- int ihandle = 0;
- if (this instanceof BugzillaTask) {
- ihandle = 0;
- } else {
- ihandle = Integer.parseInt(this.handle.substring(handle.indexOf('-')+1, handle.length()));
- }
- int maxSub = findLargestSubTaskHandle(getChildren());
- return maxSub > ihandle ? maxSub : ihandle;
- }
-
- private int findLargestSubTaskHandle(List<ITask> tasks) {
- int ihandle = 0;
- int maxHandle = 0;
- for (ITask t : tasks) {
- if (t instanceof BugzillaTask) {
- ihandle = 0;
- } else {
- ihandle = Integer.parseInt(t.getHandle().substring(t.getHandle().indexOf('-')+1, t.getHandle().length()));
- }
-
- if (ihandle > maxHandle) {
- maxHandle = ihandle;
- }
- int maxSub = findLargestSubTaskHandle(t.getChildren());
- if (maxSub > maxHandle) {
- maxHandle = maxSub;
- }
- }
- return maxHandle;
- }
-
- public boolean hasSubTaskWithPriority(String priority) {
- return findSubTaskWithPriority(getChildren(), priority);
- }
-
- private boolean findSubTaskWithPriority(List<ITask> subtasks, String priority) {
- for(ITask t : subtasks) {
- if (t.getPriority().equals(priority)) {
- return true;
- }
- findSubTaskWithPriority(t.getChildren(), priority);
- }
- return false;
- }
-}
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/TaskList.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/TaskList.java
deleted file mode 100644
index 55bd2fa2a..000000000
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/TaskList.java
+++ /dev/null
@@ -1,150 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 - 2005 University Of British Columbia and others.
- * 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:
- * University Of British Columbia - initial API and implementation
- *******************************************************************************/
-/*
- * Created on Dec 22, 2004
- */
-package org.eclipse.mylar.tasks;
-
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
-import org.eclipse.mylar.tasks.BugzillaTask.BugTaskState;
-
-
-/**
- * @author Mik Kersten
- */
-public class TaskList implements Serializable {
-
- private static final long serialVersionUID = 3618984485791021105L;
-
- private List<ITask> rootTasks = new ArrayList<ITask>();
- private transient List<ITask> activeTasks = new ArrayList<ITask>();
-
- public void addRootTask(ITask task) {
- rootTasks.add(task);
- }
-
- public void setActive(ITask task, boolean active) {
- task.setActive(active);
- if (active) {
- activeTasks.add(task);
- } else {
- activeTasks.remove(task);
- }
- }
-
- /**
- * TODO: make data structure handle this traversal
- */
- public ITask getTaskForId(String id) {
- return setActiveHelper(rootTasks, id);
- }
-
- private ITask setActiveHelper(List<ITask> tasks, String id) {
- for (ITask task : tasks) {
- if (task.getHandle() == id) {
- return task;
- } else {
- ITask child = setActiveHelper(task.getChildren(), id);
- if (child != null) return child;
- }
- }
- return null;
- }
-
- public List<ITask> getActiveTasks() {
- return activeTasks;
- }
-
- public List<ITask> getTaskFor(Category category) {
- List<ITask> categoryTasks = new ArrayList<ITask>();
- for (ITask task : rootTasks) {
- if (task.getCategories().contains(category)) categoryTasks.add(task);
- }
- return categoryTasks;
- }
-
- public List<ITask> getRootTasks() {
- return rootTasks;
- }
-
- public Set<Category> getCategories() {
- Set<Category> categories = new HashSet<Category>();
- for (ITask task : rootTasks) {
- categories.addAll(task.getCategories());
- }
- return categories;
- }
-
- public void refreshRestoredTasks() {
- activeTasks = new ArrayList<ITask>();
- activateRestoredTasks(rootTasks);
- restoreParents(rootTasks, null);
- refreshBugReports(rootTasks);
- }
- private void activateRestoredTasks(List<ITask> tasks) {
- for (ITask task : tasks) {
- if (task.isActive()) {
- setActive(task, true);
- }
- activateRestoredTasks(task.getChildren());
- }
- }
- private void restoreParents(List<ITask> tasks, ITask parent) {
- for (ITask task : tasks) {
- task.setParent(parent);
- restoreParents(task.getChildren(), task);
- }
- }
- private void refreshBugReports(List<ITask> tasks) {
- for (ITask task : tasks) {
- if (task instanceof BugzillaTask) {
- ((BugzillaTask)task).readBugReport();
- ((BugzillaTask)task).setState(BugTaskState.FREE);
- }
- refreshBugReports(task.getChildren());
- }
- }
- public List<ITask> getTasksInProgress() {
- List<ITask> inprogress = new ArrayList<ITask>();
- for (ITask task : rootTasks) {
- if (!task.isCompleted()) {
- inprogress.add(task);
- }
- }
- return inprogress;
- }
- public List<ITask> getCompletedTasks() {
- List <ITask> complete = new ArrayList<ITask>();
- for (ITask task : rootTasks) {
- if (task.isCompleted()) {
- complete.add(task);
- } else if (task.hasCompletedSubTasks(false)) {
- complete.add(task);
- }
- }
- return complete;
- }
- public int findLargestTaskHandle() {
- int max = 0;
- for (ITask t : rootTasks) {
- int maxSub = t.findLargestTaskHandle();
- if (maxSub > max) {
- max = maxSub;
- }
- }
- return max;
- }
-}
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/TaskListManager.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/TaskListManager.java
deleted file mode 100644
index 085be1a0e..000000000
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/TaskListManager.java
+++ /dev/null
@@ -1,169 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 - 2005 University Of British Columbia and others.
- * 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:
- * University Of British Columbia - initial API and implementation
- *******************************************************************************/
-/*
- * Created on Dec 26, 2004
- */
-package org.eclipse.mylar.tasks;
-
-import java.io.File;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.mylar.core.MylarPlugin;
-import org.eclipse.mylar.tasks.util.RelativePathUtil;
-import org.eclipse.mylar.tasks.util.XmlUtil;
-
-
-/**
- * @author Mik Kersten
- */
-public class TaskListManager {
-
- private File file;
- private TaskList taskList = new TaskList();
- private List<ITaskActivityListener> listeners = new ArrayList<ITaskActivityListener>();
- private int nextTaskId;
-
- public TaskListManager(File file) {
- this.file = file;
- if (MylarPlugin.getDefault().getPreferenceStore().contains(MylarTasksPlugin.TASK_ID)) { // TODO: fix to MylarTasksPlugin
- nextTaskId = MylarPlugin.getDefault().getPreferenceStore().getInt(MylarTasksPlugin.TASK_ID);
- } else {
- nextTaskId = 1;
- }
- }
-
- public TaskList createNewTaskList() {
- return taskList;
- }
-
- public String genUniqueTaskId() {
- return "task-" + nextTaskId++;
- }
-
- public boolean readTaskList() {
- try {
- if (file.exists()) {
- XmlUtil.readTaskList(taskList, file);
- int maxHandle = taskList.findLargestTaskHandle();
- if (maxHandle >= nextTaskId) {
- nextTaskId = maxHandle + 1;
- }
- for (ITaskActivityListener listener : listeners) listener.tasksActivated(taskList.getActiveTasks());
- }
- return true;
- } catch (Exception e) {
- MylarPlugin.log(e, "task read failed");
- return false;
- }
- }
-
- public void saveTaskList() {
- try {
- XmlUtil.writeTaskList(taskList, file);
- MylarPlugin.getDefault().getPreferenceStore().setValue(MylarTasksPlugin.TASK_ID, nextTaskId);
- } catch (Exception e) {
- e.printStackTrace(); // TODO: fix
-// MylarPlugin.fail(e, "Could not save task list", true);
- }
- }
-
- public TaskList getTaskList() {
- return taskList;
- }
-
- public void setTaskList(TaskList taskList) {
- this.taskList = taskList;
- }
-
- public void deleteTask(ITask task) {
- taskList.setActive(task, false);
- if (taskList.getRootTasks().contains(task)) {
- taskList.getRootTasks().remove(task);
- } else {
- task.getParent().getChildren().remove(task);
- }
- }
-
- public void addListener(ITaskActivityListener listener) {
- listeners.add(listener);
- }
-
- public void removeListener(ITaskActivityListener listener) {
- listeners.remove(listener);
- }
-
- public void activateTask(ITask task) {
- if (task.isCategory()) {
- for (ITask childTask : task.getChildren()) {
- taskList.setActive(childTask, true);
- for (ITaskActivityListener listener : listeners) listener.taskActivated(childTask);
- }
- } else {
- taskList.setActive(task, true);
- for (ITaskActivityListener listener : listeners) listener.taskActivated(task);
- }
- }
-
- public void deactivateTask(ITask task) {
- if (task.isCategory()) {
- for (ITask childTask : task.getChildren()) {
- taskList.setActive(childTask, false);
- for (ITaskActivityListener listener : listeners) listener.taskDeactivated(childTask);
- }
- } else {
- taskList.setActive(task, false);
- for (ITaskActivityListener listener : listeners) listener.taskDeactivated(task);
- }
- }
-
- public void taskPropertyChanged(ITask task, String property) {
- for (ITaskActivityListener listener : listeners) listener.taskPropertyChanged(task, property);
- }
-
- public void updateTaskscapeReference(String prevDir) {
- List<ITask> rootTasks = this.getTaskList().getRootTasks();
- updateTaskscapeReferenceHelper(rootTasks, prevDir);
- }
- public void updateTaskscapeReferenceHelper(List<ITask> list, String prevDir) {
- for (ITask task : list) {
- if (!task.getPath().startsWith("task-")) {
- if (task.getPath().startsWith("..")) {
- String path = task.getPath();
- File d = new File(prevDir);
- while (path.startsWith("..")) {
- d = d.getParentFile();
- path = path.substring(3, path.length());
- }
-
- String absPath = d.getPath() + "/" + path + MylarTasksPlugin.FILE_EXTENSION;
- absPath = absPath.replaceAll("\\\\", "/");
- String rel = RelativePathUtil.findRelativePath(MylarPlugin.getDefault().getUserDataDirectory() + "/", absPath);
- task.setPath(rel);
- taskPropertyChanged(task, "Path");
- } else {
- String absPath = prevDir + "/" + task.getPath() + MylarTasksPlugin.FILE_EXTENSION;
- absPath = absPath.replaceAll("\\\\", "/");
- String rel = RelativePathUtil.findRelativePath(MylarPlugin.getDefault().getUserDataDirectory(), absPath);
- task.setPath(rel);
- taskPropertyChanged(task, "Path");
- }
- }
- updateTaskscapeReferenceHelper(task.getChildren(), prevDir);
- }
- }
- public void setFile(File f) {
- if (this.file.exists()) {
- this.file.delete();
- }
- this.file = f;
- }
-}
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/bugzilla/BugzillaCacheFile.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/bugzilla/BugzillaCacheFile.java
deleted file mode 100644
index 7da0be56e..000000000
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/bugzilla/BugzillaCacheFile.java
+++ /dev/null
@@ -1,131 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 - 2005 University Of British Columbia and others.
- * 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:
- * University Of British Columbia - initial API and implementation
- *******************************************************************************/
-package org.eclipse.mylar.tasks.bugzilla;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.mylar.bugzilla.BugzillaPlugin;
-import org.eclipse.mylar.bugzilla.core.IBugzillaBug;
-
-/**
- * COPIED FROM @see org.eclipse.mylar.bugzilla.offlineReports.OfflineReportsFile
- *
- * @author Shawn Minto
- */
-public class BugzillaCacheFile {
-
- private File file;
-
- private ArrayList<IBugzillaBug> list = new ArrayList<IBugzillaBug>();
-
- protected int latestNewBugId = 0;
-
- public BugzillaCacheFile(File file) throws ClassNotFoundException, IOException {
- this.file = file;
- if (file.exists()) {
- readFile();
- }
- }
-
- public void add(IBugzillaBug entry) {
- // add the entry to the list and write the file to disk
- list.add(entry);
- writeFile();
- }
-
- public void update() {
- writeFile();
- }
-
- public int getNextOfflineBugId() {
- latestNewBugId++;
- return latestNewBugId;
- }
-
- public int find(int id) {
- for (int i = 0; i < list.size(); i++) {
- IBugzillaBug currBug = list.get(i);
- if (currBug != null && (currBug.getId() == id) && !currBug.isLocallyCreated())
- return i;
- }
- return -1;
- }
-
- public ArrayList<IBugzillaBug> elements() {
- return list;
- }
-
- private void writeFile() {
- try {
- ObjectOutputStream out = new ObjectOutputStream(new FileOutputStream(file));
-
- // Write the size of the list so that we can read it back in easier
- out.writeInt(list.size());
-
- out.writeInt(latestNewBugId);
-
- // write each element in the array list
- for (int i = 0; i < list.size(); i++) {
- Object item = list.get(i);
- out.writeObject(item);
- }
- out.close();
- }
- catch (IOException e) {
- // put up a message and log the error if there is a problem writing to the file
- MessageDialog.openError(null,
- "I/O Error",
- "Bugzilla could not write to offline reports file.");
- BugzillaPlugin.log(e);
- }
- }
-
- private void readFile() throws ClassNotFoundException, IOException {
- ObjectInputStream in = new ObjectInputStream(new FileInputStream(file));
-
- // get the number of offline reports in the file
- int size = in.readInt();
-
- // get the bug id of the most recently created offline report
- latestNewBugId = in.readInt();
-
- // read in each of the offline reports in the file
- for (int nX = 0; nX < size; nX++) {
- IBugzillaBug item = (IBugzillaBug) in.readObject();
- // add the offline report to the offlineReports list
- list.add(item);
- }
- in.close();
- }
-
- public void remove(List<IBugzillaBug> sel) {
- list.removeAll(sel);
-
- // rewrite the file so that the data is persistant
- writeFile();
- }
-
- public void removeAll() {
- list.clear();
-
- // rewrite the file so that the data is persistant
- writeFile();
- }
-}
-
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/bugzilla/BugzillaContentProvider.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/bugzilla/BugzillaContentProvider.java
deleted file mode 100644
index f8e62a5f0..000000000
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/bugzilla/BugzillaContentProvider.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 - 2005 University Of British Columbia and others.
- * 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:
- * University Of British Columbia - initial API and implementation
- *******************************************************************************/
-/*
- * Created on Jan 13, 2005
- */
-package org.eclipse.mylar.tasks.bugzilla;
-
-import org.eclipse.mylar.bugzilla.core.BugReport;
-import org.eclipse.mylar.tasks.BugzillaTask;
-
-
-/**
- * @author Mik Kersten
- * @author Eric Booth
- */
-public class BugzillaContentProvider {
-
- public BugzillaContentProvider() {
- // don't have any initialization to do
- }
-
- /**
- * @return String containing bug priority and label, e.g. "[12345] P2: fix failing test"
- */
- public String getBugzillaDescription(BugzillaTask bugTask) {
- if (bugTask == null) return "<no info>";
-
- String prefix = //((bugTask.isDirty()) ? ">" : "") +
- "<" + BugzillaTask.getBugId(bugTask.getHandle()) + ">: ";
-
- if (bugTask.getState() == BugzillaTask.BugTaskState.DOWNLOADING) {
- return prefix + ": <Downloading bug report from server...>";
- } else if (bugTask.getState() == BugzillaTask.BugTaskState.OPENING) {
- return prefix + ": <Opening bug report in editor...>";
- } else if (bugTask.getState() == BugzillaTask.BugTaskState.COMPARING) {
- return prefix + ": <Comparing bug report with server...>";
- } else if (bugTask.getState() == BugzillaTask.BugTaskState.WAITING) {
- return prefix + ": <Waiting to check server...>";
- }
-
- // generate the label
- if (bugTask.isBugDownloaded()) {
- BugReport report = bugTask.getBugReport();
- return prefix + report.getSummary();
- }
- else {
- return prefix + ": <could not find bug>";
- }
- }
-
-}
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/bugzilla/BugzillaEditingMonitor.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/bugzilla/BugzillaEditingMonitor.java
deleted file mode 100644
index 8eadb4e55..000000000
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/bugzilla/BugzillaEditingMonitor.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 - 2005 University Of British Columbia and others.
- * 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:
- * University Of British Columbia - initial API and implementation
- *******************************************************************************/
-/*
- * Created on Apr 27, 2005
- */
-package org.eclipse.mylar.tasks.bugzilla;
-
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.mylar.bugzilla.ui.editor.AbstractBugEditor;
-import org.eclipse.mylar.bugzilla.ui.outline.BugzillaReportSelection;
-import org.eclipse.mylar.core.AbstractSelectionMonitor;
-import org.eclipse.mylar.tasks.ui.BugzillaTaskEditor;
-import org.eclipse.ui.IWorkbenchPart;
-
-
-/**
- * @author Mik Kersten
- */
-public class BugzillaEditingMonitor extends AbstractSelectionMonitor {
-
- public BugzillaEditingMonitor() {
- super();
- }
-
- @Override
- protected void handleWorkbenchPartSelection(IWorkbenchPart part, ISelection selection) {
- if(!(part instanceof AbstractBugEditor) && !(part instanceof BugzillaTaskEditor))
- return;
-
- if(selection instanceof StructuredSelection){
- StructuredSelection ss = (StructuredSelection)selection;
- Object object = ss.getFirstElement();
- if(object instanceof BugzillaReportSelection) super.handleElementSelection(part, object);
- }
- }
-
-}
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/bugzilla/BugzillaMylarBridge.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/bugzilla/BugzillaMylarBridge.java
deleted file mode 100644
index 6dc4033b9..000000000
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/bugzilla/BugzillaMylarBridge.java
+++ /dev/null
@@ -1,142 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 - 2005 University Of British Columbia and others.
- * 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:
- * University Of British Columbia - initial API and implementation
- *******************************************************************************/
-/*
- * Created on Oct 1, 2004
- */
-package org.eclipse.mylar.tasks.bugzilla;
-
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.jdt.core.IJavaElement;
-import org.eclipse.jdt.core.IMember;
-
-
-/**
- * Class to handle the bridge between mylar and bugzilla
- *
- * @author Shawn Minto
- */
-public class BugzillaMylarBridge {
-
- /** The hash of all of the landmarks and their related search hits */
- private HashMap<String, Map<Integer, List<BugzillaReportNode>>> landmarksHash;
- /**
- * The currently running search jobs so that we can cancel it if necessary <br> KEY: IMember VALUE: Job
- */
- public static HashMap<String, Job> runningJobs = new HashMap<String, Job>();
-
- /**
- * Constructor
- */
- public BugzillaMylarBridge() {
- landmarksHash = new HashMap<String, Map<Integer, List<BugzillaReportNode>>>();
- }
-
-
- /**
- * Remove a landmark from the hash
- *
- * @param removed
- * This landmark to remove (IJavaElement)
- */
- public void removeFromLandmarksHash(IJavaElement removed) {
- landmarksHash.remove(removed.getHandleIdentifier());
- }
-
- /**
- * Remove all of the landmarks from the hash that are in the list
- *
- * @param removed
- * This list of landmarks to remove (IJavaElements)
- */
- public void removeFromLandmarksHash(List<IJavaElement> removed) {
-
- for(IJavaElement je : removed) {
- landmarksHash.remove(je.getHandleIdentifier());
- }
- }
-
- /**
- * Add data to the landmarks hash
- *
- * @param doiList
- * The list of BugzillaSearchHitDoiInfo
- * @param m
- * The member that this list is for
- */
- public void addToLandmarksHash(List<BugzillaReportNode> doiList, IMember m, int scope) {
- Map<Integer, List<BugzillaReportNode>> searches = landmarksHash.get(m.getHandleIdentifier());
-
- if(searches == null){
- searches = new HashMap<Integer, List<BugzillaReportNode>>();
- }
- searches.put(scope, doiList);
- landmarksHash.put(m.getHandleIdentifier(), searches);
- }
-
- /**
- * Get the doiList for the given IMember from the landmarks hash
- *
- * @param m
- * The member to get the doiList for
- * @return The doiList or null if it doesn't exist
- */
- public List<BugzillaReportNode> getFromLandmarksHash(IMember m, int scope) {
- Map<Integer, List<BugzillaReportNode>> scopes = landmarksHash.get(m.getHandleIdentifier());
- if(scopes == null)
- return null;
- else
- return scopes.get(scope);
- }
-
- /**
- * Determine whether the current element has a search job running for it
- *
- * @param e
- * The element that we want to know whether there is a search job
- * or not
- * @return <code>true</code> if it does else <code>false</code>
- */
- public static boolean doesJobExist(String handle) {
- return runningJobs.containsKey(handle);
- }
-
- /**
- * Remove search job for the given element
- *
- * @param m
- * The element that we want to make sure that the search is
- * canceled for
- */
- public static void removeSearchJob(String handle) {
-
- // make sure that there wasn't a previous search job that we know
- // of. If there was, cancel it
- if (doesJobExist(handle)) {
- // get the search job and wait until it is cancelled
- Job prevJob = runningJobs.get(handle);
- prevJob.cancel();
- runningJobs.remove(handle);
- }
- }
-
- /**
- * Add a search job to our list
- * @param handle The handle of the element that we are searching for
- * @param searchJob The job that represents the search
- */
- public static void addJob(String handle, Job searchJob) {
- runningJobs.put(handle, searchJob);
- }
-} \ No newline at end of file
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/bugzilla/BugzillaReferencesProvider.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/bugzilla/BugzillaReferencesProvider.java
deleted file mode 100644
index 6b810f142..000000000
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/bugzilla/BugzillaReferencesProvider.java
+++ /dev/null
@@ -1,142 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 - 2005 University Of British Columbia and others.
- * 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:
- * University Of British Columbia - initial API and implementation
- *******************************************************************************/
-/*
- * Created on Feb 2, 2005
- */
-package org.eclipse.mylar.tasks.bugzilla;
-
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.jdt.core.IJavaElement;
-import org.eclipse.jdt.core.IMember;
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.mylar.core.model.ITaskscapeNode;
-import org.eclipse.mylar.core.search.IActiveSearchListener;
-import org.eclipse.mylar.core.search.IMylarSearchOperation;
-import org.eclipse.mylar.core.search.RelationshipProvider;
-import org.eclipse.mylar.tasks.MylarTasksPlugin;
-import org.eclipse.mylar.tasks.bugzilla.search.BugzillaMylarSearch;
-
-
-/**
- * @author Shawn Minto
- */
-public class BugzillaReferencesProvider extends RelationshipProvider {
-
- public static final String ID = "org.eclipse.mylar.bugzilla.search.references";
- public static final String NAME = "Bugilla report references";
-
- public BugzillaReferencesProvider() {
- super(BugzillaStructureBridge.EXTENSION, ID);
- }
-
- protected boolean acceptElement(IJavaElement javaElement) {
- return javaElement != null
- && (javaElement instanceof IMember || javaElement instanceof IType);
- }
-
- /**
- * HACK: checking kind as string - don't want the dependancy to mylar.java
- */
- @Override
- protected void findRelated(final ITaskscapeNode node, int degreeOfSeparation) {
- if (!node.getStructureKind().equals("java")) return;
- IJavaElement javaElement = JavaCore.create(node.getElementHandle());
- if (!acceptElement(javaElement)) {
- return;
- }
- runJob(node, degreeOfSeparation);
-
- //XXX what if degreeOfSeparation is 5?
- }
-
- @Override
- public IMylarSearchOperation getSearchOperation(ITaskscapeNode node, int limitTo, int degreeOfSepatation) {
- IJavaElement javaElement = JavaCore.create(node.getElementHandle());
- return new BugzillaMylarSearch(degreeOfSepatation, javaElement);
- }
-
- private void runJob(final ITaskscapeNode node, final int degreeOfSeparation) {
- BugzillaMylarSearch search = (BugzillaMylarSearch)getSearchOperation(node, 0, degreeOfSeparation);
-
- search.addListener(new IActiveSearchListener(){
-
- private boolean gathered = false;
-
- public void searchCompleted(List<?> nodes) {
- Iterator<?> itr = nodes.iterator();
-
- BugzillaStructureBridge bridge = MylarTasksPlugin.getDefault().getStructureBridge();
-
- while(itr.hasNext()) {
- Object o = itr.next();
- if(o instanceof BugzillaReportNode){
- BugzillaReportNode bugzillaNode = (BugzillaReportNode)o;
- String handle = bugzillaNode.getElementHandle();
- if(bridge.getCached(handle) == null)
- cache(handle, bugzillaNode);
- incrementInterest(degreeOfSeparation, BugzillaStructureBridge.EXTENSION, handle);
- }
- }
- gathered = true;
- }
-
- public boolean resultsGathered() {
- return gathered;
- }
-
- });
- search.run(new NullProgressMonitor());
- }
-
- @Override
- protected String getSourceId() {
- return ID;
- }
-
- @Override
- public String getName() {
- return NAME;
- }
-
- /*
- *
- * STUFF FOR TEMPORARILY CACHING A PROXY REPORT
- *
- * TODO remove the proxys and update the BugzillaStructureBridge cache so that on restart,
- * we dont have to get all of the bugs
- *
- */
- private static final Map<String, BugzillaReportNode> reports = new HashMap<String, BugzillaReportNode>();
-
- public BugzillaReportNode getCached(String handle){
- return reports.get(handle);
- }
-
- protected void cache(String handle, BugzillaReportNode bugzillaNode) {
- reports.put(handle, bugzillaNode);
- }
-
- public void clearCachedReports(){
- reports.clear();
- }
-
- public Collection<? extends String> getCachedHandles() {
- return reports.keySet();
- }
-
-}
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/bugzilla/BugzillaReportNode.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/bugzilla/BugzillaReportNode.java
deleted file mode 100644
index 6ac4c26a5..000000000
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/bugzilla/BugzillaReportNode.java
+++ /dev/null
@@ -1,184 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 - 2005 University Of British Columbia and others.
- * 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:
- * University Of British Columbia - initial API and implementation
- *******************************************************************************/
-/*
- * Created on Oct 21, 2004
- */
-package org.eclipse.mylar.tasks.bugzilla;
-
-import java.io.IOException;
-import java.net.MalformedURLException;
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.security.auth.login.LoginException;
-
-import org.eclipse.mylar.bugzilla.core.BugReport;
-import org.eclipse.mylar.bugzilla.core.BugzillaRepository;
-import org.eclipse.mylar.bugzilla.search.BugzillaSearchHit;
-
-
-/**
- * Class to store the DoiInfo of a BugzillaSearchHit
- *
- * @author Shawn Minto
- */
-public class BugzillaReportNode {
-
- private static final long serialVersionUID = 3257004367222419506L;
-
- /** The BugzillaSearchHit associated with this DoiInfo */
- private BugzillaSearchHit hit;
-
- /** Whether this search hit was from an exact search like a stack trace */
- private boolean isExact = false;
-
- /** List of all of the StackTrace's in the given bug */
- private List<StackTrace> stackTraces;
-
- /** The bug report associated with this DoiInfo */
- private BugReport bug;
-
- /**
- * Constructor
- *
- * @param initialValue
- * The initial Doi value
- * @param hit
- * The BugzillaSearchHit associated with this DoiInfo
- * @param isExact
- * Whether the search was exact or not
- */
- public BugzillaReportNode(float initialValue, BugzillaSearchHit hit,
- boolean isExact) {
- this.hit = hit;
- this.isExact = isExact;
- bug = null;
- stackTraces = new ArrayList<StackTrace>();
- }
-
- /**
- * Get the bugzilla search hit relating to this DoiInfo
- *
- * @return The BugzillaSearchHit related to this DoiInfo
- */
- public BugzillaSearchHit getHit() {
- return hit;
- }
-
- @Override
- public String toString() {
- return hit.toString();
- }
-
- /**
- * Determine if the search hit this represents is exact or not
- *
- * @return <code>true</code> if the search was exact otherwise
- * <code>false</code>
- */
- public boolean isExact() {
- return isExact;
- }
-
- /**
- * Set whether this bug has any exact elements in it - the search used was fully qualified
- *
- * @param isExact -
- * Whether there are any exact element matches in it
- */
- public void setExact(boolean isExact) {
- this.isExact = isExact;
- }
-
- /**
- * Get the bug report associated with this DoiInfo<br>
- * The bug is downloaded if it was not previously
- *
- * @return Returns the BugReport
- *
- * @throws IOException
- * @throws LoginException
- * @throws MalformedURLException
- */
- public BugReport getBug() throws MalformedURLException, LoginException, IOException {
- if(bug == null){
-
- // get the bug report
- bug = BugzillaRepository.getInstance().getBug(
- hit.getId());
- }
- return bug;
- }
-
- /**
- * Set the bug report associated with this DoiInfo
- *
- * @param bug -
- * BugReport that this is associated with
- */
- public void setBug(BugReport bug) {
- this.bug = bug;
- }
-
- /**
- * Get all of the stack traces contained in the bug
- *
- * @return Returns a list of StackTrace's
- */
- public List<StackTrace> getStackTraces() {
- return stackTraces;
- }
-
- /**
- * Determine whether the doi info has any stack traces associated with it
- * @return <code>true</code> if there are some stack traces else <code>false</code>
- */
- public boolean hasStackTraces(){
- return !stackTraces.isEmpty();
- }
-
- /**
- * Add a stack trace to this DoiInfo
- *
- * @param stackTrace -
- * The StackTrace to add
- */
- public void addStackTrace(StackTrace stackTrace) {
- this.stackTraces.add(stackTrace);
- }
-
- /**
- * Add an array of stack traces to this DoiInfo
- *
- * @param stackTracesToAdd -
- * The StackTraces to add
- */
- public void addStackTraces(StackTrace[] stackTracesToAdd) {
- for (int i = 0; i < stackTracesToAdd.length; i++)
- this.stackTraces.add(stackTracesToAdd[i]);
- }
-
- /**
- * Get the name of the bug report
- * @return The name of the bug report, max 20 characters
- */
- public String getName() {
- final int MAX_LENGTH = 100;
- String description = hit.getDescription();
- int length = description.length();
- if (length > MAX_LENGTH) description = description.substring(0, MAX_LENGTH) + "..";
- return "bug " + hit.getId() + ": " + description;
- }
-
- public String getElementHandle() {
- return hit.getServer() + ";" + hit.getId();
- }
-} \ No newline at end of file
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/bugzilla/BugzillaStructureBridge.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/bugzilla/BugzillaStructureBridge.java
deleted file mode 100644
index 272e8c2fd..000000000
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/bugzilla/BugzillaStructureBridge.java
+++ /dev/null
@@ -1,278 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 - 2005 University Of British Columbia and others.
- * 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:
- * University Of British Columbia - initial API and implementation
- *******************************************************************************/
-/*
- * Created on May 2, 2005
- */
-package org.eclipse.mylar.tasks.bugzilla;
-
-import java.lang.reflect.InvocationTargetException;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Set;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.mylar.bugzilla.core.BugReport;
-import org.eclipse.mylar.bugzilla.core.BugzillaRepository;
-import org.eclipse.mylar.bugzilla.core.IBugzillaBug;
-import org.eclipse.mylar.bugzilla.search.BugzillaSearchHit;
-import org.eclipse.mylar.bugzilla.ui.editor.AbstractBugEditor;
-import org.eclipse.mylar.bugzilla.ui.outline.BugzillaOutlineNode;
-import org.eclipse.mylar.bugzilla.ui.outline.BugzillaReportSelection;
-import org.eclipse.mylar.bugzilla.ui.outline.BugzillaTools;
-import org.eclipse.mylar.core.IMylarStructureBridge;
-import org.eclipse.mylar.core.MylarPlugin;
-import org.eclipse.mylar.tasks.MylarTasksPlugin;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.actions.WorkspaceModifyOperation;
-import org.eclipse.ui.progress.IProgressService;
-import org.eclipse.ui.views.markers.internal.ProblemMarker;
-
-
-public class BugzillaStructureBridge implements IMylarStructureBridge {
-
- public final static String EXTENSION = "bugzilla";
-
- public String getResourceExtension() {
- return EXTENSION;
- }
-
- public BugzillaStructureBridge() {
- super();
- readCacheFile();
- }
-
- /**
- * Handle format: <server-name:port>;<bug-id>;<comment#>
- *
- * Use: BugzillaTools ???
- */
- public String getHandleIdentifier(Object object) {
- if(object instanceof BugzillaOutlineNode){
- BugzillaOutlineNode n = (BugzillaOutlineNode)object;
- return BugzillaTools.getHandle(n);
- }
- else if(object instanceof BugzillaReportSelection){
- BugzillaReportSelection n = (BugzillaReportSelection)object;
- return BugzillaTools.getHandle(n);
- }
- return null;
- }
-
- private BugReport result;
-
- public Object getObjectForHandle(final String handle) {
- result = null;
-
- String [] parts = handle.split(";");
- if (parts.length >= 2){
- String server = parts[0];
- final int id = Integer.parseInt(parts[1]);
-
- String bugHandle = server + ";" + id;
-
- int commentNumber = -1;
- if(parts.length == 3){
- commentNumber = Integer.parseInt(parts[2]);
- }
-
- // get the bugzillaOutlineNode for the element
- IEditorPart editorPart = null;
- try{
- editorPart = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
- }catch(NullPointerException e){
- // do nothing, this just means that there is no active page
- }
- if(editorPart != null && editorPart instanceof AbstractBugEditor){
- AbstractBugEditor abe = ((AbstractBugEditor)editorPart);
- BugzillaOutlineNode node = abe.getModel();
- return findNode(node, commentNumber);
- }
-
- // try to get from the cache, if it doesn't exist, startup an operation to get it
- result = getFromCache(bugHandle);
- if(result == null){
- WorkspaceModifyOperation op = new WorkspaceModifyOperation() {
- protected void execute(IProgressMonitor monitor) throws CoreException {
- monitor.beginTask("Downloading Bug# " + id, IProgressMonitor.UNKNOWN);
- try {
- result = BugzillaRepository.getInstance().getCurrentBug(id);
- }catch(Exception e){
- result = null;
- }
- }};
-
- // Use the progess service to execute the runnable
- IProgressService service = PlatformUI.getWorkbench().getProgressService();
- try {
- service.run(false, false, op);
- } catch (InvocationTargetException e) {
- // Operation was canceled
- } catch (InterruptedException e) {
- // Handle the wrapped exception
- }
-
- if(result != null)
- cache(bugHandle, result);
- }
-
- BugzillaOutlineNode node = BugzillaOutlineNode.parseBugReport(result);
- return findNode(node, commentNumber);
- }
- else{
- return null;
- }
- }
-
- private BugzillaOutlineNode findNode(BugzillaOutlineNode startNode, int commentNumber){
-
- if(commentNumber == -1){
- return startNode;
- }else if(startNode.getComment() != null && startNode.getComment().getNumber() == commentNumber -1){
- return startNode;
- } else if(startNode.isCommentHeader() && commentNumber == 1){
- return startNode;
- }else if(startNode.isDescription() && commentNumber == 0){
- return startNode;
- }
-
- BugzillaOutlineNode[] children = startNode.getChildren();
- for(int i = 0; i < children.length; i++){
- BugzillaOutlineNode n = findNode(children[i], commentNumber);
- if(n != null)
- return n;
- }
- return null;
- }
-
- public String getParentHandle(String handle) {
-
- //check so that we don't need to try to get the parent if we are already at the bug report
- if(!handle.matches(".*;.*;.*"))
- return null;
-
- BugzillaOutlineNode bon = (BugzillaOutlineNode)getObjectForHandle(handle);
- if(bon != null && bon.getParent() != null)
- return BugzillaTools.getHandle(bon.getParent());
- else
- return null;
-// String [] parts = handle.split(";");
-// if (parts.length == 1){
-// return null;
-// }else if (parts.length > 2) {
-// String newHandle = "";
-// for(int i = 0; i < parts.length - 1; i++)
-// newHandle += parts[i] + ";";
-// return newHandle.substring(0, newHandle.length() - 1);
-//// return handle.substring(0, handle.lastIndexOf(";"));
-// }
-// return null;
- }
-
- public String getName(Object object) {
- if(object instanceof BugzillaOutlineNode){
- BugzillaOutlineNode b = (BugzillaOutlineNode)object;
- return BugzillaTools.getName(b);
- } else if (object instanceof BugzillaReportNode){
- BugzillaSearchHit hit = ((BugzillaReportNode)object).getHit();
- return hit.getServer() + ": Bug#: " + hit.getId() + ": " + hit.getDescription();
- }
- return "";
- }
-
- public boolean acceptAsLandmark(String handle) {
- return false;
- }
-
- public boolean acceptsObject(Object object) {
- return object instanceof BugzillaOutlineNode || object instanceof BugzillaReportSelection;
- }
-
- public boolean canFilter(Object element) {
- return true;
- }
-
- public boolean isDocument(String handle) {
- return (handle.indexOf(';') == handle.lastIndexOf(';') && handle.indexOf(";") != -1);
- }
-
- public String getHandleForMarker(ProblemMarker marker) {
- return null;
- }
-
- public IProject getProjectForObject(Object object) {
- // bugzilla objects do not yet sit in a project
- return null;
- }
-
- public String getResourceExtension(String elementHandle) {
- return getResourceExtension();
- }
-
- /*
- *
- * STUFF FOR CACHING BUG REPORTS
- *
- */
-
- // bug report cache
- private Map<String, BugReport> cache = new HashMap<String, BugReport>();
-
- public void cache(String handle, BugReport report) {
- cache.put(handle, report);
- cacheFile.add(report);
- }
-
- public void clearCache(){
- cache.clear();
- cacheFile.removeAll();
- }
-
- private BugReport getFromCache(String bugHandle) {
- return cache.get(bugHandle);
- }
-
- public Set<String> getCachedHandles(){
- return cache.keySet();
- }
-
- private BugzillaCacheFile cacheFile;
-
- private IPath getCacheFile() {
- IPath stateLocation = Platform.getPluginStateLocation(MylarTasksPlugin.getDefault());
- IPath configFile = stateLocation.append("offlineReports");
- return configFile;
- }
-
- private void readCacheFile() {
- IPath cachPath = getCacheFile();
-
- try {
- cacheFile = new BugzillaCacheFile(cachPath.toFile());
- ArrayList<IBugzillaBug> cached = cacheFile.elements();
- for(IBugzillaBug bug: cached){
- if(bug instanceof BugReport)
- cache.put(BugzillaTools.getHandle(bug), (BugReport)bug);
- }
- } catch (Exception e) {
- MylarPlugin.log(e, "occurred while restoring saved offline Bugzilla reports.");
- }
- }
-
- public BugReport getCached(String handle) {
- return cache.get(handle);
- }
-}
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/bugzilla/StackTrace.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/bugzilla/StackTrace.java
deleted file mode 100644
index 096c0c732..000000000
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/bugzilla/StackTrace.java
+++ /dev/null
@@ -1,375 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 - 2005 University Of British Columbia and others.
- * 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:
- * University Of British Columbia - initial API and implementation
- *******************************************************************************/
-/*
- * Created on Dec 8, 2004
- */
-package org.eclipse.mylar.tasks.bugzilla;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * Class to hold all of the information about a stack trace
- *
- * @author Shawn Minto
- */
-public class StackTrace {
-
- /** The length of the stack trace in the original string */
- private int length;
-
- /** The offset of the stack trace in the orignal string */
- private int offset;
-
- /** The string of the stack trace */
- private String stackTrace;
-
- /** This is the comment that the stack trace appeared in. String if desciption else Comment */
- private Object comment;
-
- /**
- * Constructor
- *
- * @param stackTrace
- * The stack trace string
- * @param offset
- * The offset of the stack trace in the original string
- * @param length
- * The length of the stack trace in the original string
- * @param comment
- * The comment that the stack trace came from
- */
- public StackTrace(String stackTrace, int offset, int length, Object comment) {
- this.stackTrace = stackTrace;
- this.offset = offset;
- this.length = length;
- this.comment = comment;
- }
-
- /**
- * Get the offset for the stack trace
- *
- * @return Returns the offset.
- */
- public int getOffset() {
- return offset;
- }
-
- /**
- * Get the stack trace for the bug
- *
- * @return Returns the stackTrace.
- */
- public String getStackTrace() {
- return stackTrace;
- }
-
- /**
- * Get the length of the bug
- *
- * @return Returns the length.
- */
- public int getLength() {
- return length;
- }
-
- /**
- * Get the Comment that this stack trace came from
- *
- * @return Returns the Comment if it was a comment else a String if it was the description
- */
- public Object getComment() {
- return comment;
- }
-
- /**
- * Find a standard java stack trace in the given string
- *
- *
- * @param s
- * The string to search for stack traces
- * @param comment
- * The comment that the text came from.<br>
- * Comment if a comment else a String
- * @return String[] of stack traces - each element is 1 trace
- */
- public static StackTrace[] getStackTrace(String s, Object comment) {
-
- // setup the regex used to determine if it looks like we are at a
- // stack trace and whether it is something that should be skipped
- String regexExceptionType = "^(.*\\.)+.+(Exception|Error|Throwable).*";
- String regexSkip = ".*\\.\\..*";
-
- // get all of the individual lines for the string
- String[] lines = s.split("\r\n");
-
- // the character start of the current stack trace
- int charStackStart = 0;
-
- // the current character in the string - used for the start and the
- // offset
- int[] charPos = { 0 }; // array so pass by reference
-
- boolean inStackTrace = false;
- List<String> stackTrace = null;
- List<StackTrace> stackTraces = new ArrayList<StackTrace>();
-
- // go through each of the lines of the string
- for (int i = 0; i < lines.length; i++) {
-
- if (lines[i].matches(regexSkip)){
-
- // update the current character position
- charPos[0] += lines[i].length() + 2;
-
- }else if (lines[i].trim().matches(regexExceptionType) && !inStackTrace) {
-
- // we have matched the stack trace and we are not already in one
-
- // add the old stack trace to the list of stack traces
- if (stackTrace != null && stackTrace.size() > 1) {
- stackTraces.add(getStackTrace(stackTrace, charStackStart,
- charPos[0] - charStackStart, comment));
- }
-
- // prepare for a new stack trace
- stackTrace = new ArrayList<String>();
- inStackTrace = true;
-
- // the current line is the start of our stack trace
- stackTrace.add(lines[i]);
- charStackStart = charPos[0];
- charPos[0] += lines[i].length() + 2;
- } else if (inStackTrace) {
- // we are in a stack trace
-
- int[] pos = { i }; // array so pass by reference
-
- // get the next at clause of the stack trace
- String stack = getNextAt(lines, pos, charPos);
-
- // check if there was an at
- if (stack == null) {
-
- // there wasn't so we are done this stack trace
- inStackTrace = false;
- if (stackTrace != null && stackTrace.size() > 1) {
- stackTraces.add(getStackTrace(stackTrace,
- charStackStart, charPos[0] - charStackStart, comment));
- }
- stackTrace = null;
- } else {
-
- // we had one, so add it to this stack trace
- stackTrace.add(stack);
- }
-
- // update the position
- i = pos[0];
- } else {
- // update the current character position
- charPos[0] += lines[i].length() + 2;
- }
- }
-
- // make sure to add the stack trace if it was the last in the string
- if (stackTrace != null && stackTrace.size() > 1) {
- stackTraces.add(getStackTrace(stackTrace, charStackStart,
- charPos[0] - charStackStart, comment));
- }
-
- if (stackTraces.size() == 0)
- return null;
-
- // get the string values of the stack traces and return it
- return getTracesFromList(stackTraces);
- }
-
- /**
- * Get the next at clause from a potential stack trace -- looks ahead 4
- * lines
- *
- * @param lines
- * The array of all of the lines in the bug
- * @param i
- * The current position to start at
- * @param charPos
- * The current character position in the original string
- * @return The next at clause, or <code>null</code><br>
- * If an at line is matched, but the end isn't within the 4 lines,
- * only the first line is returned. Also, charPos is updated as well
- * as i
- */
- private static String getNextAt(String[] lines, int[] i, int[] charPos) {
- String regexAtString = "^at.*";
- String regexEndString = ".*:\\d+\\)$";
- int index = i[0];
- String l1, l2, l3, l4;
- l1 = l2 = l3 = l4 = null;
- String res = null;
-
- // get the first line to look at
- if (lines.length > index) {
- l1 = lines[index];
- } else {
- // if the first line doesn't exist, we are done and should
- // return
- return null;
- }
-
- // get the next 3 lines
- if (lines.length > index + 1) {
- l2 = lines[index + 1];
- }
- if (lines.length > index + 2) {
- l3 = lines[index + 2];
- }
- if (lines.length > index + 3) {
- l4 = lines[index + 3];
- }
-
- // make sure that the first line is the start of an at
- // if not, return null
- if (l1.trim().matches(regexAtString)) {
- charPos[0] += l1.length() + 2;
- res = l1;
- } else
- return null;
-
- // now determine where the end is if it wasn't on 1 line
- if (!res.trim().matches(regexEndString)) {
-
- if (l2 != null && l2.trim().matches(regexEndString)) {
-
- // it was on the second line
- // update the current position and the result string
- i[0] = index + 1;
- charPos[0] += l2.length() + 2;
- res += l2.trim();
- } else if (l3 != null && l3.trim().matches(regexEndString)) {
-
- // it was on the third line
- // update the current position and the result string
- i[0] = index + 2;
- charPos[0] += l2.length() + l3.length() + 4;
- res += l2.trim();
- res += l3.trim();
- } else if (l4 != null && l4.trim().matches(regexEndString)) {
-
- // it was on the fourth line
- // update the current position and the result string
- i[0] = index + 3;
- charPos[0] += l2.length() + l3.length() + l4.length() + 6;
- res += l2.trim();
- res += l3.trim();
- res += l4.trim();
- }
- }
-
- // return the result
- return res;
- }
-
- /**
- * Get the StackTrace
- *
- * @param l
- * the list of lines that contain the trace
- * @param start
- * the start of the stack trace
- * @param offset
- * the offset of the stack trace
- * @param comment
- * The comment that the stack trace came from
- * @return The StackTrace for the given data
- */
- private static StackTrace getStackTrace(List<String> l, int offset, int length, Object comment) {
- String s = "";
- for(String s2 : l) {
- s += s2 + "\r\n";
- }
-
- return new StackTrace(s, offset, length, comment);
- }
-
- /**
- * Convert a List StackTraces to a StackTrace[] <br>
- *
- * @param l
- * The List of StackTraces
- * @return StackTrace[] of the List
- */
- private static StackTrace[] getTracesFromList(List<StackTrace> l) {
-
- // make sure that there is something to convert, else return null
- if (l == null || l.size() == 0)
- return null;
-
- // convert the list of strings to an array of strings
- int i = 0;
- StackTrace[] s = new StackTrace[l.size()];
-
- for(StackTrace st : l) {
- s[i] = st;
- i++;
- }
-
- // return the string array
- return s;
- }
-
- /**
- * Escape all of the special regex characters from the string
- *
- * @param s
- * The string to escape the characters for
- * @return A string with all of the special characters escaped <br>
- * <code>
- * . => \.<br>
- * $ => \$<br>
- * ? => \?<br>
- * { => \{<br>
- * } => \}<br>
- * ( => \(<br>
- * ) => \)<br>
- * [ => \[<br>
- * ] => \]<br>
- * + => \+<br>
- * * => \*<br>
- * | => \|<br>
- * ^ => \^<br>
- * \ => \\<br>
- * / => \/<br>
- * </code>
- */
- public static String escapeForRegex(String s) {
- String sFixed = s;
-
- // replace all special regex characters
- sFixed = sFixed.replaceAll("\\\\", "\\\\\\\\");
- sFixed = sFixed.replaceAll("\\$", "\\\\\\$");
- sFixed = sFixed.replaceAll("\\.", "\\\\.");
- sFixed = sFixed.replaceAll("\\?", "\\\\?");
- sFixed = sFixed.replaceAll("\\{", "\\\\{");
- sFixed = sFixed.replaceAll("\\}", "\\\\}");
- sFixed = sFixed.replaceAll("\\(", "\\\\(");
- sFixed = sFixed.replaceAll("\\)", "\\\\)");
- sFixed = sFixed.replaceAll("\\[", "\\\\[");
- sFixed = sFixed.replaceAll("\\]", "\\\\]");
- sFixed = sFixed.replaceAll("\\+", "\\\\+");
- sFixed = sFixed.replaceAll("\\*", "\\\\*");
- sFixed = sFixed.replaceAll("\\|", "\\\\|");
- sFixed = sFixed.replaceAll("\\^", "\\\\^");
- sFixed = sFixed.replaceAll("\\/", "\\\\/");
-
- return sFixed;
- }
-} \ No newline at end of file
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/bugzilla/Util.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/bugzilla/Util.java
deleted file mode 100644
index fb26f0500..000000000
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/bugzilla/Util.java
+++ /dev/null
@@ -1,226 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 - 2005 University Of British Columbia and others.
- * 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:
- * University Of British Columbia - initial API and implementation
- *******************************************************************************/
-/*
- * Created on Nov 19, 2004
- */
-package org.eclipse.mylar.tasks.bugzilla;
-
-import java.io.UnsupportedEncodingException;
-import java.net.URLEncoder;
-import java.nio.charset.Charset;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.jdt.core.IJavaElement;
-import org.eclipse.jdt.core.IMember;
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.mylar.bugzilla.BugzillaPlugin;
-import org.eclipse.mylar.bugzilla.BugzillaPreferences;
-import org.eclipse.mylar.bugzilla.IBugzillaConstants;
-import org.eclipse.mylar.core.model.InterestComparator;
-import org.eclipse.mylar.tasks.bugzilla.search.BugzillaMylarSearchOperation;
-
-
-/**
- * Utilities methods for the BugzillaMylarBridge
- *
- * @author Shawn Minto
- */
-public class Util {
-
- /**
- * List of all of the search operations that can be done <br> all words, any words, regex
- */
- private static final String[] patternOperationValues = { "allwordssubstr", "anywordssubstr", "regexp" };
- /**
- * Sugzilla preferences so that we can get the search params
- */
- private static IPreferenceStore prefs = BugzillaPlugin.getDefault().getPreferenceStore();
- /**
- * List of all of the resolutions that we can have <br> FIXED, INVALID, WONTFIX, LATER, REMIND, DUPLICATE, WORKSFORME, MOVED, ---
- */
- private static String[] resolutionValues = BugzillaPreferences.queryOptionsToArray(prefs.getString(IBugzillaConstants.RESOLUTION_VALUES));
- /**
- * List of all of the statuses that we can have <br> UNCONFIRMED, NEW, ASSIGNED, REOPENED, RESOLVED, VERIFIED, CLOSED
- */
- private static String[] statusValues = BugzillaPreferences.queryOptionsToArray(prefs.getString(IBugzillaConstants.STATUS_VALUES));
-
- /**
- * Get only the landmarks that are IMember and sort them according to their
- * DOI value (highest to lowest)
- *
- * @param landmarks
- * The landmarks to check
- * @return List of IMember landmarks sorted by DOI value
- */
- public static List<IMember> getMemberLandmarks(List<IJavaElement> landmarks) {
- List<IMember> memberLandmarks = new ArrayList<IMember>();
-
- for(IJavaElement je : landmarks) {
-
- // keep only the IMember landmarks
- if (je instanceof IMember) {
- memberLandmarks.add((IMember)je);
- }
- }
-
- // sort the landmarks
- Collections.sort(memberLandmarks, new InterestComparator<IMember>());
-
- return memberLandmarks;
- }
-
- /**
- * Get the bugzilla url used for searching for exact matches
- *
- * @param je
- * The IMember to create the query string for
- * @return A url string for the search
- */
- public static String getExactSearchURL(IMember je) {
- StringBuffer sb = getQueryURLStart();
-
- String long_desc = "";
-
- // get the fully qualified name of the element
- long_desc += BugzillaMylarSearchOperation.getFullyQualifiedName(je);
-
- try{
- // encode the string to be used as a url
- sb.append(URLEncoder.encode(long_desc, Charset.defaultCharset().toString()));
- } catch (UnsupportedEncodingException e)
- {
- // should never get here since we are using the default encoding
- }
- sb.append(getQueryURLEnd());
-
- return sb.toString();
- }
-
- /**
- * Get the bugzilla url used for searching for inexact matches
- *
- * @param je
- * The IMember to create the query string for
- * @return A url string for the search
- */
- public static String getInexactSearchURL(IMember je) {
- StringBuffer sb = getQueryURLStart();
-
-
- String long_desc = "";
-
- // add the member, qualified with just its parents name
- if (!(je instanceof IType))
- long_desc += je.getParent().getElementName()+".";
- long_desc += je.getElementName();
-
- try{
- // encode the string to be used as a url
- sb.append(URLEncoder.encode(long_desc, Charset.defaultCharset().toString()));
- } catch (UnsupportedEncodingException e)
- {
- // should never get here since we are using the default encoding
- }
- sb.append(getQueryURLEnd());
-
- return sb.toString();
- }
-
- /**
- * Create the end of the bugzilla query URL with all of the status' and resolutions that we want
- * @return StringBuffer with the end of the query URL in it
- */
- public static StringBuffer getQueryURLEnd(){
-
- StringBuffer sb = new StringBuffer();
-
- // add the status and resolutions that we care about
- sb.append("&bug_status=" + statusValues[0]); // UNCONFIRMED
- sb.append("&bug_status=" + statusValues[1]); // NEW
- sb.append("&bug_status=" + statusValues[2]); // ASSIGNED
- sb.append("&bug_status=" + statusValues[3]); // REOPENED
- sb.append("&bug_status=" + statusValues[4]); // RESOLVED
- sb.append("&bug_status=" + statusValues[5]); // VERIFIED
- sb.append("&bug_status=" + statusValues[6]); // CLOSED
-
- sb.append("&resolution=" + resolutionValues[0]); // FIXED
- sb.append("&resolution=" + resolutionValues[3]); // LATER
- sb.append("&resolution=" + "---"); // ---
- return sb;
- }
-
- /**
- * Create the bugzilla query URL start.
- *
- * @return The start of the query url as a StringBuffer <br>
- * Example: https://bugs.eclipse.org/bugs/buglist.cgi?long_desc_type=allwordssubstr&long_desc=
- */
- public static StringBuffer getQueryURLStart() {
- StringBuffer sb = new StringBuffer(BugzillaPlugin.getDefault()
- .getServerName());
-
- if (sb.charAt(sb.length() - 1) != '/') {
- sb.append('/');
- }
- sb.append("buglist.cgi?");
-
- // use the username and password if we have it
- if (BugzillaPreferences.getUserName() != null
- && !BugzillaPreferences.getUserName().equals("")
- && BugzillaPreferences.getPassword() != null
- && !BugzillaPreferences.getPassword().equals("")) {
- try{
- sb.append("GoAheadAndLogIn=1&Bugzilla_login="
- + URLEncoder.encode(BugzillaPreferences.getUserName(), Charset.defaultCharset().toString())
- + "&Bugzilla_password="
- + URLEncoder.encode(BugzillaPreferences.getPassword(), Charset.defaultCharset().toString())
- + "&");
- } catch (UnsupportedEncodingException e)
- {
- // should never get here since we are using the default encoding
- }
- }
-
- // add the description search type
- sb.append("long_desc_type=");
- sb.append(patternOperationValues[0]); // search for all words
- sb.append("&long_desc=");
-
- return sb;
- }
-
- /**
- * Search the given string for another string
- * @param elementName The name of the element that we are looking for
- * @param comment The text to search for this element name
- * @return <code>true</code> if the element is found in the text else <code>false</code>
- */
- public static boolean hasElementName(String elementName, String comment) {
-
- // setup a regex for the element name
- String regexElement = ".*"+elementName+".*";
-
- // get all of the individual lines for the string
- String[] lines = comment.split("\n");
-
- // go through each of the lines of the string
- for (int i = 0; i < lines.length; i++) {
-
- if (lines[i].matches(regexElement)){
- return true;
- }
- }
- return false;
- }
-} \ No newline at end of file
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/bugzilla/search/BugzillaMylarSearch.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/bugzilla/search/BugzillaMylarSearch.java
deleted file mode 100644
index dea6339ee..000000000
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/bugzilla/search/BugzillaMylarSearch.java
+++ /dev/null
@@ -1,148 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 - 2005 University Of British Columbia and others.
- * 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:
- * University Of British Columbia - initial API and implementation
- *******************************************************************************/
-/*
- * Created on Oct 13, 2004
- */
-package org.eclipse.mylar.tasks.bugzilla.search;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.jdt.core.IJavaElement;
-import org.eclipse.jdt.core.IMember;
-import org.eclipse.mylar.core.search.IActiveSearchListener;
-import org.eclipse.mylar.core.search.IMylarSearchOperation;
-import org.eclipse.mylar.tasks.bugzilla.BugzillaMylarBridge;
-import org.eclipse.mylar.tasks.bugzilla.BugzillaReportNode;
-import org.eclipse.mylar.tasks.bugzilla.Util;
-
-
-/**
- * Used to facilitate bugzilla searches based on IJavaElements
- *
- * @author Shawn Minto
- */
-public class BugzillaMylarSearch implements IMylarSearchOperation {
-
- // scope identifiers
- public static final int LOCAL_QUAL = 1; // local implies a bugzilla task, not just an offline report
- public static final int LOCAL_UNQUAL = 2;
- public static final int FULLY_QUAL = 3;
- public static final int UNQUAL = 4;
-
- private int scope;
-
- private IJavaElement element;
-
- private String handle = "";
-
- /**
- * Constructor
- * @param scope The scope of this search
- */
- public BugzillaMylarSearch(int scope, IJavaElement element) {
- this.scope = scope;
- this.element = element;
- }
-
- public IStatus run(IProgressMonitor monitor) {
- handle = element.getHandleIdentifier() + " " + scope;
- List<IJavaElement> landmarks = new ArrayList<IJavaElement>();
- landmarks.add(element);
-
- if (!BugzillaMylarBridge.doesJobExist(handle)) {
-
- // perform the bugzilla search
- // get only the useful landmarks (IMember)
- List<IMember> members = Util.getMemberLandmarks(landmarks);
-
- // go through all of the landmarks that we are given and perform a
- // search on them
- for(IMember m : members){
-
- // FIXME: decide whether to do leave the caching of searches in for now or not
- // check if we have the info cached
-// List<BugzillaReportNode> landmarkDoi = MylarTasksPlugin.getBridge()
-// .getFromLandmarksHash(m, scope);
-
-// if (landmarkDoi != null) {
-// //TODO decide when to queue up and do a refresh search
-// notifySearchCompleted(landmarkDoi);
-// continue;
-// }
-
- // create a search operation so that we can search
- BugzillaMylarSearchOperation op = new BugzillaMylarSearchOperation(
- this, m, scope);
-
- // create a new search job so that it can be scheduled and
- // run as a background thread
- Job searchJob = new BugzillaMylarSearchJob(
- "Querying Bugzilla Server - Mylar - "
- + op.getSearchMemberName(), op);
-
- // schedule the new search job
- searchJob.schedule();
-
- // save this searchJobs handle so that we can cancel it if need be
- BugzillaMylarBridge.addJob(handle, searchJob);
- }
- }
- return Status.OK_STATUS;
- }
-
- /** List of listeners wanting to know about the searches */
- private List<IActiveSearchListener> listeners = new ArrayList<IActiveSearchListener>();
-
- /**
- * Add a listener for when the bugzilla search is completed
- *
- * @param l
- * The listener to add
- */
- public void addListener(IActiveSearchListener l) {
- // add the listener to the list
- listeners.add(l);
- }
-
- /**
- * Remove a listener for when the bugzilla search is completed
- *
- * @param l
- * The listener to remove
- */
- public void removeListener(IActiveSearchListener l) {
- // remove the listener from the list
- listeners.remove(l);
- }
-
- /**
- * Notify all of the listeners that the bugzilla search is completed
- *
- * @param doiList
- * A list of BugzillaSearchHitDoiInfo
- * @param member
- * The IMember that the search was performed on
- */
- public void notifySearchCompleted(List<BugzillaReportNode> doiList) {
- // go through all of the listeners and call searchCompleted(colelctor,
- // member)
- BugzillaMylarBridge.removeSearchJob(handle);
- for (IActiveSearchListener listener : listeners) {
- listener.searchCompleted(doiList);
- }
- }
-
-} \ No newline at end of file
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/bugzilla/search/BugzillaMylarSearchJob.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/bugzilla/search/BugzillaMylarSearchJob.java
deleted file mode 100644
index 209d17434..000000000
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/bugzilla/search/BugzillaMylarSearchJob.java
+++ /dev/null
@@ -1,109 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 - 2005 University Of British Columbia and others.
- * 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:
- * University Of British Columbia - initial API and implementation
- *******************************************************************************/
-/*
- * Created on Oct 6, 2004
- */
-package org.eclipse.mylar.tasks.bugzilla.search;
-
-import javax.security.auth.login.LoginException;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.jface.dialogs.ErrorDialog;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.mylar.bugzilla.BugzillaPlugin;
-import org.eclipse.mylar.bugzilla.IBugzillaConstants;
-import org.eclipse.mylar.tasks.bugzilla.BugzillaMylarBridge;
-import org.eclipse.ui.PlatformUI;
-
-
-/**
- * The bugzilla search job used to search a bugzilla site
- *
- * @author Shawn Minto
- */
-public class BugzillaMylarSearchJob extends Job {
-
- /** The search operation used to perform the query */
- private BugzillaMylarSearchOperation operation;
-
- /**
- * Constructor
- *
- * @param name
- * Job name
- * @param operation
- * The operation to perform the search query
- */
- public BugzillaMylarSearchJob(String name,
- BugzillaMylarSearchOperation operation) {
- super(name);
- this.operation = operation;
- }
-
- @Override
- protected IStatus run(IProgressMonitor monitor) {
- // create a new status
- final IStatus[] status = new IStatus[1];
-
- try {
- // execute the search operation
- operation.execute(monitor);
-
- // get the status of the search operation
- status[0] = operation.getStatus();
-
- // determine if there was an error, if it was cancelled, or if it is
- // ok
- if ( status[0].getCode() == IStatus.CANCEL) {
- // it was cancelled, so just return
- status[0] = Status.OK_STATUS;
-
- // make sure that we know this job is not running anymore
- BugzillaMylarBridge.removeSearchJob(operation.getSearchMember().getHandleIdentifier()+" "+operation.getScope());//runningJobs.remove(operation.getSearchMember());
- return status[0];
- } else if (!status[0].isOK()) {
- // there was an error, so display an error message
- PlatformUI.getWorkbench().getDisplay().asyncExec(
- new Runnable() {
- public void run() {
- ErrorDialog.openError(null,
- "Bugzilla Search Error", null,
- status[0]);
- }
- });
- status[0] = Status.OK_STATUS;
-
- // make sure we know that this job is not running anymore
- BugzillaMylarBridge.removeSearchJob(operation.getSearchMember().getHandleIdentifier()+" "+operation.getScope());//runningJobs.remove(operation.getSearchMember());
- return status[0];
- }
- } catch (LoginException e) {
- // we had a problem while searching that seems like a login info
- // problem
- // thrown in BugzillaSearchOperation
- MessageDialog
- .openError(
- null,
- "Login Error",
- "Bugzilla could not log you in to get the information you requested since login name or password is incorrect.\nPlease check your settings in the bugzilla preferences. ");
- BugzillaPlugin.log(new Status(IStatus.ERROR,
- IBugzillaConstants.PLUGIN_ID, IStatus.OK, "", e));
- } finally {
- // make sure that we know that this job is not running anymore
- BugzillaMylarBridge.removeSearchJob(operation.getSearchMember().getHandleIdentifier()+" "+operation.getScope());//.runningJobs.remove(operation.getSearchMember());
- }
-
- return status[0];
- }
-} \ No newline at end of file
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/bugzilla/search/BugzillaMylarSearchOperation.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/bugzilla/search/BugzillaMylarSearchOperation.java
deleted file mode 100644
index 04f632e81..000000000
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/bugzilla/search/BugzillaMylarSearchOperation.java
+++ /dev/null
@@ -1,526 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 - 2005 University Of British Columbia and others.
- * 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:
- * University Of British Columbia - initial API and implementation
- *******************************************************************************/
-/*
- * Created on Oct 14, 2004
- */
-package org.eclipse.mylar.tasks.bugzilla.search;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import javax.security.auth.login.LoginException;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jdt.core.IJavaElement;
-import org.eclipse.jdt.core.IMember;
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.mylar.bugzilla.core.BugReport;
-import org.eclipse.mylar.bugzilla.core.Comment;
-import org.eclipse.mylar.bugzilla.search.BugzillaSearchEngine;
-import org.eclipse.mylar.bugzilla.search.BugzillaSearchHit;
-import org.eclipse.mylar.bugzilla.search.BugzillaSearchQuery;
-import org.eclipse.mylar.bugzilla.search.IBugzillaSearchOperation;
-import org.eclipse.mylar.core.MylarPlugin;
-import org.eclipse.mylar.tasks.BugzillaTask;
-import org.eclipse.mylar.tasks.ITask;
-import org.eclipse.mylar.tasks.MylarTasksPlugin;
-import org.eclipse.mylar.tasks.bugzilla.BugzillaReportNode;
-import org.eclipse.mylar.tasks.bugzilla.StackTrace;
-import org.eclipse.mylar.tasks.bugzilla.Util;
-import org.eclipse.ui.actions.WorkspaceModifyOperation;
-
-
-/**
- * Bugzilla search operation for Mylar
- *
- * @author Shawn Minto
- */
-public class BugzillaMylarSearchOperation extends WorkspaceModifyOperation
- implements IBugzillaSearchOperation {
- /** The IMember we are doing the search for */
- private IMember javaElement;
-
- /** The bugzilla collector for the search */
- private BugzillaResultCollector collector = null;
-
- /** The status of the search operation */
- private IStatus status;
-
- /** The LoginException that was thrown when trying to do the search */
- private LoginException loginException = null;
-
- /** The fully qualified name of the member we are searching for */
- private String name;
-
- /** The bugzilla search query */
- private BugzillaSearchQuery query;
-
- private BugzillaMylarSearch search;
-
- private int scope;
-
- /**
- * Constructor
- *
- * @param m
- * The member that we are doing the search for
- */
- public BugzillaMylarSearchOperation(BugzillaMylarSearch search, IMember m, int scope) {
- this.javaElement = m;
- this.search = search;
- this.scope = scope;
- name = getFullyQualifiedName(m);
- }
-
- /**
- * Get the fully qualified name of a IMember
- * TODO: move to a more central location so that others can use this, but don't want to add unecessary coupling
- *
- * @return String representing the fully qualified name
- */
- public static String getFullyQualifiedName(IJavaElement je) {
- if(!(je instanceof IMember)) return null;
-
- IMember m = (IMember)je;
- if (m.getDeclaringType() == null)
- return ((IType) m).getFullyQualifiedName();
- else
- return m.getDeclaringType().getFullyQualifiedName() + "."
- + m.getElementName();
- }
-
- @Override
- public void execute(IProgressMonitor monitor) {
-
- BugzillaResultCollector searchCollector = null;
-
- if(scope == BugzillaMylarSearch.FULLY_QUAL){
- searchCollector = searchQualified(monitor);
- }else if(scope == BugzillaMylarSearch.UNQUAL){
- searchCollector = searchUnqualified(monitor);
- }else if(scope == BugzillaMylarSearch.LOCAL_QUAL){
- searchCollector = searchLocalQual(monitor);
- }else if(scope == BugzillaMylarSearch.LOCAL_UNQUAL){
- searchCollector = searchLocalUnQual(monitor);
- }else{
- return;
- }
-
- if(searchCollector == null){
- search.notifySearchCompleted(
- new ArrayList<BugzillaReportNode>());
- return;
- }
-
- List<BugzillaSearchHit> l = searchCollector.getResults();
-
- // get the list of doi elements
- List<BugzillaReportNode> doiList = getDoiList(l);
-
- // we completed the search, so notify all of the listeners
- // that the search has been completed
- MylarTasksPlugin.getBridge()
- .addToLandmarksHash(doiList, javaElement, scope);
- search.notifySearchCompleted(
- doiList);
- // MIK: commmented out logging
-// MonitorPlugin.log(this, "There were " + doiList.size() + " items found");
- }
-
- /**
- * Search the local bugs for the member using the qualified name
- * @param monitor The progress monitor to search with
- * @return The BugzillaResultCollector with the results of the search
- */
- private BugzillaResultCollector searchLocalQual(IProgressMonitor monitor) {
-
- //get the fully qualified name for searching
- String elementName = getFullyQualifiedName(javaElement);
-
- // setup the search result collector
- collector = new BugzillaResultCollector();
- collector.setOperation(this);
- collector.setProgressMonitor(monitor);
-
- // get all of the root tasks and start the search
- List<ITask> tasks = MylarTasksPlugin.getTaskListManager().getTaskList().getRootTasks();
- searchLocal(tasks, collector, elementName, monitor);
-
- // return the collector
- return collector;
- }
-
- /**
- * Search the local bugs for the member using the unqualified name
- * @param monitor The progress monitor to search with
- * @return The BugzillaResultCollector with the results of the search
- */
- private BugzillaResultCollector searchLocalUnQual(IProgressMonitor monitor) {
-
- // get the element name for searching
- String elementName = javaElement.getElementName();
-
- // setup the search result collector
- collector = new BugzillaResultCollector();
- collector.setOperation(this);
- collector.setProgressMonitor(monitor);
-
- // get all of the root tasks and start the search
- List<ITask> tasks = MylarTasksPlugin.getTaskListManager().getTaskList().getRootTasks();
- searchLocal(tasks, collector, elementName, monitor);
-
- // return the collector
- return collector;
- }
-
- /**
- * Search the local bugs for the member
- * @param tasks The tasks to search
- * @param searchCollector The collector to add the results to
- * @param elementName The name of the element that we are looking for
- * @param monitor The progress monitor
- */
- private void searchLocal(List<ITask> tasks, BugzillaResultCollector searchCollector, String elementName, IProgressMonitor monitor) {
- if(tasks == null) return;
-
- // go through all of the tasks
- for(ITask task : tasks){
- monitor.worked(1);
-
- // check what kind of task it is
- if(task instanceof BugzillaTask){
-
- // we have a bugzilla task, so get the bug report
- BugzillaTask bugTask = (BugzillaTask)task;
- BugReport bug = bugTask.getBugReport();
-
- // parse the bug report for the element that we are searching for
- boolean isHit = search(elementName, bug);
-
- // determine if we have a hit or not
- if(isHit){
-
- // make a search hit from the bug and then add it to the collector
- BugzillaSearchHit hit = new BugzillaSearchHit(bug.getId(), bug.getDescription(), "","","","","","","", bug.getServer());
- try{
- searchCollector.accept(hit);
- }catch(CoreException e){
- MylarPlugin.log(e, "bug search failed");
- }
- }
- }
-
- // get the children and perform the search on them as well
- List<ITask> children = task.getChildren();
- if(children != null){
- searchLocal(children, searchCollector, elementName, monitor);
- }
- }
- status = Status.OK_STATUS;
- }
-
- /**
- * Search the bug for the given element name
- * @param elementName The name of the element to search for
- * @param bug The bug to search in
- */
- private boolean search(String elementName, BugReport bug) {
-
- if (bug == null) return false; // MIK: added null check here
- String description = bug.getDescription();
- String summary = bug.getSummary();
- List<Comment> comments = bug.getComments();
-
- // search the description and the summary
- if(Util.hasElementName(elementName, summary))
- return true;
-
- if(Util.hasElementName(elementName, description))
- return true;
-
- Iterator<Comment> comItr = comments.iterator();
- while (comItr.hasNext()) {
- Comment comment = comItr.next();
- String commentText = comment.getText();
- // search the text for a reference to the element
- if(Util.hasElementName(elementName, commentText))
- return true;
- }
- return false;
- }
-
- /**
- * Perform the actual search on the Bugzilla server
- * @param url The url to use for the search
- * @param searchCollector The collector to put the search results into
- * @param monitor The progress monitor to use for the search
- * @return The BugzillaResultCollector with the search results
- */
- private BugzillaResultCollector search(String url, BugzillaResultCollector searchCollector, IProgressMonitor monitor){
-
- // set the initial number of matches to 0
- int matches = 0;
- // setup the progress monitor and start the search
- searchCollector.setProgressMonitor(monitor);
- BugzillaSearchEngine engine = new BugzillaSearchEngine(url);
- try {
-
- // perform the search
- status = engine.search(searchCollector, matches);
-
- // check the status so that we don't keep searching if there
- // is a problem
- if (status.getCode() == IStatus.CANCEL) {
- MylarPlugin.log("search cancelled", this);
- return null;
- } else if (!status.isOK()) {
- MylarPlugin.log("search error", this);
- MylarPlugin.log(status);
- return null;
- }
- return searchCollector;
- } catch (LoginException e) {
- //save this exception to throw later
- this.loginException = e;
- }
- return null;
- }
-
- /**
- * Perform a search for qualified instances of the member
- * @param monitor The progress monitor to use
- * @return The BugzillaResultCollector with the search results
- */
- private BugzillaResultCollector searchQualified(IProgressMonitor monitor)
- {
- // create a new collector for the results
- collector = new BugzillaResultCollector();
- collector.setOperation(this);
- collector.setProgressMonitor(monitor);
-
- // get the search url
- String url = Util.getExactSearchURL(javaElement);
-
- // log the url that we are searching with
- // MIK: commmented out logging
-// MonitorPlugin.log(this, url);
-
- return search(url, collector, monitor);
- }
-
- /**
- * Perform a search for unqualified instances of the member
- * @param monitor The progress monitor to use
- * @return The BugzillaResultCollector with the search results
- */
- private BugzillaResultCollector searchUnqualified(IProgressMonitor monitor)
- {
- // create a new collector for the results
- collector = new BugzillaResultCollector();
- collector.setOperation(this);
- collector.setProgressMonitor(monitor);
-
- // get the search url
- String url = Util.getInexactSearchURL(javaElement);
-
- // log the url that we are searching with
- // MIK: commmented out logging
-// MonitorPlugin.log(this, url);
-
- return search(url, collector, monitor);
- }
-
-// /**
-// * Remove all of the duplicates
-// * @param compare The List of BugzillaSearchHits to compare with
-// * @param base The List of BugzillaSearchHits to remove the duplicates from
-// */
-// private void removeDuplicates(List<BugzillaSearchHit> compare, List<BugzillaSearchHit> base){
-//
-// for(BugzillaSearchHit h1 : compare){
-// Iterator itr2 = base.iterator();
-// while(itr2.hasNext()){
-// BugzillaSearchHit h2 = (BugzillaSearchHit)itr2.next();
-// if(h2.getId() == h1.getId()){
-// // we found a duplicate so remove it
-// itr2.remove();
-// break;
-// }
-// }
-// }
-// }
-//
- /**
- * Perform a second pass parse to determine if there are any stack traces in
- * the bug - currently only used for the exact search results
- *
- * @param doiList -
- * the list of BugzillaSearchHitDOI elements to parse
- */
- public static void secondPassBugzillaParser(List<BugzillaReportNode> doiList) {
-
- // go through each of the items in the doiList
- for(BugzillaReportNode info : doiList) {
-
- // get the bug report so that we have all of the data
- // - descriptions, comments, etc
- BugReport b = null;
- try{
- b = info.getBug();
- }catch(Exception e){
- // don't care since null will be caught
- }
-
- // if the report could not be downloaded, try the next one
- if (b == null)
- continue;
-
- // see if the description has a stack trace in it
- StackTrace[] stackTrace = StackTrace.getStackTrace(b.getDescription(), b.getDescription());
- if (stackTrace != null) {
-
- // add the stack trace to the doi info
- info.setExact(true);
- info.addStackTraces(stackTrace);
- }
-
- // go through all of the comments for the bug
- Iterator<Comment> comItr = b.getComments().iterator();
- while (comItr.hasNext()) {
- Comment comment = comItr.next();
- String commentText = comment.getText();
-
- // see if the comment has a stack trace in it
- stackTrace = StackTrace.getStackTrace(commentText, comment);
- if (stackTrace != null) {
-
- // add the stack trace to the doi info
- info.setExact(true);
- info.addStackTraces(stackTrace);
- }
- }
- }
- }
-
- /**
- * Add the results returned to the Hash of landmarks
- *
- * @param results
- * The list of results
- * @param isExact
- * whether the search was exact or not
- */
- private List<BugzillaReportNode> getDoiList(List<BugzillaSearchHit> results) {
- List<BugzillaReportNode> doiList = new ArrayList<BugzillaReportNode>();
-
- boolean isExact = (scope==BugzillaMylarSearch.FULLY_QUAL || scope==BugzillaMylarSearch.LOCAL_QUAL)?true:false;
-
- BugzillaReportNode info = null;
- // go through all of the results and create a DoiInfo list
- for(BugzillaSearchHit hit : results){
-
- try {
- float value = 0;
- info = new BugzillaReportNode(
- value, hit, isExact);
-
- // only download the bug for the exact matches
- //downloading bugs kills the time - can we do this elsewhere? - different thread? persistant?
-// if(isExact){
-// // get the bug report for the doi info item
-// BugReport b = BugzillaRepository.getInstance().getBug(
-// hit.getId());
-// // add the bug to the doi info for future use
-// info.setBug(b);
-// }
-
- } catch (Exception e) {
- MylarPlugin.log(e, "search failed");
- }
- finally{
- doiList.add(info);
- }
- }
- return doiList;
- }
-
- /**
- * @see org.eclipse.mylar.bugzilla.search.IBugzillaSearchOperation#getStatus()
- */
- public IStatus getStatus() throws LoginException {
- // if a LoginException was thrown while trying to search, throw this
- if (loginException == null)
- return status;
- else
- throw loginException;
- }
-
- /**
- * @see org.eclipse.mylar.bugzilla.search.IBugzillaSearchOperation#getImageDescriptor()
- */
- public ImageDescriptor getImageDescriptor() {
- return null;
- }
-
- /**
- * Get the member that we are performing the search for
- *
- * @return The member this search is being performed for
- */
- public IMember getSearchMember() {
- return javaElement;
- }
-
- /**
- * Get the name of the member that we are searching for
- *
- * @return The fully qualified name of the member
- */
- public String getSearchMemberName() {
- return name;
- }
-
- /**
- * @see org.eclipse.mylar.bugzilla.search.IBugzillaSearchOperation#getQuery()
- */
- public BugzillaSearchQuery getQuery() {
- return query;
- }
-
- /**
- * @see org.eclipse.mylar.bugzilla.search.IBugzillaSearchOperation#setQuery(org.eclipse.mylar.bugzilla.search.BugzillaSearchQuery)
- */
- public void setQuery(BugzillaSearchQuery newQuery) {
- this.query = newQuery;
- }
-
- /**
- * Get the name of the element that we are searching for
- *
- * @return The name of the element
- */
- public String getName(){
- return name;
- }
-
- /**
- * Get the scope of the search operation
- * @return The scope - defined in BugzillaMylarSearch
- */
- public int getScope() {
- return scope;
- }
-} \ No newline at end of file
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/bugzilla/search/BugzillaResultCollector.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/bugzilla/search/BugzillaResultCollector.java
deleted file mode 100644
index 3bbc47c2b..000000000
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/bugzilla/search/BugzillaResultCollector.java
+++ /dev/null
@@ -1,182 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 - 2005 University Of British Columbia and others.
- * 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:
- * University Of British Columbia - initial API and implementation
- *******************************************************************************/
-/*
- * Created on Oct 4, 2004
- */
-package org.eclipse.mylar.tasks.bugzilla.search;
-
-import java.text.MessageFormat;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.mylar.bugzilla.search.BugzillaSearchHit;
-import org.eclipse.mylar.bugzilla.search.IBugzillaSearchOperation;
-import org.eclipse.mylar.bugzilla.search.IBugzillaSearchResultCollector;
-
-
-/**
- * Collector for the bugzilla search results
- *
- * @author Shawn Minto
- */
-public class BugzillaResultCollector implements IBugzillaSearchResultCollector {
- /** A list of all of the search results found */
- private List<BugzillaSearchHit> results = new ArrayList<BugzillaSearchHit>();
-
- /** The progress monitor for the search operation */
- private IProgressMonitor monitor;
-
- /** The number of matches found */
- private int matchCount;
-
- /** The bugzilla search operation */
- private IBugzillaSearchOperation operation;
-
- /** The string to display to the user while querying */
- private static final String STARTING = "querying the server";
-
- /** The string to display to the user when the query is done */
- private static final String DONE = "done";
-
- /** The string to display when there is one match from the search */
- private static final String MATCH = "Bugzilla Mylar search - 1 match";
-
- /** The string to display when there is more than one match from the search */
- private static final String MATCHES = "Bugzilla Mylar search - {0} matches";
-
- /**
- * @see org.eclipse.mylar.bugzilla.search.IBugzillaSearchResultCollector#aboutToStart()
- */
- public void aboutToStart(int startMatchCount) throws CoreException {
- // initiailize the number of matches
- matchCount = startMatchCount;
-
- // set the progress monitor to say that we are querying the server
- monitor.setTaskName(STARTING);
- }
-
- /**
- * @see org.eclipse.mylar.bugzilla.search.IBugzillaSearchResultCollector#accept(org.eclipse.mylar.bugzilla.search.BugzillaSearchHit)
- */
- public void accept(BugzillaSearchHit hit) throws CoreException {
- // add the result to the list of results
- results.add(hit);
-
- // increment the match count
- matchCount++;
-
- if (getProgressMonitor() != null) {
- if (!getProgressMonitor().isCanceled()) {
- // if the operation is cancelled finish with whatever data was
- // already found
- getProgressMonitor().subTask(
- getFormattedMatchesString(matchCount));
- getProgressMonitor().worked(1);
- }
- }
- }
-
- /**
- * @see org.eclipse.mylar.bugzilla.search.IBugzillaSearchResultCollector#done()
- */
- public void done() {
- if (getProgressMonitor() != null) {
- if (!monitor.isCanceled()) {
- // if the operation is cancelled, finish with the data that we
- // already have
- String matchesString = getFormattedMatchesString(matchCount);
- monitor.setTaskName(MessageFormat.format(DONE,
- new Object[] { matchesString }));
- }
- }
-
- monitor = null;
- }
-
- /**
- * @see org.eclipse.mylar.bugzilla.search.IBugzillaSearchResultCollector#getProgressMonitor()
- */
- public IProgressMonitor getProgressMonitor() {
- return monitor;
- }
-
- /**
- * @see org.eclipse.mylar.bugzilla.search.IBugzillaSearchResultCollector#setProgressMonitor(org.eclipse.core.runtime.IProgressMonitor)
- */
- public void setProgressMonitor(IProgressMonitor monitor) {
- this.monitor = monitor;
- }
-
- /**
- * @see org.eclipse.mylar.bugzilla.search.IBugzillaSearchResultCollector#setOperation(org.eclipse.mylar.bugzilla.search.BugzillaSearchOperation)
- */
- public void setOperation(IBugzillaSearchOperation operation) {
- this.operation = operation;
- }
-
- /**
- * @see org.eclipse.mylar.bugzilla.search.IBugzillaSearchResultCollector#getOperation()
- */
- public IBugzillaSearchOperation getOperation() {
- return operation;
- }
-
- /**
- * Get the string specifying the number of matches found
- *
- * @param count
- * The number of matches found
- * @return The <code>String</code> specifying the number of matches found
- */
- private String getFormattedMatchesString(int count) {
- // if only 1 match, return the singular match string
- String name = "";
- if(operation instanceof BugzillaMylarSearchOperation)
- name = " - " + ((BugzillaMylarSearchOperation)operation).getName();
- if (count == 1)
- return MATCH + name;
-
- // format the matches string and return it
- Object[] messageFormatArgs = { new Integer(count) };
- return MessageFormat.format(MATCHES + name,
- messageFormatArgs);
- }
-
- /**
- * Get the list of results
- *
- * @return A List of BugzillaSearchHit
- */
- public List<BugzillaSearchHit> getResults() {
- return results;
- }
-
- /**
- * Get the number of matches from the operation
- *
- * @return Returns the matchCount.
- */
- public int getMatchCount() {
- return matchCount;
- }
-
- /**
- * Set the starting number of matches for the search operation
- *
- * @param matchCount
- * The matchCount to set.
- */
- public void setMatchCount(int matchCount) {
- this.matchCount = matchCount;
- }
-} \ No newline at end of file
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/bugzilla/ui/BugzillaNodeLabelProvider.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/bugzilla/ui/BugzillaNodeLabelProvider.java
deleted file mode 100644
index 01a2f5791..000000000
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/bugzilla/ui/BugzillaNodeLabelProvider.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 - 2005 University Of British Columbia and others.
- * 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:
- * University Of British Columbia - initial API and implementation
- *******************************************************************************/
-/*
- * Created on Apr 18, 2005
- */
-package org.eclipse.mylar.tasks.bugzilla.ui;
-
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.ILabelProviderListener;
-import org.eclipse.mylar.bugzilla.core.BugReport;
-import org.eclipse.mylar.core.model.ITaskscapeNode;
-import org.eclipse.mylar.tasks.MylarTasksPlugin;
-import org.eclipse.mylar.tasks.bugzilla.BugzillaReportNode;
-import org.eclipse.mylar.ui.MylarImages;
-import org.eclipse.swt.graphics.Image;
-
-/**
- * @author Mik Kersten
- */
-public class BugzillaNodeLabelProvider implements ILabelProvider {
-
- public Image getImage(Object element) {
- return MylarImages.getImage(MylarImages.BUG);
- }
-
- /**
- * TODO: slow?
- */
- public String getText(Object element) {
- ITaskscapeNode node = (ITaskscapeNode)element;
-
- // try to get from the cache before downloading
- Object report;
- BugzillaReportNode reportNode = MylarTasksPlugin.getReferenceProvider().getCached(node.getElementHandle());
- BugReport cachedReport = MylarTasksPlugin.getDefault().getStructureBridge().getCached(node.getElementHandle());
- if(reportNode != null && cachedReport == null){
- report = reportNode;
- } else{
- report = MylarTasksPlugin.getDefault().getStructureBridge().getObjectForHandle(node.getElementHandle());
- }
- return MylarTasksPlugin.getDefault().getStructureBridge().getName(report);
- }
-
- public void addListener(ILabelProviderListener listener) {
- // don't need to worry about listeners
- }
-
- public void dispose() {
- // don't care about dispose
- }
-
- public boolean isLabelProperty(Object element, String property) {
- return false;
- }
-
- public void removeListener(ILabelProviderListener listener) {
- // don't need to worry about listeners
- }
-}
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/bugzilla/ui/BugzillaUiBridge.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/bugzilla/ui/BugzillaUiBridge.java
deleted file mode 100644
index acd09e20c..000000000
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/bugzilla/ui/BugzillaUiBridge.java
+++ /dev/null
@@ -1,141 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 - 2005 University Of British Columbia and others.
- * 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:
- * University Of British Columbia - initial API and implementation
- *******************************************************************************/
-/*
- * Created on Apr 6, 2005
- */
-package org.eclipse.mylar.tasks.bugzilla.ui;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.mylar.bugzilla.ui.BugzillaOpenStructure;
-import org.eclipse.mylar.bugzilla.ui.ViewBugzillaAction;
-import org.eclipse.mylar.bugzilla.ui.editor.AbstractBugEditor;
-import org.eclipse.mylar.bugzilla.ui.outline.BugzillaOutlinePage;
-import org.eclipse.mylar.core.model.ITaskscapeNode;
-import org.eclipse.mylar.tasks.BugzillaTask;
-import org.eclipse.mylar.tasks.ITask;
-import org.eclipse.mylar.tasks.MylarTasksPlugin;
-import org.eclipse.mylar.tasks.bugzilla.BugzillaReferencesProvider;
-import org.eclipse.mylar.tasks.ui.BugzillaTaskEditor;
-import org.eclipse.mylar.ui.IMylarUiBridge;
-import org.eclipse.mylar.ui.MylarImages;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IEditorReference;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.internal.Workbench;
-
-public class BugzillaUiBridge implements IMylarUiBridge {
-
- protected BugzillaNodeLabelProvider labelProvider = new BugzillaNodeLabelProvider();
-
- public void open(ITaskscapeNode node) {
- String handle = node.getElementHandle();
- String bugHandle = handle;
- String server =handle.substring(0, handle.indexOf(";"));
-
- handle = handle.substring(handle.indexOf(";") + 1);
- int next = handle.indexOf(";");
-
- int bugId;
- int commentNumer = -1;
- if(next == -1){
- bugId = Integer.parseInt(handle);
- }
- else{
- bugId = Integer.parseInt(handle.substring(0, handle.indexOf(";")));
- commentNumer = Integer.parseInt(handle.substring(handle.indexOf(";") + 1));
- bugHandle = bugHandle.substring(0, next);
- }
-
- List<BugzillaOpenStructure> l = new ArrayList<BugzillaOpenStructure>(1);
- l.add(new BugzillaOpenStructure(server, bugId, commentNumer));
-
- ITask task= MylarTasksPlugin.getTaskListManager().getTaskList().getTaskForId(bugHandle);
- if (task != null && task instanceof BugzillaTask) {
- BugzillaTask bugzillaTask = (BugzillaTask)task;
- bugzillaTask.openTask(commentNumer);
- } else {
- // open the bug in the editor
- ViewBugzillaAction viewBugs = new ViewBugzillaAction("Display bugs in editor", l);
- viewBugs.schedule();
- }
- }
-
- public ILabelProvider getLabelProvider() {
- return labelProvider;
- }
-
- public void close(ITaskscapeNode node) {
- IWorkbenchPage page = Workbench.getInstance().getActiveWorkbenchWindow().getActivePage();
- if (page != null) {
- IEditorReference[] references = page.getEditorReferences();
- for (int i = 0; i < references.length; i++) {
- IEditorPart part = references[i].getEditor(false);
- if (part != null) {
- if (part instanceof AbstractBugEditor) {
- ((AbstractBugEditor)part).close();
- } else if(part instanceof BugzillaTaskEditor){
- ((BugzillaTaskEditor)part).close();
- }
- }
- }
- }
- }
-
- public boolean acceptsEditor(IEditorPart editorPart) {
- return editorPart instanceof AbstractBugEditor;
- }
-
- public List<TreeViewer> getTreeViewers(IEditorPart editor) {
- ArrayList<TreeViewer> outlines = new ArrayList<TreeViewer>(1);
- TreeViewer outline = getOutlineTreeViewer(editor);
- if (outline != null) {
- outlines.add(outline);
- return outlines;
- } else {
- return Collections.emptyList();
- }
- }
-
- protected TreeViewer getOutlineTreeViewer(IEditorPart editor) {
- if(editor instanceof AbstractBugEditor){
- AbstractBugEditor abe = (AbstractBugEditor)editor;
- BugzillaOutlinePage outline = abe.getOutline();
- if(outline != null) return outline.getOutlineTreeViewer();
- }
- return null;
- }
-
- public void refreshOutline(Object element, boolean updateLabels) {
- IEditorPart editorPart = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
- TreeViewer treeViewer = getOutlineTreeViewer(editorPart);
- if (treeViewer != null) {
- treeViewer.refresh(true);
-
- treeViewer.expandAll();
- }
- }
-
- public ImageDescriptor getIconForRelationship(String relationshipHandle) {
- return MylarImages.RELATIONSHIPS_REFS_BUGZILLA;
-
- }
-
- public String getNameForRelationship(String relationshipHandle) {
- return BugzillaReferencesProvider.NAME;
- }
-}
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/BugzillaTaskEditor.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/BugzillaTaskEditor.java
deleted file mode 100644
index bc450ce42..000000000
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/BugzillaTaskEditor.java
+++ /dev/null
@@ -1,291 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 - 2005 University Of British Columbia and others.
- * 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:
- * University Of British Columbia - initial API and implementation
- *******************************************************************************/
-/*
- * Created on 31-Jan-2005
- */
-package org.eclipse.mylar.tasks.ui;
-
-import org.eclipse.core.resources.IMarker;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.mylar.bugzilla.IBugzillaAttributeListener;
-import org.eclipse.mylar.bugzilla.core.BugReport;
-import org.eclipse.mylar.bugzilla.ui.editor.AbstractBugEditor;
-import org.eclipse.mylar.bugzilla.ui.editor.ExistingBugEditor;
-import org.eclipse.mylar.bugzilla.ui.editor.ExistingBugEditorInput;
-import org.eclipse.mylar.core.MylarPlugin;
-import org.eclipse.mylar.tasks.BugzillaTask;
-import org.eclipse.mylar.tasks.MylarTasksPlugin;
-import org.eclipse.mylar.tasks.ui.views.TaskListView;
-import org.eclipse.mylar.ui.MylarImages;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IEditorSite;
-import org.eclipse.ui.IPartListener;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.internal.Workbench;
-import org.eclipse.ui.part.MultiPageEditorPart;
-import org.eclipse.ui.views.contentoutline.IContentOutlinePage;
-
-/**
- * @author Eric Booth
- */
-public class BugzillaTaskEditor extends MultiPageEditorPart {
-
- /** The task that created this editor */
- protected BugzillaTask bugTask;
-
- /** This bug report can be modified by the user and saved offline. */
- protected BugReport offlineBug;
-
- private ExistingBugEditor bugzillaEditor;
-
- private BugzillaTaskEditorInput bugzillaEditorInput;
-
- private TaskSummaryEditor taskSummaryEditor = new TaskSummaryEditor();
-
- protected IContentOutlinePage outlinePage = null;
-
- private IBugzillaAttributeListener ATTRIBUTE_LISTENER = new IBugzillaAttributeListener() {
- public void attributeChanged(String attribute, String value) {
- if (attribute.equals("Priority")) {
- bugTask.setPriority(value);
- if (TaskListView.getDefault() != null) TaskListView.getDefault().notifyTaskDataChanged(bugTask);
- }
- }
- };
-
-
- public BugzillaTaskEditor() {
- super();
-
- // get the workbench page and add a listener so we can detect when it closes
- IWorkbench wb = MylarTasksPlugin.getDefault().getWorkbench();
- IWorkbenchWindow aw = wb.getActiveWorkbenchWindow();
- IWorkbenchPage ap = aw.getActivePage();
- BugzillaTaskEditorListener listener = new BugzillaTaskEditorListener();
- ap.addPartListener(listener);
-
- bugzillaEditor = new ExistingBugEditor();
- bugzillaEditor.addAttributeListener(ATTRIBUTE_LISTENER);
- taskSummaryEditor = new TaskSummaryEditor();
- }
-
- public AbstractBugEditor getBugzillaEditor(){
- return bugzillaEditor;
- }
-
- public TaskSummaryEditor getTaskEditor(){
- return taskSummaryEditor;
- }
-
-
- public void gotoMarker(IMarker marker) {
- // don't do anything
- }
-
- /**
- * Creates page 1 of the multi-page editor,
- * which allows you to change the font used in page 2.
- */
- private void createBugzillaSubmitPage() {
- bugzillaEditor.createPartControl(getContainer());
- Composite composite = bugzillaEditor.getEditorComposite();
- int index = addPage(composite);
- setPageText(index, "Bugzilla");
- }
-
-
- private void createSummaryPage() {
- try{
- int index = addPage(taskSummaryEditor, new TaskEditorInput(bugTask));
- setPageText(index, "Summary");
- }catch(Exception e){
- MylarPlugin.log(e, "summary failed");
- }
- }
-
- /**
- * Creates the pages of the multi-page editor.
- */
- @Override
- protected void createPages() {
- createBugzillaSubmitPage();
- createSummaryPage();
- }
-
- /**
- * Saves the multi-page editor's document.
- */
- @Override
- public void doSave(IProgressMonitor monitor) {
- getEditor(0).doSave(monitor);
- }
-
- /**
- * Saves the multi-page editor's document as another file.
- * Also updates the text for page 0's tab, and updates this multi-page editor's input
- * to correspond to the nested editor's.
- */
- @Override
- public void doSaveAs() {
- IEditorPart editor = getEditor(0);
- editor.doSaveAs();
- setPageText(0, editor.getTitle());
- setInput(editor.getEditorInput());
- }
-
- @Override
- public void init(IEditorSite site, IEditorInput editorInput) throws PartInitException {
- if (!(editorInput instanceof BugzillaTaskEditorInput))
- throw new PartInitException("Invalid Input: Must be BugzillaTaskEditorInput");
- bugzillaEditorInput = (BugzillaTaskEditorInput) editorInput;
- bugTask = bugzillaEditorInput.getBugTask();
-
- offlineBug = bugzillaEditorInput.getOfflineBug();
- super.init(site, editorInput);
- super.setSite(site);
- super.setInput(editorInput);
-
- try {
- bugzillaEditor.init(this.getEditorSite(), this.getEditorInput());
- }
- catch (Exception e) {
- throw new PartInitException(e.getMessage());
- }
-
- // Set the title on the editor's tab
- this.setPartName("Bug #" + bugzillaEditorInput.getBugId());
- this.setTitleImage(MylarImages.getImage(MylarImages.TASK_BUGZILLA));
- }
-
- @Override
- public boolean isSaveAsAllowed() {
- return false;
- }
-
- /**
- * Calculates the contents of page 2 when the it is activated.
- */
- @Override
- protected void pageChange(int newPageIndex) {
- super.pageChange(newPageIndex);
- }
-
- /**
- * Sets the font related data to be applied to the text in page 2.
- */
- @Override
- public void setFocus() {
- // The default focus for this editor is the submit page
- bugzillaEditor.setFocus();
- }
-
- /**
- * @return Returns the bugTask.
- */
- public BugzillaTask getBugTask() {
- return bugTask;
- }
-
- /**
- * @return Returns the offlineBug.
- */
- public BugReport getOfflineBug() {
- return offlineBug;
- }
-
- /**
- * Updates the title of the editor to reflect dirty status.
- * If the bug report has been modified but not saved, then
- * an indicator will appear in the title.
- * @param isDirty
- * is true when the bug report has been modified but not saved
- */
- public void showDirtyStatus(boolean isDirty) {
- String prefix = (isDirty) ? "*" : "" ;
- setPartName(prefix + "Bug #" + bugzillaEditorInput.getBugId());
- }
-
- /**
- * Class to listen for editor events
- */
- private class BugzillaTaskEditorListener implements IPartListener
- {
-
- public void partActivated(IWorkbenchPart part) {
- // don't care about this event
- }
-
- public void partBroughtToTop(IWorkbenchPart part) {
- // don't care about this event
- }
-
- public void partClosed(IWorkbenchPart part) {
-
- // if we are closing a bug editor
- if (part instanceof BugzillaTaskEditor) {
- BugzillaTaskEditor taskEditor = (BugzillaTaskEditor)part;
-
- // check if it needs to be saved
- if (taskEditor.bugzillaEditor.isDirty) {
- // ask the user whether they want to save it or not and perform the appropriate action
- taskEditor.bugzillaEditor.changeDirtyStatus(false);
- boolean response = MessageDialog.openQuestion(null, "Save Changes",
- "You have made some changes to the bug, do you want to save them?");
- if (response) {
- taskEditor.bugzillaEditor.saveBug();
- } else {
- ExistingBugEditorInput input = (ExistingBugEditorInput)taskEditor.bugzillaEditor.getEditorInput();
- bugTask.setPriority(input.getBug().getAttribute("Priority").getValue());
- }
- }
- }
- }
-
- public void partDeactivated(IWorkbenchPart part) {
- // don't care about this event
- }
-
- public void partOpened(IWorkbenchPart part) {
- // don't care about this event
- }
- }
-
- public void makeNewPage(BugReport serverBug, String newCommentText) {
- if (serverBug == null) {
- MessageDialog.openInformation(Workbench.getInstance().getActiveWorkbenchWindow().getShell(),
- "Could not open bug.", "Bug #" + offlineBug.getId()
- + " could not be read from the server. Try refreshing the bug task.");
- return;
- }
- }
-
- @Override
- public Object getAdapter(Class adapter) {
- return bugzillaEditor.getAdapter(adapter);
- }
-
- public void close() {
- Display display= getSite().getShell().getDisplay();
- display.asyncExec(new Runnable() {
- public void run() {
- getSite().getPage().closeEditor(BugzillaTaskEditor.this, false);
- }
- });
- }
-}
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/BugzillaTaskEditorInput.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/BugzillaTaskEditorInput.java
deleted file mode 100644
index af9e7f5e9..000000000
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/BugzillaTaskEditorInput.java
+++ /dev/null
@@ -1,135 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 - 2005 University Of British Columbia and others.
- * 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:
- * University Of British Columbia - initial API and implementation
- *******************************************************************************/
-/*
- * Created on 1-Feb-2005
- */
-package org.eclipse.mylar.tasks.ui;
-
-import java.io.IOException;
-
-import javax.security.auth.login.LoginException;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.mylar.bugzilla.core.BugReport;
-import org.eclipse.mylar.bugzilla.ui.editor.ExistingBugEditorInput;
-import org.eclipse.mylar.tasks.BugzillaTask;
-import org.eclipse.ui.IPersistableElement;
-
-
-/**
- * @author Eric Booth
- */
-public class BugzillaTaskEditorInput extends ExistingBugEditorInput {
-
-
- private String bugTitle;
-
- private BugReport offlineBug;
-
- private BugzillaTask bugTask;
-
- public BugzillaTaskEditorInput(BugzillaTask bugTask) throws LoginException, IOException {
- super(BugzillaTask.getBugId(bugTask.getHandle()));
- this.bugTask = bugTask;
- offlineBug = bugTask.getBugReport();
- bugId = BugzillaTask.getBugId(bugTask.getHandle());
- bugTitle = "";
- }
-
- protected void setBugTitle(String str) {
- // 03-20-03 Allows editor to store title (once it is known)
- bugTitle = str;
- }
-
- @Override
- public boolean exists() {
- return true;
- }
-
- @Override
- public ImageDescriptor getImageDescriptor() {
- return null;
- }
-
- @Override
- public String getName() {
- return "Bug #" + bugId;
- }
-
- @Override
- public IPersistableElement getPersistable() {
- return null;
- }
-
- @Override
- public String getToolTipText() {
- return bugTitle;
- }
-
- @Override
- public Object getAdapter(Class adapter) {
- return null;
- }
-
- @Override
- public int getBugId() {
- return bugId;
- }
-
- /**
- * Returns the online server bug for this input
- *
- * @see BugzillaRepository
- * @see BugReport
- */
-// public BugReport getServerBug() {
-// return serverBug;
-// }
-
- /**
- * Returns the offline bug for this input's Bugzilla task
- */
- public BugReport getOfflineBug() {
- return offlineBug;
- }
-
- /**
- * Gets the bug page input stream
- */
-// public InputStream getInputStream() throws IOException {
-// try {
-// return url.openStream();
-// }
-// catch (Exception e) {
-// throw new IOException(e.getMessage());
-// }
-//
-// }
-
- /**
- * Returns true if the argument is a bug report editor input on the same bug id.
- */
- @Override
- public boolean equals(Object o) {
- if (o instanceof BugzillaTaskEditorInput) {
- BugzillaTaskEditorInput input = (BugzillaTaskEditorInput) o;
- return getBugId() == input.getBugId();
- }
- return false;
- }
-
- /**
- * @return Returns the <code>BugzillaTask</code>
- */
- public BugzillaTask getBugTask() {
- return bugTask;
- }
-}
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/TaskEditor.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/TaskEditor.java
deleted file mode 100644
index dc196f992..000000000
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/TaskEditor.java
+++ /dev/null
@@ -1,161 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 - 2005 University Of British Columbia and others.
- * 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:
- * University Of British Columbia - initial API and implementation
- *******************************************************************************/
-/*
- * Created on 19-Jan-2005
- */
-package org.eclipse.mylar.tasks.ui;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.mylar.tasks.ITask;
-import org.eclipse.mylar.tasks.MylarTasksPlugin;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IEditorSite;
-import org.eclipse.ui.IPartListener;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.part.MultiPageEditorPart;
-
-
-/**
- * @author Eric Booth
- */
-public class TaskEditor extends MultiPageEditorPart {
-
- protected ITask task;
- private TaskSummaryEditor taskSummaryEditor;
- private TaskEditorInput taskEditorInput;
-
- public TaskEditor() {
- super();
-
- // get the workbench page and add a listener so we can detect when it closes
- IWorkbench wb = MylarTasksPlugin.getDefault().getWorkbench();
- IWorkbenchWindow aw = wb.getActiveWorkbenchWindow();
- IWorkbenchPage ap = aw.getActivePage();
- TaskEditorListener listener = new TaskEditorListener();
- ap.addPartListener(listener);
-
- taskSummaryEditor = new TaskSummaryEditor();
- }
-
- /**
- * Creates page 1 of the multi-page editor,
- * which displays the task for viewing.
- */
- private void createTaskSummaryPage() {
- taskSummaryEditor.createPartControl(getContainer());
- int index = addPage(taskSummaryEditor.getControl());
- setPageText(index, "Summary");
- }
-
- /**
- * Creates the pages of the multi-page editor.
- */
- @Override
- protected void createPages() {
- createTaskSummaryPage();
- }
-
- @Override
- public void doSave(IProgressMonitor monitor) {
- getEditor(0).doSave(monitor);
- }
-
- /**
- * Saves the multi-page editor's document as another file.
- * Also updates the text for page 0's tab, and updates this multi-page editor's input
- * to correspond to the nested editor's.
- *
- * @see org.eclipse.ui.ISaveablePart#doSaveAs()
- */
- @Override
- public void doSaveAs() {
- IEditorPart editor = getEditor(0);
- editor.doSaveAs();
- setPageText(0, editor.getTitle());
- setInput(editor.getEditorInput());
- }
-
- @Override
- public void init(IEditorSite site, IEditorInput input) throws PartInitException {
-
- if (!(input instanceof TaskEditorInput))
- throw new PartInitException("Invalid Input: Must be TaskEditorInput");
- taskEditorInput = (TaskEditorInput)input;
- super.init(site, input);
-
- /*
- * The task data is saved only once, at the initialization of the editor. This is
- * then passed to each of the child editors. This way, only one instance of
- * the task data is stored for each editor opened.
- */
- task = taskEditorInput.getTask();
- try {
- taskSummaryEditor.init(this.getEditorSite(), this.getEditorInput());
- taskSummaryEditor.setTask(task);
- // Set the title on the editor's tab
- this.setPartName(taskEditorInput.getLabel());
- } catch (Exception e) {
- throw new PartInitException(e.getMessage());
- }
- }
-
- @Override
- public boolean isSaveAsAllowed() {
- return false;
- }
-
- /**
- * Class to listen for editor events
- */
- private class TaskEditorListener implements IPartListener
- {
-
- /**
- * @see org.eclipse.ui.IPartListener#partActivated(org.eclipse.ui.IWorkbenchPart)
- */
- public void partActivated(IWorkbenchPart part) {
- // don't care about this event
- }
-
- /**
- * @see org.eclipse.ui.IPartListener#partBroughtToTop(org.eclipse.ui.IWorkbenchPart)
- */
- public void partBroughtToTop(IWorkbenchPart part) {
- // don't care about this event
- }
-
- /**
- * @see org.eclipse.ui.IPartListener#partClosed(org.eclipse.ui.IWorkbenchPart)
- */
- public void partClosed(IWorkbenchPart part) {
- // don't care about this event
- }
-
- /**
- * @see org.eclipse.ui.IPartListener#partDeactivated(org.eclipse.ui.IWorkbenchPart)
- */
- public void partDeactivated(IWorkbenchPart part) {
- // don't care about this event
- }
-
- /**
- * @see org.eclipse.ui.IPartListener#partOpened(org.eclipse.ui.IWorkbenchPart)
- */
- public void partOpened(IWorkbenchPart part) {
- // don't care about this event
- }
- }
-}
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/TaskEditorCopyAction.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/TaskEditorCopyAction.java
deleted file mode 100644
index 90af072f7..000000000
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/TaskEditorCopyAction.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 - 2005 University Of British Columbia and others.
- * 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:
- * University Of British Columbia - initial API and implementation
- *******************************************************************************/
-/*
- * Created on 20-Jan-2005
- */
-package org.eclipse.mylar.tasks.ui;
-
-import org.eclipse.jface.action.Action;
-
-/**
- * TODO: delete?
- */
-public class TaskEditorCopyAction extends Action {
-
- public TaskEditorCopyAction() {
- setText("TaskSummaryEditor.copy.text");
- }
-
- @Override
- public void run() {
-// if (editorPart instanceof TaskSummaryEditor)
-// ((TaskSummaryEditor)editorPart).getCurrentText().copy();
- }
-
-}
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/TaskEditorInput.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/TaskEditorInput.java
deleted file mode 100644
index 8c6e04b33..000000000
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/TaskEditorInput.java
+++ /dev/null
@@ -1,113 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 - 2005 University Of British Columbia and others.
- * 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:
- * University Of British Columbia - initial API and implementation
- *******************************************************************************/
-/*
- * Created on 19-Jan-2005
- */
-package org.eclipse.mylar.tasks.ui;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.mylar.tasks.ITask;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IPersistableElement;
-
-
-/**
- * @author Eric Booth
- */
-public class TaskEditorInput implements IEditorInput {
-
- private ITask task;
-
- private String id;
-
- private String label;
-
- public TaskEditorInput(ITask task) {
- this.task = task;
- id = task.getHandle();
- label = task.getLabel();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IEditorInput#exists()
- */
- public boolean exists() {
- return true;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IEditorInput#getImageDescriptor()
- */
- public ImageDescriptor getImageDescriptor() {
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IEditorInput#getName()
- */
- public String getName() {
- return "Task #" + id;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IEditorInput#getPersistable()
- */
- public IPersistableElement getPersistable() {
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IEditorInput#getToolTipText()
- */
- public String getToolTipText() {
- return label;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
- */
- public Object getAdapter(Class adapter) {
- return null;
- }
-
- /**
- * @return Returns the task.
- */
- public ITask getTask() {
- return task;
- }
-
- /**
- * @return Returns the id.
- */
- public String getId() {
- return id;
- }
-
- /**
- * @return Returns the label.
- */
- public String getLabel() {
- return label;
- }
-
- /**
- * Returns true if the argument is a bug report editor input on the same bug id.
- */
- @Override
- public boolean equals(Object o) {
- if (o instanceof TaskEditorInput) {
- TaskEditorInput input = (TaskEditorInput) o;
- return getId() == input.getId();
- }
- return false;
- }
-}
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/TaskSummaryEditor.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/TaskSummaryEditor.java
deleted file mode 100644
index f79e3f627..000000000
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/TaskSummaryEditor.java
+++ /dev/null
@@ -1,1238 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 - 2005 University Of British Columbia and others.
- * 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:
- * University Of British Columbia - initial API and implementation
- *******************************************************************************/
-/*
- * Created on 19-Jan-2005
- *
- * TODO To change the template for this generated file go to
- * Window - Preferences - Java - Code Style - Code Templates
- */
-package org.eclipse.mylar.tasks.ui;
-
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.util.List;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.IMenuListener;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.action.MenuManager;
-import org.eclipse.jface.dialogs.InputDialog;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.viewers.CellEditor;
-import org.eclipse.jface.viewers.ColumnWeightData;
-import org.eclipse.jface.viewers.ICellModifier;
-import org.eclipse.jface.viewers.IColorProvider;
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.ITableLabelProvider;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.viewers.TableLayout;
-import org.eclipse.jface.viewers.TableViewer;
-import org.eclipse.jface.viewers.TextCellEditor;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.viewers.ViewerSorter;
-import org.eclipse.mylar.core.MylarPlugin;
-import org.eclipse.mylar.tasks.ITask;
-import org.eclipse.mylar.tasks.ITaskActivityListener;
-import org.eclipse.mylar.tasks.MylarTasksPlugin;
-import org.eclipse.mylar.tasks.RelatedLinks;
-import org.eclipse.mylar.tasks.ui.views.TaskListView;
-import org.eclipse.mylar.tasks.util.RelativePathUtil;
-import org.eclipse.mylar.ui.MylarImages;
-import org.eclipse.mylar.ui.MylarUiPlugin;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.SWTException;
-import org.eclipse.swt.events.FocusEvent;
-import org.eclipse.swt.events.FocusListener;
-import org.eclipse.swt.events.MouseEvent;
-import org.eclipse.swt.events.MouseTrackListener;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.Cursor;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.FileDialog;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Menu;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.TableColumn;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IEditorSite;
-import org.eclipse.ui.ISharedImages;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.actions.ActionFactory;
-import org.eclipse.ui.actions.RetargetAction;
-import org.eclipse.ui.browser.IWebBrowser;
-import org.eclipse.ui.forms.FormColors;
-import org.eclipse.ui.forms.events.ExpansionEvent;
-import org.eclipse.ui.forms.events.IExpansionListener;
-import org.eclipse.ui.forms.widgets.ExpandableComposite;
-import org.eclipse.ui.forms.widgets.FormToolkit;
-import org.eclipse.ui.forms.widgets.ScrolledForm;
-import org.eclipse.ui.forms.widgets.Section;
-import org.eclipse.ui.forms.widgets.TableWrapData;
-import org.eclipse.ui.forms.widgets.TableWrapLayout;
-import org.eclipse.ui.internal.WorkbenchImages;
-import org.eclipse.ui.internal.WorkbenchMessages;
-import org.eclipse.ui.internal.browser.WorkbenchBrowserSupport;
-import org.eclipse.ui.part.EditorPart;
-
-/**
- * For details on forms, go to:
- * http://dev.eclipse.org/viewcvs/index.cgi/%7Echeckout%7E/pde-ui-home/working/EclipseForms/EclipseForms.html
- * @author Ken Sueda
- */
-public class TaskSummaryEditor extends EditorPart {
- private ITask task;
- private TaskEditorInput editorInput;
- private Composite editorComposite;
- private TaskEditorCopyAction copyAction;
- private RetargetAction pasteAction;
- private RetargetAction cutAction;
- private static final String cutActionDefId = "org.eclipse.ui.edit.cut";
- private static final String pasteActionDefId = "org.eclipse.ui.edit.paste";
- private Table table;
- private TableViewer tableViewer;
- private RelatedLinks links;
- private RelatedLinksContentProvider contentProvider;
-
- private Button browse;
- private Text pathText;
- private ScrolledForm sform;
- private Action add;
- private Action delete;
- private Text description;
-
- private ITaskActivityListener TASK_LIST_LISTENER = new ITaskActivityListener() {
- public void taskActivated(ITask activeTask) {
- if (task != null && !browse.isDisposed() && activeTask.getHandle().equals(task.getHandle())) {
- browse.setEnabled(false);
- }
- }
-
- public void tasksActivated(List<ITask> tasks) {
- for (ITask t : tasks) {
- taskActivated(t);
- }
- }
-
- public void taskDeactivated(ITask deactiveTask) {
- if (task != null && !browse.isDisposed() && deactiveTask.getHandle().equals(task.getHandle())) {
- browse.setEnabled(true);
- }
- }
-
- public void taskPropertyChanged(ITask updatedTask, String property) {
- if (task != null && updatedTask.getHandle().equals(task.getHandle())) {
- if (property.equals("Description") && !description.isDisposed()) {
- description.setText(task.getLabel());
- } else if (property.equals("Path") && !pathText.isDisposed()) {
- pathText.setText("<Mylar_Dir>/" + task.getPath());
- }
- }
- }
- };
- /**
- *
- */
- public TaskSummaryEditor() {
- super();
-
- cutAction = new RetargetAction(ActionFactory.CUT.getId(),
- WorkbenchMessages.Workbench_cut);
- cutAction.setToolTipText(
- WorkbenchMessages.Workbench_cutToolTip);
- cutAction.setImageDescriptor(WorkbenchImages.getImageDescriptor(
- ISharedImages.IMG_TOOL_CUT));
- cutAction.setHoverImageDescriptor(WorkbenchImages.getImageDescriptor(
- ISharedImages.IMG_TOOL_CUT));
- cutAction.setDisabledImageDescriptor(WorkbenchImages.getImageDescriptor(
- ISharedImages.IMG_TOOL_CUT_DISABLED));
- cutAction.setAccelerator(SWT.CTRL | 'x');
- cutAction.setActionDefinitionId(cutActionDefId);
-
- pasteAction = new RetargetAction(ActionFactory.PASTE.getId(),
- WorkbenchMessages.Workbench_paste);
- pasteAction.setToolTipText(
- WorkbenchMessages.Workbench_pasteToolTip);
- pasteAction.setImageDescriptor(WorkbenchImages.getImageDescriptor(
- ISharedImages.IMG_TOOL_PASTE));
- pasteAction.setHoverImageDescriptor(WorkbenchImages.getImageDescriptor(
- ISharedImages.IMG_TOOL_PASTE));
- pasteAction.setDisabledImageDescriptor(WorkbenchImages.getImageDescriptor(
- ISharedImages.IMG_TOOL_PASTE_DISABLED));
- pasteAction.setAccelerator(SWT.CTRL | 'v');
- pasteAction.setActionDefinitionId(pasteActionDefId);
-
- copyAction = new TaskEditorCopyAction();
- copyAction.setText(
- WorkbenchMessages.Workbench_copy);
- copyAction.setImageDescriptor(WorkbenchImages.getImageDescriptor(
- ISharedImages.IMG_TOOL_COPY));
- copyAction.setHoverImageDescriptor(WorkbenchImages.getImageDescriptor(
- ISharedImages.IMG_TOOL_COPY));
- copyAction.setDisabledImageDescriptor(WorkbenchImages.getImageDescriptor(
- ISharedImages.IMG_TOOL_COPY_DISABLED));
- copyAction.setAccelerator(SWT.CTRL | 'c');
-
- copyAction.setEnabled(false);
- MylarTasksPlugin.getTaskListManager().addListener(TASK_LIST_LISTENER);
- }
- @Override
- public void doSave(IProgressMonitor monitor) {
- // don't support saving
- }
- @Override
- public void doSaveAs() {
- // don't support saving
- }
- @Override
- public void init(IEditorSite site, IEditorInput input) throws PartInitException {
- if (!(input instanceof TaskEditorInput)) {
- throw new PartInitException("Invalid Input: Must be TaskEditorInput");
- }
- setSite(site);
- setInput(input);
- editorInput = (TaskEditorInput)input;
- setPartName(editorInput.getLabel());
- }
- @Override
- public boolean isDirty() {
- return false;
- }
- @Override
- public boolean isSaveAsAllowed() {
- return false;
- }
-
- @Override
- public void createPartControl(Composite parent) {
-// ManagedForm form = new ManagedForm(parent);
-// FormToolkit toolkit = form.getToolkit();
-// editorComposite = form.getForm();
- FormToolkit toolkit = new FormToolkit(parent.getDisplay());
- sform = toolkit.createScrolledForm(parent);
- sform.getBody().setLayout(new TableWrapLayout());
- editorComposite = sform.getBody();
-
-
- TableWrapLayout layout = new TableWrapLayout();
- layout.bottomMargin = 10;
- layout.topMargin = 10;
- layout.leftMargin = 10;
- layout.rightMargin = 10;
- layout.numColumns = 1;
- layout.makeColumnsEqualWidth = true;
- layout.verticalSpacing = 20;
- layout.horizontalSpacing = 10;
- editorComposite.setLayout(layout);
- //editorComposite.setLayoutData(new TableWrapData(TableWrapData.FILL_GRAB));
-
- // Put the info onto the editor
- createContent(editorComposite, toolkit);
- }
-
- @Override
- public void setFocus() {
- // don't care when the focus is set
- }
-
- /**
- * @return Returns the editorComposite.
- */
- public Composite getEditorComposite() {
- return editorComposite;
- }
-
- public Control getControl() {
- return sform;
- }
-
- public void setTask(ITask task) throws Exception {
- if (task == null)
- throw new Exception("ITask object is null.");
- this.task = task;
- }
-
- private Composite createContent(Composite parent, FormToolkit toolkit) {
- TaskEditorInput taskEditorInput = (TaskEditorInput)getEditorInput();
-
- task = taskEditorInput.getTask();
- if (task == null) {
- MessageDialog.openError(parent.getShell(), "No such task", "No task exists with this id");
- return null;
- }
-
- try {
- createTaskSection(parent, toolkit);
- createNotesSection(parent, toolkit);
- createPlanningGameSection(parent, toolkit);
- createRelatedLinksSection(parent, toolkit);
- } catch (SWTException e) {
- MylarPlugin.log(e, "content failed");
- }
- return null;
- }
-
- private void createTaskSection(Composite parent, FormToolkit toolkit) {
- Section section = toolkit.createSection(parent, ExpandableComposite.TITLE_BAR);
- section.setText("Mylar Task Description");
- section.setLayout(new TableWrapLayout());
- section.setLayoutData(new TableWrapData(TableWrapData.FILL_GRAB));
- section.addExpansionListener(new IExpansionListener() {
- public void expansionStateChanging(ExpansionEvent e) {
- sform.reflow(true);
- }
- public void expansionStateChanged(ExpansionEvent e) {
- sform.reflow(true);
- }
- });
-
- Composite container = toolkit.createComposite(section);
- section.setClient(container);
- TableWrapLayout layout = new TableWrapLayout();
- layout.numColumns = 3;
- container.setLayout(layout);
-
- Label l = toolkit.createLabel(container, "Description:");
- l.setForeground(toolkit.getColors().getColor(FormColors.TITLE));
- description = toolkit.createText(container,task.getLabel(), SWT.BORDER);
- TableWrapData td = new TableWrapData(TableWrapData.FILL_GRAB);
- td.colspan = 2;
- description.setLayoutData(td);
- description.addFocusListener(new FocusListener() {
- public void focusGained(FocusEvent e) {
- // don't care about focus gained
- }
-
- public void focusLost(FocusEvent e) {
- String label = description.getText();
- task.setLabel(label);
- refreshTaskListView(task);
- }
- });
-
- l = toolkit.createLabel(container, "Task Handle:");
- l.setForeground(toolkit.getColors().getColor(FormColors.TITLE));
- Text handle = toolkit.createText(container, task.getHandle(), SWT.BORDER);
- td = new TableWrapData(TableWrapData.FILL_GRAB);
- td.colspan = 2;
- handle.setLayoutData(td);
- handle.setEditable(false);
- handle.setEnabled(false);
-
-
- Label l2 = toolkit.createLabel(container, "Task context path:");
- l2.setForeground(toolkit.getColors().getColor(FormColors.TITLE));
- pathText = toolkit.createText(container, "<Mylar_Dir>/"+task.getPath()+".xml", SWT.BORDER);
- pathText.setLayoutData(new TableWrapData(TableWrapData.FILL_GRAB));
- pathText.setEditable(false);
- pathText.setEnabled(false);
-
- browse = toolkit.createButton(container, "Change", SWT.PUSH | SWT.CENTER);
- if (task.isActive()) {
- browse.setEnabled(false);
- } else {
- browse.setEnabled(true);
- }
- browse.addSelectionListener(new SelectionAdapter() {
- @Override
- public void widgetSelected(SelectionEvent e) {
-
- if (task.isActive()) {
- MessageDialog.openInformation(
- Display.getDefault().getActiveShell(),
- "Task Message",
- "Task can not be active when changing taskscape");
- } else {
- FileDialog dialog = new FileDialog(Display.getDefault()
- .getActiveShell(), SWT.OPEN);
- String[] ext = { "*.xml" };
- dialog.setFilterExtensions(ext);
-
- String mylarDir = MylarPlugin.getTaskscapeManager()
- .getMylarDir()
- + "/";
- mylarDir = mylarDir.replaceAll("\\\\", "/");
- // mylarDir = formatPath(mylarDir);
- dialog.setFilterPath(formatPath(mylarDir));
-
- String res = dialog.open();
- if (res != null) {
- res = formatPath(res);
- res = RelativePathUtil.findRelativePath(mylarDir, res);
- pathText.setText("<MylarDir>/" + res + ".xml");
- task.setPath(res);
- }
- }
- }
- });
- toolkit.createLabel(container, "");
- l = toolkit.createLabel(container, "Go to Mylar Preferences to change <Mylar_Dir>");
- l.setForeground(toolkit.getColors().getColor(FormColors.TITLE));
- }
-
- private String formatPath(String path) {
- if (path == null) return "";
- StringBuffer result = new StringBuffer(path.length() + 10);
- for (int i = 0; i < path.length(); i++) {
- if (path.charAt(i) == '\\'){
- result.append('/');
- } else {
- result.append(path.charAt(i));
- }
- }
-
- return result.toString();
- }
-
- private void createNotesSection(Composite parent, FormToolkit toolkit) {
- Section section = toolkit.createSection(parent, ExpandableComposite.TITLE_BAR);
- section.setText("Notes");
- section.setLayout(new TableWrapLayout());
- section.setLayoutData(new TableWrapData(TableWrapData.FILL_GRAB));
- section.addExpansionListener(new IExpansionListener() {
- public void expansionStateChanging(ExpansionEvent e) {
- sform.reflow(true);
- }
-
- public void expansionStateChanged(ExpansionEvent e) {
- sform.reflow(true);
- }
- });
- Composite container = toolkit.createComposite(section);
- section.setClient(container);
- TableWrapLayout layout = new TableWrapLayout();
- layout.numColumns = 2;
- container.setLayout(layout);
-
- final Text text = toolkit.createText(container, task.getNotes(), SWT.BORDER | SWT.MULTI);
- TableWrapData tablewrap = new TableWrapData(TableWrapData.FILL_GRAB);
- tablewrap.heightHint = 100;
- text.setLayoutData(tablewrap);
- text.addFocusListener(new FocusListener() {
- public void focusGained(FocusEvent e) {
- // don't care about focus gained
- }
-
- public void focusLost(FocusEvent e) {
- String notes = text.getText();
- task.setNotes(notes);
- }
- });
- }
-
- private void createPlanningGameSection(Composite parent, FormToolkit toolkit) {
- Section section = toolkit.createSection(parent, ExpandableComposite.TITLE_BAR | Section.TWISTIE);
- section.setText("Planning Game");
- section.setLayout(new TableWrapLayout());
- section.setLayoutData(new TableWrapData(TableWrapData.FILL_GRAB));
- section.addExpansionListener(new IExpansionListener() {
- public void expansionStateChanging(ExpansionEvent e) {
- sform.reflow(true);
- }
-
- public void expansionStateChanged(ExpansionEvent e) {
- sform.reflow(true);
- }
- });
- Composite container = toolkit.createComposite(section);
- section.setClient(container);
- TableWrapLayout layout = new TableWrapLayout();
- layout.numColumns = 2;
- container.setLayout(layout);
-
- Label l = toolkit.createLabel(container, "Estimated Time:");
- l.setForeground(toolkit.getColors().getColor(FormColors.TITLE));
- final Text text = toolkit.createText(container,task.getEstimatedTime(), SWT.BORDER);
- text.setLayoutData(new TableWrapData(TableWrapData.FILL_GRAB));
-
- text.addFocusListener(new FocusListener() {
- public void focusGained(FocusEvent e) {
- // don't care about focus gained
- }
-
- public void focusLost(FocusEvent e) {
- String estimate = text.getText();
- task.setEstimatedTime(estimate);
- }
- });
-
- l = toolkit.createLabel(container, "Elapsed Time:");
- l.setForeground(toolkit.getColors().getColor(FormColors.TITLE));
- Text text2 = toolkit.createText(container,task.getElapsedTime(), SWT.BORDER);
- text2.setLayoutData(new TableWrapData(TableWrapData.FILL_GRAB));
- text2.setEditable(false);
- text2.setEnabled(false);
- //text2.setForeground(background);
- }
-
- private void createRelatedLinksSection(Composite parent, FormToolkit toolkit) {
- Section section = toolkit.createSection(parent, ExpandableComposite.TITLE_BAR);
- section.setText("Related Links");
- section.setLayout(new TableWrapLayout());
- section.setLayoutData(new TableWrapData(TableWrapData.FILL_GRAB));
- section.addExpansionListener(new IExpansionListener() {
- public void expansionStateChanging(ExpansionEvent e) {
- sform.reflow(true);
- }
-
- public void expansionStateChanged(ExpansionEvent e) {
- sform.reflow(true);
- }
- });
- Composite container = toolkit.createComposite(section);
- section.setClient(container);
- TableWrapLayout layout = new TableWrapLayout();
- layout.numColumns = 2;
- container.setLayout(layout);
-
- Label l = toolkit.createLabel(container, "Related Links:");
- l.setForeground(toolkit.getColors().getColor(FormColors.TITLE));
- toolkit.createLabel(container, "");
-
- createTable(container, toolkit);
- createTableViewer(container, toolkit);
- toolkit.paintBordersFor(container);
- createAddDeleteButtons(container, toolkit);
- }
-
- private void createTable(Composite parent, FormToolkit toolkit) {
- table = toolkit.createTable(parent, SWT.NONE );
- TableColumn col1 = new TableColumn(table, SWT.NULL);
- TableLayout tlayout = new TableLayout();
- tlayout.addColumnData(new ColumnWeightData(0,0,false));
- table.setLayout(tlayout);
- TableWrapData wd = new TableWrapData(TableWrapData.FILL_GRAB);
- wd.heightHint = 100;
- wd.grabVertical = true;
- table.setLayoutData(wd);
- table.setHeaderVisible(false);
- col1.addSelectionListener(new SelectionAdapter() {
- @Override
- public void widgetSelected(SelectionEvent e) {
- tableViewer.setSorter(new RelatedLinksTableSorter(
- RelatedLinksTableSorter.LABEL));
- }
- });
- table.addMouseTrackListener(new MouseTrackListener() {
- public void mouseEnter(MouseEvent e) {
- if(!((RelatedLinksContentProvider)tableViewer.getContentProvider()).isEmpty()) {
- Cursor hyperlinkCursor = new Cursor(Display.getCurrent(), SWT.CURSOR_HAND);
- Display.getCurrent().getCursorControl().setCursor(hyperlinkCursor);
- }
- }
-
- public void mouseExit(MouseEvent e) {
- Cursor pointer = new Cursor(Display.getCurrent(), SWT.CURSOR_ARROW);
- Display.getCurrent().getCursorControl().setCursor(pointer);
- }
-
- public void mouseHover(MouseEvent e){
- if(!((RelatedLinksContentProvider)tableViewer.getContentProvider()).isEmpty()) {
- Cursor hyperlinkCursor = new Cursor(Display.getCurrent(), SWT.CURSOR_HAND);
- Display.getCurrent().getCursorControl().setCursor(hyperlinkCursor);
- }
- }
- });
- }
-
- private void createTableViewer(Composite parent, FormToolkit toolkit) {
- String[] columnNames = {"Links"};
- tableViewer = new TableViewer(table);
- tableViewer.setColumnProperties(columnNames);
-
- CellEditor[] editors = new CellEditor[columnNames.length];
-
- TextCellEditor textEditor = new TextCellEditor(table);
- ((Text) textEditor.getControl()).setTextLimit(50);
- ((Text) textEditor.getControl()).setOrientation(SWT.LEFT_TO_RIGHT);
- editors[0] = textEditor;
-
- tableViewer.setCellEditors(editors);
- tableViewer.setCellModifier(new RelatedLinksCellModifier());
- contentProvider = new RelatedLinksContentProvider();
- tableViewer.setContentProvider(contentProvider);
- tableViewer.setLabelProvider(new RelatedLinksLabelProvider());
- links = task.getRelatedLinks();
- tableViewer.setInput(links);
- defineActions();
- hookContextMenu();
- }
- private void createAddDeleteButtons(Composite parent, FormToolkit toolkit) {
- Composite container = toolkit.createComposite(parent);
- container.setLayout(new GridLayout(1, true));
- Button addButton = toolkit.createButton(container, " Add ", SWT.PUSH | SWT.CENTER);
- //add.setLayoutData(new TableWrapData(TableWrapData.FILL_GRAB));
- addButton.addSelectionListener(new SelectionAdapter() {
- @Override
- public void widgetSelected(SelectionEvent e) {
- addLink();
- }
- });
-
- Button deleteButton = toolkit.createButton(container, "Delete", SWT.PUSH | SWT.CENTER);
- deleteButton.setText("Delete");
- //delete.setLayoutData(new TableWrapData(TableWrapData.FILL_GRAB));
- deleteButton.addSelectionListener(new SelectionAdapter() {
-
- @Override
- public void widgetSelected(SelectionEvent e) {
- removeLink();
- }
- });
- }
- private void refreshTaskListView(ITask task) {
- if (TaskListView.getDefault() != null) TaskListView.getDefault().notifyTaskDataChanged(task);
- }
- private class RelatedLinksCellModifier implements ICellModifier, IColorProvider {
- RelatedLinksCellModifier() {
- super();
-
- }
- public boolean canModify(Object element, String property) {
- return true;
- }
- public Object getValue(Object element, String property) {
- Object res = null;
- if (element instanceof String) {
- String url = (String) element;
- try {
- IWebBrowser b = null;
- int flags = 0;
- if (WorkbenchBrowserSupport.getInstance()
- .isInternalWebBrowserAvailable()) {
- flags = WorkbenchBrowserSupport.AS_EDITOR
- | WorkbenchBrowserSupport.LOCATION_BAR
- | WorkbenchBrowserSupport.NAVIGATION_BAR;
-
- } else {
- flags = WorkbenchBrowserSupport.AS_EXTERNAL
- | WorkbenchBrowserSupport.LOCATION_BAR
- | WorkbenchBrowserSupport.NAVIGATION_BAR;
- }
- b = WorkbenchBrowserSupport.getInstance().createBrowser(
- flags, "org.eclipse.mylar.tasks", "Task", "tasktooltip");
- b.openURL(new URL((String) element));
- } catch (PartInitException e) {
- MessageDialog.openError( Display.getDefault().getActiveShell(),
- "URL not found", url + " could not be opened");
- } catch (MalformedURLException e) {
- MessageDialog.openError( Display.getDefault().getActiveShell(),
- "URL not found", url + " could not be opened");
- }
- res = (String) element;
- }
- return res;
- }
- public void modify(Object element, String property, Object value) {
- return;
- }
-
- public Color getForeground(Object element) {
- return MylarUiPlugin.getDefault().getColorMap().HYPERLINK;
- }
-
- public Color getBackground(Object element) {
- return null;
- }
- }
-
- private class RelatedLinksLabelProvider extends LabelProvider implements
- ITableLabelProvider, IColorProvider {
-
- public RelatedLinksLabelProvider() {
- // don't have any initialization to do
- }
- public String getColumnText(Object obj, int columnIndex) {
- String result = "";
- if (obj instanceof String) {
- switch (columnIndex) {
- case 0:
- result = (String) obj;
- break;
- default:
- break;
- }
- }
- return result;
- }
- public Image getColumnImage(Object obj, int columnIndex) {
- return null;
- }
- public Color getForeground(Object element) {
- return MylarUiPlugin.getDefault().getColorMap().HYPERLINK;
- }
-
- public Color getBackground(Object element) {
- return null;
- }
- }
-
- private class RelatedLinksContentProvider implements
- IStructuredContentProvider {
-
- public Object[] getElements(Object inputElement) {
- return links.getLinks().toArray();
- }
- public void dispose() {
- // don't care if we are disposed
- }
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
- // don't care if the input chages
- }
- public boolean isEmpty() {
- return links.getLinks().isEmpty();
- }
- }
-
- private class RelatedLinksTableSorter extends ViewerSorter {
-
- public final static int LABEL = 1;
- private int criteria;
-
- public RelatedLinksTableSorter(int criteria) {
- super();
- this.criteria = criteria;
- }
-
- @Override
- public int compare(Viewer viewer, Object o1, Object o2) {
- String s1 = (String) o1;
- String s2 = (String) o2;
- switch (criteria) {
- case LABEL:
- return compareLabel(s1, s2);
- default:
- return 0;
- }
- }
- protected int compareLabel(String s1, String s2) {
- return s1.compareTo(s2);
- }
- public int getCriteria() {
- return criteria;
- }
- }
-
- private void addLink() {
- InputDialog dialog = new InputDialog(Display.getDefault().getActiveShell(), "New related link",
- "Enter new related link for this task", "", null);
- dialog.open();
- String url = null;
- String link = dialog.getValue();
- if (!(link.startsWith("http://") || link.startsWith("https://"))) {
- url = "http://" + link;
- } else {
- url = link;
- }
- links.add(url);
- tableViewer.add(url);
- }
-
- private void removeLink() {
- String url = (String) ((IStructuredSelection) tableViewer
- .getSelection()).getFirstElement();
- if (url != null) {
- links.remove(url);
- tableViewer.remove(url);
- }
- }
- private void defineActions() {
- delete = new Action() {
- @Override
- public void run() {
- removeLink();
- }
- };
- delete.setText("Delete");
- delete.setToolTipText("Delete");
- delete.setImageDescriptor(MylarImages.REMOVE);
-
- add = new Action() {
- @Override
- public void run() {
- addLink();
- }
- };
- add.setText("Add");
- add.setToolTipText("Add");
- //add.setImageDescriptor(MylarImages.REMOVE);
- }
-
- private void hookContextMenu() {
- MenuManager menuMgr = new MenuManager("#PopupMenu");
- menuMgr.setRemoveAllWhenShown(true);
- menuMgr.addMenuListener(new IMenuListener() {
- public void menuAboutToShow(IMenuManager manager) {
- manager.add(add);
- manager.add(delete);
- }
- });
- Menu menu = menuMgr.createContextMenu(tableViewer.getControl());
- tableViewer.getControl().setMenu(menu);
- //getSite().registerContextMenu(menuMgr, tableViewer);
- }
-
-
-
-
-
-
- // Eric's Old Code...
- //
-
- //private StringBuffer sb;
- //private MenuManager contextMenuManager;
- //private final String VALUE = "VALUE";
- //private final String PROPERTY = "PROPERTY";
- //private final String HEADER = "HEADER";
- //private Color foreground;
- //private StringBuffer commentBuffer;
- //private int index;
- //private ArrayList<StyledText> texts = new ArrayList<StyledText>();
- //private StyledText currentSelectedText;
- //private Font titleFont;
- //private Font textFont;
- //private int scrollIncrement;
- //private int scrollVertPageIncrement;
- //private int scrollHorzPageIncrement;
- //private ScrolledComposite scrolledComposite;
- //private Display display;
- //private CLabel titleLabel;
- //private Composite infoArea;
- //private final int HORZ_INDENT = 0;
- //private final int HORZ_TABLE_SPACING = 10;
-
-//
-// private void focusOn(StyledText newText, int caretOffset) {
-// if (newText == null)
-// return;
-// newText.setFocus();
-// newText.setCaretOffset(caretOffset);
-// scrolledComposite.setOrigin(0, newText.getLocation().y);
-// }
-//
-// /**
-// * Find the next text
-// */
-// private StyledText nextText(StyledText text) {
-// int index = 0;
-// if (text == null)
-// return texts.get(0);
-// else
-// index = texts.indexOf(text);
-//
-// //If we are not at the end....
-// if (index < texts.size() - 1)
-// return texts.get(index + 1);
-// else
-// return texts.get(index);
-// }
-//
-// /**
-// * Find the previous text
-// */
-// private StyledText previousText(StyledText text) {
-// int index = 0;
-// if (text == null)
-// return texts.get(0);
-// else
-// index = texts.indexOf(text);
-//
-// //If we are not at the end....
-// if (index == 0)
-// return texts.get(0);
-// else
-// return texts.get(index - 1);
-// }
-//
-// protected StyledText getCurrentText() {
-// return currentSelectedText;
-// }
-//
-// protected TaskEditorCopyAction getCopyAction() {
-// return copyAction;
-// }
-//
-// private void addTextListeners(StyledText styledText) {
-// styledText.addTraverseListener(new TraverseListener() {
-// public void keyTraversed(TraverseEvent e) {
-// StyledText text = (StyledText) e.widget;
-//
-// switch (e.detail) {
-// case SWT.TRAVERSE_ESCAPE :
-// e.doit = true;
-// break;
-// case SWT.TRAVERSE_TAB_NEXT :
-//
-// text.setSelection(0);
-// StyledText nextText = nextText(text);
-// focusOn(nextText, 0);
-//
-// e.detail = SWT.TRAVERSE_NONE;
-// e.doit = true;
-// break;
-//
-// case SWT.TRAVERSE_TAB_PREVIOUS :
-//
-// text.setSelection(text.getSelection());
-// StyledText previousText = previousText(text);
-// focusOn(previousText, 0);
-//
-// e.detail = SWT.TRAVERSE_NONE;
-// e.doit = true;
-// break;
-//
-// default:
-// break;
-// }
-// }
-// });
-//
-// styledText.addKeyListener(new KeyListener() {
-// public void keyReleased(KeyEvent e) {
-// //Ignore a key release
-// }
-//
-// public void keyPressed(KeyEvent event) {
-// StyledText text = (StyledText) event.widget;
-// if (event.character == ' ' || event.character == SWT.CR) {
-// return;
-// }
-//
-// if (event.keyCode == SWT.PAGE_DOWN) {
-//
-// scrolledComposite.setOrigin(0,
-// scrolledComposite.getOrigin().y
-// + scrollVertPageIncrement);
-// return;
-// }
-// if (event.keyCode == SWT.ARROW_DOWN) {
-// scrolledComposite.setOrigin(0,
-// scrolledComposite.getOrigin().y + scrollIncrement);
-// }
-// if (event.keyCode == SWT.PAGE_UP) {
-// int origin = scrolledComposite.getOrigin().y;
-// int scrollAmount = origin - scrollVertPageIncrement;
-// if (scrollAmount <= 0) {
-// scrolledComposite.setOrigin(0, 0);
-// } else {
-// scrolledComposite.setOrigin(0, scrollAmount);
-// }
-// return;
-// }
-// if (event.keyCode == SWT.ARROW_UP) {
-// scrolledComposite.setOrigin(0,
-// scrolledComposite.getOrigin().y - scrollIncrement);
-// }
-// }
-// });
-//
-// styledText.addFocusListener(new FocusAdapter() {
-//
-// @Override
-// public void focusLost(FocusEvent e) {
-// StyledText text = (StyledText) e.widget;
-// text.setSelection(text.getSelection().x);
-// }
-// });
-// }
-
-// public void createLayouts(Composite composite, ITask task) {
-// SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm");
-// String title = "Task #" + task.getId();
-// newLayout(composite, 4, title, HEADER);
-// titleLabel.setText(title);
-// }
-//
-// public void displayArtifact(Composite composite) {
-// TaskEditorInput editorInput = (TaskEditorInput) getEditorInput();
-// background = JFaceColors.getBannerBackground(composite.getParent()
-// .getParent().getDisplay());
-// composite.setBackground(background);
-//
-// // Get the background color for the info area
-// composite.setBackground(background);
-//
-// // The entire info area is 4 columns in width
-// // all headers take up all 4, values take up 1
-// GridLayout infoLayout = new GridLayout();
-// infoLayout.numColumns = 4;
-// infoLayout.marginHeight = 10;
-// infoLayout.verticalSpacing = 6;
-//
-// infoLayout.marginWidth = 5;
-// infoLayout.horizontalSpacing = HORZ_TABLE_SPACING;
-// composite.setLayout(infoLayout);
-// GridData infoData = new GridData(GridData.FILL_BOTH);
-// composite.setLayoutData(infoData);
-//
-// // Create the page with the task's contents
-// task = editorInput.getTask();
-// if (task != null) {
-// createLayouts(composite, task);
-// } else {
-// MessageDialog.openError(composite.getShell(), "No such task",
-// "No task exists with this id");
-// return;
-// }
-// }
-//
-// /**
-// * Make sure that a String that is <code>null</code> is changed to a null
-// * string
-// *
-// * @param text
-// * The text to check if it is null or not
-// * @return
-// */
-// public String checkText(String text) {
-// if (text == null)
-// return "";
-// else
-// return text;
-// }
-//
-//
-// //
-//// public void newLayout(Composite composite, int colSpan, String text, String style) {
-//// GridData data = new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING);
-//// data.horizontalSpan = colSpan;
-//// if (style.equalsIgnoreCase(VALUE)) {
-//// StyledText styledText = new StyledText(composite, SWT.MULTI | SWT.READ_ONLY);
-//// styledText.setFont(textFont);
-//// styledText.setText(checkText(text));
-//// styledText.setBackground(background);
-//// data.horizontalIndent = HORZ_INDENT;
-////
-//// styledText.setLayoutData(data);
-//// styledText.addSelectionListener(new SelectionAdapter() {
-////
-//// @Override
-//// public void widgetSelected(SelectionEvent e) {
-//// StyledText c = (StyledText) e.widget;
-//// if (c != null && c.getSelectionCount() > 0) {
-//// if (currentSelectedText != null) {
-//// if (!c.equals(currentSelectedText)) {
-//// currentSelectedText.setSelectionRange(0, 0);
-//// }
-//// }
-//// }
-//// currentSelectedText = c;
-//// }
-//// });
-////
-//// styledText.setMenu(contextMenuManager.createContextMenu(styledText));
-////
-//// styledText.setEditable(false);
-////
-//// if (styledText.getText().trim().length() > 0) {
-//// texts.add(index, styledText);
-//// index++;
-//// addTextListeners(styledText);
-//// }
-//// } else if (style.equalsIgnoreCase(PROPERTY)) {
-//// StyledText styledText = new StyledText(composite, SWT.MULTI | SWT.READ_ONLY);
-//// styledText.setFont(textFont);
-//// styledText.setText(checkText(text));
-//// styledText.setBackground(background);
-//// data.horizontalIndent = HORZ_INDENT;
-//// styledText.setLayoutData(data);
-//// StyleRange sr = new StyleRange(
-//// styledText.getOffsetAtLine(0),
-//// text.length(),
-//// foreground,
-//// background,
-//// SWT.BOLD);
-//// styledText.setStyleRange(sr);
-//// styledText.setEnabled(false);
-//// styledText.setMenu(contextMenuManager.createContextMenu(styledText));
-//// } else {
-//// Composite generalTitleGroup = new Composite(composite, SWT.NONE);
-//// generalTitleGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-// generalTitleGroup.setLayoutData(data);
-// GridLayout generalTitleLayout = new GridLayout();
-// generalTitleLayout.numColumns = 2;
-// generalTitleLayout.marginWidth = 0;
-// generalTitleLayout.marginHeight = 9;
-// generalTitleGroup.setLayout(generalTitleLayout);
-// generalTitleGroup.setBackground(background);
-//
-// Label image = new Label(generalTitleGroup, SWT.NONE);
-// image.setBackground(background);
-// image.setImage(
-// WorkbenchImages.getImage(IDEInternalWorkbenchImages.IMG_OBJS_WELCOME_ITEM));
-// GridData gd = new GridData(GridData.FILL_VERTICAL);
-// gd.verticalAlignment = GridData.VERTICAL_ALIGN_BEGINNING;
-// image.setLayoutData(gd);
-// StyledText generalTitleText = new StyledText(generalTitleGroup, SWT.MULTI | SWT.READ_ONLY);
-// generalTitleText.setText(checkText(text));
-// generalTitleText.setBackground(background);
-// StyleRange sr = new StyleRange(
-// generalTitleText.getOffsetAtLine(0),
-// text.length(),
-// foreground,
-// background,
-// SWT.BOLD);
-// generalTitleText.setStyleRange(sr);
-// generalTitleText.setEditable(false);
-//
-// generalTitleText.addSelectionListener(new SelectionAdapter() {
-//
-// @Override
-// public void widgetSelected(SelectionEvent e) {
-// StyledText c = (StyledText) e.widget;
-// if (c != null && c.getSelectionCount() > 0) {
-// if (currentSelectedText != null) {
-// if (!c.equals(currentSelectedText)) {
-// currentSelectedText.setSelectionRange(0, 0);
-// }
-// }
-// }
-// currentSelectedText = c;
-// }
-// });
-//
-// // create context menu
-// generalTitleGroup.setMenu(contextMenuManager.createContextMenu(generalTitleGroup));
-// generalTitleText.setMenu(contextMenuManager.createContextMenu(generalTitleText));
-// image.setMenu(contextMenuManager.createContextMenu(image));
-// }
-// }
-
-// private Composite createTitleArea(Composite parent) {
- //
-// // Get the background color for the title area
-// display = parent.getDisplay();
-// Color background = JFaceColors.getBannerBackground(display);
-// Color foreground = JFaceColors.getBannerForeground(display);
-//
-// // Create the title area which will contain
-// // a title, message, and image.
-// Composite titleArea = new Composite(parent, SWT.NO_FOCUS);
-// GridLayout layout = new GridLayout();
-// layout.marginHeight = 0;
-// layout.marginWidth = 0;
-// layout.verticalSpacing = 0;
-// layout.horizontalSpacing = 0;
-// layout.numColumns = 2;
-// titleArea.setLayout(layout);
-// titleArea.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-// titleArea.setBackground(background);
-//
-// // Message label
-// titleLabel = new CLabel(titleArea, SWT.LEFT);
-// JFaceColors.setColors(titleLabel, foreground, background);
-// titleLabel.setFont(titleFont);
-// final IPropertyChangeListener fontListener = new IPropertyChangeListener() {
-// public void propertyChange(PropertyChangeEvent event) {
-// if (JFaceResources.HEADER_FONT.equals(event.getProperty())) {
-// titleLabel.setFont(titleFont);
-// }
-// }
-// };
-// titleLabel.addDisposeListener(new DisposeListener() {
-// public void widgetDisposed(DisposeEvent event) {
-// JFaceResources.getFontRegistry().removeListener(fontListener);
-// }
-// });
-// JFaceResources.getFontRegistry().addListener(fontListener);
-// GridData gd = new GridData(GridData.FILL_BOTH);
-// titleLabel.setLayoutData(gd);
- //
-// // Title image
-// Label titleImage = new Label(titleArea, SWT.LEFT);
-// titleImage.setBackground(background);
-// titleImage.setImage(
-// WorkbenchImages.getImage(
-// IDEInternalWorkbenchImages.IMG_OBJS_WELCOME_BANNER));
-// gd = new GridData();
-// gd.horizontalAlignment = GridData.END;
-// titleImage.setLayoutData(gd);
-// return titleArea;
-// }
- //
-// private Composite createInfoArea(Composite parent) {
-// // Create the title area which will contain a title, message, and image.
-// scrolledComposite = new ScrolledComposite(parent, SWT.V_SCROLL | SWT.H_SCROLL);
-// scrolledComposite.setLayoutData(new GridData(GridData.FILL_BOTH));
-// infoArea = new Composite(this.scrolledComposite, SWT.NONE);
-// scrolledComposite.setMinSize(infoArea.computeSize(SWT.DEFAULT, SWT.DEFAULT));
- //
-// contextMenuManager = new MenuManager("#TaskSummaryEditor");
-// contextMenuManager.setRemoveAllWhenShown(true);
-// contextMenuManager.addMenuListener(new IMenuListener() {
-// public void menuAboutToShow(IMenuManager manager) {
-// manager.add(cutAction);
-// manager.add(copyAction);
-// manager.add(pasteAction);
-// manager.add(new Separator());
-// manager.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
-// if (currentSelectedText == null ||
-// currentSelectedText.getSelectionText().length() == 0) {
-// copyAction.setEnabled(false);
-// }
-// else {
-// copyAction.setEnabled(true);
-// }
-// }
-// });
-// getSite().registerContextMenu(
-// "#TaskSummaryEditor",
-// contextMenuManager,
-// getSite().getSelectionProvider());
- //
-// displayArtifact(infoArea);
-// this.scrolledComposite.setContent(infoArea);
-// Point p = infoArea.computeSize(SWT.DEFAULT, SWT.DEFAULT, true);
-// this.scrolledComposite.setMinHeight(p.y);
-// this.scrolledComposite.setMinWidth(p.x);
-// this.scrolledComposite.setExpandHorizontal(true);
-// this.scrolledComposite.setExpandVertical(true);
- //
-// // Add the focus listener to the scrolled composite
-// scrolledComposite.addMouseListener(new MouseAdapter() {
-//
-// @Override
-// public void mouseUp(MouseEvent e) {
-// if (!texts.isEmpty()) {
-// StyledText target = texts.get(0);
-// target.setFocus();
-// } else {
-// scrolledComposite.setFocus();
-// }
-// }
-// });
- //
-// scrolledComposite.addControlListener(new ControlListener() {
-// public void controlMoved(ControlEvent e) {
-// // don't care if a control is moved
-// }
-// public void controlResized(ControlEvent e) {
-// scrolledComposite.getVerticalBar().setIncrement(scrollIncrement);
-// scrolledComposite.getHorizontalBar().setIncrement(scrollIncrement);
-// scrollVertPageIncrement = scrolledComposite.getClientArea().height;
-// scrollHorzPageIncrement = scrolledComposite.getClientArea().width;
-// scrolledComposite.getVerticalBar().setPageIncrement(scrollVertPageIncrement);
-// scrolledComposite.getHorizontalBar().setPageIncrement(scrollHorzPageIncrement);
-// }
-// });
-// return infoArea;
-// }
-}
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/actions/ToggleIntersectionModeAction.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/actions/ToggleIntersectionModeAction.java
deleted file mode 100644
index 2681be3df..000000000
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/actions/ToggleIntersectionModeAction.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 - 2005 University Of British Columbia and others.
- * 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:
- * University Of British Columbia - initial API and implementation
- *******************************************************************************/
-/*
- * Created on May 11, 2005
- */
-package org.eclipse.mylar.tasks.ui.actions;
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.mylar.core.ITaskscapeListener;
-import org.eclipse.mylar.core.MylarPlugin;
-import org.eclipse.mylar.ui.MylarImages;
-import org.eclipse.mylar.ui.MylarUiPlugin;
-
-/**
- * @author Mik Kersten
- */
-public class ToggleIntersectionModeAction extends Action {
-
- public ToggleIntersectionModeAction() {
- super();
- setText("Intersect Tasskscapes");
- setToolTipText("Intersect Taskscapes");
- setImageDescriptor(MylarImages.INTERSECTION);
- setActionDefinitionId("org.eclipse.mylar.ui.interest.intersection");
- setChecked(MylarUiPlugin.getDefault().isGlobalFilteringEnabled());
- }
-
- @Override
- public void run() {
- setChecked(!isChecked());
- MylarUiPlugin.getDefault().setIntersectionMode(isChecked());
- MylarPlugin.getTaskscapeManager().notifyActivePresentationSettingsChange(ITaskscapeListener.UpdateKind.HIGHLIGHTER);
- }
-}
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/views/TaskListLabelProvider.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/views/TaskListLabelProvider.java
deleted file mode 100644
index 308c35755..000000000
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/views/TaskListLabelProvider.java
+++ /dev/null
@@ -1,213 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 - 2005 University Of British Columbia and others.
- * 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:
- * University Of British Columbia - initial API and implementation
- *******************************************************************************/
-/*
- * Created on Feb 18, 2005
- */
-package org.eclipse.mylar.tasks.ui.views;
-
-import org.eclipse.jface.viewers.IColorProvider;
-import org.eclipse.jface.viewers.IFontProvider;
-import org.eclipse.jface.viewers.ITableLabelProvider;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.mylar.tasks.BugzillaTask;
-import org.eclipse.mylar.tasks.ITask;
-import org.eclipse.mylar.ui.MylarImages;
-import org.eclipse.mylar.ui.MylarUiPlugin;
-import org.eclipse.mylar.ui.internal.UiUtil;
-import org.eclipse.mylar.ui.internal.views.Highlighter;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.Font;
-import org.eclipse.swt.graphics.Image;
-
-/**
- * @author Mik Kersten
- */
-public class TaskListLabelProvider extends LabelProvider implements ITableLabelProvider, IColorProvider, IFontProvider {
-
- private Color backgroundColor = null;
-
- public String getColumnText(Object obj, int columnIndex) {
- if (obj instanceof ITask) {
- ITask task = (ITask) obj;
- switch (columnIndex) {
- case 0: return " "; // padding for background
- case 1: return "";
- case 2:
- if (task.isCategory()) {
- return "";
- } else {
- return task.getPriority();
- }
- case 3:
- return task.getLabel();
- case 4:
- return task.getHandle();
- }
- }
- return null;
- }
-
- public Font getFont(Object element) {
- if (element instanceof ITask) {
- ITask task = (ITask)element;
- if (task.isCategory()) {
- for (ITask child : task.getChildren()) {
- if (child.isActive()) return UiUtil.BOLD;
- }
- }
- if (task.isActive()) return UiUtil.BOLD;
- if (task.isCompleted()) return UiUtil.ITALIC;
- }
- return null;
- }
-
- public Image getColumnImage(Object element, int columnIndex) {
-
- if (!(element instanceof ITask)) {
- return null;
- }
- if (columnIndex == 0) {
- if (((ITask) element).isCategory()) {
- return null;
- }
- if (((ITask) element).isActive()) {
- return MylarImages.getImage(MylarImages.TASK_ACTIVE);
- } else {
- return MylarImages.getImage(MylarImages.TASK_INACTIVE);
- }
- } else if (columnIndex == 1) {
- if (((ITask) element).isCategory()) {
- return null;
- // return MylarImages.getImage(MylarImages.CATEGORY);
- } else if (element instanceof BugzillaTask) {
- return MylarImages.getImage(MylarImages.TASK_BUGZILLA);
- } else {
- return MylarImages.getImage(MylarImages.TASK);
- }
- } else {
- return null;
- }
- }
-
- public Color getBackground(Object element) {
- if (element instanceof ITask) {
- ITask task = (ITask)element;
- if (task.isCategory()) {
- return backgroundColor;
- }
- Highlighter highlighter = MylarUiPlugin.getDefault().getHighlighterForTaskId("" + task.getHandle());
- if (highlighter != null) return highlighter.getHighlightColor();
- }
- return null;
- }
-
- public Color getForeground(Object element) {
- if (element instanceof ITask) {
- ITask task = (ITask)element;
- if (task.isCompleted()) return MylarUiPlugin.getDefault().getColorMap().GRAY_VERY_LIGHT;
- }
- return null;
- }
-
- public void setBackgroundColor(Color c) {
- this.backgroundColor = c;
- }
-}
-
-//public Image getColumnImage(Object obj, int columnIndex) {
-//if (obj instanceof Highlighter) {
-// Highlighter h = (Highlighter) obj;
-// switch (columnIndex) {
-// case 1:
-// HighlighterImageDescriptor des;
-// if (h.isGradient()) {
-// des = new HighlighterImageDescriptor(h.getBase(), h
-// .getLandmarkColor());
-// } else {
-// des = new HighlighterImageDescriptor(h
-// .getLandmarkColor(), h.getLandmarkColor());
-// }
-// return des.getImage();
-// default:
-// break;
-// }
-// }
-// return null;
-//}
-
-//public Color getBackground(Object element) {
-//if (element instanceof Task) {
-// Task task = (Task)element;
-// if (task.isActive()) {
-// Highlighter highlighter = MylarUiPlugin.getDefault().getHighlighterForTaskId(((Task)task).getId());
-// if (highlighter != null) {
-// return highlighter.getHighlightColor();
-// } else {
-// return null;
-// }
-// }
-//}
-//return null;
-//}
-
-//public class TaskListLabelProvider extends LabelProvider implements IColorProvider, IFontProvider {
-//
-// public String getText(Object obj) {
-// if (obj instanceof BugzillaTask) {
-// String desc = MylarTasksPlugin.getDefault().getBugzillaProvider().getBugzillaDescription(
-// ((BugzillaTask)obj));
-// return desc;
-// } else if (obj instanceof Task) {
-// Task task = (Task)obj;
-// return task.toString();// + " [" + task.getId() + "]";
-// } else {
-// return obj.toString();
-// }
-// }
-//
-// public Image getImage(Object obj) {
-// String imageKey = ISharedImages.IMG_OBJ_ELEMENT;
-// if (obj instanceof BugzillaTask) {
-// return MylarImages.getImage(MylarImages.TASK_BUGZILLA);
-// } else if (obj instanceof Task) {
-// return MylarImages.getImage(MylarImages.TASK);
-// } else {
-// return null;
-// }
-// }
-// public Color getForeground(Object element) {
-// return null;
-// }
-//
-// public Color getBackground(Object element) {
-// if (element instanceof Task) {
-// Task task = (Task)element;
-// if (task.isActive()) {
-// Highlighter highlighter = MylarUiPlugin.getDefault().getHighlighterForTaskId(((Task)task).getId());
-// if (highlighter != null) {
-// return highlighter.getHighlightColor();
-// } else {
-// return null;
-// }
-// }
-// }
-// return null;
-// }
-//
-// public Font getFont(Object element) {
-// if (element instanceof Task) {
-// if (((Task)element).isActive()) {
-// return UiUtil.BOLD;
-// }
-// }
-// return null;
-// }
-//} \ No newline at end of file
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/views/TaskListView.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/views/TaskListView.java
deleted file mode 100644
index 9cf1a37d6..000000000
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/views/TaskListView.java
+++ /dev/null
@@ -1,1432 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 - 2005 University Of British Columbia and others.
- * 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:
- * University Of British Columbia - initial API and implementation
- *******************************************************************************/
-package org.eclipse.mylar.tasks.ui.views;
-
-import java.io.IOException;
-import java.lang.reflect.InvocationTargetException;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Set;
-
-import javax.security.auth.login.LoginException;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.ActionContributionItem;
-import org.eclipse.jface.action.IMenuCreator;
-import org.eclipse.jface.action.IMenuListener;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.action.IToolBarManager;
-import org.eclipse.jface.action.MenuManager;
-import org.eclipse.jface.action.Separator;
-import org.eclipse.jface.dialogs.InputDialog;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.viewers.CellEditor;
-import org.eclipse.jface.viewers.CheckboxCellEditor;
-import org.eclipse.jface.viewers.ComboBoxCellEditor;
-import org.eclipse.jface.viewers.DoubleClickEvent;
-import org.eclipse.jface.viewers.ICellModifier;
-import org.eclipse.jface.viewers.IDoubleClickListener;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.TextCellEditor;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.viewers.ViewerDropAdapter;
-import org.eclipse.jface.viewers.ViewerFilter;
-import org.eclipse.jface.viewers.ViewerSorter;
-import org.eclipse.jface.window.Window;
-import org.eclipse.mylar.bugzilla.core.BugReport;
-import org.eclipse.mylar.bugzilla.core.BugzillaRepository;
-import org.eclipse.mylar.core.ITaskscapeListener;
-import org.eclipse.mylar.core.MylarPlugin;
-import org.eclipse.mylar.dt.MylarWebRef;
-import org.eclipse.mylar.tasks.BugzillaTask;
-import org.eclipse.mylar.tasks.Category;
-import org.eclipse.mylar.tasks.ITask;
-import org.eclipse.mylar.tasks.MylarTasksPlugin;
-import org.eclipse.mylar.tasks.Task;
-import org.eclipse.mylar.tasks.bugzilla.BugzillaStructureBridge;
-import org.eclipse.mylar.tasks.ui.BugzillaTaskEditorInput;
-import org.eclipse.mylar.tasks.ui.TaskEditorInput;
-import org.eclipse.mylar.ui.MylarImages;
-import org.eclipse.mylar.ui.MylarUiPlugin;
-import org.eclipse.mylar.ui.actions.ToggleGlobalInterestFilteringAction;
-import org.eclipse.mylar.ui.internal.views.Highlighter;
-import org.eclipse.mylar.ui.internal.views.HighlighterImageDescriptor;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.dnd.DND;
-import org.eclipse.swt.dnd.DragSourceEvent;
-import org.eclipse.swt.dnd.DragSourceListener;
-import org.eclipse.swt.dnd.TextTransfer;
-import org.eclipse.swt.dnd.Transfer;
-import org.eclipse.swt.dnd.TransferData;
-import org.eclipse.swt.events.ControlEvent;
-import org.eclipse.swt.events.ControlListener;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Menu;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.swt.widgets.TreeColumn;
-import org.eclipse.swt.widgets.TreeItem;
-import org.eclipse.ui.IActionBars;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IMemento;
-import org.eclipse.ui.IViewSite;
-import org.eclipse.ui.IWorkbenchActionConstants;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.actions.WorkspaceModifyOperation;
-import org.eclipse.ui.internal.Workbench;
-import org.eclipse.ui.part.DrillDownAdapter;
-import org.eclipse.ui.part.ViewPart;
-import org.eclipse.ui.progress.IProgressService;
-
-/**
- * @author Mik Kersten
- */
-public class TaskListView extends ViewPart {
-
- private static TaskListView INSTANCE;
-
- //private CheckboxTreeViewer viewer;
- private TreeViewer viewer;
- private DrillDownAdapter drillDownAdapter;
-
- private Action refresh;
- private Action createTask;
- private Action createCategory;
- private Action addBugzillaReport;
- private Action rename;
- private Action delete;
- private Action doubleClickAction;
- private Action clearSelectedTaskscapeAction;
-
- //private Action toggleIntersectionModeAction = new ToggleIntersectionModeAction();
- private Action toggleFilteringAction = new ToggleGlobalInterestFilteringAction();
-
- private Action completeTask;
- private Action incompleteTask;
- private Action filterCompleteTask;
- private Action filterInCompleteTask;
- private PriorityDropDownAction filterOnPriority;
- private PriorityFilter priorityFilter = new PriorityFilter();
-
- protected String[] columnNames = new String[] { "", ".", "!", "Description", "handle" };
- protected int[] columnWidths = new int[] { 70, 20, 20, 120, 70 };
- private TreeColumn[] columns;
- private IMemento taskListMemento;
- public static final String columnWidthIdentifier = "org.eclipse.mylar.tasks.ui.views.tasklist.columnwidth";
- public static final String tableSortIdentifier = "org.eclipse.mylar.tasks.ui.views.tasklist.sortIndex";
- private int sortIndex = 2;
-
- private String[] PRIORITY_LEVELS = { "P1", "P2", "P3", "P4", "P5" };
-
- private final class CreateTaskAction extends Action {
- private boolean isCategory = false;
-
- public CreateTaskAction(boolean isCategory) {
- this.isCategory = isCategory;
- }
-
- @Override
- public void run() {
- String label = getLabelNameFromUser("task");
- if(label == null) return;
- Task newTask = new Task(MylarTasksPlugin.getTaskListManager().genUniqueTaskId(), label);
-
- Object selectedObject = ((IStructuredSelection)viewer.getSelection()).getFirstElement();
- if (selectedObject instanceof Task && !isCategory){
- ((Task)selectedObject).addSubtask(newTask);
- } else {
- if (isCategory) {
- newTask.setIsCategory(true);
- }
- MylarTasksPlugin.getTaskListManager().getTaskList().addRootTask(newTask);
- }
- MylarUiPlugin.getDefault().setHighlighterMapping(
- newTask.getHandle(),
- MylarUiPlugin.getDefault().getDefaultHighlighter().getName());
- viewer.refresh();
- }
- }
-
- private final class PriorityDropDownAction extends Action implements IMenuCreator {
- private Menu dropDownMenu = null;
-
- public PriorityDropDownAction() {
- setText("Display Priorities");
- setToolTipText("Show Tasks with Priority Levels");
- setImageDescriptor(MylarImages.FILTER_DECLARATIONS);
- setMenuCreator(this);
- }
-
- public void dispose() {
- if (dropDownMenu != null) {
- dropDownMenu.dispose();
- dropDownMenu = null;
- }
- }
-
- public Menu getMenu(Control parent) {
- if (dropDownMenu != null) {
- dropDownMenu.dispose();
- }
- dropDownMenu = new Menu(parent);
- addActionsToMenu();
- return dropDownMenu;
- }
-
- public Menu getMenu(Menu parent) {
- if (dropDownMenu != null) {
- dropDownMenu.dispose();
- }
- dropDownMenu = new Menu(parent);
- addActionsToMenu();
- return dropDownMenu;
- }
-
- public void addActionsToMenu() {
- Action P1 = new Action(PRIORITY_LEVELS[0], AS_CHECK_BOX) {
- @Override
- public void run() {
- MylarUiPlugin.getDefault().setP1FilterMode(!isChecked());
- if (isChecked()) {
- priorityFilter.displayPriority(PRIORITY_LEVELS[0]);
- } else {
- priorityFilter.hidePriority(PRIORITY_LEVELS[0]);
- }
- viewer.refresh();
- }
- };
- P1.setEnabled(true);
- P1.setChecked(!MylarUiPlugin.getDefault().isP1FilterMode());
- P1.setToolTipText(PRIORITY_LEVELS[0]);
- ActionContributionItem item= new ActionContributionItem(P1);
- item.fill(dropDownMenu, -1);
-
- Action P2 = new Action(PRIORITY_LEVELS[1], AS_CHECK_BOX) {
- @Override
- public void run() {
- MylarUiPlugin.getDefault().setP2FilterMode(!isChecked());
- if (isChecked()) {
- priorityFilter.displayPriority(PRIORITY_LEVELS[1]);
- } else {
- priorityFilter.hidePriority(PRIORITY_LEVELS[1]);
- }
- viewer.refresh();
- }
- };
- P2.setEnabled(true);
- P2.setChecked(!MylarUiPlugin.getDefault().isP2FilterMode());
- P2.setToolTipText(PRIORITY_LEVELS[1]);
- item= new ActionContributionItem(P2);
- item.fill(dropDownMenu, -1);
-
- Action P3 = new Action(PRIORITY_LEVELS[2], AS_CHECK_BOX) {
- @Override
- public void run() {
- MylarUiPlugin.getDefault().setP3FilterMode(!isChecked());
- if (isChecked()) {
- priorityFilter.displayPriority(PRIORITY_LEVELS[2]);
- } else {
- priorityFilter.hidePriority(PRIORITY_LEVELS[2]);
- }
- viewer.refresh();
- }
- };
- P3.setEnabled(true);
- P3.setChecked(!MylarUiPlugin.getDefault().isP3FilterMode());
- P3.setToolTipText(PRIORITY_LEVELS[2]);
- item= new ActionContributionItem(P3);
- item.fill(dropDownMenu, -1);
-
- Action P4 = new Action(PRIORITY_LEVELS[3], AS_CHECK_BOX) {
- @Override
- public void run() {
- MylarUiPlugin.getDefault().setP4FilterMode(!isChecked());
- if (isChecked()) {
- priorityFilter.displayPriority(PRIORITY_LEVELS[3]);
- } else {
- priorityFilter.hidePriority(PRIORITY_LEVELS[3]);
- }
- viewer.refresh();
- }
- };
- P4.setEnabled(true);
- P4.setChecked(!MylarUiPlugin.getDefault().isP4FilterMode());
- P4.setToolTipText(PRIORITY_LEVELS[3]);
- item= new ActionContributionItem(P4);
- item.fill(dropDownMenu, -1);
-
- Action P5 = new Action(PRIORITY_LEVELS[4], AS_CHECK_BOX) {
- @Override
- public void run() {
- MylarUiPlugin.getDefault().setP5FilterMode(!isChecked());
- if (isChecked()) {
- priorityFilter.displayPriority(PRIORITY_LEVELS[4]);
- } else {
- priorityFilter.hidePriority(PRIORITY_LEVELS[4]);
- }
- viewer.refresh();
- }
- };
- P5.setEnabled(true);
- P5.setChecked(!MylarUiPlugin.getDefault().isP5FilterMode());
- P5.setToolTipText(PRIORITY_LEVELS[4]);
- item= new ActionContributionItem(P5);
- item.fill(dropDownMenu, -1);
- }
- public void run() {
- }
- }
-
- private ViewerFilter completeFilter = new ViewerFilter(){
- @Override
- public boolean select(Viewer viewer, Object parentElement, Object element) {
- if (element instanceof ITask) {
- if (((ITask)element).hasCompletedSubTasks(false)) {
- return true;
- } else {
- return !((ITask)element).isCompleted();
- }
- } else {
- return false;
- }
- }
- };
-
- private ViewerFilter inCompleteFilter = new ViewerFilter(){
- @Override
- public boolean select(Viewer viewer, Object parentElement, Object element) {
- if (element instanceof ITask) {
- if (((ITask)element).hasCompletedSubTasks(true)) {
- return true;
- } else {
- return ((ITask)element).isCompleted();
- }
- } else {
- return false;
- }
- }
- };
-
- public class PriorityFilter extends ViewerFilter {
- // list of priorities that will be shown in the tasklistview
- private List<String> priorities = new ArrayList<String>();
-
- public PriorityFilter() {
- // if filter is off, then add to list
- if (!MylarUiPlugin.getDefault().isP1FilterMode()) {
- displayPriority("P1");
- }
- if (!MylarUiPlugin.getDefault().isP2FilterMode()) {
- displayPriority("P2");
- }
- if (!MylarUiPlugin.getDefault().isP3FilterMode()) {
- displayPriority("P3");
- }
- if (!MylarUiPlugin.getDefault().isP4FilterMode()) {
- displayPriority("P4");
- }
- if (!MylarUiPlugin.getDefault().isP5FilterMode()) {
- displayPriority("P5");
- }
- }
-
- public void displayPriority(String p) {
- if (!priorities.contains(p)) {
- priorities.add(p);
- }
- }
-
- public void hidePriority(String p) {
- priorities.remove(p);
- }
- @Override
- public boolean select(Viewer viewer, Object parentElement, Object element) {
- if (element instanceof ITask) {
- ITask task = (ITask) element;
- if (priorities.size() == PRIORITY_LEVELS.length) {
- return true;
- } else if (task.isCategory()) {
- return true;
- } else {
- for (String filter : priorities) {
- if (task.getPriority().equals(filter) ||
- task.hasSubTaskWithPriority(filter)) {
- return true;
- }
- }
- return false;
- }
- }
- return false;
- }
-
- };
-
- class TaskListContentProvider implements IStructuredContentProvider, ITreeContentProvider {
- public void inputChanged(Viewer v, Object oldInput, Object newInput) {
- // don't care if the input changes
- }
- public void dispose() {
- // don't care if we are disposed
- }
- public Object[] getElements(Object parent) {
- if (parent.equals(getViewSite())) {
- return MylarTasksPlugin.getTaskListManager().getTaskList().getRootTasks().toArray();
- }
- return getChildren(parent);
- }
- public Object getParent(Object child) {
- if (child instanceof Task) {
- return ((Task)child).getParent();
- }
- return null;
- }
- public Object [] getChildren(Object parent) {
- if (parent instanceof ITask) {
- return ((ITask)parent).getChildren().toArray();
- }
- return new Object[0];
- }
- public boolean hasChildren(Object parent) {
- if (parent instanceof ITask) {
- ITask task = (ITask)parent;
- return task.getChildren() != null && task.getChildren().size() > 0;
- }
- return false;
- }
- }
-
- public TaskListView() {
- INSTANCE = this;
- }
-
- class TaskListCellModifier implements ICellModifier {
-
- public boolean canModify(Object element, String property) {
- int columnIndex = Arrays.asList(columnNames).indexOf(property);
- ITask task = (ITask) element;
- switch (columnIndex) {
- case 0:
- return true;
- case 1:
- return false;
- case 2:
- return !(task instanceof BugzillaTask);
- case 3:
- return !(task instanceof BugzillaTask);
- case 4:
- return false;
- }
- return false;
- }
-
- public Object getValue(Object element, String property) {
- int columnIndex = Arrays.asList(columnNames).indexOf(property);
- ITask task = (ITask) element;
- switch (columnIndex) {
- case 0:
- return new Boolean(task.isCompleted());
- case 1:
- return "";
- case 2:
- String priorityString = task.getPriority().substring(1);
- return new Integer(priorityString);
- case 3:
- return task.getLabel();
- case 4:
- return task.getHandle();
- }
- return "";
- }
-
- public void modify(Object element, String property, Object value) {
- int columnIndex = -1;
- try {
- columnIndex = Arrays.asList(columnNames).indexOf(property);
- ITask task = (ITask) ((TreeItem) element).getData();
- switch (columnIndex) {
- case 0:
- if (!task.isCategory()) {
- if (task.isActive()) {
- MylarTasksPlugin.getTaskListManager().deactivateTask(
- task);
- } else {
- MylarTasksPlugin.getTaskListManager().activateTask(
- task);
- }
- }
- viewer.setSelection(null);
- break;
- case 1:
- break;
- case 2:
- Integer intVal = (Integer) value;
- task.setPriority("P" + (intVal + 1));
- viewer.setSelection(null);
- break;
- case 3:
- task.setLabel(((String) value).trim());
- MylarTasksPlugin.getTaskListManager().taskPropertyChanged(task, columnNames[3]);
- viewer.setSelection(null);
- break;
- case 4:
- break;
- }
- viewer.refresh(task);
- } catch (Exception e) {
- MylarPlugin.log(e, e.getMessage());
- }
- }
- }
-
- private class TaskListTableSorter extends ViewerSorter {
-
- private String column;
-
- public TaskListTableSorter(String column) {
- super();
- this.column = column;
- }
-
- /**
- * compare - invoked when column is selected calls the actual comparison
- * method for particular criteria
- */
- @Override
- public int compare(Viewer compareViewer, Object o1, Object o2) {
- ITask task1 = (ITask) o1;
- ITask task2 = (ITask) o2;
-
- if (task1.isCompleted()) return 1;
- if (task2.isCompleted()) return -1;
- if (column == columnNames[1]) {
- if (task1 instanceof BugzillaTask && !(task2 instanceof BugzillaTask)) {
- return 1;
- } else {
- return -1;
- }
- } else if (column == columnNames[2]) {
- return task1.getPriority().compareTo(task2.getPriority());
- } else if (column == columnNames[3]) {
- return task1.getLabel().compareTo(task2.getLabel());
- } else if (column == columnNames[4]){
- return task1.getPath().compareTo(task2.getPath());
- } else {
- return 0;
- }
- }
- }
-
- @Override
- public void init(IViewSite site,IMemento memento) throws PartInitException {
- init(site);
- this.taskListMemento = memento;
- }
-
- @Override
- public void saveState(IMemento memento) {
- IMemento colMemento = memento.createChild(columnWidthIdentifier);
-
- for (int i = 0; i < columnWidths.length; i++) {
- IMemento m = colMemento.createChild("col"+i);
- m.putInteger("width", columnWidths[i]);
- }
-
- IMemento sorter = memento.createChild(tableSortIdentifier);
- IMemento m = sorter.createChild("sorter");
- m.putInteger("sortIndex", sortIndex);
- }
-
- private void restoreState() {
- if (taskListMemento == null)
- return;
- IMemento taskListWidth = taskListMemento.getChild(columnWidthIdentifier);
- if (taskListWidth != null) {
- for (int i = 0; i < columnWidths.length; i++) {
- IMemento m = taskListWidth.getChild("col"+i);
- if (m != null) {
- int width = m.getInteger("width");
- columnWidths[i] = width;
- columns[i].setWidth(width);
- }
- }
- }
- IMemento sorterMemento = taskListMemento.getChild(tableSortIdentifier);
- if (sorterMemento != null) {
- IMemento m = sorterMemento.getChild("sorter");
- if (m != null) {
- sortIndex = m.getInteger("sortIndex");
- } else {
- sortIndex = 2;
- }
- } else {
- sortIndex = 2; // default priority
- }
- viewer.setSorter(new TaskListTableSorter(columnNames[sortIndex]));
- viewer.addFilter(priorityFilter);
- viewer.refresh();
- }
-
- /**
- * This is a callback that will allow us
- * to create the viewer and initialize it.
- */
- @Override
- public void createPartControl(Composite parent) {
- viewer = new TreeViewer(parent, SWT.VERTICAL | SWT.H_SCROLL | SWT.V_SCROLL | SWT.FULL_SELECTION | SWT.HIDE_SELECTION);
- viewer.getTree().setHeaderVisible(true);
- viewer.getTree().setLinesVisible(true);
- viewer.setColumnProperties(columnNames);
- viewer.setUseHashlookup(true);
-
- columns = new TreeColumn[columnNames.length];
- for (int i = 0; i < columnNames.length; i++) {
- columns[i] = new TreeColumn(viewer.getTree(), 0); // SWT.LEFT
- columns[i].setText(columnNames[i]);
- columns[i].setWidth(columnWidths[i]);
- final int index = i;
- columns[i].addSelectionListener(new SelectionAdapter() {
-
- @Override
- public void widgetSelected(SelectionEvent e) {
- sortIndex = index;
- viewer.setSorter(new TaskListTableSorter(columnNames[sortIndex]));
- }
- });
- columns[i].addControlListener(new ControlListener () {
- public void controlResized(ControlEvent e) {
- for (int j = 0; j < columnWidths.length; j++) {
- if (columns[j].equals(e.getSource())) {
- columnWidths[j] = columns[j].getWidth();
- }
- }
- }
- public void controlMoved(ControlEvent e) {
- // don't care if the control is moved
- }
- });
-
- }
-
- CellEditor[] editors = new CellEditor[columnNames.length];
- TextCellEditor textEditor = new TextCellEditor(viewer.getTree());
- ((Text) textEditor.getControl()).setOrientation(SWT.LEFT_TO_RIGHT);
- editors[0] = new CheckboxCellEditor();
- editors[1] = textEditor;
- editors[2] = new ComboBoxCellEditor(viewer.getTree(), PRIORITY_LEVELS, SWT.READ_ONLY);
- editors[3] = textEditor;
- viewer.setCellEditors(editors);
- viewer.setCellModifier(new TaskListCellModifier());
- viewer.setSorter(new TaskListTableSorter(columnNames[sortIndex]));
-
- drillDownAdapter = new DrillDownAdapter(viewer);
- viewer.setContentProvider(new TaskListContentProvider());
- TaskListLabelProvider lp = new TaskListLabelProvider();
- lp.setBackgroundColor(parent.getBackground());
- viewer.setLabelProvider(lp);
- viewer.setInput(getViewSite());
-
- makeActions();
- hookContextMenu();
- hookDoubleClickAction();
- contributeToActionBars();
- ToolTipHandler toolTipHandler = new ToolTipHandler(viewer.getControl().getShell());
- toolTipHandler.activateHoverHelp(viewer.getControl());
-
- initDragAndDrop(parent);
- expandToActiveTasks();
- restoreState();
- }
-
- @MylarWebRef(name="Drag and drop article", url="http://www.eclipse.org/articles/Article-Workbench-DND/drag_drop.html")
- private void initDragAndDrop(Composite parent) {
- Transfer[] types = new Transfer[] { TextTransfer.getInstance() };
-
- viewer.addDragSupport(DND.DROP_MOVE, types, new DragSourceListener() {
-
- public void dragStart(DragSourceEvent event) {
- if (((StructuredSelection) viewer.getSelection()).isEmpty()) {
- event.doit = false;
- }
- }
-
- public void dragSetData(DragSourceEvent event) {
- StructuredSelection selection = (StructuredSelection) viewer.getSelection();
- if (!selection.isEmpty()) {
- event.data = "" + ((ITask) selection.getFirstElement()).getHandle();
- } else {
- event.data = "null";
- }
- }
-
- public void dragFinished(DragSourceEvent event) {
- // don't care if the drag is done
- }
- });
-
- viewer.addDropSupport(DND.DROP_MOVE, types, new ViewerDropAdapter(viewer) {
- {
- setFeedbackEnabled(false);
- }
-
- @Override
- public boolean performDrop(Object data) {
- Object selectedObject = ((IStructuredSelection) ((TreeViewer) getViewer())
- .getSelection()).getFirstElement();
- if (selectedObject instanceof ITask) {
- ITask source = (ITask) selectedObject;
- ITask target = (ITask) getCurrentTarget();
- source.getParent().removeSubtask(source);
- target.addSubtask(source);
- viewer.refresh();
- return true;
- }
- return false;
- }
-
- @Override
- public boolean validateDrop(Object targetObject, int operation,
- TransferData transferType) {
- Object selectedObject = ((IStructuredSelection) ((TreeViewer) getViewer())
- .getSelection()).getFirstElement();
- if (selectedObject instanceof ITask) {
- ITask source = (ITask) selectedObject;
- ITask target = (ITask) getCurrentTarget();
- if (target != null && !target.isCategory())
- return false;
- if (source.isCategory())
- return false;
- }
- return TextTransfer.getInstance().isSupportedType(transferType);
- }
-
- });
- }
-
- private void expandToActiveTasks() {
- List<ITask> activeTasks = MylarTasksPlugin.getTaskListManager().getTaskList().getActiveTasks();
- for (ITask t : activeTasks) {
- viewer.expandToLevel(t, 0);
- }
- }
-
- private void hookContextMenu() {
- MenuManager menuMgr = new MenuManager("#PopupMenu");
- menuMgr.setRemoveAllWhenShown(true);
- menuMgr.addMenuListener(new IMenuListener() {
- public void menuAboutToShow(IMenuManager manager) {
- TaskListView.this.fillContextMenu(manager);
- }
- });
- Menu menu = menuMgr.createContextMenu(viewer.getControl());
- viewer.getControl().setMenu(menu);
- getSite().registerContextMenu(menuMgr, viewer);
- }
-
- private void contributeToActionBars() {
- IActionBars bars = getViewSite().getActionBars();
- fillLocalPullDown(bars.getMenuManager());
- fillLocalToolBar(bars.getToolBarManager());
- }
-
- private void fillLocalPullDown(IMenuManager manager) {
-// manager.add(createCategory);
-// manager.add(new Separator());
-// manager.add(createTask);
- }
-
- void fillContextMenu(IMenuManager manager) {
- manager.add(completeTask);
- manager.add(incompleteTask);
-// manager.add(new Separator());
- manager.add(createTask);
- manager.add(addBugzillaReport);
- manager.add(rename);
- manager.add(delete);
- manager.add(clearSelectedTaskscapeAction);
- manager.add(new Separator());
- MenuManager subMenuManager = new MenuManager("choose highlighter");
- for (Iterator<Highlighter> it = MylarUiPlugin.getDefault().getHighlighters().iterator(); it.hasNext();) {
- final Highlighter highlighter = it.next();
- final Object selectedObject = ((IStructuredSelection)viewer.getSelection()).getFirstElement();
- if (selectedObject instanceof Task){
- Action action = new Action() {
-
- @Override
- public void run() {
- Task task = (Task)selectedObject;
- MylarUiPlugin.getDefault().setHighlighterMapping(task.getHandle(), highlighter.getName());
- TaskListView.this.viewer.refresh();
- MylarPlugin.getTaskscapeManager().notifyPostPresentationSettingsChange(ITaskscapeListener.UpdateKind.HIGHLIGHTER);
-// taskscapeComponent.getTableViewer().refresh();
- }
- };
- if (highlighter.isGradient()) {
- action.setImageDescriptor(new HighlighterImageDescriptor(highlighter.getBase(), highlighter.getLandmarkColor()));
- } else {
- action.setImageDescriptor(new HighlighterImageDescriptor(highlighter.getLandmarkColor(), highlighter.getLandmarkColor()));
- }
- action.setText(highlighter.toString());
- subMenuManager.add(action);
- } else {
-// showMessage("Select task before choosing highlighter");
- }
- }
- manager.add(subMenuManager);
- manager.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
- }
-
- private void fillLocalToolBar(IToolBarManager manager) {
- manager.add(createCategory);
- manager.add(createTask);
-// manager.add(new Separator());
- manager.add(addBugzillaReport);
- manager.add(refresh);
- manager.add(new Separator());
- manager.add(toggleFilteringAction);
- //manager.add(toggleIntersectionModeAction);
- manager.add(new Separator());
- manager.add(filterCompleteTask);
- manager.add(filterInCompleteTask);
- manager.add(filterOnPriority);
- drillDownAdapter.addNavigationActions(manager);
- }
-
- /**
- * @see org.eclipse.pde.internal.ui.view.HistoryDropDownAction
- *
- */
- private void makeActions() {
- refresh = new Action() {
-
- @Override
- public void run() {
- // TODO background?
- // perform the update in an operation so that we get a progress monitor
- // update the structure bridge cache with the reference provider cached bugs
- WorkspaceModifyOperation op = new WorkspaceModifyOperation() {
- protected void execute(IProgressMonitor monitor) throws CoreException {
-
- List<ITask> tasks = MylarTasksPlugin.getTaskListManager().getTaskList().getRootTasks();
-
- for (ITask task : tasks) {
- if (task instanceof BugzillaTask) {
- ((BugzillaTask)task).refresh();
- }
- refreshChildren(task.getChildren());
- }
-
- // clear the caches
- Set<String> cachedHandles = new HashSet<String>();
- cachedHandles.addAll(MylarTasksPlugin.getDefault().getStructureBridge().getCachedHandles());
- cachedHandles.addAll(MylarTasksPlugin.getReferenceProvider().getCachedHandles());
- MylarTasksPlugin.getDefault().getStructureBridge().clearCache();
- MylarTasksPlugin.getReferenceProvider().clearCachedReports();
-
- BugzillaStructureBridge bridge = MylarTasksPlugin.getDefault().getStructureBridge();
- monitor.beginTask("Downloading Bugs" , cachedHandles.size());
- for(String key: cachedHandles){
- try {
- String [] parts = key.split(";");
- final int id = Integer.parseInt(parts[1]);
- BugReport bug = BugzillaRepository.getInstance().getCurrentBug(id);
- if(bug != null)
- bridge.cache(key, bug);
- }catch(Exception e){}
-
- monitor.worked(1);
- }
- monitor.done();
- viewer.refresh();
- }
- };
-
- // Use the progess service to execute the runnable
- IProgressService service = PlatformUI.getWorkbench().getProgressService();
- try {
- service.run(true, false, op);
- } catch (InvocationTargetException e) {
- // Operation was canceled
- } catch (InterruptedException e) {
- // Handle the wrapped exception
- }
- }
- };
- refresh.setText("Refresh all Bugzilla reports");
- refresh.setToolTipText("Refresh all Bugzilla reports");
- refresh.setImageDescriptor(MylarImages.REFRESH);
-
-// createCategory = new Action() {
-// public void run() {
-// try {
-// String label = getLabelNameFromUser("category");
-// MylarTasksPlugin.getTaskListManager().getTaskList().createCategory(label);
-// viewer.refresh();
-// } catch (Exception e) {
-// MylarPlugin.fail(e, "Couldn't create category", true);
-// }
-// }
-// };
-// createCategory.setText("Create category");
-// createCategory.setToolTipText("Create category");
-// createCategory.setImageDescriptor(MylarImages.TASK_CATEGORY_NEW);
-
- createTask = new CreateTaskAction(false);
- createTask.setText("Create task");
- createTask.setToolTipText("Create task");
- createTask.setImageDescriptor(MylarImages.TASK_NEW);
-
- createCategory = new CreateTaskAction(true);
- createCategory.setText("Create category");
- createCategory.setToolTipText("Create category");
- createCategory.setImageDescriptor(MylarImages.CATEGORY_NEW);
-
- addBugzillaReport = new Action() {
-
- @Override
- public void run() {
- String bugIdString = getBugIdFromUser();
- int bugId = -1;
- try {
- if (bugIdString != null) {
- bugId = Integer.parseInt(bugIdString);
- } else {
- return;
- }
- } catch (NumberFormatException nfe) {
- showMessage("Please enter a valid report number");
- return;
- }
-
- // Check the existing tasks to see if the id is used already.
- // This is to prevent the creation of mutliple Bugzilla tasks
- // for the same Bugzilla report.
- boolean doesIdExistAlready = false;
- List<ITask> tasks = MylarTasksPlugin.getTaskListManager().getTaskList().getRootTasks();
- for (Iterator<ITask> iter = tasks.iterator(); iter.hasNext() && !doesIdExistAlready;) {
- ITask task = iter.next();
- doesIdExistAlready = lookForId(task, "Bugzilla-" + bugId);
- }
- if (doesIdExistAlready) {
- showMessage("A Bugzilla task with ID Bugzilla-" + bugId + " already exists.");
- return;
- }
-
-
- //HACK need the server name and handle properly
- ITask newTask = new BugzillaTask("Bugzilla-"+bugId, "<bugzilla info>");
-
- Object selectedObject = ((IStructuredSelection)viewer.getSelection()).getFirstElement();
- if (selectedObject instanceof Task){
- ((Task)selectedObject).addSubtask(newTask);
- } else {
- MylarTasksPlugin.getTaskListManager().getTaskList().addRootTask(newTask);
- }
- viewer.refresh();
- }
- };
- addBugzillaReport.setText("Add bugzilla report");
- addBugzillaReport.setToolTipText("Add bugzilla report");
- addBugzillaReport.setImageDescriptor(MylarImages.TASK_BUGZILLA_NEW);
-
- delete = new Action() {
-
- @Override
- public void run() {
- boolean deleteConfirmed = MessageDialog.openQuestion(
- Workbench.getInstance().getActiveWorkbenchWindow().getShell(),
- "Confirm delete",
- "Delete selected task and all subtasks?");
- if (!deleteConfirmed) {
- return;
- } else {
- Object selectedObject = ((IStructuredSelection)viewer.getSelection()).getFirstElement();
- if (selectedObject instanceof Task) {
- MylarTasksPlugin.getTaskListManager().deleteTask((Task)selectedObject);
- MylarPlugin.getTaskscapeManager().taskDeleted(((Task)selectedObject).getHandle(), ((Task)selectedObject).getPath());
- IWorkbenchPage page = MylarTasksPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getActivePage();
-
- // if we couldn't get the page, get out of here
- if (page == null)
- return;
- try{
- closeTaskEditors((ITask)selectedObject, page);
- }catch(Exception e){
- MylarPlugin.log(e, " deletion failed");
- }
- }
- }
- viewer.refresh();
- }
- };
- delete.setText("Delete");
- delete.setToolTipText("Delete");
- delete.setImageDescriptor(MylarImages.REMOVE);
-
- completeTask = new Action() {
-
- @Override
- public void run() {
- Object selectedObject = ((IStructuredSelection)viewer.getSelection()).getFirstElement();
- if (selectedObject instanceof Task){
- ((Task)selectedObject).setCompleted(true);
- viewer.refresh(selectedObject);
- }
- }
- };
- completeTask.setText("Mark Complete");
- completeTask.setToolTipText("Mark Complete");
-// activateTask.setImageDescriptor(MylarImages.REMOVE);
-
- incompleteTask = new Action() {
-
- @Override
- public void run() {
- Object selectedObject = ((IStructuredSelection)viewer.getSelection()).getFirstElement();
- if (selectedObject instanceof Task){
- ((Task)selectedObject).setCompleted(false);
- viewer.refresh(selectedObject);
- }
- }
- };
- incompleteTask.setText("Mark Incomplete");
- incompleteTask.setToolTipText("Mark Incomplete");
-// deactivateTask.setImageDescriptor(MylarImages.REMOVE);
-
- rename = new Action() {
-
- @Override
- public void run() {
- String label = "category";
- Object selectedObject = ((IStructuredSelection)viewer.getSelection()).getFirstElement();
- if (selectedObject instanceof Task) label = "task";
-
- String newName = getLabelNameFromUser(label);
- if (selectedObject instanceof Task) {
- ((Task)selectedObject).setLabel(newName);
- } else if (selectedObject instanceof Category) {
- ((Category)selectedObject).setName(newName);
- }
- viewer.refresh(selectedObject);
- }
- };
- rename.setText("Rename");
- rename.setToolTipText("Rename");
-
- clearSelectedTaskscapeAction = new Action() {
-
- @Override
- public void run() {
- Object selectedObject = ((IStructuredSelection)viewer.getSelection()).getFirstElement();
- if (selectedObject != null) {
- MylarPlugin.getTaskscapeManager().taskDeleted(((Task)selectedObject).getHandle(), ((Task)selectedObject).getPath());
- viewer.refresh();
- }
- }
- };
- clearSelectedTaskscapeAction.setText("Erase Taskscape");
- clearSelectedTaskscapeAction.setToolTipText("Erase Taskscape");
- clearSelectedTaskscapeAction.setImageDescriptor(MylarImages.ERASE_TASKSCAPE);
-
- doubleClickAction = new Action() {
- @Override
- public void run() {
- ISelection selection = viewer.getSelection();
- Object obj = ((IStructuredSelection)selection).getFirstElement();
- if (obj instanceof ITask) {
- ((ITask)obj).openTaskInEditor();
- }
- viewer.refresh(obj);
- }
- };
-
- filterCompleteTask = new Action() {
- @Override
- public void run() {
- MylarUiPlugin.getDefault().setFilterCompleteMode(isChecked());
- if (isChecked()) {
- viewer.addFilter(completeFilter);
- filterInCompleteTask.setChecked(false);
- viewer.removeFilter(inCompleteFilter);
- } else {
- viewer.removeFilter(completeFilter);
- }
- viewer.refresh();
- }
- };
- filterCompleteTask.setText("Filter Complete tasks");
- filterCompleteTask.setToolTipText("Filter Completed tasks");
- filterCompleteTask.setImageDescriptor(MylarImages.TASK_ACTIVE);
- filterCompleteTask.setChecked(MylarUiPlugin.getDefault().isFilterCompleteMode());
-
- filterInCompleteTask = new Action() {
- @Override
- public void run() {
- MylarUiPlugin.getDefault().setFilterInCompleteMode(isChecked());
- if (isChecked()) {
- viewer.addFilter(inCompleteFilter);
- filterCompleteTask.setChecked(false);
- viewer.removeFilter(completeFilter);
- } else {
- viewer.removeFilter(inCompleteFilter);
- }
- viewer.refresh();
- }
- };
- filterInCompleteTask.setText("Filter Incomplete tasks");
- filterInCompleteTask.setToolTipText("Filter Incomplete tasks");
- filterInCompleteTask.setImageDescriptor(MylarImages.TASK_INACTIVE);
- filterInCompleteTask.setChecked(MylarUiPlugin.getDefault().isFilterInCompleteMode());
-
-
- filterOnPriority = new PriorityDropDownAction();
- }
-
- /**
- * Recursive function that checks for the occurrence of a certain task id.
- * All children of the supplied node will be checked.
- *
- * @param task
- * The <code>ITask</code> object that is to be searched.
- * @param taskId
- * The id that is being searched for.
- * @return <code>true</code> if the id was found in the node or any of its
- * children
- */
- protected boolean lookForId(ITask task, String taskId) {
- if (task.getHandle().equals(taskId)) {
- return true;
- }
-
- List<ITask> children = task.getChildren();
- if (children == null) {
- return false;
- }
-
- for (ITask childTask : children) {
- if (lookForId(childTask, taskId)) {
- return true;
- }
- }
-
- return false;
- }
-
- protected void closeTaskEditors(ITask task, IWorkbenchPage page) throws LoginException, IOException{
- IEditorInput input = null;
- if (task instanceof BugzillaTask) {
- input = new BugzillaTaskEditorInput((BugzillaTask)task);
- } else if (task instanceof Task) {
- input = new TaskEditorInput((Task) task);
- }
- IEditorPart editor = page.findEditor(input);
-
- if (editor != null) {
- page.closeEditor(editor, false);
- }
-
-
- List<ITask> children = task.getChildren();
- if (children == null)
- return;
- for (ITask child : children)
- closeTaskEditors(child, page);
- }
-
- protected void refreshChildren(List<ITask> children) {
- if (children != null) {
- for (ITask child : children) {
- if (child instanceof BugzillaTask) {
- ((BugzillaTask)child).refresh();
- }
- refreshChildren(child.getChildren());
- }
- }
- }
-
- private void hookDoubleClickAction() {
- viewer.addDoubleClickListener(new IDoubleClickListener() {
- public void doubleClick(DoubleClickEvent event) {
- doubleClickAction.run();
- }
- });
- }
- private void showMessage(String message) {
- MessageDialog.openInformation(
- viewer.getControl().getShell(),
- "Tasklist Message",
- message);
- }
-
- /**
- * Passing the focus request to the viewer's control.
- */
- @Override
- public void setFocus() {
- viewer.getControl().setFocus();
- //TODO: foo
- }
-
- private String getBugIdFromUser() {
- InputDialog dialog = new InputDialog(
- Workbench.getInstance().getActiveWorkbenchWindow().getShell(),
- "Enter Bugzilla ID",
- "Enter the Bugzilla ID: ",
- "",
- null);
- int dialogResult = dialog.open();
- if (dialogResult == Window.OK) {
- return dialog.getValue();
- } else {
- return null;
- }
- }
-
- private String getLabelNameFromUser(String kind) {
-
- InputDialog dialog = new InputDialog(
- Workbench.getInstance().getActiveWorkbenchWindow().getShell(),
- "Enter name",
- "Enter a name for the " + kind + ": ",
- "",
- null);
- int dialogResult = dialog.open();
- if (dialogResult == Window.OK) {
- return dialog.getValue();
- } else {
- return null;
- }
- }
-
- public void notifyTaskDataChanged(ITask task) {
- if (viewer.getTree() != null && !viewer.getTree().isDisposed()) {
- viewer.refresh(task);
- }
- }
-
- public static TaskListView getDefault() {
- return INSTANCE;
- }
-
- public TreeViewer getViewer() {
- return viewer;
- }
-
- public ViewerFilter getCompleteFilter() {
- return completeFilter;
- }
-
- public ViewerFilter getInCompleteFilter() {
- return inCompleteFilter;
- }
-
- public PriorityFilter getPriorityFilter() {
- return priorityFilter;
- }
-}
-
-//TextTransfer textTransfer = TextTransfer.getInstance();
-//DropTarget target = new DropTarget(viewer.getTree(), DND.DROP_MOVE);
-//target.setTransfer(new Transfer[] { textTransfer });
-//target.addDropListener(new TaskListDropTargetListener(parent, null, textTransfer, true));
-//
-//DragSource source = new DragSource(viewer.getTree(), DND.DROP_MOVE);
-//source.setTransfer(types);
-
-//source.addDragListener(new DragSourceListener() {
-//public void dragStart(DragSourceEvent event) {
-// if (((StructuredSelection)viewer.getSelection()).isEmpty()) {
-// event.doit = false;
-// }
-//}
-//public void dragSetData(DragSourceEvent event) {
-// StructuredSelection selection = (StructuredSelection) viewer.getSelection();
-// if (!selection.isEmpty()) {
-// event.data = "" + ((ITask)selection.getFirstElement()).getId();
-// } else {
-// event.data = "null";
-// }
-//}
-//
-//public void dragFinished(DragSourceEvent event) { }
-//});
-
-
-// public boolean getServerStatus() {
-// return serverStatus;
-// }
-//
-// /**
-// * Sets whether or not we could connect to the Bugzilla server. If
-// * necessary, the corresponding label in the view is updated.
-// *
-// * @param canRead
-// * <code>true</code> if the Bugzilla server could be connected
-// * to
-// */
-// public void setServerStatus(boolean canRead) {
-// if (serverStatus != canRead) {
-// serverStatus = canRead;
-// updateServerStatusLabel();
-// }
-// }
-//
-// private void updateServerStatusLabel() {
-// if (serverStatusLabel.isDisposed()) {
-// return;
-// }
-// if (serverStatus) {
-// serverStatusLabel.setText(CAN_READ_LABEL);
-// }
-// else {
-// serverStatusLabel.setText(CANNOT_READ_LABEL);
-// }
-// }
-//
-// private class ServerPingJob extends Job {
-// private boolean shouldCheckAgain = true;
-// private int counter = 0;
-//
-// public ServerPingJob(String name) {
-// super(name);
-// }
-//
-// public void stopPinging() {
-// shouldCheckAgain = false;
-// }
-//
-// protected IStatus run(IProgressMonitor monitor) {
-// while (shouldCheckAgain) {
-// try {
-// final boolean canReadFromServer = TaskListView.checkServer();
-// Workbench.getInstance().getDisplay().asyncExec(new Runnable() {
-// public void run() {
-// setServerStatus(canReadFromServer);
-// }
-// });
-// Thread.sleep(10000/*MylarPreferencePage.getServerPing()*5000*/);
-// } catch (InterruptedException e) {
-// break;
-// }
-// }
-// return new Status(IStatus.OK, MylarPlugin.IDENTIFIER, IStatus.OK, "", null);
-// }
-// }
-//
-// /**
-// * @return <code>true</code> if we could connect to the Bugzilla server
-// */
-// public static boolean checkServer() {
-// boolean canRead = true;
-// BufferedReader in = null;
-//
-// // Call this function to intialize the Bugzilla url that the repository
-// // is using.
-// BugzillaRepository.getInstance();
-//
-// try {
-// // connect to the bugzilla server
-// SSLContext ctx = SSLContext.getInstance("TLS");
-// javax.net.ssl.TrustManager[] tm = new javax.net.ssl.TrustManager[]{new TrustAll()};
-// ctx.init(null, tm, null);
-// HttpsURLConnection.setDefaultSSLSocketFactory(ctx.getSocketFactory());
-// String urlText = "";
-//
-// // use the usename and password to get into bugzilla if we have it
-// if(BugzillaPreferences.getUserName() != null && !BugzillaPreferences.getUserName().equals("") && BugzillaPreferences.getPassword() != null && !BugzillaPreferences.getPassword().equals(""))
-// {
-// /*
-// * The UnsupportedEncodingException exception for
-// * URLEncoder.encode() should not be thrown, since every
-// * implementation of the Java platform is required to support
-// * the standard charset "UTF-8"
-// */
-// try {
-// urlText += "?GoAheadAndLogIn=1&Bugzilla_login=" + URLEncoder.encode(BugzillaPreferences.getUserName(), "UTF-8") + "&Bugzilla_password=" + URLEncoder.encode(BugzillaPreferences.getPassword(), "UTF-8");
-// } catch (UnsupportedEncodingException e) { }
-// }
-//
-// URL url = new URL(BugzillaRepository.getURL() + "/enter_bug.cgi" + urlText);
-//
-// // create a new input stream for getting the bug
-// in = new BufferedReader(new InputStreamReader(url.openStream()));
-// }
-// catch (Exception e) {
-// // If there was an IOException, then there was a problem connecting.
-// // If there was some other exception, then it was a problem not
-// // related to the server.
-// if (e instanceof IOException) {
-// canRead = false;
-// }
-// }
-//
-// // Close the BufferedReader if we opened one.
-// try {
-// if (in != null)
-// in.close();
-// } catch(IOException e) {}
-//
-// return canRead;
-// }
-//
-// public void dispose() {
-// if (serverPingJob != null) {
-// serverPingJob.stopPinging();
-// }
-// super.dispose();
-// }
-
-// source.addDragListener(new DragSourceListener() {
-//
-// public void dragStart(DragSourceEvent event) {
-// if (((StructuredSelection) viewer.getSelection()).getFirstElement() == null) {
-// event.doit = false;
-// }
-// }
-//
-// public void dragSetData(DragSourceEvent event) {
-// StructuredSelection selection = (StructuredSelection)viewer.getSelection();
-// ITask task = (ITask) selection.getFirstElement();
-// if (task != null) {
-// event.data = "" + task.getId();
-// } else {
-// event.data = " ";
-// }
-// }
-//
-// public void dragFinished(DragSourceEvent event) {
-// StructuredSelection selection = (StructuredSelection)viewer.getSelection();
-// if (selection.isEmpty()) {
-// return;
-// } else {
-// ITask task = (ITask) selection.getFirstElement();
-//
-// System.err.println(">>> got task: " + task + ">> " + );
-//
-// }
-// }
-//
-// });
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/views/ToolTipHandler.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/views/ToolTipHandler.java
deleted file mode 100644
index 5efee7529..000000000
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/views/ToolTipHandler.java
+++ /dev/null
@@ -1,240 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 - 2005 University Of British Columbia and others.
- * 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:
- * University Of British Columbia - initial API and implementation
- *******************************************************************************/
-/**
- * Copied from newsgroup, forwarded from Make Technologies
- */
-
-package org.eclipse.mylar.tasks.ui.views;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.mylar.tasks.ITask;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.*;
-import org.eclipse.swt.graphics.*;
-import org.eclipse.swt.layout.*;
-import org.eclipse.swt.widgets.*;
-
-
-public class ToolTipHandler {
- private Shell parentShell;
-
- private Shell tipShell;
-
- private Label tipLabelImage;
- private Label tipLabelText;
-
- private Widget tipWidget; // widget this tooltip is hovering over
-
- protected Point tipPosition; // the position being hovered over on the
- // Entire display
-
- protected Point widgetPosition; // the position hovered over in the Widget;
-
- /**
- * Creates a new tooltip handler
- *
- * @param parent
- * the parent Shell
- */
- public ToolTipHandler(Shell parent) {
- final Display display = parent.getDisplay();
- this.parentShell = parent;
- tipShell = new Shell(parent, SWT.NONE);
- GridLayout gridLayout = new GridLayout();
- gridLayout.numColumns = 2;
- gridLayout.marginWidth = 2;
- gridLayout.marginHeight = 2;
- tipShell.setLayout(gridLayout);
- tipShell.setBackground(display
- .getSystemColor(SWT.COLOR_INFO_BACKGROUND));
-
- tipLabelImage = new Label(tipShell, SWT.NONE);
- tipLabelImage.setForeground(display
- .getSystemColor(SWT.COLOR_INFO_FOREGROUND));
- tipLabelImage.setBackground(display
- .getSystemColor(SWT.COLOR_INFO_BACKGROUND));
-
- GridData imageGridData = new GridData(
- GridData.HORIZONTAL_ALIGN_BEGINNING
- | GridData.VERTICAL_ALIGN_BEGINNING);
- tipLabelImage.setLayoutData(imageGridData);
-
- tipLabelText = new Label(tipShell, SWT.NONE);
- tipLabelText.setForeground(display
- .getSystemColor(SWT.COLOR_INFO_FOREGROUND));
- tipLabelText.setBackground(display
- .getSystemColor(SWT.COLOR_INFO_BACKGROUND));
-
- GridData textGridData = new GridData(GridData.FILL_HORIZONTAL
- | GridData.VERTICAL_ALIGN_CENTER);
- tipLabelText.setLayoutData(textGridData);
- }
-
- private ITask getTask(Object hoverObject) {
- if (hoverObject instanceof Widget) {
- Object data = ((Widget) hoverObject).getData();
- if (data != null) {
- if (data instanceof ITask) {
- return (ITask) data;
- } else if (data instanceof IAdaptable) {
- return (ITask) ((IAdaptable) data).getAdapter(ITask.class);
- }
-
- }
- }
- return null;
- }
-
- protected String getToolTipText(Object object) {
- ITask task = getTask(object);
- if (task != null) {
- return task.getToolTipText();
- }
-
- if (object instanceof Control) {
- return (String) ((Control) object).getData("TIP_TEXT");
- }
- return null;
- }
-
- protected Image getToolTipImage(Object object) {
- ITask projectNode = getTask(object);
- if (projectNode != null) {
- // TODO Code for determining image
- }
- if (object instanceof Control) {
- return (Image) ((Control) object).getData("TIP_IMAGE");
- }
- return null;
- }
-
- protected Object getToolTipHelp(Object object) {
- if (object instanceof Control) {
- return (String) ((Control) object).getData("TIP_HELPTEXT");
- }
- return null;
- }
-
- /**
- * Enables customized hover help for a specified control
- *
- * @control the control on which to enable hoverhelp
- */
- public void activateHoverHelp(final Control control) {
- /*
- * Get out of the way if we attempt to activate the control underneath
- * the tooltip
- */
- control.addMouseListener(new MouseAdapter() {
-
- @Override
- public void mouseDown(MouseEvent e) {
- if (tipShell.isVisible())
- tipShell.setVisible(false);
- }
- });
- /*
- * Trap hover events to pop-up tooltip
- */
- control.addMouseTrackListener(new MouseTrackAdapter() {
-
- @Override
- public void mouseExit(MouseEvent e) {
- if (tipShell.isVisible())
- tipShell.setVisible(false);
- tipWidget = null;
- }
-
- @Override
- public void mouseHover(MouseEvent event) {
- widgetPosition = new Point(event.x, event.y);
- Widget widget = event.widget;
- if (widget instanceof ToolBar) {
- ToolBar w = (ToolBar) widget;
- widget = w.getItem(widgetPosition);
- }
- if (widget instanceof Table) {
- Table w = (Table) widget;
- widget = w.getItem(widgetPosition);
- }
- if (widget instanceof Tree) {
- Tree w = (Tree) widget;
- widget = w.getItem(widgetPosition);
- }
- if (widget == null) {
- tipShell.setVisible(false);
- tipWidget = null;
- return;
- }
- if (widget == tipWidget)
- return;
- tipWidget = widget;
- tipPosition = control.toDisplay(widgetPosition);
- String text = getToolTipText(widget);
- Image image = getToolTipImage(widget);
- if (text == null) {
- return;
- }
- Control sourceControl = (Control) event.getSource();
- sourceControl.setFocus();
- tipLabelText.setText(text);
- tipLabelImage.setImage(image); // accepts null
- tipShell.pack();
- setHoverLocation(tipShell, tipPosition);
- tipShell.setVisible(true);
- }
- });
- /*
- * Trap F1 Help to pop up a custom help box
- */
- control.addHelpListener(new HelpListener() {
- public void helpRequested(HelpEvent event) {
- if (tipWidget == null)
- return;
- Object help = getToolTipHelp(tipWidget);
- if (help == null)
- return;
- if (help.getClass() != String.class) {
- return;
- }
- if (tipShell.isVisible()) {
- tipShell.setVisible(false);
- Shell helpShell = new Shell(parentShell, SWT.SHELL_TRIM);
- helpShell.setLayout(new FillLayout());
- Label label = new Label(helpShell, SWT.NONE);
- label.setText((String) help);
- helpShell.pack();
- setHoverLocation(helpShell, tipPosition);
- helpShell.open();
- }
- }
- });
- }
-
- /**
- * Sets the location for a hovering shell
- *
- * @param shell
- * the object that is to hover
- * @param position
- * the position of a widget to hover over
- * @return the top-left location for a hovering box
- */
- private void setHoverLocation(Shell shell, Point position) {
- Rectangle displayBounds = shell.getDisplay().getBounds();
- Rectangle shellBounds = shell.getBounds();
- shellBounds.x = Math.max(Math.min(position.x, displayBounds.width
- - shellBounds.width), 0);
- shellBounds.y = Math.max(Math.min(position.y + 16, displayBounds.height
- - shellBounds.height), 0);
- shell.setBounds(shellBounds);
- }
-} \ No newline at end of file
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/util/RelativePathUtil.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/util/RelativePathUtil.java
deleted file mode 100644
index b6105b6ed..000000000
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/util/RelativePathUtil.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 - 2005 University Of British Columbia and others.
- * 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:
- * University Of British Columbia - initial API and implementation
- *******************************************************************************/
-package org.eclipse.mylar.tasks.util;
-
-public class RelativePathUtil {
- public static String findRelativePath(String baseDirectory, String filePath) {
- if (filePath.startsWith(baseDirectory)) {
- return filePath.substring(baseDirectory.length(), filePath.lastIndexOf('.'));
- } else {
- StringBuffer result = new StringBuffer(filePath.length());
- String[] rootFolders = baseDirectory.split("/");
- String[] pathFolders = filePath.split("/");
- int diff = 0;
- for (int i = 0; i < pathFolders.length; i++) {
- if (!rootFolders[i].equals(pathFolders[i])) {
- diff = i;
- while (i < rootFolders.length) {
- result.append('.');
- result.append('.');
- result.append('/');
- i++;
- }
- while(diff < pathFolders.length - 1){
- result.append(pathFolders[diff]);
- diff++;
- }
- result.append(pathFolders[diff].substring(0, pathFolders[diff].lastIndexOf('.')));
- }
- }
- return result.toString();
- }
- }
-}
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/util/TaskTest.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/util/TaskTest.java
deleted file mode 100644
index 1a67148a2..000000000
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/util/TaskTest.java
+++ /dev/null
@@ -1,146 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 - 2005 University Of British Columbia and others.
- * 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:
- * University Of British Columbia - initial API and implementation
- *******************************************************************************/
-/*
- * Created on Jan 24, 2005
- */
-package org.eclipse.mylar.tasks.util;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * @author Shawn Minto
- */
-public class TaskTest {
- private int id = -1;
-
- private String name = "";
-
- private List<String> categories = new ArrayList<String>();
-
- private List<TaskTest> taskList = new ArrayList<TaskTest>();
-
- @Override
- public String toString() {
- return "Task";
- }
-
- public boolean isEqual(TaskTest otherTask) {
-
- boolean result = true;
- result = result && (this.id == otherTask.id);
- int compare = (this.name.compareTo(otherTask.name));
- if (compare != 0)
- result = false;
- if (!result)
- System.out.println("this: " + this.name + " otherName: "
- + otherTask.name + " a");
-
- if (this.categories.size() == otherTask.categories.size()) {
- for (int i = 0; i < this.categories.size(); i++) {
- compare = this.categories.get(i).compareTo(
- otherTask.categories.get(i));
- if (compare != 0) {
- System.err.println(this.categories.get(i) + " vs "
- + otherTask.categories.get(i));
- result = false;
- break;
- }
- }
- } else {
- System.err.println("Category length different");
- System.err.println("length: " + this.categories.size()
- + " VS Length: " + otherTask.categories.size());
- result = false;
- }
- if (this.taskList.size() == otherTask.taskList.size()) {
- for (int i = 0; i < this.taskList.size(); i++) {
- result = result
- && (this.taskList.get(i).isEqual(otherTask.taskList
- .get(i)));
- }
- } else {
- System.err.println("TaskList size is different!");
- result = false;
- }
- return result;
- }
-
- public static void printTask(TaskTest t, String tab) {
- System.out.println(tab + "TaskID: " + t.id);
- System.out.println(tab + "Name: " + t.name);
- System.out.println(tab + "Categories: ");
- for (int i = 0; i < t.categories.size(); i++) {
- System.out.println(tab + "\t " + t.categories.get(i));
- }
- for (int i = 0; i < t.taskList.size(); i++) {
- printTask(t.taskList.get(i), tab + "\t");
- }
- }
-
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- // public List<String> getCategories() {
- // return categories;
- // }
- // public void setCategories(List<String> categories) {
- // this.categories = categories;
- // }
- public int getId() {
- return id;
- }
-
- public void setId(int id) {
- this.id = id;
- }
-
- public void addCategory(String category) {
- this.categories.add(category);
- }
-
- /**
- * @return Returns the categories.
- */
- public List<String> getCategories() {
- return categories;
- }
-
- /**
- * @param categories The categories to set.
- */
- public void setCategories(List<String> categories) {
- this.categories = categories;
- }
-
- /**
- * @return Returns the taskList.
- */
- public List<TaskTest> getTaskList() {
- return taskList;
- }
-
- /**
- * @param taskList The taskList to set.
- */
- public void setTaskList(List<TaskTest> taskList) {
- this.taskList = taskList;
- }
-
- public void addSubTask(TaskTest sub) {
- this.taskList.add(sub);
- }
-}
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/util/XmlUtil.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/util/XmlUtil.java
deleted file mode 100644
index f0aa3ff82..000000000
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/util/XmlUtil.java
+++ /dev/null
@@ -1,366 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 - 2005 University Of British Columbia and others.
- * 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:
- * University Of British Columbia - initial API and implementation
- *******************************************************************************/
-/*
- * Created on Jan 17, 2005
- */
-package org.eclipse.mylar.tasks.util;
-
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.OutputStream;
-import java.util.Date;
-import java.util.List;
-
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.transform.Result;
-import javax.xml.transform.Source;
-import javax.xml.transform.Transformer;
-import javax.xml.transform.TransformerConfigurationException;
-import javax.xml.transform.TransformerException;
-import javax.xml.transform.TransformerFactory;
-import javax.xml.transform.TransformerFactoryConfigurationError;
-import javax.xml.transform.dom.DOMSource;
-import javax.xml.transform.stream.StreamResult;
-
-import org.eclipse.mylar.core.MylarPlugin;
-import org.eclipse.mylar.tasks.BugzillaTask;
-import org.eclipse.mylar.tasks.ITask;
-import org.eclipse.mylar.tasks.Task;
-import org.eclipse.mylar.tasks.TaskList;
-import org.eclipse.mylar.tasks.BugzillaTask.BugTaskState;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-import org.xml.sax.SAXException;
-
-
-/**
- * @author Ken Sueda
- */
-public class XmlUtil {
-
- private static String readVersion = "";
-
- /**
- *
- * @param tlist
- * @param outFile
- */
- public static void writeTaskList(TaskList tlist, File outFile) {
- DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
- DocumentBuilder db;
- Document doc = null;
-
- try {
- db = dbf.newDocumentBuilder();
- doc = db.newDocument();
- } catch (ParserConfigurationException e) {
- e.printStackTrace();
- }
-
- Element root = doc.createElement("TaskList");
- root.setAttribute("Version", "1.0.0");
-
- // iterate through each subtask and externalize those
- //
- for (int i = 0; i < tlist.getRootTasks().size(); i++) {
- writeTask(tlist.getRootTasks().get(i), doc, root);
- }
- doc.appendChild(root);
- writeDOMtoFile(doc, outFile);
- return;
- }
-
- /**
- * Writes an XML file from a DOM.
- *
- * doc - the document to write
- * file - the file to be written to
- */
- public static void writeDOMtoFile(Document doc, File file) {
- try {
- // A file output stream is an output stream for writing data to a File
- //
- OutputStream outputStream = new FileOutputStream(file);
- writeDOMtoStream(doc, outputStream);
- outputStream.flush();
- outputStream.close();
- } catch (Exception fnfe) {
- MylarPlugin.log(fnfe, "Tasklist could not be found");
- }
- }
-
- /**
- * Writes the provided XML document out to the specified output stream.
- *
- * doc - the document to be written
- * outputStream - the stream to which the document is to be written
- */
- public static void writeDOMtoStream(Document doc, OutputStream outputStream) {
- // Prepare the DOM document for writing
- // DOMSource - Acts as a holder for a transformation Source tree in the
- // form of a Document Object Model (DOM) tree
- //
- Source source = new DOMSource(doc);
-
- // StreamResult - Acts as an holder for a XML transformation result
- // Prepare the output stream
- //
- Result result = new StreamResult(outputStream);
-
- // An instance of this class can be obtained with the
- // TransformerFactory.newTransformer method. This instance may
- // then be used to process XML from a variety of sources and write
- // the transformation output to a variety of sinks
- //
-
- Transformer xformer = null;
- try {
- xformer = TransformerFactory.newInstance().newTransformer();
- //Transform the XML Source to a Result
- //
- xformer.transform(source, result);
- } catch (TransformerConfigurationException e) {
- e.printStackTrace();
- } catch (TransformerFactoryConfigurationError e) {
- e.printStackTrace();
- } catch (TransformerException e1) {
- e1.printStackTrace();
- }
- }
-
- /**
- *
- * @param t
- * @param doc
- * @param root
- */
- public static void writeTask(ITask t, Document doc, Element root) {
-
- // create node and set attributes
- //
- Element node = doc.createElement("Task");
- node.setAttribute("Path", t.getPath());
- node.setAttribute("Label", t.getLabel());
- node.setAttribute("Handle", t.getHandle());
- node.setAttribute("Priority", t.getPriority());
-
- if (t.isCategory()) {
- node.setAttribute("IsCategory", "true");
- } else {
- node.setAttribute("IsCategory", "false");
- }
- if (t.isCompleted()) {
- node.setAttribute("Complete", "true");
- } else {
- node.setAttribute("Complete", "false");
- }
- if (t.isActive()) {
- node.setAttribute("Active", "true");
- } else {
- node.setAttribute("Active", "false");
- }
- if (t instanceof BugzillaTask) {
- BugzillaTask bt = (BugzillaTask) t;
- node.setAttribute("Bugzilla", "true");
- node.setAttribute("LastDate", new Long(bt.getLastRefreshTime()
- .getTime()).toString());
- if (bt.isDirty()) {
- node.setAttribute("Dirty", "true");
- } else {
- node.setAttribute("Dirty", "false");
- }
- bt.saveBugReport(false);
- } else {
- node.setAttribute("Bugzilla", "false");
- }
- node.setAttribute("Notes", t.getNotes());
- node.setAttribute("Elapsed", t.getElapsedTime());
- node.setAttribute("Estimated", t.getEstimatedTime());
- List<String> rl = t.getRelatedLinks().getLinks();
- int i = 0;
- for (String link : rl) {
- node.setAttribute("link"+i, link);
- i++;
- }
-
- List<ITask> children = t.getChildren();
-
- i = 0;
- for (i = 0; i < children.size(); i++) {
- writeTask(children.get(i), doc, node);
- }
-
- // append new node to root node
- //
- root.appendChild(node);
- return;
- }
-
- public static void readTaskList(TaskList tlist, File inFile) {
- try {
- // parse file
- //
- Document doc = openAsDOM(inFile);
-
- // read root node to get version number
- //
- Element root = doc.getDocumentElement();
- readVersion = root.getAttribute("Version");
-
- NodeList list = root.getChildNodes();
- for (int i = 0; i < list.getLength(); i++) {
- Node child = list.item(i);
- tlist.addRootTask(readTask(child, null, tlist));
- }
- } catch (Exception e) {
- String name = inFile.getAbsolutePath();
- name = name.substring(0, name.lastIndexOf('.')) + "-save.xml";
- inFile.renameTo(new File(name));
- MylarPlugin.log(e, "XmlUtil");
- }
- }
-
- /**
- * Opens the specified XML file and parses it into a DOM Document.
- *
- * Filename - the name of the file to open
- * Return - the Document built from the XML file
- * Throws - XMLException if the file cannot be parsed as XML
- * - IOException if the file cannot be opened
- */
- public static Document openAsDOM(File inputFile) throws IOException {
-
- // A factory API that enables applications to obtain a parser
- // that produces DOM object trees from XML documents
- //
- DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
-
- // Using DocumentBuilder, obtain a Document from XML file.
- //
- DocumentBuilder builder = null;
- Document document = null;
- try {
- // create new instance of DocumentBuilder
- //
- builder = factory.newDocumentBuilder();
- } catch (ParserConfigurationException pce) {
- inputFile.renameTo(new File(inputFile.getName() + "save.xml"));
- MylarPlugin.log(pce, "Failed to load XML file");
- }
- try {
- // Parse the content of the given file as an XML document
- // and return a new DOM Document object. Also throws IOException
- document = builder.parse(inputFile);
- } catch (SAXException se) {
- inputFile.renameTo(new File(inputFile.getName() + "save.xml"));
- MylarPlugin.log(se, "Failed to parse XML file");
- }
- return document;
- }
-
- public static ITask readTask(Node node, ITask root, TaskList tlist) {
- //extract node and create new sub task
- //
- Element e = (Element) node;
- ITask t;
- String handle = "";
- if (e.hasAttribute("ID")) {
- handle = e.getAttribute("ID");
- } else {
- handle = e.getAttribute("Handle");
- }
-
- String label = e.getAttribute("Label");
- String priority = e.getAttribute("Priority");
-
- if (e.getAttribute("Bugzilla").compareTo("true") == 0) {
- t = new BugzillaTask(handle, label, true);
- BugzillaTask bt = (BugzillaTask) t;
- bt.setState(BugTaskState.FREE);
- bt.setLastRefresh(new Date(new Long(e.getAttribute("LastDate"))
- .longValue()));
- if (e.getAttribute("Dirty").compareTo("true") == 0) {
- bt.setDirty(true);
- } else {
- bt.setDirty(false);
- }
- if (bt.readBugReport() == false) {
- MylarPlugin.log("Failed to read bug report", null);
- }
- } else {
- t = new Task(handle, label);
- }
- t.setPriority(priority);
- t.setPath(e.getAttribute("Path"));
-
- if (e.getAttribute("Active").compareTo("true") == 0) {
- t.setActive(true);
- tlist.setActive(t, true);
- } else {
- t.setActive(false);
- }
-
- if (e.getAttribute("Complete").compareTo("true") == 0) {
- t.setCompleted(true);
- } else {
- t.setCompleted(false);
- }
- if (e.getAttribute("IsCategory").compareTo("true") == 0) {
- t.setIsCategory(true);
- } else {
- t.setIsCategory(false);
- }
-
- if (e.hasAttribute("Notes")) {
- t.setNotes(e.getAttribute("Notes"));
- } else {
- t.setNotes("");
- }
- if (e.hasAttribute("Elapsed")) {
- t.setElapsedTime(e.getAttribute("Elapsed"));
- } else {
- t.setElapsedTime("");
- }
- if (e.hasAttribute("Estimated")) {
- t.setEstimatedTime(e.getAttribute("Estimated"));
- } else {
- t.setEstimatedTime("");
- }
-
- int i = 0;
- while (e.hasAttribute("link"+i)) {
- t.getRelatedLinks().add(e.getAttribute("link"+i));
- i++;
- }
-
- if (!readVersion.equals("1.0.0")) {
- // for newer revisions
- // XXX: readVersion had to be read once to remove warning..
- }
-
- i = 0;
- NodeList list = e.getChildNodes();
- for (i = 0; i < list.getLength(); i++) {
- Node child = list.item(i);
- t.addSubtask(readTask(child, t, tlist));
- }
- if (root != null) {
- t.setParent(root);
- }
- return t;
- }
-}
-

Back to the top