Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteffen Pingel2012-03-22 11:58:37 -0400
committerSteffen Pingel2012-03-22 11:58:37 -0400
commitccda8d54bb81cd9277641100b3b7802cb0b1f2b3 (patch)
treef296f24e99db6eb28145772d1efbbd36d03d64e6
parent7dc0725dc8f833e150ed0ad5a864d6af60a8ecb3 (diff)
downloadorg.eclipse.mylyn.incubator-ccda8d54bb81cd9277641100b3b7802cb0b1f2b3.tar.gz
org.eclipse.mylyn.incubator-ccda8d54bb81cd9277641100b3b7802cb0b1f2b3.tar.xz
org.eclipse.mylyn.incubator-ccda8d54bb81cd9277641100b3b7802cb0b1f2b3.zip
NEW - bug 374506: remove deprecated internal provisional classes
https://bugs.eclipse.org/bugs/show_bug.cgi?id=374506
-rw-r--r--org.eclipse.mylyn.ide.dev/developer/archive/contributors.html156
-rw-r--r--org.eclipse.mylyn.ide.dev/developer/archive/issue-trackers.html205
-rw-r--r--org.eclipse.mylyn.ide.dev/developer/archive/tests-manual.html226
-rw-r--r--org.eclipse.mylyn.ide.dev/developer/src-old/AbstractHyperlinkDetector.java37
-rw-r--r--org.eclipse.mylyn.ide.dev/developer/src-old/AbstractQueryHit.java193
-rw-r--r--org.eclipse.mylyn.ide.dev/developer/src-old/AwtExample.java229
-rw-r--r--org.eclipse.mylyn.ide.dev/developer/src-old/BugzillaHyperLinkDetector.java202
-rw-r--r--org.eclipse.mylyn.ide.dev/developer/src-old/BugzillaReportElement.java118
-rw-r--r--org.eclipse.mylyn.ide.dev/developer/src-old/BugzillaTaskHandler.java272
-rw-r--r--org.eclipse.mylyn.ide.dev/developer/src-old/BugzillaTaskListManager.java84
-rw-r--r--org.eclipse.mylyn.ide.dev/developer/src-old/ChartTest.java69
-rw-r--r--org.eclipse.mylyn.ide.dev/developer/src-old/CommitContextAction.java64
-rw-r--r--org.eclipse.mylyn.ide.dev/developer/src-old/DoiDecoratingTableLabelProvider.java88
-rw-r--r--org.eclipse.mylyn.ide.dev/developer/src-old/EditorListener.java48
-rw-r--r--org.eclipse.mylyn.ide.dev/developer/src-old/EditorPageListener.java43
-rw-r--r--org.eclipse.mylyn.ide.dev/developer/src-old/ExplorerFilteredTree.java68
-rw-r--r--org.eclipse.mylyn.ide.dev/developer/src-old/FilteringNavigatorView.java44
-rw-r--r--org.eclipse.mylyn.ide.dev/developer/src-old/FluidPrototyping.java41
-rw-r--r--org.eclipse.mylyn.ide.dev/developer/src-old/IMapListener.java23
-rw-r--r--org.eclipse.mylyn.ide.dev/developer/src-old/Interest.java32
-rw-r--r--org.eclipse.mylyn.ide.dev/developer/src-old/JavaStackTraceHyperlinkAdapter.java144
-rw-r--r--org.eclipse.mylyn.ide.dev/developer/src-old/MylarJavaElementDescriptor.java82
-rw-r--r--org.eclipse.mylyn.ide.dev/developer/src-old/NewLocalTaskAction.java109
-rw-r--r--org.eclipse.mylyn.ide.dev/developer/src-old/PackageExplorerManager.java164
-rw-r--r--org.eclipse.mylyn.ide.dev/developer/src-old/ProblemsListInterestSorter.java88
-rw-r--r--org.eclipse.mylyn.ide.dev/developer/src-old/RelativePathUtil.java41
-rw-r--r--org.eclipse.mylyn.ide.dev/developer/src-old/RemoveFromContextAction.java105
-rw-r--r--org.eclipse.mylyn.ide.dev/developer/src-old/RepositoryAwareStatusHandler.java79
-rw-r--r--org.eclipse.mylyn.ide.dev/developer/src-old/Scatch.jpage179
-rw-r--r--org.eclipse.mylyn.ide.dev/developer/src-old/SynchronizeChangedTasksJob.java89
-rw-r--r--org.eclipse.mylyn.ide.dev/developer/src-old/TaskActivityTimer.java129
-rw-r--r--org.eclipse.mylyn.ide.dev/developer/src-old/TaskActivityTimingTest.java176
-rw-r--r--org.eclipse.mylyn.ide.dev/developer/src-old/TaskListBackupManager.java350
-rw-r--r--org.eclipse.mylyn.ide.dev/developer/src-old/TaskListDataMigration.java261
-rw-r--r--org.eclipse.mylyn.ide.dev/developer/src-old/TaskListSaveManager.java352
-rw-r--r--org.eclipse.mylyn.ide.dev/developer/src-old/TaskRepositoriesTableLabelProvider.java73
-rw-r--r--org.eclipse.mylyn.ide.dev/developer/src-old/TaskTest.java139
-rw-r--r--org.eclipse.mylyn.ide.dev/developer/src-old/TaskscapeVizView.java195
-rw-r--r--org.eclipse.mylyn.ide.dev/developer/src-old/TimingStuff.jpage16
-rw-r--r--org.eclipse.mylyn.ide.dev/developer/src-old/UserSelectionMonitor.java94
-rw-r--r--org.eclipse.mylyn.ide.dev/developer/src-old/bugs/BugzillaActiveSearchTest.java339
-rw-r--r--org.eclipse.mylyn.ide.dev/developer/src-old/bugs/BugzillaContextLabelProvider.java71
-rw-r--r--org.eclipse.mylyn.ide.dev/developer/src-old/bugs/BugzillaEditingMonitor.java46
-rw-r--r--org.eclipse.mylyn.ide.dev/developer/src-old/bugs/BugzillaMylynSearch.java188
-rw-r--r--org.eclipse.mylyn.ide.dev/developer/src-old/bugs/BugzillaMylynSearchJob.java104
-rw-r--r--org.eclipse.mylyn.ide.dev/developer/src-old/bugs/BugzillaMylynSearchOperation.java540
-rw-r--r--org.eclipse.mylyn.ide.dev/developer/src-old/bugs/BugzillaReferencesProvider.java199
-rw-r--r--org.eclipse.mylyn.ide.dev/developer/src-old/bugs/BugzillaReportInfo.java189
-rw-r--r--org.eclipse.mylyn.ide.dev/developer/src-old/bugs/BugzillaSearchEngine.java545
-rw-r--r--org.eclipse.mylyn.ide.dev/developer/src-old/bugs/BugzillaSearchManager.java152
-rw-r--r--org.eclipse.mylyn.ide.dev/developer/src-old/bugs/BugzillaStructureBridge.java140
-rw-r--r--org.eclipse.mylyn.ide.dev/developer/src-old/bugs/BugzillaUiBridge.java139
-rw-r--r--org.eclipse.mylyn.ide.dev/developer/src-old/bugs/IBugzillaSearchOperation.java53
-rw-r--r--org.eclipse.mylyn.ide.dev/developer/src-old/bugs/MylynBugsManager.java96
-rw-r--r--org.eclipse.mylyn.ide.dev/developer/src-old/bugs/ProgressQueryHitCollector.java152
-rw-r--r--org.eclipse.mylyn.ide.dev/developer/src-old/bugs/Util.java220
-rw-r--r--org.eclipse.mylyn.ide.dev/developer/src-old/bugzilla/AbstractBugzillaReportWizard.java238
-rw-r--r--org.eclipse.mylyn.ide.dev/developer/src-old/bugzilla/AbstractBugzillaWizardPage.java780
-rw-r--r--org.eclipse.mylyn.ide.dev/developer/src-old/bugzilla/AbstractFavoritesAction.java53
-rw-r--r--org.eclipse.mylyn.ide.dev/developer/src-old/bugzilla/AbstractOfflineReportsAction.java54
-rw-r--r--org.eclipse.mylyn.ide.dev/developer/src-old/bugzilla/AbstractWizardListPage.java200
-rw-r--r--org.eclipse.mylyn.ide.dev/developer/src-old/bugzilla/AddFavoriteAction.java123
-rw-r--r--org.eclipse.mylyn.ide.dev/developer/src-old/bugzilla/AttachmentPartSource.java43
-rw-r--r--org.eclipse.mylyn.ide.dev/developer/src-old/bugzilla/BugParser.java1107
-rw-r--r--org.eclipse.mylyn.ide.dev/developer/src-old/bugzilla/BugSubmissionHandler.java186
-rw-r--r--org.eclipse.mylyn.ide.dev/developer/src-old/bugzilla/Bugzilla220ParserTest.java92
-rw-r--r--org.eclipse.mylyn.ide.dev/developer/src-old/bugzilla/BugzillaAttributeFactory.java161
-rw-r--r--org.eclipse.mylyn.ide.dev/developer/src-old/bugzilla/BugzillaCategorySearchOperation.java163
-rw-r--r--org.eclipse.mylyn.ide.dev/developer/src-old/bugzilla/BugzillaCompareInput.java121
-rw-r--r--org.eclipse.mylyn.ide.dev/developer/src-old/bugzilla/BugzillaCompareNode.java284
-rw-r--r--org.eclipse.mylyn.ide.dev/developer/src-old/bugzilla/BugzillaCompareStructureCreator.java76
-rw-r--r--org.eclipse.mylyn.ide.dev/developer/src-old/bugzilla/BugzillaException.java67
-rw-r--r--org.eclipse.mylyn.ide.dev/developer/src-old/bugzilla/BugzillaHyperLink.java74
-rw-r--r--org.eclipse.mylyn.ide.dev/developer/src-old/bugzilla/BugzillaLabelProvider.java84
-rw-r--r--org.eclipse.mylyn.ide.dev/developer/src-old/bugzilla/BugzillaNewBugParserTestCDT.java213
-rw-r--r--org.eclipse.mylyn.ide.dev/developer/src-old/bugzilla/BugzillaNewBugParserTestEquinox.java219
-rw-r--r--org.eclipse.mylyn.ide.dev/developer/src-old/bugzilla/BugzillaNewBugParserTestGMT.java219
-rw-r--r--org.eclipse.mylyn.ide.dev/developer/src-old/bugzilla/BugzillaNewBugParserTestPlatform.java246
-rw-r--r--org.eclipse.mylyn.ide.dev/developer/src-old/bugzilla/BugzillaNewBugParserTestVE.java225
-rw-r--r--org.eclipse.mylyn.ide.dev/developer/src-old/bugzilla/BugzillaParserTest.java196
-rw-r--r--org.eclipse.mylyn.ide.dev/developer/src-old/bugzilla/BugzillaParserTestNoBug.java47
-rw-r--r--org.eclipse.mylyn.ide.dev/developer/src-old/bugzilla/BugzillaPreferencePage.java235
-rw-r--r--org.eclipse.mylyn.ide.dev/developer/src-old/bugzilla/BugzillaProductPage.java472
-rw-r--r--org.eclipse.mylyn.ide.dev/developer/src-old/bugzilla/BugzillaQueryHit.java53
-rw-r--r--org.eclipse.mylyn.ide.dev/developer/src-old/bugzilla/BugzillaQueryPageParser.java540
-rw-r--r--org.eclipse.mylyn.ide.dev/developer/src-old/bugzilla/BugzillaReportSubmitForm.java738
-rw-r--r--org.eclipse.mylyn.ide.dev/developer/src-old/bugzilla/BugzillaRepositoryQuery.java44
-rw-r--r--org.eclipse.mylyn.ide.dev/developer/src-old/bugzilla/BugzillaResultMatchAdapter.java71
-rw-r--r--org.eclipse.mylyn.ide.dev/developer/src-old/bugzilla/BugzillaSearchHit.java215
-rw-r--r--org.eclipse.mylyn.ide.dev/developer/src-old/bugzilla/BugzillaSearchOperation.java103
-rw-r--r--org.eclipse.mylyn.ide.dev/developer/src-old/bugzilla/BugzillaSearchQuery.java85
-rw-r--r--org.eclipse.mylyn.ide.dev/developer/src-old/bugzilla/BugzillaStackTraceDuplicateDetector.java64
-rw-r--r--org.eclipse.mylyn.ide.dev/developer/src-old/bugzilla/BugzillaStackTraceTest.java196
-rw-r--r--org.eclipse.mylyn.ide.dev/developer/src-old/bugzilla/BugzillaTask.java73
-rw-r--r--org.eclipse.mylyn.ide.dev/developer/src-old/bugzilla/BugzillaTaskEditor.java822
-rw-r--r--org.eclipse.mylyn.ide.dev/developer/src-old/bugzilla/BugzillaTaskEditorFactory.java85
-rw-r--r--org.eclipse.mylyn.ide.dev/developer/src-old/bugzilla/BugzillaTaskEditorInput.java81
-rw-r--r--org.eclipse.mylyn.ide.dev/developer/src-old/bugzilla/BugzillaTaskHyperlinkDetector.java91
-rw-r--r--org.eclipse.mylyn.ide.dev/developer/src-old/bugzilla/BugzillaTaskListFactory.java104
-rw-r--r--org.eclipse.mylyn.ide.dev/developer/src-old/bugzilla/CreateBugzillaTaskAction.java113
-rw-r--r--org.eclipse.mylyn.ide.dev/developer/src-old/bugzilla/DeleteFavoriteAction.java70
-rw-r--r--org.eclipse.mylyn.ide.dev/developer/src-old/bugzilla/DummySearchHitProvider.java33
-rw-r--r--org.eclipse.mylyn.ide.dev/developer/src-old/bugzilla/Favorite.java113
-rw-r--r--org.eclipse.mylyn.ide.dev/developer/src-old/bugzilla/FavoritesFile.java316
-rw-r--r--org.eclipse.mylyn.ide.dev/developer/src-old/bugzilla/FavoritesView.java574
-rw-r--r--org.eclipse.mylyn.ide.dev/developer/src-old/bugzilla/GetQueryDialog.java201
-rw-r--r--org.eclipse.mylyn.ide.dev/developer/src-old/bugzilla/IBugzillaSearchResultCollector.java76
-rw-r--r--org.eclipse.mylyn.ide.dev/developer/src-old/bugzilla/KeywordParser.java155
-rw-r--r--org.eclipse.mylyn.ide.dev/developer/src-old/bugzilla/NewBugParser.java427
-rw-r--r--org.eclipse.mylyn.ide.dev/developer/src-old/bugzilla/NewBugWizardTest.java98
-rw-r--r--org.eclipse.mylyn.ide.dev/developer/src-old/bugzilla/NewBugzillaTaskData.java183
-rw-r--r--org.eclipse.mylyn.ide.dev/developer/src-old/bugzilla/NewBugzillaTaskEditor.java252
-rw-r--r--org.eclipse.mylyn.ide.dev/developer/src-old/bugzilla/OpenBugzillaReportJob.java48
-rw-r--r--org.eclipse.mylyn.ide.dev/developer/src-old/bugzilla/RegularExpressionMatchTest.java87
-rw-r--r--org.eclipse.mylyn.ide.dev/developer/src-old/bugzilla/RepositoryConfiguration.java407
-rw-r--r--org.eclipse.mylyn.ide.dev/developer/src-old/bugzilla/RepositoryReportFactory.java53
-rw-r--r--org.eclipse.mylyn.ide.dev/developer/src-old/bugzilla/SaveQueryDialog.java90
-rw-r--r--org.eclipse.mylyn.ide.dev/developer/src-old/bugzilla/SavedQueryFile.java256
-rw-r--r--org.eclipse.mylyn.ide.dev/developer/src-old/bugzilla/SaxBugReportContentHandler.java291
-rw-r--r--org.eclipse.mylyn.ide.dev/developer/src-old/bugzilla/SaxConfigurationContentHandler.java437
-rw-r--r--org.eclipse.mylyn.ide.dev/developer/src-old/bugzilla/SaxConfigurationContentHandlerOLD.java399
-rw-r--r--org.eclipse.mylyn.ide.dev/developer/src-old/bugzilla/TaskListNotificationManagerTest.java137
-rw-r--r--org.eclipse.mylyn.ide.dev/developer/src-old/bugzilla/ViewBugzillaAction.java68
-rw-r--r--org.eclipse.mylyn.ide.dev/developer/src-old/bugzilla/ViewFavoriteAction.java58
-rw-r--r--org.eclipse.mylyn.ide.dev/developer/src-old/bugzilla/ViewOfflineReportAction.java88
-rw-r--r--org.eclipse.mylyn.ide.dev/developer/src-old/bugzilla/WizardAttributesPage.java33
-rw-r--r--org.eclipse.mylyn.ide.dev/developer/src-old/editors/AbstractNewRepositoryTaskEditor.java534
-rw-r--r--org.eclipse.mylyn.ide.dev/developer/src-old/editors/AbstractRepositoryQueryWizard.java74
-rw-r--r--org.eclipse.mylyn.ide.dev/developer/src-old/editors/AbstractRepositoryTaskEditor.java4051
-rw-r--r--org.eclipse.mylyn.ide.dev/developer/src-old/editors/AbstractRepositoryTaskEditorInput.java133
-rw-r--r--org.eclipse.mylyn.ide.dev/developer/src-old/editors/AbstractTaskEditorFactory.java53
-rw-r--r--org.eclipse.mylyn.ide.dev/developer/src-old/editors/AutoFoldingStructureProvider.java944
-rw-r--r--org.eclipse.mylyn.ide.dev/developer/src-old/editors/ContentOutlineTools.java69
-rw-r--r--org.eclipse.mylyn.ide.dev/developer/src-old/editors/MylarClassFileEditor.java148
-rw-r--r--org.eclipse.mylyn.ide.dev/developer/src-old/editors/NewTaskEditorInput.java54
-rw-r--r--org.eclipse.mylyn.ide.dev/developer/src-old/editors/RepositoryTaskEditorCopyAction.java48
-rw-r--r--org.eclipse.mylyn.ide.dev/developer/src-old/editors/RepositoryTaskEditorDropListener.java167
-rw-r--r--org.eclipse.mylyn.ide.dev/developer/src-old/editors/RepositoryTaskEditorInput.java109
-rw-r--r--org.eclipse.mylyn.ide.dev/developer/src-old/editors/RepositoryTaskOutlineComparer.java45
-rw-r--r--org.eclipse.mylyn.ide.dev/developer/src-old/editors/RepositoryTaskOutlineNode.java338
-rw-r--r--org.eclipse.mylyn.ide.dev/developer/src-old/editors/RepositoryTaskOutlinePage.java208
-rw-r--r--org.eclipse.mylyn.ide.dev/developer/src-old/editors/TaskEditorUrlHyperlinkDetector.java113
-rw-r--r--org.eclipse.mylyn.ide.dev/developer/src-old/editors/TaskFactory.java183
-rw-r--r--org.eclipse.mylyn.ide.dev/developer/src-old/editors/TaskSpellingReconcileStrategy.java193
-rw-r--r--org.eclipse.mylyn.ide.dev/developer/src-old/editors/plugin-scraps.xml8
-rw-r--r--org.eclipse.mylyn.ide.dev/developer/src-old/hypertext/RelatedLinks.java46
-rw-r--r--org.eclipse.mylyn.ide.dev/developer/src-old/hypertext/WebElementsEditor.java480
-rw-r--r--org.eclipse.mylyn.ide.dev/developer/src-old/hypertext/WebElementsEditorFactory.java51
-rw-r--r--org.eclipse.mylyn.ide.dev/developer/src-old/hypertext/WebElementsEditorInput.java55
-rw-r--r--org.eclipse.mylyn.ide.dev/developer/src-old/hypertext/WebResourceContentProvider.java104
-rw-r--r--org.eclipse.mylyn.ide.dev/developer/src-old/hypertext/WebResourceLabelProvider.java59
-rw-r--r--org.eclipse.mylyn.ide.dev/developer/src-old/jira/JiraIssueContentOutlinePage.java136
-rw-r--r--org.eclipse.mylyn.ide.dev/developer/src-old/jira/JiraIssueEditorInput.java99
-rw-r--r--org.eclipse.mylyn.ide.dev/developer/src-old/jira/JiraTaskEditor.java419
-rw-r--r--org.eclipse.mylyn.ide.dev/developer/src-old/monitor/CardinalStatistic.java66
-rw-r--r--org.eclipse.mylyn.ide.dev/developer/src-old/monitor/PassiveTimer.java34
-rw-r--r--org.eclipse.mylyn.ide.dev/developer/src-old/monitor/SelectionMonitor.java174
-rw-r--r--org.eclipse.mylyn.ide.dev/developer/src-old/monitor/TemporalStatistic.java61
-rw-r--r--org.eclipse.mylyn.ide.dev/developer/src-old/monitor/UsageCountView.java62
-rw-r--r--org.eclipse.mylyn.ide.dev/developer/src-old/monitor/UsageSession.java337
-rw-r--r--org.eclipse.mylyn.ide.dev/developer/src-old/monitor/UsageStatistic.java53
-rw-r--r--org.eclipse.mylyn.ide.dev/developer/src-old/tasks/AbstractTaskListFactory.java184
-rw-r--r--org.eclipse.mylyn.ide.dev/developer/src-old/tasks/ITaskDataStorage.java54
-rw-r--r--org.eclipse.mylyn.ide.dev/developer/src-old/tasks/OfflineCachingStorage.java324
-rw-r--r--org.eclipse.mylyn.ide.dev/developer/src-old/tasks/OfflineDataStore.java69
-rw-r--r--org.eclipse.mylyn.ide.dev/developer/src-old/tasks/OfflineFileStorage.java726
-rw-r--r--org.eclipse.mylyn.ide.dev/developer/src-old/tasks/TaskDataStorageManager.java357
-rw-r--r--org.eclipse.mylyn.ide.dev/developer/src-old/tests/BugzillaTaskDataMigrationTest.java35
-rw-r--r--org.eclipse.mylyn.ide.dev/developer/src-old/tests/Job.java87
-rw-r--r--org.eclipse.mylyn.ide.dev/developer/src-old/tests/People.java67
-rw-r--r--org.eclipse.mylyn.ide.dev/developer/src-old/tests/Person.java107
-rw-r--r--org.eclipse.mylyn.ide.dev/developer/src-old/trac/RepositorySearchQuery.java88
-rw-r--r--org.eclipse.mylyn.ide.dev/developer/src-old/views/ActiveTaskscapeView.java207
-rw-r--r--org.eclipse.mylyn.ide.dev/developer/src-old/views/DoiViewerFilter.java123
-rw-r--r--org.eclipse.mylyn.ide.dev/developer/src-old/views/ImageTableCellEditor.java215
-rw-r--r--org.eclipse.mylyn.ide.dev/developer/src-old/views/MylarFontDecoratingJavaLabelProvider.java47
-rw-r--r--org.eclipse.mylyn.ide.dev/developer/src-old/views/MylarJavaOutlinePage.java1433
-rw-r--r--org.eclipse.mylyn.ide.dev/developer/src-old/views/MylarMonitorView.java178
-rw-r--r--org.eclipse.mylyn.ide.dev/developer/src-old/views/MylarPackageExplorer.java174
-rw-r--r--org.eclipse.mylyn.ide.dev/developer/src-old/views/MylarProblemView.java289
-rw-r--r--org.eclipse.mylyn.ide.dev/developer/src-old/views/NextTaskDropDownAction.java59
-rw-r--r--org.eclipse.mylyn.ide.dev/developer/src-old/views/ProblemsFieldDoi.java90
-rw-r--r--org.eclipse.mylyn.ide.dev/developer/src-old/views/ProblemsFieldJavaElement.java109
-rw-r--r--org.eclipse.mylyn.ide.dev/developer/src-old/views/ProblemsListFilter.java39
-rw-r--r--org.eclipse.mylyn.ide.dev/developer/src-old/views/TaskListDropTargetListener.java73
-rw-r--r--org.eclipse.mylyn.ide.dev/developer/src-old/views/TaskListToolTipHandler.java569
-rw-r--r--org.eclipse.mylyn.ide.dev/developer/src-old/views/ToggleAutoManagerExplorerAction.java59
-rw-r--r--org.eclipse.mylyn.ide.dev/developer/src-old/views/ToggleAutoManagerProblemsAction.java61
-rw-r--r--org.eclipse.mylyn.ide.dev/developer/src-old/views/ToggleFilterDeclarationsAction.java64
-rw-r--r--org.eclipse.mylyn.ide.dev/developer/src-old/views/UsageStatisticsView.java123
-rw-r--r--org.eclipse.mylyn.ide.dev/developer/src-old/views/pugin-scraps.xml361
191 files changed, 0 insertions, 38765 deletions
diff --git a/org.eclipse.mylyn.ide.dev/developer/archive/contributors.html b/org.eclipse.mylyn.ide.dev/developer/archive/contributors.html
deleted file mode 100644
index 3c02db93..00000000
--- a/org.eclipse.mylyn.ide.dev/developer/archive/contributors.html
+++ /dev/null
@@ -1,156 +0,0 @@
-<HTML>
-<HEAD>
- <META HTTP-EQUIV="EXPIRES" CONTENT="0">
- <META HTTP-EQUIV="" CONTENT="">
- <TITLE>Mylar</TITLE>
-<style>
-<!--
-
-/********************************************************************
- * TOP LEVEL
- ********************************************************************/
-A:link { color:#4756AC; }
-A:visited { color:#4756AC; }
-/* A:visited { color:#60657B; } */
-A:hover { color:#711616}
-BODY {
- background-color:white;
- margin-left: 10px;
-}
-P {
- font:13px Verdana, Arial, Helvetica, sans-serif;
- margin-right: 10px;
- margin-left: 10px;
-}
-
-PRE { font:13px "Courier", sans-serif; }
-
-/********************************************************************
- * SPAN LEVEL
- ********************************************************************/
-
-B { font-weight:bold; }
-STRONG { font-weight:bold; }
-CODE { font:13px "Courier", sans-serif; }
-
-/********************************************************************
- * HEADINGS
- ********************************************************************/
-H1 { font:20px Verdana, Helvetica, sans-serif;
- color:black;
- font-weight:bold;
- margin-left: 10px;
-}
-
-H2 { font:18px Verdana, Arial, Helvetica, sans-serif;
- color:black;
- font-weight:bold;
- margin-left: 10px;
-}
-
-H3 { font:16px Verdana, Arial, Helvetica, sans-serif;
- color:black;
- font-weight:bold;
- margin-left: 10px;
-}
-H4 { font:13px Verdana, Arial, Helvetica, sans-serif;
- color:black;
- font-weight:bold;
- margin-left: 10px;
-}
-
-/********************************************************************
- * LISTS & TABLES
- ********************************************************************/
-LI { font:13px Verdana, Arial, Helvetica, sans-serif; }
-
-UL { font:13px Verdana, Arial, Helvetica, sans-serif; }
-
-OL { font:13px Verdana, Arial, Helvetica, sans-serif; }
-DT { font:13px Verdana, Arial, Helvetica, sans-serif; font-weight:bold; }
-DD { font:13px Verdana, Arial, Helvetica, sans-serif; }
-
-TD { font:13px Verdana, Arial, Helvetica, sans-serif; }
-
-TH { font:13px Verdana, Arial, Helvetica, sans-serif;
- font-weight:bold;
- text-align:center;
-}
-
-
-/********************************************************************
- * FORMS
- ********************************************************************/
-
-.searchInput { color: #666666; border: 1px solid; background: none;
- font:11px Verdana, Arial, Helvetica, sans-serif;
- padding-left: 3; padding-top: 2; padding-bottom: 3; }
-
-/********************************************************************
- * CLASSES *
- ********************************************************************/
-
-.navBarSection { font:10px Verdana, Arial, Helvetica, sans-serif; font-weight:bold;}
-
-.navBarSubSection { font:10px Verdana, Arial, Helvetica, sans-serif; }
-.fancyHeading { font:20px Chantilly, Arial, Helvetica, sans-serif;
- margin-right: 10px;
- color:#6f7a92;
- margin-left: 10px;
-}
-
-.indentedParagraph { font:13px Verdana, Arial, Helvetica, sans-serif;
- margin-right: 10px;
- text-align:left;
- margin-left: 30px;
-}
-
-.footer {
- font:10px Verdana, Arial, Helvetica, sans-serif;
- color:#888888;
- text-align:left
-}
-
-.figureTitle { font:13px Verdana, Arial, Helvetica, sans-serif;
- text-align:justify;
- text-align:center
-}
-
-.copyrightNotice { font:10px Verdana, Arial, Helvetica, sans-serif; color:#999999; }
-
-.smallHeading { font:13px Verdana, Arial, Helvetica, sans-serif; font-weight:bold; }
-
-.tinyHeading { font:11px Verdana, Arial, Helvetica, sans-serif; font-weight:bold; }
-
-.newsText { font:11px Verdana, Arial, Helvetica, sans-serif; }
-
-.smallParagraph { font:11px Verdana, Arial, Helvetica, sans-serif; }
-
-.code { }
-
-.command { }
-
-.codeindent { margin-left: 30px; }
-
-.commandindent { margin-left: 30px; }
--->
-</style>
-
-<SCRIPT>
- </SCRIPT>
-</HEAD>
-<BODY LINK="#4756AC" VLINK="#60657B" BGCOLOR="#FFFFFF">
-
- <p>Non-committer contributions to Mylar (last updated June 17, 2005)</p>
- <ul>
- <li>org.eclipse.mylar.tasks<ul>
- <li>Ken Sueda (<a href="mailto:ksueda@cs.ubc.ca">ksueda@cs.ubc.ca</a>)<ul>
- <li>2005-06-17: contributed task serialization as xml and
- improvements to task list view</li>
- </ul>
- </li>
- </ul>
- </li>
- </ul>
- </body>
-</html> \ No newline at end of file
diff --git a/org.eclipse.mylyn.ide.dev/developer/archive/issue-trackers.html b/org.eclipse.mylyn.ide.dev/developer/archive/issue-trackers.html
deleted file mode 100644
index a928c883..00000000
--- a/org.eclipse.mylyn.ide.dev/developer/archive/issue-trackers.html
+++ /dev/null
@@ -1,205 +0,0 @@
-<html>
-
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
-<title>Mylar Issue Tracker Requirements</title>
-</head>
-
-<body>
-
-<div id="globalWrapper">
- <div id="column-content">
- <div id="content">
- <h1 class="firstHeading">Mylar Issue Tracker Requirements</h1>
- <div id="bodyContent">
- History
- <ul>
- <li>2005-11-25: Initial draft (Brock Janiczak and Mik
- Kersten) </li>
- </ul>
- <p><b>General</b> </p>
- <ul>
- <li>Associate a repository with a project, credentials
- stored in keyring. UI is a project properties page specified
- by provider.
- </li>
- <li>Possibly provide view showing all repositories, where
- each provider can populate repository nodes with contets
- (e.g. products, reports).
- </li>
- <li>Should be able to discover new repositories by checking
- out a project.
- <ul>
- <li>Mik: Brock, could you provide more detail on this
- one? </li>
- <li><font color="#6600cc">Consider the case of a user
- that is new to a project.&nbsp; It would be really nice if
- all they had to do was check out a project from CVS/SVN
- and the tracker instance is created and associated with
- the project automatically.&nbsp; I was expecting to store
- this information as a project scoped preference (so it
- can be checked in to version control).&nbsp; Another option
- is to have a a file (like the team PSF file) that can be
- imported to create the required tracker instances and
- attempt to connect each project to its appropriate
- instance.</font> </li>
- <li><font color="#6600cc">Also, most issue trackers have
- some way to partition bugs into groups (that can relate
- to a project atrifact).&nbsp; It would be nice if this could
- also be associated with the project so when an issue is
- created in the context of a project the component (or
- whatever your tracker calls it) can be defaulted.</font>
- </li>
- </ul>
- <p>&nbsp;</li>
- <li>No coupling to mylar core or UI. </li>
- </ul>
- <p><b>Queries</b> </p>
- <ul>
- <li>Provide a general notion of a query and parameters, hits
- returned, and a persistance mechanism (a first cut at this
- is already in mylar.tasklist).
- </li>
- <li>Provide incoming/outgoing status notification. </li>
- </ul>
- <p><b>Editing Reports</b> </p>
- <ul>
- <li>Basic mode of embedding browser when opening issue.
- </li>
- <li>Generic issue editor similar to Mylar's Bugzilla one,
- based on attributes and comments. </li>
- </ul>
- <p><b>Text</b> </p>
- <ul>
- <li>Hyperlink issue number in text editors.
- <ul>
- <li>Brock: Berhaps we could have Team support for this?
- SVN could store the info in properties and CVS in a
- file.
- </li>
- <li>Mik: isn't it enough just to look up the repository
- associated with the project? </li>
- <li><font color="#6600cc">It is possible to open a
- resource directly from the history view or the
- repository view.&nbsp; In these cases there is no project.</font></li>
- </ul>
- </li>
- </ul>
- <p><b>Source Repositories</b> </p>
- <ul>
- <li>Provide hyperlink support in the history view
- <ul>
- <li>Mik: This may be better as a popup action, which
- Mylar already has. But hyperlink could work as well.
- </li>
- <li><font color="#6600cc">A popup action is fine when
- there is only one bug referenced in the commit comment,
- but some people (like myself) sometimes check in a
- change that relates to multiple issues.&nbsp; I probably
- shouldn't, but i do :)</font></li>
- </ul>
- </li>
- <li>Populate commit comment with issue details.
- <ul>
- <li>Brock: (Possible use the new template stuff? Ie a
- dynamic template)
- </li>
- <li><font color="#6600cc">Just clarifying this as it
- makes no sense at all...&nbsp; In 3.2 CVS supports static
- templates.&nbsp; The user just creates a chunk of text and it
- can be added into the commit dialog.&nbsp; I can't see why
- this template support can't be updated to support
- 'active' templates.&nbsp; You select a 'bug' template and a
- dialog pops up asking you to enter (or search for) a
- bug.&nbsp; These values will then be inserted into the
- template before it is added to the commit dialog.&nbsp; I
- think this would be of more value than the current
- static templates.&nbsp; I would be willing to look at
- providing a patch to Team/CVS for this one.&nbsp; btw, I will
- try and convince them to push it down to the Team level
- so the same templates can be used for all team providers
- (it seems to make sense).</font></li>
- </ul>
- </li>
- <li>Perform some sort of Issue workflow action on commit
- (probably resolve)
- <ul>
- <li>Brock: CVS has no support for any of this yet. They
- would probably accept patches for most of this. If some
- of this could be moved to Team, even better. All
- repositories have a commit process and all have a
- revision history.
- </li>
- <li><font color="#6600cc">again, what was I on?&nbsp; I
- basically wanted a post commit hook so we could perform
- an action against the issue tracker.&nbsp; The obvious thing
- to do is comment/resolve an issue.&nbsp; Perhaps i was asking
- for a team level commit dialog???</font></li>
- </ul>
- </li>
- </ul>
- <p><b>Mylar</b> </p>
- <ul>
- <li>What are the requirements for Mylar?
- <ul>
- <li>Brock: It really only needs to get a list of issue
- from a query. The query implementation and UI need to be
- provider specific unless the query is always &quot;my bugs&quot;.
- I don't see a problem with adding a Mylar/Issue Tracker
- bridge to do this.
- </li>
- <li>Mik: The main thing Mylar needs is for there to be a
- single high quality Tasks view that makes it easy to
- work with local tasks, reports, and queries, and for
- that to be consisntent across providers. What it layers
- on to that is the ability to activate contexts. It also
- needs a mechanism for attaching context to issues, and
- retrieving them from issues. From a source and feature
- perspective the task functionality should be decoupled
- from Mylar (and it is, i.e. you can use the Mylar Tasks
- view and Bugzilla support without the Mylar UI). But
- Mylar is all about a very task-centric view of the
- world, and as such the UIs will be highly
- interdependent. </li>
- <li><font color="#6600cc">I am not sure how to support
- local issues yet.&nbsp; It is almost as if we need another
- view to show local issues (the platform task view would
- be perfect)</font><br>
-&nbsp;</li>
- <li><font color="#6600cc">I have been thinking about the
- best way to structure the UI.&nbsp; The issue tracker as it
- currently stands is no good.&nbsp; I was considering having
- two separate views; A &quot;Repository browser&quot; and an issue
- list.&nbsp; The common navigator stuff that is coming for 3.2
- would be perfect for the repository browser.&nbsp; We could
- have a top level (project level) item for the issue
- trackers as well as a node in each project that has an
- attached provider.&nbsp; This seems to be a more logical
- thing to do and puts the issue information right where
- the user needs it.</font></li>
- </ul>
- </li>
- </ul>
- <p><b>Use Cases</b> </p>
- <ul>
- <li>Work with bugs and queries within Eclipse.
- </li>
- <li>Work with Mylar's task contexts (layers on above). </li>
- <li><font color="#6600cc">As a user, one thing i would
- *love* is to have a list of active searches.&nbsp; These will
- update every so often and let me know when there are new
- matches (or changes).&nbsp; This way i don't have to be
- distracted by emails.&nbsp; Being able to switch between a set of
- issues without re-running the query would also be nice.</font></li>
- </ul>
- <!-- Saved in parser cache with key wiki:pcache:idhash:1317-0!1!0!0!!en!2 and timestamp 20051130154503 -->
- <div class="printfooter">
-&nbsp;</div>
- <!-- end content --></div>
- </div>
- </div>
-</div>
-
-</body>
-
-</html>
diff --git a/org.eclipse.mylyn.ide.dev/developer/archive/tests-manual.html b/org.eclipse.mylyn.ide.dev/developer/archive/tests-manual.html
deleted file mode 100644
index bcd019fb..00000000
--- a/org.eclipse.mylyn.ide.dev/developer/archive/tests-manual.html
+++ /dev/null
@@ -1,226 +0,0 @@
-<html>
- <body>
- <h2>&nbsp;</h2>
- <p align="center"><font size="4">DEPRECATED</font></p>
- <p><font size="4">This information is now maintained here: http://wiki.eclipse.org/index.php/Mylar_Testing</font></p>
- <h2>&nbsp;</h2>
- <h2><strike>Mylar Manual Tests</strike></h2>
- <p><b>Help</b></p>
- <ul>
- <li><b>&nbsp;</b>Help &gt; Help Contents &gt; Mylar &gt; New and Noteworthy&nbsp;&nbsp;
- [ ensure updated ]</li>
- </ul>
- <p><b>Bugzilla Client</b></p>
-
- <ul>
- <li>Offline Reports<ul>
- <li><font color="#FF6600">Ensure that when a bug report is opened offline that has no offline
- data the bug page reads: &quot;Repository task data not available, please
- synchronize.&quot; (Aug 17, 2006 [0.6.2] page reads &quot;Could not download
- task data...&quot;</font></li>
- <li>In the case of migration ensure that offline reports still open correctly (if not
- lost completely).</li>
- </ul>
- </li>
- <li>Editor Hyperlinking - URL Hyperlinks, Bug hyperlinks (bug# 123, bug 12312,
- task# 1, task 12, duplicate bug links), stack trace links</li>
- <li>Editor menu/commands - Cut/Copy/Paste/Select-all&nbsp; from menu and
- using shortcut keys</li>
- <li>Repository Search&nbsp;&nbsp; (Search &gt; Search... &gt; Repository Search tab)<ul>
- <li>Repository search page<ul>
- <li>Ensure warning if no repository exists.</li>
- <li>Cycle through available repository search pages ensuring
- that they populate with the last search performed on the
- respective repository</li>
- <li>Ensure other repository types search pages appear when
- selected</li>
- </ul></li>
- <li>Repository Search Results View<ul>
- <li>Test opening non-local report (Bug should open in bugzilla
- editor (blue bin icon) and the browser tab should be available)</li>
- <li>Test opening report with local data (Bug should open in
- bugzilla editor (clipboard with blue bin overlay icon) and the
- Planning tab and Browser tab should be available)</li>
- </ul></li>
- </ul></li>
- <li>Bugzilla Query Wizard</li> (Tasklist)<ul>
- <li>Create new query</li>
- <li>Open query to see that parameters are still there</li>
- <li>Check for error handling (enter invalid number in max returned etc)</li>
- </ul></li>
- <li>New Bug submission (valid credentials)<ul>
- <li>Test new bug submission for each Bugzilla server version</li>
- </ul></li>
- <li>Update of Repository Configuration<ul>
- <li>Test from TaskRepositoriesView context menu</li>
- <li>Test from BugzillaProductPage</li>
- <li>A dialog should be produced in either case when an io or login
- exceptions occur.</li>
- <li>Configuration caching<ul>
- <li>Run new bug wizard, update products...</li>
- <li>Restart eclipse, rerun wizard, products should appear immediately</li>
- </ul></li>
- </ul>
- </li>
- <li>New Bug submission (invalid credentials)<ul>
- <li>Remove username and password from a repository configuration in the
- Task Repositories view</li>
- <li>Initiate new repository task action</li>
- <li>Select repository with missing credentials</li>
- <li>Upon submitting new bug editor user is
- presented with credentials error dialog</li>
- </ul></li>
- <li>New Bug submission (invalid password)<ul>
- <li>Make repository password invalid in Task Repositories view.</li>
- <li>Initiate new repository task action.</li>
- <li>Select repository with invalid password</li>
- <li>Error Dialog presented on product update or selection of Next: The
- user name or password you entered is not valid...</li>
- </ul></li>
- <li>Submission of changes to a Bugzilla report should result in all
- parent queries being re-synchronized as well as the task itself being
- synchronized</li>
- <li>Ensure submission of comment doesn't remove any depends on / blocks
- bugs</li>
- <li>Submission of changes to existing bug with invalid repository
- credentials<ul>
- <li>Mylar Bugzilla Client Dialog: Bugzilla could not post your bug since your login name or password is incorrect.
- Ensure proper repository configuration in Task Repositories view.</li>
- </ul></li>
- <li><font color="#FF6600">Bug Compare (ensure attribute compare works)
- (July 31, 2006 [0.6.1] - Compare button removed)</font></li>
- <li>Synchronize from context menu (invalid userid and password)<ul>
- <li><font color="#FF6600">Report Download Failed Dialog: Ensure proper repository
- configuration in Task Repositories view. (Aug 17, 2006 [0.6.2] -
- currently upon failure the task remains italic and if the error is
- not an io related exception it is logged.)</font></li>
- </ul></li>
- <li>Synchronizing while disconnected should not put errors in the
- eclipse log</li>
- <li>Reports &gt; Task list notification<ul>
- <li>Open, modify, save, should have outgoing decorator<ul>
- <li>Case synchronize: should get option to override local changes<ul>
- <li>If overriding, overlay and changes go away</li>
- <li>If no override, get conflict icon to show</li>
- </ul></li>
- <li>Case open: should retain outgoing overlay</li>
- <li>Case edit and save again: outgoing overlay remains (should
- not receive conflict warning)</li>
- <li>Case submit: outgoing overlay should disappear (should be no incoming
- upon synchronize)</li>
- </ul></li>
- <li>Task in CONFLICT state<ul>
- <li>Case open: remains with conflict decorator</li>
- <li>Case synchronize: should get option to override local changes<ul>
- <li>Case overriding: overlay and changes go away</li>
- <li>Case no override: changes remain, conflict decorator appears</li>
- </ul></li>
- <li>Case edit: Currently state switches to OUTGOING which is
- correct for now because we migrate their comment into the new
- report<br>&nbsp;</li>
- </ul>
- <p></li>
- <li>Query hits not yet downloaded<ul>
- <li>Case open: report downloaded (task icon appears), no decoration</li>
- <li>Case synchronize: report downloaded (task icon appears), no
- decoration<br>&nbsp;</li>
- </ul></li>
- <li>Open report&nbsp; in external editor and add a comment.<ul>
- <li>Case synchronize: incoming decoration should appear on task<ul>
- <li>Case open: task opens with new content, no decoration</li>
- <li>Case open (bug editor already open):&nbsp;
- User presented with dialog asking if they want to reopen
- with latest version</li>
- <li>Case Background Synchronization incoming state remains</li>
- </ul></li>
- <li>Case open: task opens with offline content, user asked if
- they want to refresh with incoming content.<br>&nbsp;</li>
- </ul></li>
- <li>Open, modify, save, should have outgoing decorator, open report in
- external browser, add comment<ul>
- <li>Case open: Outgoing decorator remains</li>
- <li>Case Submit: Dialog:Possible problem posting Bugzilla
- report... HTML mid-air collision dialog<ul>
- <li>Overwrite changes dialog (if yes - SYNCHRONIZED, if no -
- CONFLICT)</li>
- </ul></li>
- <li>Case synchronize: should get option to override local changes<ul>
- <li>If overriding, overlay and changes go away</li>
- <li>If no override, get conflict icon to show<br>&nbsp;</li>
- </ul></li>
- </ul></li>
- <li>Copy report to a local category, repeat above tests ensuring
- decoration always </li>
- <li>Copy report to root category, repeat tests ensuring decoration
- always matches</li>
- </ul></li>
- <li>Check that auto background synchronize works<ul>
- <li>Ensure that new hits (i.e. reports created using web ui) appear in
- query after auto sync</li>
- <li>Ensure that incoming on existing tasks appears after auto
- synchronization&nbsp;&nbsp;&nbsp; </li>
- </ul></li>
- <li>If editor open and task gets incoming, dialog
- should be presented asking if user wants to refresh and reopen.</li>
- <li>Check that if changes are made to the notes field of the Planning
- editor that save still works (editor doesn't remain dirty).</li>
- <li>Ensure that when offline reports file is deleted, tasks don't
- suddenly all have incoming status upon synchronizing</li>
- <li>Reports &gt; Outline View<ul>
- <li>Clicking on comments in outline view should cause editor to
- scroll to respective bug on page.</li>
- </ul></li>
- <li>DnD Attachments: Ensure all of the following launch the new attachment wizard with
- the appropriate file specified.
- <ul><li>Drag a file from the workspace to the attachments section or new comment box.</li>
- <li>Drag a file from a different application (or desktop) onto the attachments section
- or new comment box.</li>
- <li>Drag a region of text from any application (eg. a web browser) onto the attachments
- section or new comment box.</li>
- </ul></li>
- </ul>
- <p><b>Task List</b></p>
- <ul>
- <li>File -&gt; Export -&gt; Mylar Task Data: ensure it works</li>
- <li>File -&gt; Import -&gt; Mylar Task Data:<ul>
- <li>Test importing with task in active state</li>
- </ul>
- </li>
- <li>Make a task, make it active, move it to the
- archive (remove from root category) - file should remain visible in task list</li>
- <li>Task List Auto-Archive</li>
- <li>Addition and removal of files from change sets</li>
- <li>Mylar context sensitive JUnit unit tests</li>
- <li>Ensure internal browser tab can be disabled (via preferences)</li>
- <li>Drag and Drop<ul>
- <li>From category to category: move</li>
- <li>From query to category: copies</li>
- <li>Task to external text: copies details</li>
- <li>Task to external explorer: copies context file (<font color="#FF6600">
- July 31, 2006 [0.6.1] - if context doesn't exist need to disable drop?</font>
- )</li>
- </ul>
-
- </li>
- </ul>
-
- <p><b>SDK Integration</b></p>
- <ul>
- <li>Problems view</li>
- <li>Debug view</li>
- <li>Eclipse native tasks view</li>
- <li>History view -> context menu -> Open Corresponding Task</li>
- </ul>
-
- <p><b>Java</b></p>
- <ul>
- <li>Run JUnit context test without interesting tests: should get message</li>
- <li>Run JUnit contexts test with interesting tests, should run</li>
- <li>Do above for PDE JUnit tests</li>
- <li>Ensure code folding works properly</li>
- </ul>
- <p>PDE</p>
- <ul>
- <li>...</li>
- </ul>
-</body></html>
diff --git a/org.eclipse.mylyn.ide.dev/developer/src-old/AbstractHyperlinkDetector.java b/org.eclipse.mylyn.ide.dev/developer/src-old/AbstractHyperlinkDetector.java
deleted file mode 100644
index c00e819b..00000000
--- a/org.eclipse.mylyn.ide.dev/developer/src-old/AbstractHyperlinkDetector.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 - 2006 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.mylyn.internal.bugs.java;
-
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.ITextViewer;
-import org.eclipse.jface.text.hyperlink.IHyperlink;
-import org.eclipse.jface.text.hyperlink.IHyperlinkDetector;
-import org.eclipse.ui.texteditor.ITextEditor;
-
-/**
- * @author Mik Kersten
- */
-public abstract class AbstractHyperlinkDetector implements IHyperlinkDetector {
-
- private ITextEditor fEditor;
-
- public abstract IHyperlink[] detectHyperlinks(ITextViewer textViewer, IRegion region,
- boolean canShowMultipleHyperlinks);
-
- public ITextEditor getEditor() {
- return fEditor;
- }
-
- public void setEditor(ITextEditor editor) {
- this.fEditor = editor;
- }
-} \ No newline at end of file
diff --git a/org.eclipse.mylyn.ide.dev/developer/src-old/AbstractQueryHit.java b/org.eclipse.mylyn.ide.dev/developer/src-old/AbstractQueryHit.java
deleted file mode 100644
index 8208a99f..00000000
--- a/org.eclipse.mylyn.ide.dev/developer/src-old/AbstractQueryHit.java
+++ /dev/null
@@ -1,193 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 - 2006 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.mylyn.tasks.core;
-
-import org.eclipse.core.runtime.PlatformObject;
-import org.eclipse.mylyn.internal.tasks.core.RepositoryTaskHandleUtil;
-import org.eclipse.mylyn.tasks.core.Task.PriorityLevel;
-
-/**
- * @author Mik Kersten
- */
-/*public*/ abstract class AbstractQueryHit extends PlatformObject implements ITaskListElement {
-
- protected TaskList taskList;
-
- protected AbstractTask task;
-
- protected String repositoryUrl;
-
- protected String summary;
-
- protected String priority = PriorityLevel.getDefault().toString();
-
- protected String taskId;
-
- private boolean completed = false;
-
- private boolean isNotified = false;
-
- private AbstractRepositoryQuery parent;
-
- protected AbstractQueryHit(TaskList taskList, String repositoryUrl, String description, String taskId) {
- this.taskList = taskList;
- this.repositoryUrl = repositoryUrl;
- this.summary = description;
- this.taskId = taskId;
- }
-
- public AbstractRepositoryQuery getParent() {
- return parent;
- }
-
- public void setParent(AbstractRepositoryQuery parent) {
- this.parent = parent;
- }
-
- public String getRepositoryUrl() {
- return repositoryUrl;
- }
-
- public void setRepositoryUrl(String repositoryUrl) {
- this.repositoryUrl = repositoryUrl;
- }
-
- public String getSummary() {
- if (task != null) {
- return task.getSummary();
- } else {
- return summary;
- }
- }
-
- public AbstractTask getOrCreateCorrespondingTask() {
- if (taskList == null) {
- return null;
- }
-
- ITask existingTask = taskList.getTask(getHandleIdentifier());
- if (existingTask instanceof AbstractTask) {
- this.task = (AbstractTask) existingTask;
- } else {
- task = createTask();
- task.setCompleted(completed);
- taskList.addTask(task);
- }
- return task;
- }
-
- //@Deprecated
- protected abstract AbstractTask createTask();
-
- /**
- * @return null if there is no corresponding task
- */
- public AbstractTask getCorrespondingTask() {
- return task;
- }
-
- public void setCorrespondingTask(AbstractTask task) {
- this.task = task;
- }
-
- public boolean isCompleted() {
- if (task != null) {
- return task.isCompleted();
- } else {
- return completed;
- }
- }
-
- public void setCompleted(boolean completed) {
- this.completed = completed;
- }
-
- public final String getHandleIdentifier() {
- if (task != null) {
- return task.getHandleIdentifier();
- }
- return RepositoryTaskHandleUtil.getHandle(repositoryUrl, taskId);
- }
-
- /**
- * @return Unique identifier for this task on the corresponding server, must
- * be robust to changing attributes on the task.
- */
- public String getTaskId() {
- return taskId;
- }
-
- /**
- * @return An ID that can be presented to the user for identifying the task,
- * override to return null if no such ID exists.
- */
- public String getIdentifyingLabel() {
- return getTaskId();
- }
-
- public boolean isNotified() {
- return isNotified;
- }
-
- public void setNotified(boolean notified) {
- isNotified = notified;
- }
-
- @Override
- public boolean equals(Object obj) {
- if (!(obj instanceof AbstractQueryHit)) {
- return false;
- }
- AbstractQueryHit hit = (AbstractQueryHit) obj;
- return hit.getHandleIdentifier().equals(this.getHandleIdentifier());
- }
-
- @Override
- public int hashCode() {
- return this.getHandleIdentifier().hashCode();
- }
-
- /**
- * @return the url of the hit without any additional login information etc.
- */
- public String getUrl() {
- return "";
- }
-
- public String getPriority() {
- if (task != null) {
- return task.getPriority();
- } else {
- return priority;
- }
- }
-
- public void setPriority(String priority) {
- this.priority = priority;
- }
-
- public void setSummary(String description) {
- this.summary = description;
- }
-
- public void setHandleIdentifier(String id) {
- // ignore
- }
-
- public int compareTo(ITaskListElement taskListElement) {
- return this.taskId.compareTo(((AbstractQueryHit) taskListElement).taskId);
- }
-
- @Deprecated
- public void setTaskId(String taskId) {
- this.taskId = taskId;
- }
-}
diff --git a/org.eclipse.mylyn.ide.dev/developer/src-old/AwtExample.java b/org.eclipse.mylyn.ide.dev/developer/src-old/AwtExample.java
deleted file mode 100644
index 25bf549b..00000000
--- a/org.eclipse.mylyn.ide.dev/developer/src-old/AwtExample.java
+++ /dev/null
@@ -1,229 +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
- *******************************************************************************/
-import java.awt.EventQueue;
-import java.io.File;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.awt.SWT_AWT;
-import org.eclipse.swt.graphics.RGB;
-import org.eclipse.swt.graphics.Rectangle;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.*;
-
-public class AwtExample {
-
- public static void main(String[] args) {
- final Display display = new Display();
- final Shell shell = new Shell(display);
- shell.setText("SWT and Swing/AWT Example");
-
- Listener exitListener = new Listener() {
- public void handleEvent(Event e) {
- MessageBox dialog = new MessageBox(shell, SWT.OK | SWT.CANCEL | SWT.ICON_QUESTION);
- dialog.setText("Question");
- dialog.setMessage("Exit?");
- if (e.type == SWT.Close) e.doit = false;
- if (dialog.open() != SWT.OK) return;
- shell.dispose();
- }
- };
- Listener aboutListener = new Listener() {
- public void handleEvent(Event e) {
- final Shell s = new Shell(shell, SWT.DIALOG_TRIM | SWT.APPLICATION_MODAL);
- s.setText("About");
- GridLayout layout = new GridLayout(1, false);
- layout.verticalSpacing = 20;
- layout.marginHeight = layout.marginWidth = 10;
- s.setLayout(layout);
- Label label = new Label(s, SWT.NONE);
- label.setText("SWT and AWT Example.");
- Button button = new Button(s, SWT.PUSH);
- button.setText("OK");
- GridData data = new GridData();
- data.horizontalAlignment = GridData.CENTER;
- button.setLayoutData(data);
- button.addListener(SWT.Selection, new Listener() {
- public void handleEvent(Event e) {
- s.dispose();
- }
- });
- s.pack();
- Rectangle parentBounds = shell.getBounds();
- Rectangle bounds = s.getBounds();
- int x = parentBounds.x + (parentBounds.width - bounds.width) / 2;
- int y = parentBounds.y + (parentBounds.height - bounds.height) / 2;
- s.setLocation(x, y);
- s.open();
- while (!s.isDisposed()) {
- if (!display.readAndDispatch()) display.sleep();
- }
- }
- };
- shell.addListener(SWT.Close, exitListener);
- Menu mb = new Menu(shell, SWT.BAR);
- MenuItem fileItem = new MenuItem(mb, SWT.CASCADE);
- fileItem.setText("&File");
- Menu fileMenu = new Menu(shell, SWT.DROP_DOWN);
- fileItem.setMenu(fileMenu);
- MenuItem exitItem = new MenuItem(fileMenu, SWT.PUSH);
- exitItem.setText("&Exit\tCtrl+X");
- exitItem.setAccelerator(SWT.CONTROL + 'X');
- exitItem.addListener(SWT.Selection, exitListener);
- MenuItem aboutItem = new MenuItem(fileMenu, SWT.PUSH);
- aboutItem.setText("&About\tCtrl+A");
- aboutItem.setAccelerator(SWT.CONTROL + 'A');
- aboutItem.addListener(SWT.Selection, aboutListener);
- shell.setMenuBar(mb);
-
- RGB color = shell.getBackground().getRGB();
- Label separator1 = new Label(shell, SWT.SEPARATOR | SWT.HORIZONTAL);
- Label locationLb = new Label(shell, SWT.NONE);
- locationLb.setText("Location:");
- Composite locationComp = new Composite(shell, SWT.EMBEDDED);
- ToolBar toolBar = new ToolBar(shell, SWT.FLAT);
- ToolItem exitToolItem = new ToolItem(toolBar, SWT.PUSH);
- exitToolItem.setText("&Exit");
- exitToolItem.addListener(SWT.Selection, exitListener);
- ToolItem aboutToolItem = new ToolItem(toolBar, SWT.PUSH);
- aboutToolItem.setText("&About");
- aboutToolItem.addListener(SWT.Selection, aboutListener);
- Label separator2 = new Label(shell, SWT.SEPARATOR | SWT.HORIZONTAL);
- final Composite comp = new Composite(shell, SWT.NONE);
- final Tree fileTree = new Tree(comp, SWT.SINGLE | SWT.BORDER);
- Sash sash = new Sash(comp, SWT.VERTICAL);
- Composite tableComp = new Composite(comp, SWT.EMBEDDED);
- Label separator3 = new Label(shell, SWT.SEPARATOR | SWT.HORIZONTAL);
- Composite statusComp = new Composite(shell, SWT.EMBEDDED);
-
- java.awt.Frame locationFrame = SWT_AWT.new_Frame(locationComp);
- final java.awt.TextField locationText = new java.awt.TextField();
- locationFrame.add(locationText);
-
- java.awt.Frame fileTableFrame = SWT_AWT.new_Frame(tableComp);
- java.awt.Panel panel = new java.awt.Panel(new java.awt.BorderLayout());
- fileTableFrame.add(panel);
-
- java.awt.Frame statusFrame = SWT_AWT.new_Frame(statusComp);
- statusFrame.setBackground(new java.awt.Color(color.red, color.green, color.blue));
- final java.awt.Label statusLabel = new java.awt.Label();
- statusFrame.add(statusLabel);
- statusLabel.setText("Select a file");
-
- sash.addListener(SWT.Selection, new Listener() {
- public void handleEvent(Event e) {
- if (e.detail == SWT.DRAG) return;
- GridData data = (GridData)fileTree.getLayoutData();
- Rectangle trim = fileTree.computeTrim(0, 0, 0, 0);
- data.widthHint = e.x - trim.width;
- comp.layout();
- }
- });
-
- File[] roots = File.listRoots();
- for (int i = 0; i < roots.length; i++) {
- File file = roots[i];
- TreeItem treeItem = new TreeItem(fileTree, SWT.NONE);
- treeItem.setText(file.getAbsolutePath());
- treeItem.setData(file);
- TreeItem dumyItem = new TreeItem(treeItem, SWT.NONE);
- }
- fileTree.addListener(SWT.Expand, new Listener() {
- public void handleEvent(Event e) {
- TreeItem item = (TreeItem)e.item;
- if (item == null) return;
- if (item.getItemCount() == 1) {
- TreeItem firstItem = item.getItems()[0];
- if (firstItem.getData() != null) return;
- firstItem.dispose();
- } else {
- return;
- }
- File root = (File)item.getData();
- File[] files = root.listFiles();
- if (files == null) return;
- for (int i = 0; i < files.length; i++) {
- File file = files[i];
- if (file.isDirectory()) {
- TreeItem treeItem = new TreeItem(item, SWT.NONE);
- treeItem.setText(file.getName());
- treeItem.setData(file);
- TreeItem dumyItem = new TreeItem(treeItem, SWT.NONE);
- }
- }
- }
- });
- fileTree.addListener(SWT.Selection, new Listener() {
- public void handleEvent(Event e) {
- TreeItem item = (TreeItem)e.item;
- if (item == null) return;
- final File root = (File)item.getData();
- EventQueue.invokeLater(new Runnable() {
- public void run() {
- statusLabel.setText(root.getAbsolutePath());
- locationText.setText(root.getAbsolutePath());
- }
- });
- }
- });
-
- GridLayout layout = new GridLayout(4, false);
- layout.marginWidth = layout.marginHeight = 0;
- layout.horizontalSpacing = layout.verticalSpacing = 1;
- shell.setLayout(layout);
- GridData data;
- data = new GridData(GridData.FILL_HORIZONTAL);
- data.horizontalSpan = 4;
- separator1.setLayoutData(data);
- data = new GridData();
- data.horizontalSpan = 1;
- data.horizontalIndent = 10;
- locationLb.setLayoutData(data);
- data = new GridData(GridData.FILL_HORIZONTAL);
- data.horizontalSpan = 2;
- data.heightHint = locationText.getPreferredSize().height;
- locationComp.setLayoutData(data);
- data = new GridData(GridData.FILL_HORIZONTAL);
- data.horizontalSpan = 1;
- toolBar.setLayoutData(data);
- data = new GridData(GridData.FILL_HORIZONTAL);
- data.horizontalSpan = 4;
- separator2.setLayoutData(data);
- data = new GridData(GridData.FILL_BOTH);
- data.horizontalSpan = 4;
- comp.setLayoutData(data);
- data = new GridData(GridData.FILL_HORIZONTAL);
- data.horizontalSpan = 4;
- separator3.setLayoutData(data);
- data = new GridData(GridData.FILL_HORIZONTAL);
- data.horizontalSpan = 4;
- data.heightHint = statusLabel.getPreferredSize().height;
- statusComp.setLayoutData(data);
-
- layout = new GridLayout(3, false);
- layout.marginWidth = layout.marginHeight = 0;
- layout.horizontalSpacing = layout.verticalSpacing = 1;
- comp.setLayout(layout);
- data = new GridData(GridData.FILL_VERTICAL);
- data.widthHint = 200;
- fileTree.setLayoutData(data);
- data = new GridData(GridData.FILL_VERTICAL);
- sash.setLayoutData(data);
- data = new GridData(GridData.FILL_BOTH);
- tableComp.setLayoutData(data);
-
- shell.open();
- while(!shell.isDisposed()) {
- if (!display.readAndDispatch()) display.sleep();
- }
- display.dispose();
- }
-}
diff --git a/org.eclipse.mylyn.ide.dev/developer/src-old/BugzillaHyperLinkDetector.java b/org.eclipse.mylyn.ide.dev/developer/src-old/BugzillaHyperLinkDetector.java
deleted file mode 100644
index 423c1cf6..00000000
--- a/org.eclipse.mylyn.ide.dev/developer/src-old/BugzillaHyperLinkDetector.java
+++ /dev/null
@@ -1,202 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 - 2006 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.mylyn.internal.bugs.java;
-
-import java.util.List;
-
-import org.eclipse.jdt.core.IJavaElement;
-import org.eclipse.jdt.core.dom.ASTNode;
-import org.eclipse.jdt.core.dom.Block;
-import org.eclipse.jdt.core.dom.Comment;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jdt.core.dom.TextElement;
-import org.eclipse.jdt.internal.corext.dom.NodeFinder;
-import org.eclipse.jdt.internal.ui.JavaPlugin;
-import org.eclipse.jdt.internal.ui.javaeditor.ASTProvider;
-import org.eclipse.jdt.internal.ui.javaeditor.JavaEditor;
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.ITextViewer;
-import org.eclipse.jface.text.hyperlink.IHyperlink;
-import org.eclipse.mylyn.internal.bugzilla.ui.BugzillaHyperlinkUtil;
-import org.eclipse.mylyn.internal.core.util.MylarStatusHandler;
-import org.eclipse.mylyn.provisional.tasklist.TaskRepository;
-import org.eclipse.ui.IEditorSite;
-import org.eclipse.ui.texteditor.ITextEditor;
-
-/**
- * @author Shawn Minto
- * Detects bugzilla hyperlinks within source code
- */
-public class BugzillaHyperLinkDetector extends AbstractHyperlinkDetector {
-
- private TaskRepository repository;
-
- public BugzillaHyperLinkDetector(TaskRepository repository) {
- this.repository = repository;
- }
-
- @SuppressWarnings("unchecked")
- public IHyperlink[] detectHyperlinks(ITextViewer textViewer, IRegion region, boolean canShowMultipleHyperlinks) {
-
- ITextEditor textEditor = getEditor();
- if (region == null || textEditor == null || canShowMultipleHyperlinks || !(textEditor instanceof JavaEditor))
- return null;
-
- IEditorSite site = textEditor.getEditorSite();
- if (site == null)
- return null;
-
- IJavaElement javaElement;
- Object adapter = textEditor.getEditorInput().getAdapter(IJavaElement.class);
- if (adapter instanceof IJavaElement) {
- javaElement = (IJavaElement)adapter;
- } else {
- return null;
- }
-
- if (javaElement == null)
- return null;
-
- CompilationUnit ast = JavaPlugin.getDefault().getASTProvider().getAST(javaElement, ASTProvider.WAIT_NO, null);
- if (ast == null)
- return null;
-
- ASTNode node = NodeFinder.perform(ast, region.getOffset(), 1);
-
- if (node == null || !(node instanceof TextElement || node instanceof Block))
- return null;
-
- String comment = null;
- int commentStart = -1;
-
- if (node instanceof TextElement) {
- TextElement element = (TextElement) node;
- comment = element.getText();
- commentStart = element.getStartPosition();
- } else if (node instanceof Block) {
- Comment c = findComment(ast.getCommentList(), region.getOffset(), 1);
- if (c != null) {
- try {
- IDocument document = textEditor.getDocumentProvider().getDocument(textEditor.getEditorInput());
- String commentString = document.get(c.getStartPosition(), c.getLength());
- comment = getStringFromComment(c, region.getOffset(), commentString);
- commentStart = getLocationFromComment(c, comment, commentString) + c.getStartPosition();
- } catch (BadLocationException e) {
- MylarStatusHandler.log(e, "Failed to get text for comment");
- }
- }
- }
-
- if (comment == null)
- return null;
-
- int startOffset = region.getOffset();
- int endOffset = startOffset + region.getLength();
-
- return BugzillaHyperlinkUtil.findBugHyperlinks(repository.getUrl(), startOffset, endOffset, comment, commentStart);
- }
-
-// private IHyperlink[] findBugHyperlinks(int startOffset, int endOffset, String comment, int commentStart) {
-//
-// Pattern p = Pattern.compile("^.*bug\\s+\\d+.*");
-// Matcher m = p.matcher(comment.toLowerCase().trim());
-// boolean b = m.matches();
-//
-// p = Pattern.compile("^.*bug#\\s+\\d+.*");
-// m = p.matcher(comment.toLowerCase().trim());
-// boolean b2 = m.matches();
-//
-// p = Pattern.compile("^.*bug\\s#\\d+.*");
-// m = p.matcher(comment.toLowerCase().trim());
-// boolean b3 = m.matches();
-//
-// p = Pattern.compile("^.*bug#\\d+.*");
-// m = p.matcher(comment.toLowerCase().trim());
-// boolean b4 = m.matches();
-//
-// // XXX walk forward from where we are
-// if (b || b2 || b3 || b4) {
-//
-// int start = comment.toLowerCase().indexOf("bug");
-// int ahead = 4;
-// if (b2 || b3 || b4) {
-// int pound = comment.toLowerCase().indexOf("#", start);
-// ahead = pound - start + 1;
-// }
-// String endComment = comment.substring(start + ahead, comment.length());
-// endComment = endComment.trim();
-// int endCommentStart = comment.indexOf(endComment);
-//
-// int end = comment.indexOf(" ", endCommentStart);
-// int end2 = comment.indexOf(":", endCommentStart);
-//
-// if ((end2 < end && end2 != -1) || (end == -1 && end2 != -1)) {
-// end = end2;
-// }
-//
-// if (end == -1)
-// end = comment.length();
-//
-// try {
-// int bugId = Integer.parseInt(comment.substring(endCommentStart, end).trim());
-//
-// start += commentStart;
-// end += commentStart;
-//
-// if (startOffset >= start && endOffset <= end) {
-// IRegion sregion = new Region(start, end - start);
-// return new IHyperlink[] { new BugzillaHyperLink(sregion, bugId) };
-// }
-// } catch (NumberFormatException e) {
-// return null;
-// }
-// }
-// return null;
-// }
-
- private int getLocationFromComment(Comment c, String commentLine, String commentString) {
- if (commentLine == null) {
- return -1;
- } else {
- return commentString.indexOf(commentLine);
- }
- }
-
- private String getStringFromComment(Comment comment, int desiredOffset, String commentString) {
- String[] parts = commentString.split("\n");
- if (parts.length > 1) {
- int offset = comment.getStartPosition();
- for (String part : parts) {
- int newOffset = offset + part.length() + 1;
- if (desiredOffset >= offset && desiredOffset <= newOffset) {
- return part;
- }
-
- }
- } else {
- return commentString;
- }
-
- return null;
- }
-
- private Comment findComment(List<Comment> commentList, int offset, int i) {
- for (Comment comment : commentList) {
- if (comment.getStartPosition() <= offset
- && (comment.getStartPosition() + comment.getLength() >= offset + i)) {
- return comment;
- }
- }
- return null;
- }
-}
diff --git a/org.eclipse.mylyn.ide.dev/developer/src-old/BugzillaReportElement.java b/org.eclipse.mylyn.ide.dev/developer/src-old/BugzillaReportElement.java
deleted file mode 100644
index 0547e7ad..00000000
--- a/org.eclipse.mylyn.ide.dev/developer/src-old/BugzillaReportElement.java
+++ /dev/null
@@ -1,118 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 - 2006 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.mylyn.internal.tasklist;
-
-/**
- * Bugzilla XML element enum. Each enum has the attribute name
- * and associated xml element tag name.
- *
- * @author Rob Elves
- */
-public class BugzillaReportElement {
- // Format: ENUM ( "pretty name", "xml key", <hidden: true/false>, <readonly: true/false>)
- // Hidden elements are not automatically displayed in ui
- public static final BugzillaReportElement ASSIGNED_TO = new BugzillaReportElement("Assigned to:", "assigned_to", false, true);
- public static final BugzillaReportElement ATTACHID = new BugzillaReportElement("attachid", "attachid");
- public static final BugzillaReportElement ATTACHMENT = new BugzillaReportElement("attachment", "attachment");
- public static final BugzillaReportElement BLOCKED = new BugzillaReportElement("Bug blocks:", "blocked");
- public static final BugzillaReportElement BUG = new BugzillaReportElement("bug","bug", true);
- public static final BugzillaReportElement BUG_FILE_LOC = new BugzillaReportElement("URL:", "bug_file_loc", true);
- public static final BugzillaReportElement BUG_ID = new BugzillaReportElement("Bug:", "bug_id", true);
- public static final BugzillaReportElement BUG_SEVERITY = new BugzillaReportElement("Severity:", "bug_severity", false);
- public static final BugzillaReportElement BUG_STATUS = new BugzillaReportElement("Status:", "bug_status", false, true);
- public static final BugzillaReportElement BUG_WHEN = new BugzillaReportElement("bug_when", "bug_when", true, true);
- public static final BugzillaReportElement BUGZILLA = new BugzillaReportElement("bugzilla", "bugzilla", true);
- public static final BugzillaReportElement CC = new BugzillaReportElement("CC:", "cc", true, true);
- public static final BugzillaReportElement CCLIST_ACCESSIBLE = new BugzillaReportElement("cclist_accessible", "cclist_accessible", true);
- public static final BugzillaReportElement CLASSIFICATION = new BugzillaReportElement("Classification:", "classification", true);
- public static final BugzillaReportElement CLASSIFICATION_ID = new BugzillaReportElement("Classification ID:", "classification_id", true);
- public static final BugzillaReportElement COMPONENT = new BugzillaReportElement("Component:", "component", false);
- public static final BugzillaReportElement CREATION_TS = new BugzillaReportElement("Creation date:", "creation_ts", true);
- public static final BugzillaReportElement CTYPE = new BugzillaReportElement("Content Type", "ctype");
- public static final BugzillaReportElement DATA = new BugzillaReportElement("data", "data");
- public static final BugzillaReportElement DATE = new BugzillaReportElement("Date", "date");
- public static final BugzillaReportElement DELTA_TS = new BugzillaReportElement("Last Modification", "delta_ts", true);
- public static final BugzillaReportElement DEPENDSON = new BugzillaReportElement("Bug depends on:", "dependson");
- public static final BugzillaReportElement DESC = new BugzillaReportElement("desc", "desc");
- public static final BugzillaReportElement EVERCONFIRMED = new BugzillaReportElement("everconfirmed", "everconfirmed", true);
- public static final BugzillaReportElement FILENAME = new BugzillaReportElement("filename", "filename");
- public static final BugzillaReportElement IS_OBSOLETE = new BugzillaReportElement("Obsolete", "isobsolete", true);
- public static final BugzillaReportElement KEYWORDS = new BugzillaReportElement("Keywords:", "keywords", true);
- public static final BugzillaReportElement LONG_DESC = new BugzillaReportElement("Description:", "long_desc");
- public static final BugzillaReportElement LONGDESCLENGTH = new BugzillaReportElement("Number of comments", "longdesclength", true);
- public static final BugzillaReportElement NEWCC = new BugzillaReportElement("Add CC:", "newcc", true);
- public static final BugzillaReportElement OP_SYS = new BugzillaReportElement("OS:", "op_sys", false);
- public static final BugzillaReportElement PRIORITY = new BugzillaReportElement("Priority:", "priority", false);
- public static final BugzillaReportElement PRODUCT = new BugzillaReportElement("Product:", "product", false);
- public static final BugzillaReportElement REP_PLATFORM = new BugzillaReportElement("Platform:", "rep_platform", false);
- public static final BugzillaReportElement REPORTER = new BugzillaReportElement("Reporter:", "reporter", false, true);
- public static final BugzillaReportElement REPORTER_ACCESSIBLE = new BugzillaReportElement("reporter_accessible", "reporter_accessible", true);
- public static final BugzillaReportElement RESOLUTION = new BugzillaReportElement("Resolution:", "resolution", false, true); // Exiting bug field, new cc
- public static final BugzillaReportElement SHORT_DESC = new BugzillaReportElement("Summary:", "short_desc", true);
- public static final BugzillaReportElement TARGET_MILESTONE = new BugzillaReportElement("Target milestone:", "target_milestone", false);
- public static final BugzillaReportElement THETEXT = new BugzillaReportElement("thetext", "thetext");
- public static final BugzillaReportElement TYPE = new BugzillaReportElement("type", "type");
- public static final BugzillaReportElement UNKNOWN = new BugzillaReportElement("UNKNOWN", "UNKNOWN");
- public static final BugzillaReportElement VERSION = new BugzillaReportElement("Version:", "version", false);
- public static final BugzillaReportElement VOTES = new BugzillaReportElement("Votes:", "votes", false, true);
- public static final BugzillaReportElement WHO = new BugzillaReportElement("who", "who");
- public static final BugzillaReportElement QA_CONTACT= new BugzillaReportElement("QA Contact", "qa_contact", false, false);
- public static final BugzillaReportElement ADDSELFCC = new BugzillaReportElement("Add self to CC", "addselfcc", true, false);
- // Used by search engine
- public static final BugzillaReportElement LI = new BugzillaReportElement("used by search engine", "li", true);
- public static final BugzillaReportElement ID = new BugzillaReportElement("used by search engine", "id", true);
- public static final BugzillaReportElement SHORT_SHORT_DESC = new BugzillaReportElement("used by search engine", "short_short_desc", false);
- public static final BugzillaReportElement SEQ = new BugzillaReportElement("used by search engine", "seq", false);
- public static final BugzillaReportElement RESULT = new BugzillaReportElement("used by search engine", "result", false);
- public static final BugzillaReportElement RDF = new BugzillaReportElement("used by search engine", "rdf", false);
- public static final BugzillaReportElement INSTALLATION = new BugzillaReportElement("used by search engine", "installation", false);
- public static final BugzillaReportElement BUGS = new BugzillaReportElement("used by search engine", "bugs", false);
-
- private final boolean isHidden;
-
- private final boolean isReadOnly;
-
- private final String keyString;
-
- private final String prettyName;
-
- BugzillaReportElement(String prettyName, String fieldName) {
- this(prettyName, fieldName, false, false);
- }
-
- BugzillaReportElement(String prettyName, String fieldName, boolean hidden) {
- this(prettyName, fieldName, hidden, false);
- }
-
- BugzillaReportElement(String prettyName, String fieldName, boolean hidden, boolean readonly) {
- this.prettyName = prettyName;
- this.keyString = fieldName;
- this.isHidden = hidden;
- this.isReadOnly = readonly;
- }
-
- public String getKeyString() {
- return keyString;
- }
-
- public boolean isHidden() {
- return isHidden;
- }
-
- public boolean isReadOnly() {
- return isReadOnly;
- }
-
- public String toString() {
- return prettyName;
- }
-}
diff --git a/org.eclipse.mylyn.ide.dev/developer/src-old/BugzillaTaskHandler.java b/org.eclipse.mylyn.ide.dev/developer/src-old/BugzillaTaskHandler.java
deleted file mode 100644
index 0f127065..00000000
--- a/org.eclipse.mylyn.ide.dev/developer/src-old/BugzillaTaskHandler.java
+++ /dev/null
@@ -1,272 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 - 2006 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.mylyn.internal.bugzilla.ui.tasklist;
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.mylyn.internal.tasklist.ITaskHandler;
-import org.eclipse.mylyn.internal.tasklist.ui.ITaskListElement;
-import org.eclipse.mylyn.internal.tasklist.ui.actions.CopyDescriptionAction;
-import org.eclipse.mylyn.internal.tasklist.ui.actions.DeleteAction;
-import org.eclipse.mylyn.internal.tasklist.ui.actions.GoIntoAction;
-import org.eclipse.mylyn.internal.tasklist.ui.actions.OpenTaskInExternalBrowserAction;
-import org.eclipse.mylyn.internal.tasklist.ui.actions.OpenTaskListElementAction;
-import org.eclipse.mylyn.internal.tasklist.ui.actions.RemoveFromCategoryAction;
-import org.eclipse.mylyn.internal.tasklist.ui.actions.RenameAction;
-import org.eclipse.mylyn.tasklist.ITask;
-
-/**
- * @author Mik Kersten and Ken Sueda
- *
- * TODO: refactor
- */
-public class BugzillaTaskHandler implements ITaskHandler {
-
- public boolean acceptsItem(ITaskListElement element) {
- return element instanceof BugzillaTask || element instanceof BugzillaQueryHit
- || element instanceof BugzillaQueryCategory;
- }
-
-// public void taskClosed(ITask element, IWorkbenchPage page) {
-// try {
-// IEditorInput input = null;
-// if (element instanceof BugzillaTask) {
-// input = new BugzillaTaskEditorInput((BugzillaTask) element, true);
-// }
-// IEditorPart editor = page.findEditor(input);
-//
-// if (editor != null) {
-// page.closeEditor(editor, false);
-// }
-// } catch (Exception e) {
-// MylarStatusHandler.log(e, "Error while trying to close a bugzilla task");
-// }
-// }
-
- public boolean enableAction(Action action, ITaskListElement element) {
-
- if (element instanceof BugzillaQueryHit) {
- BugzillaQueryHit hit = (BugzillaQueryHit) element;
- if (hit.getCorrespondingTask() != null && hit.getCorrespondingTask().hasValidUrl()) {
- return true;
- }
- return false;
- } else if (element instanceof BugzillaTask) {
- if (action instanceof OpenTaskInExternalBrowserAction) {
- if (((ITask) element).hasValidUrl()) {
- return true;
- } else {
- return false;
- }
- } else if (action instanceof DeleteAction || action instanceof CopyDescriptionAction
- || action instanceof OpenTaskListElementAction || action instanceof RemoveFromCategoryAction) {
- return true;
- } else {
- return false;
- }
- } else if (element instanceof BugzillaQueryCategory) {
- if (action instanceof DeleteAction || action instanceof CopyDescriptionAction
- || action instanceof OpenTaskListElementAction || action instanceof RenameAction) {
- return true;
- } else if (action instanceof GoIntoAction) {
- BugzillaQueryCategory cat = (BugzillaQueryCategory) element;
- if (cat.getHits().size() > 0) {
- return true;
- }
- } else {
- return false;
- }
- }
- return false;
- }
-}
-
-//public void itemOpened(ITaskListElement element) {
-//
-// boolean offline = MylarTaskListPlugin.getPrefs().getBoolean(TaskListPreferenceConstants.WORK_OFFLINE);
-//
-// if (element instanceof BugzillaTask) {
-// BugzillaTask bugzillaTask = (BugzillaTask) element;
-// TaskListUiUtil.openEditor(bugzillaTask);
-// MylarTaskListPlugin.ReportOpenMode mode = MylarTaskListPlugin.getDefault().getReportMode();
-// if (mode == MylarTaskListPlugin.ReportOpenMode.EDITOR) {
-// bugzillaTask.openTaskInEditor(offline);
-// } else if (mode == MylarTaskListPlugin.ReportOpenMode.INTERNAL_BROWSER) {
-// if (offline) {
-// MessageDialog.openInformation(null, "Unable to open bug",
-// "Unable to open the selected bugzilla task since you are currently offline");
-// return;
-// }
-// String title = "Bug #" + TaskRepositoryManager.getTaskIdAsInt(bugzillaTask.getHandleIdentifier());
-// TaskListUiUtil.openUrl(title, title, bugzillaTask.getUrl());
-// } else {
-// // not supported
-// }
-// } else if (element instanceof BugzillaCustomQueryCategory) {
-// BugzillaCustomQueryCategory queryCategory = (BugzillaCustomQueryCategory) element;
-// BugzillaCustomQueryDialog sqd = new BugzillaCustomQueryDialog(Display.getCurrent().getActiveShell(),
-// queryCategory.getQueryUrl(), queryCategory.getDescription(), queryCategory.getMaxHits() + "");
-// if (sqd.open() == Dialog.OK) {
-// queryCategory.setDescription(sqd.getName());
-// queryCategory.setQueryUrl(sqd.getUrl());
-// int maxHits = -1;
-// try {
-// maxHits = Integer.parseInt(sqd.getMaxHits());
-// } catch (Exception e) {
-// }
-// queryCategory.setMaxHits(maxHits);
-//
-// new SynchronizeReportsAction(queryCategory).run();
-// }
-// } else if (element instanceof BugzillaQueryCategory) {
-// BugzillaQueryCategory queryCategory = (BugzillaQueryCategory) element;
-// BugzillaQueryDialog queryDialog = new BugzillaQueryDialog(Display.getCurrent().getActiveShell(),
-// queryCategory.getRepositoryUrl(), queryCategory.getQueryUrl(), queryCategory.getDescription(),
-// queryCategory.getMaxHits() + "");
-// if (queryDialog.open() == Dialog.OK) {
-// queryCategory.setDescription(queryDialog.getName());
-// queryCategory.setQueryUrl(queryDialog.getUrl());
-// queryCategory.setRepositoryUrl(queryDialog.getRepository().getUrl().toExternalForm());
-// int maxHits = -1;
-// try {
-// maxHits = Integer.parseInt(queryDialog.getMaxHits());
-// } catch (Exception e) {
-// }
-// queryCategory.setMaxHits(maxHits);
-//
-// new SynchronizeReportsAction(queryCategory).run();
-// }
-// } else if (element instanceof BugzillaQueryHit) {
-// BugzillaQueryHit hit = (BugzillaQueryHit) element;
-// MylarTaskListPlugin.ReportOpenMode mode = MylarTaskListPlugin.getDefault().getReportMode();
-// if (mode == MylarTaskListPlugin.ReportOpenMode.EDITOR) {
-// if (hit.getCorrespondingTask() != null) {
-// hit.getCorrespondingTask().openTaskInEditor(offline);
-// } else {
-// if (offline) {
-// MessageDialog.openInformation(null, "Unable to open bug",
-// "Unable to open the selected bugzilla report since you are currently offline");
-// return;
-// }
-// BugzillaOpenStructure open = new BugzillaOpenStructure(((BugzillaQueryHit) element)
-// .getRepositoryUrl(), ((BugzillaQueryHit) element).getId(), -1);
-// List<BugzillaOpenStructure> selectedBugs = new ArrayList<BugzillaOpenStructure>();
-// selectedBugs.add(open);
-// ViewBugzillaAction viewBugs = new ViewBugzillaAction("Display bugs in editor", selectedBugs);
-// viewBugs.schedule();
-// }
-// }
-// else if (mode == MylarTaskListPlugin.ReportOpenMode.INTERNAL_BROWSER) {
-// if (offline) {
-// MessageDialog.openInformation(null, "Unable to open bug",
-// "Unable to open the selected bugzilla report since you are currently offline");
-// return;
-// }
-// String title = "Bug #" + TaskRepositoryManager.getTaskIdAsInt(hit.getHandleIdentifier());
-// TaskListUiUtil.openUrl(title, title, hit.getBugUrl());
-// } else {
-// // not supported
-// }
-// }
-// }
-
-// public ITask getCorrespondingTask(IQueryHit queryHit) {
-// if (queryHit instanceof BugzillaQueryHit) {
-// BugzillaQueryHit hit = (BugzillaQueryHit) queryHit;
-// return hit.getOrCreateCorrespondingTask();
-// } else {
-// return null;
-// }
-// }
-
-// public void itemRemoved(ITaskListElement element, ITaskCategory category) {
-// if (element instanceof BugzillaTask) {
-// BugzillaTask task = (BugzillaTask) element;
-// if (category instanceof TaskCategory) {
-// MylarTaskListPlugin.getTaskListManager().removeFromCategoryAndRoot((TaskCategory)
-// category, task);
-// // category.removeTask(task);
-// } else {
-// String message = MESSAGE_CONFIRM_DELETE;
-// boolean deleteConfirmed =
-// MessageDialog.openQuestion(PlatformUI.getWorkbench().getActiveWorkbenchWindow()
-// .getShell(), "Confirm delete", message);
-// if (!deleteConfirmed)
-// return;
-// MylarTaskListPlugin.getTaskListManager().deleteTask(task);
-// }
-// }
-// }
-
-// private static final String MESSAGE_CONFIRM_DELETE = "Remove this report from
-// the task list, and discard any task context or local notes?";
-
-// public boolean deleteElement(ITaskListElement element) {
-// if (element instanceof BugzillaQueryCategory) {
-// boolean deleteConfirmed =
-// MessageDialog.openQuestion(PlatformUI.getWorkbench().getActiveWorkbenchWindow()
-// .getShell(), "Confirm delete", "Delete the selected query and all contained
-// tasks?");
-// if (!deleteConfirmed)
-// return false;
-// BugzillaQueryCategory query = (BugzillaQueryCategory) element;
-// MylarTaskListPlugin.getTaskListManager().deleteQuery(query);
-// } else if (element instanceof BugzillaTask) {
-// BugzillaTask task = (BugzillaTask) element;
-// if (task.isActive()) {
-// MessageDialog.openError(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),
-// "Delete failed",
-// "Task must be deactivated in order to delete.");
-// return false;
-// }
-//
-// // String message = task.getDeleteConfirmationMessage();
-// boolean deleteConfirmed =
-// MessageDialog.openQuestion(PlatformUI.getWorkbench().getActiveWorkbenchWindow()
-// .getShell(), "Confirm delete", MESSAGE_CONFIRM_DELETE);
-// if (!deleteConfirmed)
-// return false;
-//
-// // task.removeReport();
-// MylarTaskListPlugin.getTaskListManager().deleteTask(task);
-// ContextCorePlugin.getContextManager().contextDeleted(task.getHandleIdentifier());
-// IWorkbenchPage page =
-// MylarTaskListPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow()
-// .getActivePage();
-//
-// // if we couldn't get the page, get out of here
-// if (page == null)
-// return true;
-// try {
-// TaskListView.getDefault().closeTaskEditors(task, page);
-// } catch (Exception e) {
-// MylarStatusHandler.log(e, " deletion failed");
-// }
-// }
-// TaskListView.getDefault().getViewer().refresh();
-// return true;
-// }
-
-// public void dropItem(ITaskListElement element, TaskCategory cat) {
-// if (element instanceof BugzillaQueryHit) {
-// BugzillaQueryHit bugzillaHit = (BugzillaQueryHit) element;
-// if (bugzillaHit.getAssociatedTask() != null) {
-// MylarTaskListPlugin.getTaskListManager().moveToCategory(cat,
-// bugzillaHit.getAssociatedTask());
-// } else {
-// BugzillaTask bugzillaTask = new BugzillaTask(bugzillaHit, true);
-// bugzillaHit.setAssociatedTask(bugzillaTask);
-// MylarTaskListPlugin.getTaskListManager().moveToCategory(cat,
-// bugzillaTask);
-// BugzillaUiPlugin.getDefault().getBugzillaTaskListManager().addToBugzillaTaskRegistry(bugzillaTask);
-// }
-// }
-// }
diff --git a/org.eclipse.mylyn.ide.dev/developer/src-old/BugzillaTaskListManager.java b/org.eclipse.mylyn.ide.dev/developer/src-old/BugzillaTaskListManager.java
deleted file mode 100644
index c47474f6..00000000
--- a/org.eclipse.mylyn.ide.dev/developer/src-old/BugzillaTaskListManager.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 - 2006 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.mylyn.internal.bugzilla.ui.tasklist;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.eclipse.mylyn.bugzilla.core.IBugzillaBug;
-import org.eclipse.mylyn.internal.bugzilla.core.IOfflineBugListener;
-import org.eclipse.mylyn.internal.bugzilla.ui.tasklist.BugzillaTask.BugReportSyncState;
-import org.eclipse.mylyn.internal.tasklist.TaskCategory;
-import org.eclipse.mylyn.internal.tasklist.TaskRepositoryManager;
-import org.eclipse.mylyn.internal.tasklist.ui.views.TaskListView;
-import org.eclipse.mylyn.tasklist.ITask;
-import org.eclipse.mylyn.tasklist.MylarTaskListPlugin;
-
-/**
- * @author Mik Kersten and Ken Sueda
- */
-public class BugzillaTaskListManager { //implements IOfflineBugListener {
-
-// private Map<String, BugzillaTask> bugzillaTaskArchive = new HashMap<String, BugzillaTask>();
-//
-// private TaskCategory cat = null;
-//
-// public void addToBugzillaTaskArchive(BugzillaTask task) {
-// if (bugzillaTaskArchive.get(task.getHandleIdentifier()) == null) {
-// bugzillaTaskArchive.put(task.getHandleIdentifier(), task);
-// if (cat != null) {
-// cat.internalAddTask(task);
-// }
-// }
-// }
-//
-// public BugzillaTask getFromBugzillaTaskRegistry(String handle) {
-// return bugzillaTaskArchive.get(handle);
-// }
-//
-// public Map<String, BugzillaTask> getBugzillaTaskRegistry() {
-// return bugzillaTaskArchive;
-// }
-//
-// public void setTaskRegistyCategory(TaskCategory cat) {
-// this.cat = cat;
-// }
-//
-// public void offlineStatusChange(IBugzillaBug bug, BugzillaOfflineStaus status) {
-// BugReportSyncState state = null;
-// if (status == BugzillaOfflineStaus.SAVED_WITH_OUTGOING_CHANGES) {
-// state = BugReportSyncState.OUTGOING;
-// } else if (status == BugzillaOfflineStaus.SAVED) {
-// state = BugReportSyncState.OK;
-// } else if (status == BugzillaOfflineStaus.SAVED_WITH_INCOMMING_CHANGES) {
-// state = BugReportSyncState.INCOMMING;
-// } else if (status == BugzillaOfflineStaus.CONFLICT) {
-// state = BugReportSyncState.CONFLICT;
-// }
-// if (state == null) {
-// // this means that we got a status that we didn't understand
-// return;
-// }
-//
-// String handle = TaskRepositoryManager.getHandle(bug.getRepository(), bug.getId());
-// ITask task = MylarTaskListPlugin.getTaskListManager().getTaskForHandle(handle, true);
-// if (task != null && task instanceof BugzillaTask) {
-// BugzillaTask bugTask = (BugzillaTask) task;
-// bugTask.setSyncState(state);
-// if (TaskListView.getDefault() != null && TaskListView.getDefault().getViewer() != null
-// && !TaskListView.getDefault().getViewer().getControl().isDisposed()) {
-// TaskListView.getDefault().getViewer().refresh();
-// }
-// }
-// }
-
-}
diff --git a/org.eclipse.mylyn.ide.dev/developer/src-old/ChartTest.java b/org.eclipse.mylyn.ide.dev/developer/src-old/ChartTest.java
deleted file mode 100644
index 3a09dd2e..00000000
--- a/org.eclipse.mylyn.ide.dev/developer/src-old/ChartTest.java
+++ /dev/null
@@ -1,69 +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 Jul 12, 2004
- */
-package org.eclipse.mylyn.tests.chart;
-
-import javax.swing.JFrame;
-
-import org.jfree.chart.*;
-import org.jfree.chart.plot.PlotOrientation;
-import org.jfree.data.CategoryDataset;
-import org.jfree.data.DatasetUtilities;
-
-public class ChartTest extends JFrame {
-
- private static final long serialVersionUID = 3256720663090640433L;
-
- public static void main(final String[] args) {
- final ChartTest demo = new ChartTest("Mylar Test");
- demo.pack();
- demo.setTitle("chart test");
- demo.setVisible(true);
- }
-
- public ChartTest(final String title) {
- final CategoryDataset dataset = createCategoryDataset();
- final JFreeChart chart = createChart(dataset);
- final ChartPanel chartPanel = new ChartPanel(chart);
- chartPanel.setPreferredSize(new java.awt.Dimension(500, 270));
- super.setContentPane(chartPanel);
- }
-
- private JFreeChart createChart(final CategoryDataset dataset) {
-
- final JFreeChart chart = ChartFactory.createStackedBarChart(
- "", // chart title
- "Eclipse Usage", // domain axis label
- "Time (minutes)", // range axis label
- dataset, // data
- PlotOrientation.VERTICAL, // the plot orientation
- true, // legend
- true, // tooltips
- false // urls
- );
- return chart;
- }
-
- public static CategoryDataset createCategoryDataset() {
-
- final double[][] data = new double[][]
- {{10.0, 4.0, 15.0, 14.0, 0, 0, 0},
- {5.0, 7.0, 14.0, 3.0, 0, 0, 0},
- {6.0, 17.0, 12.0, 7.0, 0, 0, 0}};
-
- String[] measurements = { "navigating", "editing", "other" };
- String[] days = { "mon", "tue", "wed", "thu", "fri", "sat", "sun" };
-
- return DatasetUtilities.createCategoryDataset(measurements, days, data);
- }
-}
diff --git a/org.eclipse.mylyn.ide.dev/developer/src-old/CommitContextAction.java b/org.eclipse.mylyn.ide.dev/developer/src-old/CommitContextAction.java
deleted file mode 100644
index 9713ea4f..00000000
--- a/org.eclipse.mylyn.ide.dev/developer/src-old/CommitContextAction.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 - 2006 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.mylyn.internal.team.ui.actions;
-
-import java.util.List;
-
-import org.eclipse.core.resources.IResource;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.mylyn.context.core.MylarStatusHandler;
-import org.eclipse.mylyn.internal.tasks.ui.views.TaskListView;
-import org.eclipse.mylyn.internal.team.TeamRespositoriesManager;
-import org.eclipse.mylyn.tasks.core.ITask;
-import org.eclipse.mylyn.team.MylarTeamPlugin;
-import org.eclipse.mylyn.team.AbstractTeamRepositoryProvider;
-import org.eclipse.ui.IViewActionDelegate;
-import org.eclipse.ui.IViewPart;
-
-/**
- * @author Mik Kersten
- */
-public class CommitContextAction implements IViewActionDelegate {
-
- public void init(IViewPart view) {
- // TODO Auto-generated method stub
- }
-
- public void run(IAction action) {
- ITask task = TaskListView.getFromActivePerspective().getSelectedTask();
- IResource[] resources = MylarTeamPlugin.getDefault().getChangeSetManager().getResources(task);
- if (resources == null || resources.length == 0) {
- MessageDialog.openInformation(null, "Mylar Information",
- "There are no interesting resources in the corresponding change set.\nRefer to Synchronize view.");
- return;
- }
-
- List<AbstractTeamRepositoryProvider> providers = TeamRespositoriesManager.getInstance().getProviders();
- for (Object element : providers) {
- try {
- AbstractTeamRepositoryProvider provider = (AbstractTeamRepositoryProvider) element;
- if (provider.hasOutgoingChanges(resources)) {
- provider.commit(resources);
- }
- } catch (Exception e) {
- MylarStatusHandler.fail(e, "Could not commit context.", false);
- }
- }
-
- }
-
- public void selectionChanged(IAction action, ISelection selection) {
- // ignore
- }
-}
diff --git a/org.eclipse.mylyn.ide.dev/developer/src-old/DoiDecoratingTableLabelProvider.java b/org.eclipse.mylyn.ide.dev/developer/src-old/DoiDecoratingTableLabelProvider.java
deleted file mode 100644
index fcd88eb4..00000000
--- a/org.eclipse.mylyn.ide.dev/developer/src-old/DoiDecoratingTableLabelProvider.java
+++ /dev/null
@@ -1,88 +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 Jul 26, 2004
- */
-package org.eclipse.mylyn.ui.views.support;
-
-import org.eclipse.jdt.core.IJavaElement;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jdt.internal.ui.viewsupport.JavaUILabelProvider;
-import org.eclipse.jface.viewers.IFontProvider;
-import org.eclipse.jface.viewers.ITableLabelProvider;
-import org.eclipse.swt.graphics.*;
-
-import org.eclipse.mylyn.model.*;
-import org.eclipse.mylyn.ui.UiUtil;
-
-/**
- * @author Mik Kersten
- * @deprecated
- */
-public class DoiDecoratingTableLabelProvider extends JavaUILabelProvider
- implements ITableLabelProvider, IFontProvider {
-
- public String getColumnText(Object object, int index) {
- if (object instanceof TaskscapeNode) {
- TaskscapeNode node = (TaskscapeNode)object;
- if (node.getKind().equals(ITaskscapeNode.Kind.Java)) {
- IJavaElement element = JavaCore.create(node.getElementHandle());
- if (element != null) {
- String label = element.getElementName();
- return label + " (" + node.getDegreeOfInterest().getDegreeOfInterest().getDoiValue() + ")";
- } else {
- return "<missing element>";
- }
- } else {
- return node.getElementHandle();
- }
- } else if (object instanceof TaskscapeEdge){
- TaskscapeEdge edge = (TaskscapeEdge)object;
- return edge.toString();
- }
- return "? " + object;
- }
-
- public Image getColumnImage(Object object, int index) {
- if (object instanceof TaskscapeNode) {
- TaskscapeNode node = (TaskscapeNode)object;
- if (node.getKind().equals(ITaskscapeNode.Kind.Java)) {
- IJavaElement javaElement = JavaCore.create(node.getElementHandle());
- return getImage(javaElement);
- }
- }
- return null;
- }
-
- public Color getBackground(Object element) {
-// if (element instanceof IJavaElement) {
-// return UiUtil.getBackgroundForElement((IJavaElement)element);
-// } else {
- return null;
-// }
- }
-
- public Color getForeground(Object element) {
-// if (element instanceof IJavaElement) {
-// return UiUtil.getForegroundForElement((IJavaElement)element);
-// } else {
- return null;
-// }
- }
-
- public Font getFont(Object object) {
- if (object instanceof IJavaElement) {
- return UiUtil.getFontForElement((IJavaElement)object);
- } else {
- return null;
- }
- }
-}
diff --git a/org.eclipse.mylyn.ide.dev/developer/src-old/EditorListener.java b/org.eclipse.mylyn.ide.dev/developer/src-old/EditorListener.java
deleted file mode 100644
index 10eab695..00000000
--- a/org.eclipse.mylyn.ide.dev/developer/src-old/EditorListener.java
+++ /dev/null
@@ -1,48 +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 Jun 24, 2004
- *
- * TODO To change the template for this generated file go to
- * Window - Preferences - Java - Code Style - Code Templates
- */
-package org.eclipse.mylyn.monitor;
-
-import org.eclipse.ui.IPartListener;
-import org.eclipse.ui.IWorkbenchPart;
-
-/**
- * @author beatmik
- *
- * TODO To change the template for this generated type comment go to
- * Window - Preferences - Java - Code Style - Code Templates
- */
-public class EditorListener implements IPartListener {
-
- public void partOpened(IWorkbenchPart part) {
-
- }
-
- public void partDeactivated(IWorkbenchPart part) {
- }
-
- public void partClosed(IWorkbenchPart part) {
-
- }
-
- public void partActivated(IWorkbenchPart part) {
-
- }
-
- public void partBroughtToTop(IWorkbenchPart part) {
-
- }
-}
diff --git a/org.eclipse.mylyn.ide.dev/developer/src-old/EditorPageListener.java b/org.eclipse.mylyn.ide.dev/developer/src-old/EditorPageListener.java
deleted file mode 100644
index 49e86791..00000000
--- a/org.eclipse.mylyn.ide.dev/developer/src-old/EditorPageListener.java
+++ /dev/null
@@ -1,43 +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 Jun 24, 2004
- *
- * TODO To change the template for this generated file go to
- * Window - Preferences - Java - Code Style - Code Templates
- */
-package org.eclipse.mylyn.monitor;
-
-import org.eclipse.ui.IPageListener;
-import org.eclipse.ui.IWorkbenchPage;
-
-/**
- * @author Mik Kersten
- */
-public class EditorPageListener implements IPageListener {
-
- public EditorPageListener() {
- super();
- }
-
- public void pageActivated(IWorkbenchPage page) {
-
- }
-
- public void pageClosed(IWorkbenchPage page) {
-
- }
-
- public void pageOpened(IWorkbenchPage page) {
-
- }
-
-}
diff --git a/org.eclipse.mylyn.ide.dev/developer/src-old/ExplorerFilteredTree.java b/org.eclipse.mylyn.ide.dev/developer/src-old/ExplorerFilteredTree.java
deleted file mode 100644
index e8a200e5..00000000
--- a/org.eclipse.mylyn.ide.dev/developer/src-old/ExplorerFilteredTree.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 - 2006 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.mylyn.internal.browser.views;
-
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.mylyn.context.ui.InterestFilter;
-import org.eclipse.mylyn.internal.tasks.ui.views.AbstractMylarFilteredTree;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.DisposeEvent;
-import org.eclipse.swt.events.DisposeListener;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.ui.dialogs.PatternFilter;
-
-/**
- * @author Mik Kersten
- */
-public class ExplorerFilteredTree extends AbstractMylarFilteredTree {
-
- private InterestFilter suppressedFilter = null;
-
- public ExplorerFilteredTree(String viewId, Composite parent, int treeStyle, PatternFilter filter) {
- super(parent, treeStyle, filter);
-// this.viewId = viewId;
- }
-
- /**
- * Create the tree. Subclasses may override.
- *
- * @param parent parent <code>Composite</code>
- * @param style SWT style bits used to create the tree
- * @return the tree
- */
- protected Control createTreeControl(Composite parent, int style) {
-// treeViewer = new ResourceTreeViewer(viewId, parent, style);
- GridData data = new GridData(SWT.FILL, SWT.FILL, true, true);
- treeViewer.getControl().setLayoutData(data);
- treeViewer.getControl().addDisposeListener(new DisposeListener(){
- /* (non-Javadoc)
- * @see org.eclipse.swt.events.DisposeListener#widgetDisposed(org.eclipse.swt.events.DisposeEvent)
- */
- public void widgetDisposed(DisposeEvent e) {
- Job refreshJob = getRefreshJob();
- if (refreshJob != null) {
- getRefreshJob().cancel();
- }
- }
- });
-
- treeViewer.addFilter(getPatternFilter());
- return treeViewer.getControl();
- }
-
- @Override
- protected Composite createStatusComposite(Composite container) {
- return null;
- }
-} \ No newline at end of file
diff --git a/org.eclipse.mylyn.ide.dev/developer/src-old/FilteringNavigatorView.java b/org.eclipse.mylyn.ide.dev/developer/src-old/FilteringNavigatorView.java
deleted file mode 100644
index dbfbff7a..00000000
--- a/org.eclipse.mylyn.ide.dev/developer/src-old/FilteringNavigatorView.java
+++ /dev/null
@@ -1,44 +0,0 @@
-package org.eclipse.mylyn.internal.browser.views;
-///*******************************************************************************
-// * Copyright (c) 2004 - 2006 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.mylyn.internal.browser.views;
-//
-//import org.eclipse.jface.viewers.TreeViewer;
-//import org.eclipse.mylyn.internal.tasks.ui.TaskListPatternFilter;
-//import org.eclipse.swt.SWT;
-//import org.eclipse.swt.widgets.Composite;
-//import org.eclipse.ui.dialogs.FilteredTree;
-//import org.eclipse.ui.views.navigator.ResourceNavigator;
-//
-///**
-// * @author Mik Kersten
-// */
-//public class ExplorerView extends ResourceNavigator {
-//
-// public static final String ID = "org.eclipse.mylyn.explorer.ui.explorer";
-//
-// protected TreeViewer createViewer(Composite parent) {
-// FilteredTree filteredTree = new ExplorerFilteredTree(ID, parent, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL,
-// new TaskListPatternFilter());
-//
-// TreeViewer viewer = filteredTree.getViewer();
-//
-// // NOTE: below from super
-// viewer.setUseHashlookup(true);
-// initContentProvider(viewer);
-// initLabelProvider(viewer);
-// initFilters(viewer);
-// initListeners(viewer);
-//
-// return viewer;
-// }
-//}
diff --git a/org.eclipse.mylyn.ide.dev/developer/src-old/FluidPrototyping.java b/org.eclipse.mylyn.ide.dev/developer/src-old/FluidPrototyping.java
deleted file mode 100644
index 920b7ccb..00000000
--- a/org.eclipse.mylyn.ide.dev/developer/src-old/FluidPrototyping.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
- *******************************************************************************/
-/*
- * Created on Jan 31, 2005
- */
-
-/**
- * @author Mik Kersten
- */
-public class Foo {
-
- int y = 0;
-
- public void setY(int y) {
- this.y = y;
- Display.update();
- }
-
- public void setX(int x) { }
-
- public void setP1(<field> p) { }
-
- public void setP2(<field> p) { }
-
-}
-
-class <field> { }
-
-class Display { static void update() {} }
-
-class Point { }
-
-class Line { } \ No newline at end of file
diff --git a/org.eclipse.mylyn.ide.dev/developer/src-old/IMapListener.java b/org.eclipse.mylyn.ide.dev/developer/src-old/IMapListener.java
deleted file mode 100644
index b742277f..00000000
--- a/org.eclipse.mylyn.ide.dev/developer/src-old/IMapListener.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 Jul 8, 2004
- */
-package org.eclipse.mylyn.monitor;
-
-/**
- * @author Mik Kersten
- */
-public interface IMapListener {
-
- public void mapUpdated();
-
-}
diff --git a/org.eclipse.mylyn.ide.dev/developer/src-old/Interest.java b/org.eclipse.mylyn.ide.dev/developer/src-old/Interest.java
deleted file mode 100644
index 4c165bf9..00000000
--- a/org.eclipse.mylyn.ide.dev/developer/src-old/Interest.java
+++ /dev/null
@@ -1,32 +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 Jun 23, 2004
- */
-package org.eclipse.mylyn.model;
-
-import java.io.Serializable;
-
-/**
- * @author Mik Kersten
- */
-public class Interest implements Serializable {
-
- private float value = 10;
-
- public float getValue() {
- return value;
- }
-
- public void setValue(float value) {
- this.value = value;
- }
-}
diff --git a/org.eclipse.mylyn.ide.dev/developer/src-old/JavaStackTraceHyperlinkAdapter.java b/org.eclipse.mylyn.ide.dev/developer/src-old/JavaStackTraceHyperlinkAdapter.java
deleted file mode 100644
index 0a1b0688..00000000
--- a/org.eclipse.mylyn.ide.dev/developer/src-old/JavaStackTraceHyperlinkAdapter.java
+++ /dev/null
@@ -1,144 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 - 2006 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.mylyn.internal.java.ui;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.debug.ui.IDebugModelPresentation;
-import org.eclipse.jdt.internal.debug.ui.JDIDebugUIPlugin;
-import org.eclipse.jdt.internal.debug.ui.actions.OpenTypeAction;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.forms.events.HyperlinkAdapter;
-import org.eclipse.ui.texteditor.IDocumentProvider;
-import org.eclipse.ui.texteditor.ITextEditor;
-
-/**
- * @author Robert Elves
- */
-public final class JavaStackTraceHyperlinkAdapter extends HyperlinkAdapter {
- public void linkActivated(org.eclipse.ui.forms.events.HyperlinkEvent e) {
- String typeName;
- int lineNumber;
- try {
- String linkText = (String) e.getHref();
- typeName = getTypeName(linkText);
- lineNumber = getLineNumber(linkText);
-
- // documents start at 0
- if (lineNumber > 0) {
- lineNumber--;
- }
- Object sourceElement = getSourceElement(typeName);
- if (sourceElement != null) {
- IDebugModelPresentation presentation = JDIDebugUIPlugin.getDefault()
- .getModelPresentation();
- IEditorInput editorInput = presentation.getEditorInput(sourceElement);
- if (editorInput != null) {
- String editorId = presentation.getEditorId(editorInput, sourceElement);
- if (editorId != null) {
- IEditorPart editorPart = JDIDebugUIPlugin.getActivePage().openEditor(
- editorInput, editorId);
- if (editorPart instanceof ITextEditor && lineNumber >= 0) {
- ITextEditor textEditor = (ITextEditor) editorPart;
- IDocumentProvider provider = textEditor.getDocumentProvider();
- provider.connect(editorInput);
- IDocument document = provider.getDocument(editorInput);
- try {
- IRegion line = document.getLineInformation(lineNumber);
- textEditor.selectAndReveal(line.getOffset(), line.getLength());
- } catch (BadLocationException e1) {
- MessageDialog.openInformation(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), "Open Type", "Failed to open type.");
- }
- provider.disconnect(editorInput);
- }
- return;
- }
- }
- }
- // did not find source
- MessageDialog.openInformation(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), "Open Type",
- "Type could not be located.");
- } catch (CoreException e1) {
- MessageDialog.openInformation(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), "Open Type",
- "Failed to open type.");
- return;
- }
- }
-
- // adapted from JavaStackTraceHyperlink
- private Object getSourceElement(String typeName) throws CoreException {
- Object result = null;
- result = OpenTypeAction.findTypeInWorkspace(typeName);
- // }
- return result;
- }
-
- // adapted from JavaStackTraceHyperlink
- private String getTypeName(String linkText) {
- int start = linkText.indexOf('(');
- int end = linkText.indexOf(':');
- if (start >= 0 && end > start) {
-
- // get File name (w/o .java)
- String typeName = linkText.substring(start + 1, end);
- typeName.indexOf(".");
- typeName = typeName.substring(0, typeName.indexOf("."));
-
- String qualifier = linkText.substring(0, start);
- // remove the method name
- start = qualifier.lastIndexOf('.');
-
- if (start >= 0) {
- // remove the class name
- start = new String((String) qualifier.subSequence(0, start)).lastIndexOf('.');
- if (start == -1) {
- start = 0; // default package
- }
- }
-
- if (start >= 0) {
- qualifier = qualifier.substring(0, start);
- }
-
- if (qualifier.length() > 0) {
- typeName = qualifier + "." + typeName; //$NON-NLS-1$
- }
- return typeName;
- }
-
- return "error"; // TODO: Complain
- }
-
- // adapted from JavaStackTraceHyperlink
- private int getLineNumber(String linkText) throws CoreException {
- int index = linkText.lastIndexOf(':');
- if (index >= 0) {
- String numText = linkText.substring(index + 1);
- index = numText.indexOf(')');
- if (index >= 0) {
- numText = numText.substring(0, index);
- }
- try {
- return Integer.parseInt(numText);
- } catch (NumberFormatException e) {
- throw new CoreException(null);
- }
- }
-
- throw new CoreException(null);
- }
-} \ No newline at end of file
diff --git a/org.eclipse.mylyn.ide.dev/developer/src-old/MylarJavaElementDescriptor.java b/org.eclipse.mylyn.ide.dev/developer/src-old/MylarJavaElementDescriptor.java
deleted file mode 100644
index 89655658..00000000
--- a/org.eclipse.mylyn.ide.dev/developer/src-old/MylarJavaElementDescriptor.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 - 2006 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.mylyn.internal.java.ui.editor;
-
-import org.eclipse.jdt.internal.ui.JavaPlugin;
-import org.eclipse.jface.resource.CompositeImageDescriptor;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.util.Assert;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.graphics.ImageData;
-import org.eclipse.swt.graphics.Point;
-
-/**
- * @author Shawn Minto
- */
-public class MylarJavaElementDescriptor extends CompositeImageDescriptor {
-
- private Image baseImage;
-
- private ImageDescriptor overlay;
-
- private Point fSize;
-
- public MylarJavaElementDescriptor(Image baseImage, ImageDescriptor overlay, Point size) {
- this.baseImage = baseImage;
- this.overlay = overlay;
- setImageSize(size);
- }
-
- @Override
- protected void drawCompositeImage(int width, int height) {
- if (baseImage == null)
- return;
- ImageData bg = baseImage.getImageData();
-
- drawImage(bg, 0, 0);
-
- // Point size= getSize();
- ImageData data = getImageData(overlay);
- drawImage(data, data.width, bg.height - data.height);
- }
-
- private ImageData getImageData(ImageDescriptor descriptor) {
- ImageData data = descriptor.getImageData(); // see bug 51965:
- // getImageData can return
- // null
- if (data == null) {
- data = DEFAULT_IMAGE_DATA;
- JavaPlugin.logErrorMessage("Image data not available: " + descriptor.toString()); //$NON-NLS-1$
- }
- return data;
- }
-
- /**
- * Sets the size of the image created by calling <code>createImage()</code>.
- *
- * @param size
- * the size of the image returned from calling
- * <code>createImage()</code>
- * @see ImageDescriptor#createImage()
- */
- public void setImageSize(Point size) {
- Assert.isNotNull(size);
- Assert.isTrue(size.x >= 0 && size.y >= 0);
- fSize = size;
- }
-
- @Override
- protected Point getSize() {
- return new Point(fSize.x, fSize.y);
- }
-
-}
diff --git a/org.eclipse.mylyn.ide.dev/developer/src-old/NewLocalTaskAction.java b/org.eclipse.mylyn.ide.dev/developer/src-old/NewLocalTaskAction.java
deleted file mode 100644
index de71565d..00000000
--- a/org.eclipse.mylyn.ide.dev/developer/src-old/NewLocalTaskAction.java
+++ /dev/null
@@ -1,109 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 - 2006 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.mylyn.internal.tasks.ui.actions;
-
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.mylyn.internal.tasks.core.LocalRepositoryConnector;
-import org.eclipse.mylyn.internal.tasks.ui.ITasksUiConstants;
-import org.eclipse.mylyn.internal.tasks.ui.TasksUiImages;
-import org.eclipse.mylyn.internal.tasks.ui.views.TaskInputDialog;
-import org.eclipse.mylyn.internal.tasks.ui.views.TaskListView;
-import org.eclipse.mylyn.tasks.core.ITask;
-import org.eclipse.mylyn.tasks.core.Task;
-import org.eclipse.mylyn.tasks.core.TaskCategory;
-import org.eclipse.mylyn.tasks.ui.TaskListManager;
-import org.eclipse.mylyn.tasks.ui.TasksUiPlugin;
-import org.eclipse.mylyn.tasks.ui.TasksUiUtil;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.IViewActionDelegate;
-import org.eclipse.ui.IViewPart;
-
-/**
- * @author Mik Kersten
- */
-@Deprecated
-public class NewLocalTaskAction extends Action implements IViewActionDelegate {
-
- public static final String ID = "org.eclipse.mylyn.tasks.ui.actions.create.task";
-
- public NewLocalTaskAction() {
- this(null);
- }
-
- public NewLocalTaskAction(TaskListView view) {
- setText(TaskInputDialog.LABEL_SHELL);
- setToolTipText(TaskInputDialog.LABEL_SHELL);
- setId(ID);
- setImageDescriptor(TasksUiImages.TASK_NEW);
- }
-
- public void init(IViewPart view) {
- }
-
- public void run(IAction action) {
- run();
- }
-
- @Override
- public void run() {
- Task newTask = new Task(TasksUiPlugin.getTaskListManager().genUniqueTaskHandle(), LocalRepositoryConnector.DEFAULT_SUMMARY);
- TaskListManager.scheduleNewTask(newTask);
-
- Object selectedObject = null;
- TaskListView view = TaskListView.getFromActivePerspective();
- if (view != null) {
- selectedObject = ((IStructuredSelection) view.getViewer().getSelection()).getFirstElement();
- }
- if (selectedObject instanceof TaskCategory) {
- TasksUiPlugin.getTaskList().addTask(newTask, (TaskCategory) selectedObject);
- } else if (selectedObject instanceof ITask) {
- ITask task = (ITask) selectedObject;
- if (task.getContainer() instanceof TaskCategory) {
- TasksUiPlugin.getTaskList().addTask(newTask, task.getContainer());
- } else if (view != null && view.getDrilledIntoCategory() instanceof TaskCategory) {
- TasksUiPlugin.getTaskList().addTask(newTask,
- view.getDrilledIntoCategory());
- } else {
- TasksUiPlugin.getTaskList().addTask(newTask,
- TasksUiPlugin.getTaskList().getUncategorizedCategory());
- }
- } else if (view != null && view.getDrilledIntoCategory() instanceof TaskCategory) {
- TasksUiPlugin.getTaskList().addTask(newTask,
- view.getDrilledIntoCategory());
- } else {
- if (view != null && view.getDrilledIntoCategory() != null) {
- MessageDialog
- .openInformation(Display.getCurrent().getActiveShell(), ITasksUiConstants.TITLE_DIALOG,
- "The new task has been added to the root of the list, since tasks can not be added to a query.");
- }
- TasksUiPlugin.getTaskList().addTask(newTask,
- TasksUiPlugin.getTaskList().getUncategorizedCategory());
- }
-
- TasksUiUtil.openEditor(newTask, true);
-
- // if (view != null) {
- // view.getViewer().refresh();
- // view.setInRenameAction(true);
- // view.getViewer().editElement(newTask, 4);
- // view.setInRenameAction(false);
- // }
- }
-
- public void selectionChanged(IAction action, ISelection selection) {
- }
-}
diff --git a/org.eclipse.mylyn.ide.dev/developer/src-old/PackageExplorerManager.java b/org.eclipse.mylyn.ide.dev/developer/src-old/PackageExplorerManager.java
deleted file mode 100644
index 90caa1d5..00000000
--- a/org.eclipse.mylyn.ide.dev/developer/src-old/PackageExplorerManager.java
+++ /dev/null
@@ -1,164 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 - 2006 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.mylyn.internal.java;
-
-import java.util.Arrays;
-import java.util.List;
-
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jdt.core.IJavaElement;
-import org.eclipse.jdt.core.IMember;
-import org.eclipse.jdt.internal.ui.actions.SelectionConverter;
-import org.eclipse.jdt.internal.ui.javaeditor.JavaEditor;
-import org.eclipse.jdt.internal.ui.packageview.PackageExplorerPart;
-import org.eclipse.jface.text.TextSelection;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.jface.viewers.ViewerFilter;
-import org.eclipse.mylyn.context.core.ContextCorePlugin;
-import org.eclipse.mylyn.context.core.IMylarContext;
-import org.eclipse.mylyn.context.core.IMylarContextListener;
-import org.eclipse.mylyn.context.core.IMylarElement;
-import org.eclipse.mylyn.context.core.MylarStatusHandler;
-import org.eclipse.mylyn.internal.context.ui.actions.AbstractFocusViewAction;
-import org.eclipse.mylyn.internal.java.ui.JavaDeclarationsFilter;
-import org.eclipse.ui.ISelectionListener;
-import org.eclipse.ui.IWorkbenchPart;
-
-/**
- * Sets member selections on the Package Explorer when appropriate, and manages
- * tree expansion state.
- *
- * @author Mik Kersten
- */
-public class PackageExplorerManager implements IMylarContextListener, ISelectionListener {
-
- public void selectionChanged(IWorkbenchPart part, ISelection changedSelection) {
- if (!(part instanceof PackageExplorerPart)) {
- return;
- }
- AbstractFocusViewAction applyAction = AbstractFocusViewAction.getActionForPart((PackageExplorerPart)part);
- if (!ContextCorePlugin.getContextManager().isContextActive()
- || (applyAction != null && !applyAction.isChecked())) {
- return;
- }
- try {
- Object elementToSelect = null;
- if (changedSelection instanceof TextSelection && part instanceof JavaEditor) {
- TextSelection textSelection = (TextSelection) changedSelection;
- IJavaElement javaElement = SelectionConverter.resolveEnclosingElement((JavaEditor) part, textSelection);
- if (javaElement != null)
- elementToSelect = javaElement;
- } else if (changedSelection instanceof TextSelection) {
-// if (part instanceof EditorPart) {
-// elementToSelect = ((EditorPart) part).getEditorInput().getAdapter(IResource.class);
-// }
- } else {
- return;
- }
-
- if (elementToSelect != null) {
- PackageExplorerPart packageExplorer = PackageExplorerPart.getFromActivePerspective();
- if (packageExplorer != null) {
- TreeViewer viewer = packageExplorer.getTreeViewer();
- StructuredSelection currentSelection = (StructuredSelection)viewer.getSelection();
- if (currentSelection.size() <= 1) {
- boolean membersFilteredMode = false;
- for (ViewerFilter filter : Arrays.asList(viewer.getFilters())) {
- if (filter instanceof JavaDeclarationsFilter)
- membersFilteredMode = true;
- }
- if (membersFilteredMode) {
- if (elementToSelect instanceof IMember) {
- ICompilationUnit toSelect = ((IMember) elementToSelect).getCompilationUnit();
- if (toSelect != null) {
- viewer.setSelection(new StructuredSelection(toSelect), true);
- }
- }
- } else if (elementToSelect != null) {
- if (!elementToSelect.equals(currentSelection.getFirstElement())) {
- viewer.setSelection(new StructuredSelection(elementToSelect), true);
- }
- }
- }
-// if (elementToSelect != null
-// && MylarJavaPlugin.getDefault().getPluginPreferences().getBoolean(
-// MylarJavaPrefConstants.PACKAGE_EXPLORER_AUTO_EXPAND)) {
-// viewer.expandAll();
-// }
- }
- }
- } catch (Throwable t) {
- MylarStatusHandler.log(t, "Could not update package explorer");
- }
- }
-
- public void contextActivated(IMylarContext taskscape) {
-// try {
-// if (ContextCorePlugin.getContextManager().isContextActive()
-// && FocusPackageExplorerAction.getDefault() != null
-// && FocusPackageExplorerAction.getDefault().isChecked()) {
-//
-// PackageExplorerPart packageExplorer = PackageExplorerPart.getFromActivePerspective();
-// if (packageExplorer != null) {
-// packageExplorer.setLinkingEnabled(false);
-// packageExplorer.getTreeViewer().expandAll();
-// }
-// }
-// } catch (Throwable t) {
-// MylarStatusHandler.log(t, "Could not update package explorer");
-// }
- }
-
- public void contextDeactivated(IMylarContext taskscape) {
- PackageExplorerPart packageExplorer = PackageExplorerPart.getFromActivePerspective();
- if (packageExplorer != null) {
- packageExplorer.getTreeViewer().collapseAll();
- }
- }
-
-// private boolean isInLinkToEditorMode(PackageExplorerPart packageExplorer) {
-// return JavaPlugin.getDefault().getPreferenceStore().getBoolean(PreferenceConstants.LINK_PACKAGES_TO_EDITOR);
-// }
-
- public void interestChanged(List<IMylarElement> nodes) {
- // ignore
- }
-
- public void revealInteresting() {
- // ignore
- }
-
- public void presentationSettingsChanging(UpdateKind kind) {
- // ignore
- }
-
- public void presentationSettingsChanged(UpdateKind kind) {
- // ignore
- }
-
- public void landmarkAdded(IMylarElement node) {
- // ignore
- }
-
- public void landmarkRemoved(IMylarElement node) {
- // ignore
- }
-
- public void nodeDeleted(IMylarElement node) {
- // ignore
- }
-
- public void edgesChanged(IMylarElement node) {
- // ignore
- }
-}
diff --git a/org.eclipse.mylyn.ide.dev/developer/src-old/ProblemsListInterestSorter.java b/org.eclipse.mylyn.ide.dev/developer/src-old/ProblemsListInterestSorter.java
deleted file mode 100644
index d3dd6f09..00000000
--- a/org.eclipse.mylyn.ide.dev/developer/src-old/ProblemsListInterestSorter.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 - 2006 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.mylyn.internal.ide.ui;
-
-import org.eclipse.core.resources.IMarker;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.mylyn.context.core.IMylarElement;
-import org.eclipse.mylyn.context.core.IMylarStructureBridge;
-import org.eclipse.mylyn.context.core.InterestComparator;
-import org.eclipse.mylyn.context.core.ContextCorePlugin;
-import org.eclipse.ui.views.markers.internal.FieldFolder;
-import org.eclipse.ui.views.markers.internal.FieldLineNumber;
-import org.eclipse.ui.views.markers.internal.FieldResource;
-import org.eclipse.ui.views.markers.internal.FieldSeverityAndMessage;
-import org.eclipse.ui.views.markers.internal.IField;
-import org.eclipse.ui.views.markers.internal.ProblemMarker;
-import org.eclipse.ui.views.markers.internal.TableSorter;
-
-/**
- * @author Mik Kersten
- */
-public class ProblemsListInterestSorter extends TableSorter {
-
- // COPIED: from ProblemView
- private final static int ASCENDING = TableSorter.ASCENDING;
-
- private final static int DESCENDING = TableSorter.DESCENDING;
-
- private final static int SEVERITY = 0;
-
- private final static int DOI = 1;
-
- private final static int DESCRIPTION = 2;
-
- private final static int RESOURCE = 3;
-
- private final static int[] DEFAULT_PRIORITIES = { SEVERITY, DOI, DESCRIPTION, RESOURCE };
-
- private final static int[] DEFAULT_DIRECTIONS = { DESCENDING, // severity
- ASCENDING, // folder
- ASCENDING, // resource
- ASCENDING }; // location
-
- private final static IField[] VISIBLE_FIELDS = { new FieldSeverityAndMessage(), new FieldFolder(), new FieldResource(),
- new FieldLineNumber() };
-
- // END COPY
-
- public ProblemsListInterestSorter() {
- super(VISIBLE_FIELDS, DEFAULT_PRIORITIES, DEFAULT_DIRECTIONS);
- }
-
- protected InterestComparator<IMylarElement> interestComparator = new InterestComparator<IMylarElement>();
-
- @Override
- public int compare(Viewer viewer, Object obj1, Object obj2) {
- if (obj1 instanceof ProblemMarker && obj1 instanceof ProblemMarker) {
- ProblemMarker marker1 = (ProblemMarker) obj1;
- ProblemMarker marker2 = (ProblemMarker) obj2;
- if (marker1.getSeverity() == IMarker.SEVERITY_ERROR && marker2.getSeverity() < IMarker.SEVERITY_ERROR) {
- return -1;
- } else if (marker2.getSeverity() == IMarker.SEVERITY_ERROR
- && marker1.getSeverity() < IMarker.SEVERITY_ERROR) {
- return 1;
- } else {
- if (ContextCorePlugin.getContextManager().isContextActive()) {
- IMylarStructureBridge bridge = ContextCore.getStructureBridge(
- marker1.getResource().getFileExtension());
- IMylarElement node1 = ContextCorePlugin.getContextManager().getElement(
- bridge.getHandleForOffsetInObject(marker1, 0));
- IMylarElement node2 = ContextCorePlugin.getContextManager().getElement(
- bridge.getHandleForOffsetInObject(marker2, 0));
- return interestComparator.compare(node1, node2);
- }
- }
- }
- return super.compare(viewer, obj1, obj2);
- }
-}
diff --git a/org.eclipse.mylyn.ide.dev/developer/src-old/RelativePathUtil.java b/org.eclipse.mylyn.ide.dev/developer/src-old/RelativePathUtil.java
deleted file mode 100644
index 408917e0..00000000
--- a/org.eclipse.mylyn.ide.dev/developer/src-old/RelativePathUtil.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 - 2006 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.mylyn.internal.tasklist;
-
-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.ide.dev/developer/src-old/RemoveFromContextAction.java b/org.eclipse.mylyn.ide.dev/developer/src-old/RemoveFromContextAction.java
deleted file mode 100644
index 5fe86fa8..00000000
--- a/org.eclipse.mylyn.ide.dev/developer/src-old/RemoveFromContextAction.java
+++ /dev/null
@@ -1,105 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 - 2006 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.mylyn.internal.context.ui.actions;
-
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.Set;
-
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.mylyn.context.core.AbstractContextStructureBridge;
-import org.eclipse.mylyn.context.core.ContextCorePlugin;
-import org.eclipse.mylyn.context.core.IInteractionElement;
-import org.eclipse.mylyn.context.ui.InterestFilter;
-import org.eclipse.mylyn.internal.tasks.ui.TasksUiImages;
-import org.eclipse.ui.actions.BaseSelectionListenerAction;
-import org.eclipse.ui.internal.navigator.NavigatorContentServiceContentProvider;
-import org.eclipse.ui.navigator.CommonViewer;
-
-/**
- *
- * @author Mik Kersten
- */
-public class RemoveFromContextAction extends BaseSelectionListenerAction {
-
- public static final String ID = "org.eclipse.mylyn.context.ui.actions.delete";
-
- private CommonViewer commonViewer;
-
- private InterestFilter interestFilter;
-
- public RemoveFromContextAction(CommonViewer commonViewer, InterestFilter interestFilter) {
- super("Remove from Context");
- setId(ID);
- setImageDescriptor(TasksUiImages.REMOVE);
- this.commonViewer = commonViewer;
- this.interestFilter = interestFilter;
- }
-
- @Override
- public void run() {
- Set<IInteractionElement> toRemove = new HashSet<IInteractionElement>();
-
- for (Iterator<?> iterator = super.getStructuredSelection().iterator(); iterator.hasNext();) {
- Object object = iterator.next();
- collectChildren(toRemove, object);
- }
-
- for (IInteractionElement element : toRemove) {
- ContextCorePlugin.getContextManager().delete(element);
- }
- if (commonViewer != null) {
- commonViewer.refresh();
- }
- }
-
- private void collectChildren(Set<IInteractionElement> toRemove, Object object) {
- IInteractionElement element = resolveElement(object);
- if (element != null) {
- toRemove.add(element);
- }
-
- Object[] children = ((NavigatorContentServiceContentProvider)commonViewer.getContentProvider()).getChildren(object);
- for (int i = 0; i < children.length; i++) {
- Object child = children[i];
- if (interestFilter.select(commonViewer, object, child)) {
- collectChildren(toRemove, child);
- }
- }
- }
-
- private IInteractionElement resolveElement(Object object) {
- IInteractionElement element = null;
- if (object instanceof IInteractionElement) {
- element = (IInteractionElement)object;
- } else {
- AbstractContextStructureBridge bridge = ContextCore.getStructureBridge(object);
- if (bridge.getContentType() == null) {
- // try to resolve the resource
- if (object instanceof IAdaptable) {
- Object adapted = ((IAdaptable) object).getAdapter(IResource.class);
- if (adapted instanceof IResource) {
- object = adapted;
- }
- bridge = ContextCore.getStructureBridge(object);
- }
- }
-
- if (!object.getClass().getName().equals(Object.class.getCanonicalName())) {
- String handle = bridge.getHandleIdentifier(object);
- element = ContextCorePlugin.getContextManager().getElement(handle);
- }
- }
- return element;
- }
-}
diff --git a/org.eclipse.mylyn.ide.dev/developer/src-old/RepositoryAwareStatusHandler.java b/org.eclipse.mylyn.ide.dev/developer/src-old/RepositoryAwareStatusHandler.java
deleted file mode 100644
index 8310f6d6..00000000
--- a/org.eclipse.mylyn.ide.dev/developer/src-old/RepositoryAwareStatusHandler.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2008 Tasktop Technologies 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:
- * Tasktop Technologies - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.mylyn.internal.tasks.ui;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jface.dialogs.ErrorDialog;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.PlatformUI;
-
-/**
- * @deprecated Do not use. This class is pending for removal: see bug 237552.
- */
-@Deprecated
-public class RepositoryAwareStatusHandler {
-
- protected static final String ERROR_MESSAGE = "Please report the following error at:\n"
- + "http://bugs.eclipse.org/bugs/enter_bug.cgi?product=Mylyn\n\n"
- + "Or via the popup menu in the Error Log view (see Window -> Show View)";
-
- /**
- * Used to ensure that only one dialog is open.
- */
- private static boolean errorDialogOpen = false;
-
- private static RepositoryAwareStatusHandler instance;
-
- public synchronized static RepositoryAwareStatusHandler getInstance() {
- if (instance == null) {
- new RepositoryAwareStatusHandler();
- }
- return instance;
- }
-
- public RepositoryAwareStatusHandler() {
- instance = this;
- }
-
- @Deprecated
- public void fail(final IStatus status, boolean informUser) {
- if (informUser && Platform.isRunning()) {
- try {
- PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() {
- public void run() {
- Shell shell = null;
- if (PlatformUI.getWorkbench() != null
- && PlatformUI.getWorkbench().getActiveWorkbenchWindow() != null) {
- shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();
- }
-
- // ensure that only one dialog can be open at a time
- synchronized (shell) {
- try {
- if (!errorDialogOpen) {
- errorDialogOpen = true;
- ErrorDialog.openError(shell, "Mylyn Error", ERROR_MESSAGE, status);
- }
- } finally {
- errorDialogOpen = false;
- }
- }
- }
- });
- } catch (Throwable t) {
- status.getException().printStackTrace();
- }
- }
- }
-
-}
diff --git a/org.eclipse.mylyn.ide.dev/developer/src-old/Scatch.jpage b/org.eclipse.mylyn.ide.dev/developer/src-old/Scatch.jpage
deleted file mode 100644
index 990639aa..00000000
--- a/org.eclipse.mylyn.ide.dev/developer/src-old/Scatch.jpage
+++ /dev/null
@@ -1,179 +0,0 @@
-package ca.ubc.mylar;
-
-import java.io.*;
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jdt.internal.ui.viewsupport.JavaElementImageProvider;
-import org.eclipse.jface.dialogs.ErrorDialog;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.ui.internal.Workbench;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-
-import ca.ubc.mylar.model.DoiModelManager;
-import ca.ubc.mylar.monitor.UsageStatisticsManager;
-
-/**
- * The main plugin class to be used in the desktop.
- */
-public class MylarPlugin extends AbstractUIPlugin {
-
- public static boolean DEBUG_MODE = false;
- public static final String LOG_FILE_NAME = "mylar-log.txt";
-
- private static boolean enabled = true;
-
- private static MylarPlugin plugin;
- private static UserSelectionListener userSelectionListneer = new UserSelectionListener();
- private static DoiModelManager modelManager = new DoiModelManager();
- private static UsageStatisticsManager statisticsManager = new UsageStatisticsManager();
-
- private static PrintStream logStream;
-
- //Resource bundle.
- private ResourceBundle resourceBundle;
- private JavaElementImageProvider javaImageProvider;
-
- public static DoiModelManager getModelManager() {
- return modelManager;
- }
-
- static {
- IPath rootPath = ResourcesPlugin.getWorkspace().getRoot().getLocation();
- String path = rootPath.toString() + File.separator + LOG_FILE_NAME;
- try {
- logStream = new PrintStream(new FileOutputStream(new File(path), true));
- } catch (FileNotFoundException e) {
- e.printStackTrace();
- }
- }
-
- /**
- * The constructor.
- */
- public MylarPlugin() {
- super();
- plugin = this;
- try {
- resourceBundle = ResourceBundle.getBundle("ca.ubc.mylar.MylarPluginResources");
- javaImageProvider = new JavaElementImageProvider();
- } catch (MissingResourceException x) {
- resourceBundle = null;
- } catch (Throwable t) {
- System.err.println("> Mylar failed to start: " + t.getMessage());
- t.printStackTrace();
- }
- }
-
- /**
- * Returns the shared instance.
- */
- public static MylarPlugin getDefault() {
- return plugin;
- }
-
- public static IPreferenceStore getPrefs() {
- return getDefault().getPreferenceStore();
- }
-
- public static void log(Object source, String message) {
- StringBuffer buffer = new StringBuffer();
- buffer.append("[");
- buffer.append(Util.getFormattedDate());
- buffer.append(", ");
- buffer.append(Util.getFormattedTime());
- buffer.append("] ");
-
- if (source != null) buffer.append(source.getClass().getName());
- buffer.append(": " + message);
-
- if (DEBUG_MODE) System.out.println(buffer.toString());
- if (logStream != null) logStream.println(buffer.toString());
- }
-
- /**
- * @param throwable can be null
- * @param message
- */
- public static void fail(Throwable throwable, String message) {
- StringWriter stringWriter= new StringWriter();
- PrintWriter writer= new PrintWriter(stringWriter);
- StringBuffer buffer = new StringBuffer();
- if (throwable != null) {
- throwable.printStackTrace(writer);
- buffer = stringWriter.getBuffer();
- }
- log(MylarPlugin.getDefault(), "fail: " + message + "\n" + buffer.toString());
-
- final Status status= new Status(
- Status.ERROR,
- "ca.ubc.mylar",
- Status.OK,
- message, //$NON-NLS-1$
- throwable);
-
- Workbench.getInstance().getDisplay().syncExec(new Runnable() {
- public void run() {
- ErrorDialog.openError(
- Workbench.getInstance().getActiveWorkbenchWindow().getShell(),
- "Mylar error",
- "Please report the following error",
- status);
- }
- });
- }
-
- /**
- * Returns the string from the plugin's resource bundle,
- * or 'key' if not found.
- */
- public static String getResourceString(String key) {
- ResourceBundle bundle = MylarPlugin.getDefault().getResourceBundle();
- try {
- return (bundle != null) ? bundle.getString(key) : key;
- } catch (MissingResourceException e) {
- return key;
- }
- }
-
- /**
- * Returns the string from the plugin's resource bundle,
- * or 'key' if not found.
- */
- public static String getMessage(String key) {
- ResourceBundle bundle = getDefault().getResourceBundle();
- try {
- return (bundle != null) ? bundle.getString(key) : key;
- } catch (MissingResourceException e) {
- return key;
- }
- }
-
- /**
- * Returns the plugin's resource bundle,
- */
- public ResourceBundle getResourceBundle() {
- return resourceBundle;
- }
-
- public static UsageStatisticsManager getStatisticsManager() {
- return statisticsManager;
- }
-
- /**
- * For testing.
- */
- public static UserSelectionListener getUserSelectionListneer() {
- return userSelectionListneer;
- }
-
- public static boolean isEnabled() {
- return enabled;
- }
- public static void setEnabled(boolean enabled) {
- MylarPlugin.enabled = enabled;
- }
-}
diff --git a/org.eclipse.mylyn.ide.dev/developer/src-old/SynchronizeChangedTasksJob.java b/org.eclipse.mylyn.ide.dev/developer/src-old/SynchronizeChangedTasksJob.java
deleted file mode 100644
index 3a27af1d..00000000
--- a/org.eclipse.mylyn.ide.dev/developer/src-old/SynchronizeChangedTasksJob.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 - 2006 Mylar committers 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
- *******************************************************************************/
-
-package org.eclipse.mylyn.tasks.ui;
-
-import java.util.Iterator;
-import java.util.Set;
-
-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.core.runtime.SubProgressMonitor;
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.mylyn.internal.monitor.core.util.StatusManager;
-import org.eclipse.mylyn.tasks.core.AbstractRepositoryConnector;
-import org.eclipse.mylyn.tasks.core.AbstractTask;
-import org.eclipse.mylyn.tasks.core.TaskList;
-import org.eclipse.mylyn.tasks.core.TaskRepository;
-
-public class SynchronizeChangedTasksJob extends Job {
-
- private final AbstractRepositoryConnector connector;
-
- private final TaskRepository repository;
-
- private boolean forced;
-
- public SynchronizeChangedTasksJob(AbstractRepositoryConnector connector, TaskRepository repository) {
- super("Get Changed Tasks");
-
- this.connector = connector;
- this.repository = repository;
- }
-
- /**
- * Returns true, if synchronization was triggered manually and not by an automatic background job.
- */
- public boolean isForced() {
- return forced;
- }
-
- /**
- * Indicates a manual synchronization (User initiated). If set to true, a dialog will be displayed in case of
- * errors. Any tasks with missing data will be retrieved.
- */
- public void setForced(boolean forced) {
- this.forced = forced;
- }
-
- @Override
- public IStatus run(IProgressMonitor monitor) {
- try {
- monitor.beginTask("Synchronizing changed tasks", IProgressMonitor.UNKNOWN);
-
- TaskList taskList = TasksUiPlugin.getTaskList();
- Set<AbstractTask> tasks = taskList.getRepositoryTasks(repository.getUrl());
-
- boolean changed = connector.markStaleTasks(repository, tasks, new SubProgressMonitor(monitor, 1));
- if (!changed) {
- return Status.OK_STATUS;
- }
-
- for (Iterator<AbstractTask> it = tasks.iterator(); it.hasNext();) {
- if (!it.next().isStale()) {
- it.remove();
- }
- }
-
- if (tasks.isEmpty()) {
- return Status.OK_STATUS;
- }
-
- TasksUiPlugin.getSynchronizationManager().synchronize(connector, tasks, forced, null);
- } catch (final CoreException e) {
- StatusManager.log(e.getStatus());
- } finally {
- monitor.done();
- }
-
- return Status.OK_STATUS;
- };
-
-}
diff --git a/org.eclipse.mylyn.ide.dev/developer/src-old/TaskActivityTimer.java b/org.eclipse.mylyn.ide.dev/developer/src-old/TaskActivityTimer.java
deleted file mode 100644
index fe5b191b..00000000
--- a/org.eclipse.mylyn.ide.dev/developer/src-old/TaskActivityTimer.java
+++ /dev/null
@@ -1,129 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 - 2006 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.mylyn.internal.tasks.ui.util;
-
-import java.util.Calendar;
-
-import org.eclipse.mylyn.context.core.IInteractionEventListener;
-import org.eclipse.mylyn.context.core.InteractionEvent;
-import org.eclipse.mylyn.internal.context.core.util.ITimerThreadListener;
-import org.eclipse.mylyn.internal.context.core.util.TimerThread;
-import org.eclipse.mylyn.monitor.MylarMonitorPlugin;
-import org.eclipse.mylyn.tasks.core.ITask;
-import org.eclipse.ui.IWindowListener;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PlatformUI;
-
-/**
- * @author Mik Kersten
- */
-public class TaskActivityTimer implements ITimerThreadListener, IInteractionEventListener, IWindowListener {
-
- private TimerThread timer;
-
- private ITask task;
-
- private long lastActivity;
-
- private boolean started;
-
- public TaskActivityTimer(ITask task, int timeout, int sleepInterval) {
- this.task = task;
- timer = new TimerThread(timeout, sleepInterval);
- PlatformUI.getWorkbench().addWindowListener(this);
- MylarMonitorPlugin.getDefault().addInteractionListener(this);
- timer.addListener(this);
- }
-
- public void startTimer() {
- lastActivity = Calendar.getInstance().getTimeInMillis();
- timer.start();
- started = true;
- }
-
- public void stopTimer() {
- if (!timer.isSuspended()) {
- addElapsedToActivityTime();
- }
- timer.kill();
- timer.removeListener(this);
- MylarMonitorPlugin.getDefault().removeInteractionListener(this);
- PlatformUI.getWorkbench().removeWindowListener(this);
- started = false;
- }
-
- public void fireTimedOut() {
- suspendTiming();
- }
-
- public void interactionObserved(InteractionEvent event) {
- // lastActivity = Calendar.getInstance().getTimeInMillis();
- timer.resetTimer();
- }
-
- private void suspendTiming() {
- addElapsedToActivityTime();
- timer.setSuspended(true);
- }
-
- private void addElapsedToActivityTime() {
-// long elapsed = Calendar.getInstance().getTimeInMillis() - lastActivity;
-// task.setElapsedTime(task.getElapsedTime() + elapsed);
-// lastActivity = Calendar.getInstance().getTimeInMillis();
- }
-
- public void startMonitoring() {
-
- }
-
- public void stopMonitoring() {
-
- }
-
- /**
- * Public for testing
- */
- public boolean isStarted() {
- return started;
- }
-
- public String toString() {
- return "timer for task: " + task.toString();
- }
-
- public boolean isSuspended() {
- return timer.isSuspended();
- }
-
- public void intervalElapsed() {
- addElapsedToActivityTime();
- }
-
- public void windowActivated(IWorkbenchWindow window) {
- timer.resetTimer();
- lastActivity = Calendar.getInstance().getTimeInMillis();
- }
-
- public void windowDeactivated(IWorkbenchWindow window) {
- suspendTiming();
- }
-
- public void windowClosed(IWorkbenchWindow window) {
- if (PlatformUI.getWorkbench().getWorkbenchWindowCount() == 0) {
- timer.kill();
- }
- }
-
- public void windowOpened(IWorkbenchWindow window) {
- // ignore
- }
-}
diff --git a/org.eclipse.mylyn.ide.dev/developer/src-old/TaskActivityTimingTest.java b/org.eclipse.mylyn.ide.dev/developer/src-old/TaskActivityTimingTest.java
deleted file mode 100644
index dbc63001..00000000
--- a/org.eclipse.mylyn.ide.dev/developer/src-old/TaskActivityTimingTest.java
+++ /dev/null
@@ -1,176 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 - 2006 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.mylyn.tasks.tests;
-
-import junit.framework.TestCase;
-
-import org.eclipse.mylyn.context.core.InteractionEvent;
-import org.eclipse.mylyn.internal.context.core.util.TimerThread;
-import org.eclipse.mylyn.internal.tasks.ui.util.TaskActivityTimer;
-import org.eclipse.mylyn.monitor.MylarMonitorPlugin;
-import org.eclipse.mylyn.tasks.core.ITask;
-import org.eclipse.mylyn.tasks.core.Task;
-import org.eclipse.mylyn.tasks.ui.TaskListManager;
-import org.eclipse.mylyn.tasks.ui.TasksUiPlugin;
-
-/**
- * @author Mik Kersten
- */
-public class TaskActivityTimingTest extends TestCase {
-
- // 5 seconds (minimum value since TimerThread sleeps
- // for 5 seconds anyway before checking
-
- private static final int SLOP = 100;
-
- private static final int SLEEP_INTERVAL = SLOP * 3;
-
- private static final int TIMEOUT = SLEEP_INTERVAL * 2;
-
- private static final int SLEEP_NOTIMEOUT = TIMEOUT - SLOP; // 1 second
-
- // Introdueced long sleep for testing inactivity where TimerThread
- // sleeps for 5 seconds so we must sleep at least that long before
- // it will have woken up and suspended.
- private static final int SLEEP_TIMEOUT = TIMEOUT + SLOP; // 5.5 seconds
-
- protected TaskListManager manager = TasksUiPlugin.getTaskListManager();
-
- protected Task task1 = null;
-
- protected int originalActivityTimeout = -1;
-
- protected void setUp() throws Exception {
- super.setUp();
- task1 = new Task("t1", "t1", true);
- originalActivityTimeout = MylarMonitorPlugin.getDefault().getInactivityTimeout();
- MylarMonitorPlugin.getDefault().setInactivityTimeout(TIMEOUT);
- manager.setTimerSleepInterval(SLEEP_INTERVAL);
- }
-
- public void tearDown() {
- TasksUiPlugin.getTaskListManager().deactivateTask(task1);
- ITask remaining = TasksUiPlugin.getTaskList().getActiveTask();
- if (remaining != null) {
- TasksUiPlugin.getTaskListManager().deactivateTask(remaining);
- }
- MylarMonitorPlugin.getDefault().setInactivityTimeout(originalActivityTimeout);
- manager.setTimerSleepInterval(TimerThread.DEFAULT_SLEEP_INTERVAL);
- }
-
- public void testDeactivation() throws InterruptedException {
- assertEquals(0, task1.getElapsedTime());
- TasksUiPlugin.getTaskListManager().deactivateTask(task1);
- assertEquals(0, task1.getElapsedTime());
-
- TasksUiPlugin.getTaskListManager().activateTask(task1);
- Thread.sleep(SLEEP_NOTIMEOUT);
- TasksUiPlugin.getTaskListManager().deactivateTask(task1);
- assertTrue("elapsed: " + task1.getElapsedTime(), task1.getElapsedTime() >= SLEEP_NOTIMEOUT - 2*SLOP);
- }
-
- public void testTimerMap() throws InterruptedException {
- Task task0 = new Task("t0", "t0", true);
- manager.activateTask(task0);
- assertEquals(1, manager.getTimerMap().values().size());
- TaskActivityTimer timer0 = manager.getTimerMap().get(task0);
- assertTrue(timer0.isStarted());
-
- long elapsed = task1.getElapsedTime();
- assertEquals(0, elapsed);
- TasksUiPlugin.getTaskListManager().activateTask(task1);
- TaskActivityTimer timer1 = manager.getTimerMap().get(task1);
- // previous task was deactivated
- assertEquals(1, manager.getTimerMap().values().size());
- assertTrue(timer1.isStarted());
- Thread.sleep(SLEEP_TIMEOUT);
-
- manager.deactivateTask(task1);
- elapsed = task1.getElapsedTime();
- assertTrue("should be around TIMEOUT", (elapsed > (TIMEOUT - 500)) && (elapsed < (TIMEOUT + 500)));
- assertFalse(timer1.isStarted());
- assertEquals(0, manager.getTimerMap().values().size());
-
- Thread.sleep(SLEEP_TIMEOUT);
- long elapsedAfterInactivity = task1.getElapsedTime();
- assertEquals("no accumulation if task deactivated", elapsed, elapsedAfterInactivity);
-
- assertFalse(timer0.isStarted());
- assertEquals(0, manager.getTimerMap().values().size());
- }
-
- public void testElapsedTimeCapture() throws InterruptedException {
- long elapsed = task1.getElapsedTime();
- assertEquals(0, elapsed);
- TasksUiPlugin.getTaskListManager().activateTask(task1);
- Thread.sleep(SLEEP_TIMEOUT);
-
- elapsed = task1.getElapsedTime();
- assertTrue("should be bigger than timeout: " + elapsed + " > " + TIMEOUT, elapsed + SLOP >= TIMEOUT);
-
- // Task should be inactive so no time accumulated
- Thread.sleep(SLEEP_TIMEOUT);
- TasksUiPlugin.getTaskListManager().deactivateTask(task1);
-
- long elapsedAfterDeactivation = task1.getElapsedTime();
- assertEquals(elapsed, elapsedAfterDeactivation);
-
- Thread.sleep(SLEEP_TIMEOUT);
- long elapsedAfterInactivity = task1.getElapsedTime();
- assertEquals("no accumulation if task inactive", elapsedAfterDeactivation, elapsedAfterInactivity);
-
- MylarMonitorPlugin.getDefault().setInactivityTimeout(SLEEP_TIMEOUT * 2);
- TasksUiPlugin.getTaskListManager().activateTask(task1);
- Thread.sleep(SLEEP_TIMEOUT);
- // Should not have timed out
- TasksUiPlugin.getTaskListManager().deactivateTask(task1);
- long elpasedAfterReactivation = task1.getElapsedTime();
-
- // adds some slop
- assertTrue("time: " + (elpasedAfterReactivation - elapsedAfterInactivity), elpasedAfterReactivation
- - elapsedAfterInactivity + 50 >= SLEEP_TIMEOUT);
- }
-
- public void testTimeout() throws InterruptedException {
-
- Task task0 = new Task("t0", "t0", true);
- assertEquals(task0.getElapsedTime(), 0);
- manager.activateTask(task0);
- assertEquals(1, manager.getTimerMap().values().size());
- TaskActivityTimer timer0 = manager.getTimerMap().get(task0);
- assertTrue(timer0.isStarted());
-
- Thread.sleep(SLEEP_TIMEOUT);
-
- // timeout should have occurred before SLEEP time
- long timeAfterSleep = task0.getElapsedTime();
-
- assertTrue(timeAfterSleep < SLEEP_TIMEOUT);
- timer0 = manager.getTimerMap().get(task0);
- assertNotNull(timer0);
- assertTrue(timer0.isSuspended());
-
- // Interaction should cause task timer to startup.
- mockInteraction();
- assertFalse(timer0.isSuspended());
- Thread.sleep(SLEEP_NOTIMEOUT);
- manager.deactivateTask(task0);
-
- assertTrue(task0.getElapsedTime() > timeAfterSleep);
- TasksUiPlugin.getTaskListManager().deactivateTask(task0);
-
- }
-
- protected void mockInteraction() {
- MylarMonitorPlugin.getDefault().notifyInteractionObserved(
- new InteractionEvent(InteractionEvent.Kind.EDIT, "java", "A.java", "mock-id"));
- }
-}
diff --git a/org.eclipse.mylyn.ide.dev/developer/src-old/TaskListBackupManager.java b/org.eclipse.mylyn.ide.dev/developer/src-old/TaskListBackupManager.java
deleted file mode 100644
index aa696b0e..00000000
--- a/org.eclipse.mylyn.ide.dev/developer/src-old/TaskListBackupManager.java
+++ /dev/null
@@ -1,350 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2007 Mylyn project committers 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
- *******************************************************************************/
-
-package org.eclipse.mylyn.internal.tasks.ui;
-
-import java.io.File;
-import java.lang.reflect.InvocationTargetException;
-import java.text.SimpleDateFormat;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Calendar;
-import java.util.Comparator;
-import java.util.Date;
-import java.util.HashSet;
-import java.util.Locale;
-import java.util.SortedMap;
-import java.util.Timer;
-import java.util.TimerTask;
-import java.util.TreeMap;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.util.IPropertyChangeListener;
-import org.eclipse.jface.util.PropertyChangeEvent;
-import org.eclipse.mylyn.internal.tasks.core.ITasksCoreConstants;
-import org.eclipse.mylyn.internal.tasks.core.TaskActivityUtil;
-import org.eclipse.mylyn.internal.tasks.ui.util.TaskDataExportJob;
-import org.eclipse.mylyn.internal.tasks.ui.wizards.TaskDataExportWizard;
-import org.eclipse.mylyn.tasks.core.AbstractTask;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.progress.IProgressService;
-
-/**
- * @author Rob Elves
- */
-public class TaskListBackupManager implements IPropertyChangeListener {
-
- public static final String TIMESTAMP_FORMAT = "yyyy-MM-dd-HHmmss";
-
- private static final String TITLE_TASKLIST_BACKUP = "Tasklist Backup";
-
- private static final String BACKUP_JOB_NAME = "Scheduled task data backup";
-
- public static final String BACKUP_FAILURE_MESSAGE = "Could not backup task data. Check backup preferences.\n";
-
- private static final long SECOND = 1000;
-
- private static final long MINUTE = 60 * SECOND;
-
- private static final long HOUR = 60 * MINUTE;
-
- private static final long DAY = 24 * HOUR;
-
- private Timer timer;
-
- //private static final Pattern zipPattern = Pattern.compile("^" + TaskDataExportWizard.ZIP_FILE_PREFIX + ".*");
-
- public TaskListBackupManager() {
- int days = TasksUiPlugin.getDefault().getPreferenceStore().getInt(TasksUiPreferenceConstants.BACKUP_SCHEDULE);
- if (days > 0) {
- start(HOUR);///2 * MINUTE
- }
- }
-
- public void start(long delay) {
- timer = new Timer();
- timer.schedule(new CheckBackupRequired(), delay, HOUR);
- }
-
- public void stop() {
- timer.cancel();
- }
-
- public void propertyChange(PropertyChangeEvent event) {
-// if (event.getProperty().equals(TaskListPreferenceConstants.BACKUP_AUTOMATICALLY)) {
-// if ((Boolean) event.getNewValue() == true) {
-// start(MINUTE);
-// } else {
-// stop();
-// }
-// }
- }
-
- public void backupNow(boolean synchronous) {
- String destination = TasksUiPlugin.getDefault().getBackupFolderPath();
-
- File backupFolder = new File(destination);
- if (!backupFolder.exists()) {
- backupFolder.mkdir();
- }
-
- removeOldBackups(backupFolder);
-
- String fileName = TaskDataExportWizard.getZipFileName();
-
- if (!synchronous) {
-
- ExportJob export = new ExportJob(destination, fileName);
- export.schedule();
-
- } else {
-
- final TaskDataExportJob backupJob = new TaskDataExportJob(destination, true, true, false, false, fileName,
- new HashSet<AbstractTask>());
-
- IProgressService service = PlatformUI.getWorkbench().getProgressService();
- try {
- service.run(true, false, backupJob);
- TasksUiPlugin.getDefault().getPreferenceStore().setValue(TasksUiPreferenceConstants.BACKUP_LAST,
- new Date().getTime());
- } catch (InterruptedException e) {
- // ignore
- } catch (InvocationTargetException e) {
- MessageDialog.openError(null, TITLE_TASKLIST_BACKUP, BACKUP_FAILURE_MESSAGE);
- }
-
- }
- }
-
- /** public for testing purposes */
- public void removeOldBackups(File folder) {
-
- int maxBackups = TasksUiPlugin.getDefault().getPreferenceStore().getInt(
- TasksUiPreferenceConstants.BACKUP_MAXFILES);
-
- File[] files = folder.listFiles();
- ArrayList<File> backupFiles = new ArrayList<File>();
- for (File file : files) {
- if (file.getName().startsWith(TaskDataExportWizard.ZIP_FILE_PREFIX)) {
- backupFiles.add(file);
- }
- }
-
- File[] backupFileArray = backupFiles.toArray(new File[backupFiles.size()]);
-
- if (backupFileArray != null && backupFileArray.length > 0) {
- Arrays.sort(backupFileArray, new Comparator<File>() {
- public int compare(File file1, File file2) {
- return new Long((file1).lastModified()).compareTo(new Long((file2).lastModified()));
- }
-
- });
-
- int toomany = backupFileArray.length - maxBackups;
- if (toomany > 0) {
- for (int x = 0; x < toomany; x++) {
- if (backupFileArray[x] != null) {
- backupFileArray[x].delete();
- }
- }
- }
- }
- }
-
- /** public for testing purposes */
- public synchronized static void removeOldBackups(File folder, Pattern pattern, int maxBackups) {
-
- if (maxBackups <= 0) {
- maxBackups = 1;
- }
-
- File[] files = folder.listFiles();
- ArrayList<File> backupFiles = new ArrayList<File>();
- for (File file : files) {
- Matcher matcher = pattern.matcher(file.getName());
- if (matcher.find()) {
- backupFiles.add(file);
- }
- }
-
- File[] backupFileArray = backupFiles.toArray(new File[backupFiles.size()]);
-
- if (backupFileArray != null && backupFileArray.length > 0) {
- Arrays.sort(backupFileArray, new Comparator<File>() {
- public int compare(File file1, File file2) {
- return new Long((file1).lastModified()).compareTo(new Long((file2).lastModified()));
- }
- });
-
- SortedMap<Long, File> filesMap = new TreeMap<Long, File>();
- for (File file2 : backupFileArray) {
- String name = file2.getName();
- if (name.startsWith(ITasksCoreConstants.PREFIX_TASKLIST)) {
- try {
- String dateString = name.substring(ITasksCoreConstants.PREFIX_TASKLIST.length() + 1,
- ITasksCoreConstants.PREFIX_TASKLIST.length() + TIMESTAMP_FORMAT.length() + 1);
- SimpleDateFormat format = new SimpleDateFormat(TIMESTAMP_FORMAT, Locale.ENGLISH);
- Date date = format.parse(dateString);
- filesMap.put(new Long(date.getTime()), file2);
- } catch (Exception e) {
- continue;
- }
- }
- }
-
- if (filesMap.size() > 0) {
-
- Calendar rangeStart = TaskActivityUtil.getCalendar();
- rangeStart.setTimeInMillis(filesMap.lastKey());
- TaskActivityUtil.snapStartOfHour(rangeStart);
- int startHour = rangeStart.get(Calendar.HOUR_OF_DAY);
- Calendar rangeEnd = TaskActivityUtil.getCalendar();
- rangeEnd.setTimeInMillis(rangeStart.getTimeInMillis());
- rangeEnd.add(Calendar.HOUR_OF_DAY, 1);
- // Keep one backup for last 8 hours of today
- for (int x = 1; x <= startHour && x < 9; x++) {
- SortedMap<Long, File> subMap = filesMap.subMap(rangeStart.getTimeInMillis(),
- rangeEnd.getTimeInMillis());
- if (subMap.size() > 1) {
- while (subMap.size() > 1) {
- File toDelete = subMap.remove(subMap.firstKey());
- toDelete.delete();
- }
- }
- rangeStart.add(Calendar.HOUR_OF_DAY, -1);
- rangeEnd.add(Calendar.HOUR_OF_DAY, -1);
- }
-
- // Keep one backup a day for the past 12 days
- TaskActivityUtil.snapStartOfDay(rangeEnd);
- rangeStart.add(Calendar.DAY_OF_YEAR, -1);
- for (int x = 1; x <= 12; x++) {
- SortedMap<Long, File> subMap = filesMap.subMap(rangeStart.getTimeInMillis(),
- rangeEnd.getTimeInMillis());
- if (subMap.size() > 1) {
- while (subMap.size() > 1) {
- File toDelete = subMap.remove(subMap.firstKey());
- toDelete.delete();
- }
- }
- rangeStart.add(Calendar.DAY_OF_YEAR, -1);
- rangeEnd.add(Calendar.DAY_OF_YEAR, -1);
- }
-
- // Remove all older backups
- SortedMap<Long, File> subMap = filesMap.subMap(0l, rangeStart.getTimeInMillis());
- if (subMap.size() > 0) {
- while (subMap.size() > 0) {
- File toDelete = subMap.remove(subMap.firstKey());
- toDelete.delete();
- }
- }
- }
- }
- }
-
-// public File getMostRecentBackup() {
-// String destination = TasksUiPlugin.getDefault().getBackupFolderPath();
-//
-// File backupFolder = new File(destination);
-// ArrayList<File> backupFiles = new ArrayList<File>();
-// if (backupFolder.exists()) {
-// File[] files = backupFolder.listFiles();
-// for (File file : files) {
-// if (file.getName().startsWith(TaskDataExportWizard.ZIP_FILE_PREFIX)) {
-// backupFiles.add(file);
-// }
-// }
-// }
-//
-// File[] backupFileArray = backupFiles.toArray(new File[backupFiles.size()]);
-//
-// if (backupFileArray != null && backupFileArray.length > 0) {
-// Arrays.sort(backupFileArray, new Comparator<File>() {
-// public int compare(File file1, File file2) {
-// return (new Long((file1).lastModified()).compareTo(new Long((file2).lastModified()))) * -1;
-// }
-//
-// });
-// }
-// if (backupFileArray != null && backupFileArray.length > 0) {
-// return backupFileArray[0];
-// }
-//
-// return null;
-// }
-
- class CheckBackupRequired extends TimerTask {
-
- @Override
- public void run() {
- PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() {
- public void run() {
- backupNow(false);
- }
- });
-// if (!Platform.isRunning() || TasksUiPlugin.getDefault() == null) {
-// return;
-// } else {
-// long lastBackup = TasksUiPlugin.getDefault().getPreferenceStore().getLong(
-// TasksUiPreferenceConstants.BACKUP_LAST);
-// int days = TasksUiPlugin.getDefault().getPreferenceStore().getInt(
-// TasksUiPreferenceConstants.BACKUP_SCHEDULE);
-// long waitPeriod = days * DAY;
-// final long now = new Date().getTime();
-//
-// if ((now - lastBackup) > waitPeriod) {
-// if (Platform.isRunning() && !PlatformUI.getWorkbench().isClosing()
-// && PlatformUI.getWorkbench().getDisplay() != null
-// && !PlatformUI.getWorkbench().getDisplay().isDisposed()) {
-// PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() {
-// public void run() {
-// backupNow(false);
-// }
-// });
-// }
-// }
-// }
- }
- }
-
- static class ExportJob extends Job {
-
- final TaskDataExportJob backupJob;
-
- public ExportJob(String destination, String filename) {
- super(BACKUP_JOB_NAME);
- backupJob = new TaskDataExportJob(destination, true, filename);
- }
-
- @Override
- protected IStatus run(IProgressMonitor monitor) {
- try {
- if (Platform.isRunning()) {
- backupJob.run(monitor);
- TasksUiPlugin.getDefault().getPreferenceStore().setValue(TasksUiPreferenceConstants.BACKUP_LAST,
- new Date().getTime());
- }
- } catch (InvocationTargetException e) {
- MessageDialog.openError(null, BACKUP_JOB_NAME,
- "Error occured during scheduled tasklist backup.\nCheck settings on Tasklist preferences page.");
- } catch (InterruptedException e) {
- return Status.CANCEL_STATUS;
- }
- return Status.OK_STATUS;
- }
-
- }
-}
diff --git a/org.eclipse.mylyn.ide.dev/developer/src-old/TaskListDataMigration.java b/org.eclipse.mylyn.ide.dev/developer/src-old/TaskListDataMigration.java
deleted file mode 100644
index 5b8bdc25..00000000
--- a/org.eclipse.mylyn.ide.dev/developer/src-old/TaskListDataMigration.java
+++ /dev/null
@@ -1,261 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 - 2006 Mylar committers 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
- *******************************************************************************/
-
-package org.eclipse.mylyn.tasks.ui;
-
-import java.io.File;
-import java.lang.reflect.InvocationTargetException;
-import java.util.ArrayList;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.SubProgressMonitor;
-import org.eclipse.jface.operation.IRunnableWithProgress;
-import org.eclipse.mylyn.context.core.MylarStatusHandler;
-import org.eclipse.mylyn.internal.context.core.MylarContextManager;
-import org.eclipse.mylyn.internal.context.core.util.ZipFileUtil;
-import org.eclipse.mylyn.internal.tasks.ui.ITasksUiConstants;
-import org.eclipse.mylyn.tasks.core.TaskRepositoryManager;
-
-/**
- * Migrate 0.6 -> 0.7 mylar data format
- *
- * @author Rob Elves
- */
-public class TaskListDataMigration implements IRunnableWithProgress {
-
- private File dataDirectory = null;
-
- public TaskListDataMigration(File sourceFolder) {
- this.dataDirectory = sourceFolder;
- }
-
- public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
- try {
- monitor.beginTask("Task Data Migration", IProgressMonitor.UNKNOWN);
- doMigration(monitor);
- } finally {
-
- }
- }
-
- public void doMigration(IProgressMonitor monitor) {
- try {
- if(dataDirectory == null || !dataDirectory.exists()) return;
- monitor.beginTask("Mylar Data Migration", 4);
- migrateTaskList(new SubProgressMonitor(monitor, IProgressMonitor.UNKNOWN));
- monitor.worked(1);
- migrateRepositoriesData(new SubProgressMonitor(monitor, IProgressMonitor.UNKNOWN));
- monitor.worked(1);
- migrateTaskContextData(new SubProgressMonitor(monitor, IProgressMonitor.UNKNOWN));
- monitor.worked(1);
- migrateActivityData(new SubProgressMonitor(monitor, IProgressMonitor.UNKNOWN));
- monitor.worked(1);
- } finally {
- monitor.done();
- }
- }
-
- public boolean migrateTaskList(IProgressMonitor monitor) {
- File oldTasklistFile = new File(dataDirectory, ITasksUiConstants.OLD_TASK_LIST_FILE);
- File newTasklistFile = new File(dataDirectory, ITasksUiConstants.DEFAULT_TASK_LIST_FILE);
- if (!oldTasklistFile.exists())
- return false;
- if (newTasklistFile.exists()) {
- if (!newTasklistFile.delete()) {
- MylarStatusHandler.fail(null, "Could not overwrite tasklist", false);
- return false;
- }
- }
- ArrayList<File> filesToZip = new ArrayList<File>();
- filesToZip.add(oldTasklistFile);
- try {
- monitor.beginTask("Migrate Tasklist Data", 1);
- ZipFileUtil.createZipFile(newTasklistFile, filesToZip, new SubProgressMonitor(monitor, 1));
- if (!oldTasklistFile.delete()) {
- MylarStatusHandler.fail(null, "Could not remove old tasklist.", false);
- return false;
- }
- monitor.worked(1);
- } catch (Exception e) {
- MylarStatusHandler.fail(e, "Error occurred while migrating old tasklist: " + e.getMessage(), true);
- return false;
- } finally {
- monitor.done();
- }
- return true;
- }
-
- public boolean migrateRepositoriesData(IProgressMonitor monitor) {
- File oldRepositoriesFile = new File(dataDirectory, TaskRepositoryManager.OLD_REPOSITORIES_FILE);
- File newRepositoriesFile = new File(dataDirectory, TaskRepositoryManager.DEFAULT_REPOSITORIES_FILE);
- if (!oldRepositoriesFile.exists())
- return false;
- if (newRepositoriesFile.exists()) {
- if (!newRepositoriesFile.delete()) {
- MylarStatusHandler.fail(null,
- "Could not overwrite repositories file. Check read/write permission on data directory.", false);
- return false;
- }
- }
- ArrayList<File> filesToZip = new ArrayList<File>();
- filesToZip.add(oldRepositoriesFile);
- try {
- monitor.beginTask("Migrate Repository Data", 1);
- ZipFileUtil.createZipFile(newRepositoriesFile, filesToZip, new SubProgressMonitor(monitor, 1));
- if (!oldRepositoriesFile.delete()) {
- MylarStatusHandler
- .fail(
- null,
- "Could not remove old repositories file. Check read/write permission on data directory.",
- false);
- return false;
- }
- monitor.worked(1);
- } catch (Exception e) {
- MylarStatusHandler.fail(e, "Error occurred while migrating old repositories data: " + e.getMessage(), true);
- return false;
- } finally {
- monitor.done();
- }
- return true;
- }
-
- public boolean migrateTaskContextData(IProgressMonitor monitor) {
- ArrayList<File> contextFiles = new ArrayList<File>();
- for (File file : dataDirectory.listFiles()) {
- if (file.getName().startsWith("http") || file.getName().startsWith("local") || file.getName().startsWith("task")) {
- if (!file.getName().endsWith(".zip")) {
- contextFiles.add(file);
- }
- }
- }
-
- try {
- monitor.beginTask("Task Context Migration", contextFiles.size());
-
- File contextsFolder = new File(dataDirectory, MylarContextManager.CONTEXTS_DIRECTORY);
- if (!contextsFolder.exists()) {
- if (!contextsFolder.mkdir()) {
- MylarStatusHandler.fail(null,
- "Could not create contexts folder. Check read/write permission on data directory.", false);
- return false;
- }
- }
- for (File file : contextFiles) {
- ArrayList<File> filesToZip = new ArrayList<File>();
- filesToZip.add(file);
- File newContextFile = new File(contextsFolder, file.getName()+".zip");
- if (newContextFile.exists()) {
- if (!newContextFile.delete()) {
- MylarStatusHandler.fail(null,
- "Could not overwrite context file. Check read/write permission on data directory.",
- false);
- return false;
- }
- }
- ZipFileUtil.createZipFile(newContextFile, filesToZip, new SubProgressMonitor(monitor, 1));
- if (!file.delete()) {
- MylarStatusHandler.fail(null,
- "Could not remove old context file. Check read/write permission on data directory.", false);
- return false;
- }
- monitor.worked(1);
- }
- } catch (Exception e) {
- MylarStatusHandler.fail(e, "Error occurred while migrating old repositories data: " + e.getMessage(), true);
- return false;
- } finally {
- monitor.done();
- }
- return true;
- }
-
- public boolean migrateActivityData(IProgressMonitor monitor) {
- File oldActivityFile = new File(dataDirectory, MylarContextManager.OLD_CONTEXT_HISTORY_FILE_NAME+MylarContextManager.CONTEXT_FILE_EXTENSION_OLD);
- if (!oldActivityFile.exists())
- return false;
-
- File contextsFolder = new File(dataDirectory, MylarContextManager.CONTEXTS_DIRECTORY);
- if (!contextsFolder.exists()) {
- if (!contextsFolder.mkdir()) {
- MylarStatusHandler.fail(null,
- "Could not create contexts folder. Check read/write permission on data directory.", false);
- return false;
- }
- }
-
- File newActivityFile = new File(contextsFolder, MylarContextManager.CONTEXT_HISTORY_FILE_NAME+MylarContextManager.CONTEXT_FILE_EXTENSION);
-
- if (newActivityFile.exists()) {
- if (!newActivityFile.delete()) {
- MylarStatusHandler.fail(null,
- "Could not overwrite activity file. Check read/write permission on data directory.", false);
- return false;
- }
- }
- ArrayList<File> filesToZip = new ArrayList<File>();
- filesToZip.add(oldActivityFile);
- try {
- monitor.beginTask("Migrate Activity Data", 1);
- ZipFileUtil.createZipFile(newActivityFile, filesToZip, new SubProgressMonitor(monitor, 1));
- if (!oldActivityFile.delete()) {
- MylarStatusHandler
- .fail(
- null,
- "Could not remove old activity file. Check read/write permission on data directory.",
- false);
- return false;
- }
- monitor.worked(1);
- } catch (Exception e) {
- MylarStatusHandler.fail(e, "Error occurred while migrating old activity data: " + e.getMessage(), true);
- return false;
- } finally {
- monitor.done();
- }
- return true;
- }
-
-}
-
-//public boolean migrateActivityData(IProgressMonitor monitor) {
-//File oldActivityFile = new File(dataDirectory, MylarContextManager.OLD_CONTEXT_HISTORY_FILE_NAME+MylarContextManager.CONTEXT_FILE_EXTENSION_OLD);
-//if (!oldActivityFile.exists())
-// return false;
-//
-//File newActivityFile = new File(dataDirectory, MylarContextManager.CONTEXT_HISTORY_FILE_NAME+MylarContextManager.CONTEXT_FILE_EXTENSION);
-//
-//if (newActivityFile.exists()) {
-// if (!newActivityFile.delete()) {
-// MylarStatusHandler.fail(null,
-// "Could not overwrite activity file. Check read/write permission on data directory.", false);
-// return false;
-// }
-//}
-//ArrayList<File> filesToZip = new ArrayList<File>();
-//filesToZip.add(oldActivityFile);
-//try {
-// monitor.beginTask("Migrate Activity Data", 1);
-// ZipFileUtil.createZipFile(newActivityFile, filesToZip, new SubProgressMonitor(monitor, 1));
-// if (!oldActivityFile.delete()) {
-// MylarStatusHandler
-// .fail(
-// null,
-// "Could not remove old activity file. Check read/write permission on data directory.",
-// false);
-// return false;
-// }
-// monitor.worked(1);
-//} catch (Exception e) {
-// MylarStatusHandler.fail(e, "Error occurred while migrating old activity data: " + e.getMessage(), true);
-// return false;
-//} finally {
-// monitor.done();
-//}
-//return true;
-//} \ No newline at end of file
diff --git a/org.eclipse.mylyn.ide.dev/developer/src-old/TaskListSaveManager.java b/org.eclipse.mylyn.ide.dev/developer/src-old/TaskListSaveManager.java
deleted file mode 100644
index d0f40ea8..00000000
--- a/org.eclipse.mylyn.ide.dev/developer/src-old/TaskListSaveManager.java
+++ /dev/null
@@ -1,352 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2007 Mylyn project committers 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
- *******************************************************************************/
-
-package org.eclipse.mylyn.internal.tasks.ui.util;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.text.SimpleDateFormat;
-import java.util.Date;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Locale;
-import java.util.Queue;
-import java.util.Set;
-import java.util.regex.Pattern;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.mylyn.commons.core.StatusHandler;
-import org.eclipse.mylyn.context.core.ContextCore;
-import org.eclipse.mylyn.context.core.IInteractionContextManager;
-import org.eclipse.mylyn.internal.tasks.core.ITasksCoreConstants;
-import org.eclipse.mylyn.internal.tasks.ui.TaskListManager;
-import org.eclipse.mylyn.internal.tasks.ui.TasksUiPlugin;
-import org.eclipse.mylyn.tasks.core.AbstractTask;
-import org.eclipse.mylyn.tasks.core.ITaskListChangeListener;
-import org.eclipse.mylyn.tasks.core.TaskContainerDelta;
-
-//import org.eclipse.ui.PlatformUI;
-
-/**
- * @author Mik Kersten
- * @author Eugene Kuleshov
- * @author Rob Elves
- */
-public class TaskListSaveManager implements ITaskListChangeListener, IBackgroundSaveListener {
-
- private final static int DEFAULT_SAVE_INTERVAL = 1 * 60 * 1000;
-
- private final BackgroundSaveTimer saveTimer;
-
- private final TaskListSaverJob taskListSaverJob;
-
- private final boolean initializationWarningDialogShow = false;
-
- private static final int MAX_TASKLIST_SNAPSHOTS = 8;
-
- public static final Pattern SNAPSHOT_REGEXP = Pattern.compile("^tasklist-.*");
-
- public TaskListSaveManager() {
- saveTimer = new BackgroundSaveTimer(this);
- saveTimer.setSaveIntervalMillis(DEFAULT_SAVE_INTERVAL);
- saveTimer.start();
-
- taskListSaverJob = new TaskListSaverJob();
- //taskListSaverJob.setRule(TasksUiPlugin.getTaskList());
- taskListSaverJob.schedule();
- }
-
- /**
- * Called periodically by the save timer
- */
- public void saveRequested() {
- if (TasksUiPlugin.getDefault() != null && Platform.isRunning()) {// &&
- // TasksUiPlugin.getDefault().isShellActive()
- try {
- taskListSaverJob.runRequested();
- } catch (Exception e) {
- StatusHandler.log(new Status(IStatus.ERROR, TasksUiPlugin.ID_PLUGIN, "Could not auto save task list", e));
- }
- }
- }
-
- /**
- * Should only be used by TaskListManager and unit tests
- *
- * @param saveContext
- * @param async
- */
- public void saveTaskList(boolean saveContext, boolean async) {
- if (TasksUiPlugin.getDefault() != null && TasksUiPlugin.getDefault().isInitialized()) {
- TaskListManager taskListManager = TasksUiPlugin.getTaskListManager();
- if (async) {
- if (saveContext) {
- AbstractTask task = taskListManager.getActiveTask();
- if (task != null) {
- taskListSaverJob.addTaskContext(task);
- }
- }
- taskListSaverJob.requestSave();
- } else {
- taskListSaverJob.waitSaveCompleted();
- IInteractionContextManager contextManager = ContextCore.getContextManager();
- if (saveContext) {
- AbstractTask task = taskListManager.getActiveTask();
- if (task != null) {
- contextManager.saveContext(task.getHandleIdentifier());
- }
- }
- internalSaveTaskList();
- }
- } /*else if (PlatformUI.getWorkbench() != null && !PlatformUI.getWorkbench().isClosing()) {
- StatusHandler.fail(new Status(IStatus.WARNING, TasksUiPlugin.ID_PLUGIN,
- "Possible task list initialization failure, not saving list"));
- if (!initializationWarningDialogShow) {
- initializationWarningDialogShow = true;
- PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() {
- public void run() {
- if (PlatformUI.getWorkbench() != null && PlatformUI.getWorkbench().getDisplay() != null) {
- MessageDialog.openInformation(
- PlatformUI.getWorkbench().getDisplay().getActiveShell(),
- ITasksUiConstants.TITLE_DIALOG,
- "If task list is blank, Mylyn Task List may have failed to initialize.\n\n"
- + "First, try restarting to see if that corrects the problem.\n\n"
- + "Then, check the Error Log view for messages, and the FAQ for solutions.\n\n"
- + ITasksUiConstants.URL_HOMEPAGE);
- }
- }
- });
- }*/
- //}
- }
-
- private synchronized void internalSaveTaskList() {
- TaskListManager taskListManager = TasksUiPlugin.getTaskListManager();
- File current = taskListManager.getTaskListFile();
- SimpleDateFormat format = new SimpleDateFormat(ITasksCoreConstants.TIMESTAMP_FORMAT, Locale.ENGLISH);
- String date = format.format(new Date());
- String backupFileName = ITasksCoreConstants.PREFIX_TASKLIST + "-" + date + ITasksCoreConstants.FILE_EXTENSION;
-
- String destination = TasksUiPlugin.getDefault().getBackupFolderPath();
-
- File backupFolder = new File(destination);
- if (!backupFolder.exists()) {
- backupFolder.mkdir();
- }
-
- File backup = new File(backupFolder, backupFileName);
- if (current.renameTo(backup)) {
- TasksUiPlugin.getBackupManager().removeOldBackups();
-
- String newTasklistPath = TasksUiPlugin.getDefault().getDataDirectory() + File.separator
- + ITasksCoreConstants.DEFAULT_TASK_LIST_FILE;
- File newTaskListFile = new File(newTasklistPath);
- taskListManager.setTaskListFile(newTaskListFile);
- } else {
- StatusHandler.log(new Status(IStatus.WARNING, TasksUiPlugin.ID_PLUGIN,
- "Unable to create task list snapshot " + backup.getAbsolutePath()));
- }
-
- taskListManager.getTaskListWriter().writeTaskList(taskListManager.getTaskList(),
- taskListManager.getTaskListFile());
- }
-
- /**
- * Copies all files in the current data directory to the specified folder. Will overwrite.
- */
- public void copyDataDirContentsTo(String targetFolderPath) {
- saveTaskList(true, false);
-
- File mainDataDir = new File(TasksUiPlugin.getDefault().getDataDirectory());
-
- for (File currFile : mainDataDir.listFiles()) {
- if (currFile.isFile()) {
- File destFile = new File(targetFolderPath + File.separator + currFile.getName());
- copy(currFile, destFile);
- } else if (currFile.isDirectory()) {
- File destDir = new File(targetFolderPath + File.separator + currFile.getName());
- if (!destDir.exists()) {
- if (!destDir.mkdir()) {
- StatusHandler.log(new Status(IStatus.WARNING, TasksUiPlugin.ID_PLUGIN,
- "Unable to create destination context folder: " + destDir.getAbsolutePath()));
- continue;
- }
- }
- for (File file : currFile.listFiles()) {
- File destFile = new File(destDir, file.getName());
- if (destFile.exists()) {
- destFile.delete();
- }
- copy(file, destFile);
- }
- }
- }
- }
-
- // public void createTaskListBackupFile() {
- // String path = TasksUiPlugin.getDefault().getDataDirectory() +
- // File.separator
- // + TasksUiPlugin.DEFAULT_TASK_LIST_FILE;
- // File taskListFile = new File(path);
- // String backup = path.substring(0, path.indexOf('.')) +
- // FILE_SUFFIX_BACKUP;
- // copy(taskListFile, new File(backup));
- // }
- //
- // public String getBackupFilePath() {
- // String path = TasksUiPlugin.getDefault().getDataDirectory() +
- // File.separator
- // + TasksUiPlugin.DEFAULT_TASK_LIST_FILE;
- // return path.substring(0, path.indexOf('.')) + FILE_SUFFIX_BACKUP;
- // }
- //
- // public void reverseBackup() {
- // String path = TasksUiPlugin.getDefault().getBackupFolderPath() +
- // File.separator
- // + TasksUiPlugin.DEFAULT_TASK_LIST_FILE;
- // File taskListFile = new File(path);
- // String backup = path.substring(0, path.indexOf('.')) +
- // FILE_SUFFIX_BACKUP;
- // copy(new File(backup), taskListFile);
- // }
-
- private boolean copy(File src, File dst) {
- try {
- InputStream in = new FileInputStream(src);
- OutputStream out = new FileOutputStream(dst);
-
- // Transfer bytes from in to out
- byte[] buf = new byte[1024];
- int len;
- while ((len = in.read(buf)) > 0) {
- out.write(buf, 0, len);
- }
- in.close();
- out.close();
- return true;
- } catch (IOException ioe) {
- return false;
- }
- }
-
- public void taskActivated(AbstractTask task) {
- // ignore
- }
-
- public void tasksActivated(List<AbstractTask> tasks) {
- // ignore
- }
-
- public void taskDeactivated(AbstractTask task) {
- saveTaskList(true, true);
- }
-
- public void localInfoChanged(AbstractTask task) {
- saveTaskList(false, true);
- }
-
- public void repositoryInfoChanged(AbstractTask task) {
- // ignore
- }
-
- /** For testing only * */
- public BackgroundSaveTimer getSaveTimer() {
- return saveTimer;
- }
-
- public void containersChanged(Set<TaskContainerDelta> containers) {
- saveTaskList(false, true);
- }
-
- public void synchronizationCompleted() {
- // ignore
- }
-
- private class TaskListSaverJob extends Job {
-
- private final Queue<AbstractTask> taskQueue = new LinkedList<AbstractTask>();
-
- private volatile boolean saveRequested = false;
-
- private volatile boolean saveCompleted = true;
-
- TaskListSaverJob() {
- super("Task List Saver");
- setPriority(Job.LONG);
- setSystem(true);
- }
-
- @Override
- protected IStatus run(IProgressMonitor monitor) {
- while (true) {
- if (saveRequested) {
- saveRequested = false;
- saveCompleted = false;
- IInteractionContextManager contextManager = ContextCore.getContextManager();
- while (!taskQueue.isEmpty()) {
- AbstractTask task = taskQueue.poll();
- if (task != null) {
- contextManager.saveContext(task.getHandleIdentifier());
- }
- }
- internalSaveTaskList();
- }
-
- if (!saveRequested) {
- synchronized (this) {
- saveCompleted = true;
- notifyAll();
- try {
- wait();
- } catch (InterruptedException ex) {
- // ignore
- }
- }
- }
- }
- }
-
- void addTaskContext(AbstractTask task) {
- taskQueue.add(task);
- }
-
- void requestSave() {
- saveRequested = true;
- }
-
- void runRequested() {
- synchronized (this) {
- notifyAll();
- }
- }
-
- void waitSaveCompleted() {
- while (!saveCompleted) {
- synchronized (this) {
- try {
- wait();
- } catch (InterruptedException ex) {
- // ignore
- }
- }
- }
- }
- }
-
- public void taskListRead() {
- }
-
-}
diff --git a/org.eclipse.mylyn.ide.dev/developer/src-old/TaskRepositoriesTableLabelProvider.java b/org.eclipse.mylyn.ide.dev/developer/src-old/TaskRepositoriesTableLabelProvider.java
deleted file mode 100644
index eb4f958c..00000000
--- a/org.eclipse.mylyn.ide.dev/developer/src-old/TaskRepositoriesTableLabelProvider.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 - 2006 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.mylyn.internal.tasks.ui.views;
-
-import org.eclipse.jface.viewers.DecoratingLabelProvider;
-import org.eclipse.jface.viewers.ILabelDecorator;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.ITableLabelProvider;
-import org.eclipse.mylyn.tasks.core.AbstractRepositoryConnector;
-import org.eclipse.mylyn.tasks.core.TaskRepository;
-import org.eclipse.swt.graphics.Image;
-
-/**
- * @author Mik Kersten
- */
-public class TaskRepositoriesTableLabelProvider extends DecoratingLabelProvider implements ITableLabelProvider {
-
- public TaskRepositoriesTableLabelProvider(ILabelProvider provider, ILabelDecorator decorator) {
- super(provider, decorator);
- }
-
- public String getColumnText(Object object, int index) {
- switch (index) {
- case 0:
- return null;
- case 1:
- if (object instanceof TaskRepository) {
- TaskRepository repository = (TaskRepository) object;
- if (repository.getRepositoryLabel() != null && repository.getRepositoryLabel().length() > 0) {
- return repository.getRepositoryLabel();
- } else {
- return null;
- }
-// else {
-// return repository.getUrl();
-// }
- } else if (object instanceof AbstractRepositoryConnector) {
- return ((AbstractRepositoryConnector) object).getLabel();
- } else {
- return getText(object);
- }
- case 2:
- if (object instanceof TaskRepository) {
- TaskRepository repository = (TaskRepository) object;
- return repository.getUrl();
- } else if (object instanceof AbstractRepositoryConnector) {
- return ((AbstractRepositoryConnector) object).getLabel();
- } else {
- return getText(object);
- }
- }
- return null;
- }
-
- public Image getColumnImage(Object element, int columnIndex) {
- if (columnIndex == 0) {
- return super.getImage(element);
- } else {
- return null;
- }
- }
-}
diff --git a/org.eclipse.mylyn.ide.dev/developer/src-old/TaskTest.java b/org.eclipse.mylyn.ide.dev/developer/src-old/TaskTest.java
deleted file mode 100644
index e8911df7..00000000
--- a/org.eclipse.mylyn.ide.dev/developer/src-old/TaskTest.java
+++ /dev/null
@@ -1,139 +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.mylyn.tasklist.tests;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * @author Shawn Minto
- *
- * TODO: remove?
- */
-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 (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) {
- result = false;
- break;
- }
- }
- } else {
- 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 {
- 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.ide.dev/developer/src-old/TaskscapeVizView.java b/org.eclipse.mylyn.ide.dev/developer/src-old/TaskscapeVizView.java
deleted file mode 100644
index f5b13fa0..00000000
--- a/org.eclipse.mylyn.ide.dev/developer/src-old/TaskscapeVizView.java
+++ /dev/null
@@ -1,195 +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 4, 2005
- */
-package org.eclipse.mylyn.sandbox.springviz;
-
-import java.awt.*;
-import java.awt.event.*;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.awt.SWT_AWT;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.part.ViewPart;
-
-import edu.berkeley.guir.prefuse.*;
-import edu.berkeley.guir.prefuse.action.RepaintAction;
-import edu.berkeley.guir.prefuse.action.assignment.ColorFunction;
-import edu.berkeley.guir.prefuse.action.filter.GraphFilter;
-import edu.berkeley.guir.prefuse.activity.ActionList;
-import edu.berkeley.guir.prefuse.activity.Activity;
-import edu.berkeley.guir.prefuse.graph.Graph;
-import edu.berkeley.guir.prefuse.graph.GraphLib;
-import edu.berkeley.guir.prefuse.render.*;
-import edu.berkeley.guir.prefusex.controls.*;
-import edu.berkeley.guir.prefusex.force.*;
-import edu.berkeley.guir.prefusex.layout.ForceDirectedLayout;
-
-/**
- * @author Mik Kersten
- */
-public class TaskscapeVizView extends ViewPart {
-
- public TaskscapeVizView() {
- super();
- }
-
- public void createPartControl(Composite parent) {
- try {
- System.setProperty("sun.awt.noerasebackground", "true");
- } catch (NoSuchMethodError error) {
- }
- Composite stuff = new Composite(parent, SWT.EMBEDDED);
- java.awt.Frame frame = SWT_AWT.new_Frame(stuff);
-// final java.awt.Label statusLabel = new java.awt.Label();
-// statusFrame.add(statusLabel);
-
-// String file = ("C:/Dev/mylar-workspace/prefuse/etc/friendster.xml");
- Graph g = GraphLib.getGrid(5,5);
-
- System.out.println("Visualizing Graph: "
- +g.getNodeCount()+" nodes, "+g.getEdgeCount()+" edges");
-
- ForceSimulator fsim = new ForceSimulator();
- fsim.addForce(new NBodyForce(-0.4f, -1f, 0.9f));
- fsim.addForce(new SpringForce(4E-5f, 75f));
- fsim.addForce(new DragForce(-0.005f));
-
- ForceDemo fdemo = new ForceDemo(g, fsim);
- fdemo.runDemo(frame);
- }
-
- public void setFocus() {
- }
-
-}
-
-class ForceDemo extends Display {
- private static final long serialVersionUID = 1L;
-
- private ForcePanel fpanel;
-
- private ForceSimulator m_fsim;
- private String m_textField;
- private ItemRegistry m_registry;
- private Activity m_actionList;
-
- private Font frameCountFont = new Font("SansSerif", Font.PLAIN, 14);
-
- public ForceDemo(Graph g, ForceSimulator fsim) {
- this(g, fsim, "label");
- } //
-
- public ForceDemo(Graph g, ForceSimulator fsim, String textField) {
- // set up component first
- m_fsim = fsim;
- m_textField = textField;
- m_registry = new ItemRegistry(g);
- this.setItemRegistry(m_registry);
- initRenderers();
- m_actionList = initActionList();
- setSize(700,700);
- pan(350,350);
- this.addControlListener(new NeighborHighlightControl());
- this.addControlListener(new DragControl(false, true));
- this.addControlListener(new FocusControl(0));
- this.addControlListener(new PanControl(false));
- this.addControlListener(new ZoomControl(false));
- } //
-
- public void runDemo(final java.awt.Frame frame) {
- // now set up application window
- fpanel = new ForcePanel(m_fsim) {
- private static final long serialVersionUID = 3617009741533296438L;
-
- public void update(java.awt.Graphics g) {
- /* Do not erase the background */
- paint(g);
- }
- };
-
-// frame = new Frame("Force Simulator Demo");
-// Container c = frame.getContentPane();
- frame.setLayout(new BorderLayout());
- frame.add(this, BorderLayout.CENTER);
- frame.add(fpanel, BorderLayout.EAST);
- frame.addWindowListener(new WindowAdapter() {
- public void windowClosing(WindowEvent e) {
- System.exit(0);
- }
- });
- frame.addComponentListener(new ComponentAdapter() {
- public void componentResized(ComponentEvent e) {
- Dimension d = frame.getSize();
- Dimension p = fpanel.getSize();
- Insets in = frame.getInsets();
- ForceDemo.this.setSize(d.width-in.left-in.right-p.width,
- d.height-in.top-in.bottom);
- } //
-
- });
- frame.pack();
- frame.setVisible(true);
-
- // start force simulation
- m_actionList.runNow();
- } //
-
- private void initRenderers() {
- TextItemRenderer nodeRenderer = new TextItemRenderer();
- nodeRenderer.setRenderType(TextItemRenderer.RENDER_TYPE_FILL);
- nodeRenderer.setRoundedCorner(8,8);
- nodeRenderer.setTextAttributeName(m_textField);
- DefaultNodeRenderer nRenderer = new DefaultNodeRenderer();
- DefaultEdgeRenderer edgeRenderer = new DefaultEdgeRenderer();
- m_registry.setRendererFactory(new DefaultRendererFactory(
- nodeRenderer, edgeRenderer, null));
- } //
-
- private ActionList initActionList() {
- ActionList actionList = new ActionList(m_registry,-1,20);
- actionList.add(new GraphFilter());
- actionList.add(new ForceDirectedLayout(m_fsim, false, false));
- actionList.add(new DemoColorFunction());
- actionList.add(new RepaintAction());
- return actionList;
- } //
-
- public class DemoColorFunction extends ColorFunction {
- private Color pastelRed = new Color(255,125,125);
- private Color pastelOrange = new Color(255,200,125);
- private Color lightGray = new Color(220,220,255);
- public Paint getColor(VisualItem item) {
- if ( item instanceof EdgeItem ) {
- if ( item.isHighlighted() )
- return pastelOrange;
- else
- return Color.LIGHT_GRAY;
- } else {
- return Color.BLACK;
- }
- } //
- public Paint getFillColor(VisualItem item) {
- if ( item.isHighlighted() )
- return pastelOrange;
- else if ( item instanceof NodeItem ) {
- if ( item.isFocus() )
- return pastelRed;
- else
- return lightGray;
- } else {
- return Color.BLACK;
- }
- } //
- } //
-
-} // end of class ForceDemo \ No newline at end of file
diff --git a/org.eclipse.mylyn.ide.dev/developer/src-old/TimingStuff.jpage b/org.eclipse.mylyn.ide.dev/developer/src-old/TimingStuff.jpage
deleted file mode 100644
index 36802374..00000000
--- a/org.eclipse.mylyn.ide.dev/developer/src-old/TimingStuff.jpage
+++ /dev/null
@@ -1,16 +0,0 @@
-//MylarPlugin.log(this, "text changed: " + event);
-//if (javaEditingTimer == null) {
-// javaEditingTimer = new PassiveTimer();
-// javaEditingTimer.restart();
-//}
-//if (keystrokeTimer != null) keystrokeTimer.stop();
-//keystrokeTimer = new ActiveTimer(
-// KEYSTROKE_TIMOUT,
-// new IActiveTimerListener() {
-// public void fireTimedOut() {
-// MylarPlugin.getUserManager().getCurrentSession().appendToTimeJavaEditing(
-// javaEditingTimer.getElapsedInSeconds()
-// );
-// javaEditingTimer = null;
-// }
-// });
diff --git a/org.eclipse.mylyn.ide.dev/developer/src-old/UserSelectionMonitor.java b/org.eclipse.mylyn.ide.dev/developer/src-old/UserSelectionMonitor.java
deleted file mode 100644
index 2a415f87..00000000
--- a/org.eclipse.mylyn.ide.dev/developer/src-old/UserSelectionMonitor.java
+++ /dev/null
@@ -1,94 +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 8, 2005
- */
-package org.eclipse.mylyn.monitor;
-
-import org.eclipse.core.internal.resources.File;
-import org.eclipse.jdt.core.IJavaElement;
-import org.eclipse.jdt.internal.ui.javaeditor.JavaEditor;
-import org.eclipse.jdt.internal.ui.javaeditor.JavaOutlinePage;
-import org.eclipse.jdt.internal.ui.packageview.PackageExplorerPart;
-import org.eclipse.jface.text.*;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.search2.internal.ui.SearchView;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.texteditor.AbstractTextEditor;
-import org.eclipse.ui.views.contentoutline.ContentOutline;
-import org.eclipse.ui.views.markers.internal.ProblemView;
-
-import org.eclipse.mylyn.core.AbstractSelectionMonitor;
-import org.eclipse.mylyn.monitor.stats.UsageSession;
-import org.eclipse.mylyn.monitor.views.UsageStatisticsView;
-
-/**
- * @author Mik Kersten
- */
-public class UserSelectionMonitor extends AbstractSelectionMonitor {
-
- private final ITextListener TEXT_LISTENER = new ITextListener() {
- public void textChanged(TextEvent event) {
- MonitorPlugin.getStatisticsManager().getCurrentSession().getCardinalStatistic(
- UsageSession.NUM_KEYSTROKES_JAVA_EDITOR).increment();
- }
- };
-
- public UserSelectionMonitor() {
- super();
- }
-
- public void handleElementSelection(IJavaElement selected) {
- }
-
- protected void handleUnknownSelection(Object selectedObject) {
- }
-
- public void handleReferenceNavigation(IJavaElement from, IJavaElement to) {
- }
-
- protected void handleSelection(File file) {
- }
-
- protected void handleWorkbenchPartSelection(IWorkbenchPart part, ISelection selection) {
- UsageSession session = MonitorPlugin.getStatisticsManager().getCurrentSession();
- if (part instanceof PackageExplorerPart) {
- session.getCardinalStatistic(UsageSession.NUM_SELECTIONS_PKG_EXPLORER).increment();
- } else if (part instanceof ContentOutline) {
- ContentOutline outline = (ContentOutline)part;
- if (outline.getCurrentPage() instanceof JavaOutlinePage) {
- session.getCardinalStatistic(UsageSession.NUM_SELECTIONS_JAVA_OUTLINE).increment();
- }
- } else if (part instanceof SearchView) {
- session.getCardinalStatistic(UsageSession.NUM_SELECTIONS_SEARCH).increment();
- } else if (part instanceof ProblemView) {
- session.getCardinalStatistic(UsageSession.NUM_SELECTIONS_PROBLEMS).increment();
- } else if (part instanceof AbstractTextEditor) {
- session.getCardinalStatistic(UsageSession.NUM_SELECTIONS_JAVA_EDITOR).increment();
- } else {
- session.getCardinalStatistic(UsageSession.NUM_SELECTIONS_OTHER).increment();
-// MonitorPlugin.log(this, "unknow selection from: " + part.getClass());
- }
- if (UsageStatisticsView.getDefault() != null) {
- UsageStatisticsView.getDefault().getViewer().refresh();
- }
- if (part instanceof AbstractTextEditor) {
- if (selection instanceof TextSelection && part instanceof JavaEditor) {
- JavaEditor currentEditor = (JavaEditor)part;
- currentEditor.getViewer().removeTextListener(TEXT_LISTENER); // in case already added
- currentEditor.getViewer().addTextListener(TEXT_LISTENER);
- }
- }
- }
-
- public void handleImplementorNavigation(IJavaElement from, IJavaElement to) {
- }
-}
diff --git a/org.eclipse.mylyn.ide.dev/developer/src-old/bugs/BugzillaActiveSearchTest.java b/org.eclipse.mylyn.ide.dev/developer/src-old/bugs/BugzillaActiveSearchTest.java
deleted file mode 100644
index 33fd05b4..00000000
--- a/org.eclipse.mylyn.ide.dev/developer/src-old/bugs/BugzillaActiveSearchTest.java
+++ /dev/null
@@ -1,339 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2008 Tasktop Technologies 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:
- * Tasktop Technologies - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.mylyn.sandbox.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.mylyn.internal.bugzilla.core.BugzillaCorePlugin;
-import org.eclipse.mylyn.internal.bugzilla.core.IBugzillaConstants;
-import org.eclipse.mylyn.internal.context.core.IActiveSearchListener;
-import org.eclipse.mylyn.internal.sandbox.bridge.bugs.BugzillaMylynSearch;
-import org.eclipse.mylyn.internal.sandbox.bridge.bugs.BugzillaReportInfo;
-import org.eclipse.mylyn.internal.sandbox.bridge.bugs.MylynBugsManager;
-import org.eclipse.mylyn.internal.tasks.core.AbstractTask;
-import org.eclipse.mylyn.internal.tasks.core.TaskCategory;
-import org.eclipse.mylyn.internal.tasks.core.TaskTask;
-import org.eclipse.mylyn.internal.tasks.ui.TaskListManager;
-import org.eclipse.mylyn.internal.tasks.ui.TasksUiPlugin;
-import org.eclipse.mylyn.java.tests.search.SearchPluginTestHelper;
-import org.eclipse.mylyn.java.tests.search.WorkspaceSetupHelper;
-import org.eclipse.mylyn.tasks.core.TaskRepository;
-
-/*
- * 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 BugzillaActiveSearchTest extends TestCase {
-
- private TaskRepository repository;
-
- // 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 final List<List<?>> lists = new ArrayList<List<?>>();
-
- private IType astNodeType;
-
- @Override
- protected void setUp() throws Exception {
- WorkspaceSetupHelper.setupWorkspace();
- repository = new TaskRepository(BugzillaCorePlugin.CONNECTOR_KIND, IBugzillaConstants.ECLIPSE_BUGZILLA_URL);
- TasksUiPlugin.getRepositoryManager().addRepository(repository);
-
- IJavaProject jp = WorkspaceSetupHelper.getJdtCoreDomProject();
- astNodeType = WorkspaceSetupHelper.getType(jp, "org.eclipse.jdt.core.dom.ASTNode");
- }
-
- @Override
- protected void tearDown() throws Exception {
- WorkspaceSetupHelper.clearDoiModel();
- TasksUiPlugin.getRepositoryManager().removeRepository(repository,
- TasksUiPlugin.getDefault().getRepositoriesFilePath());
- }
-
- /**
- * 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;
- }
- };
-
- BugzillaMylynSearch s = new BugzillaMylynSearch(BugzillaMylynSearch.UNQUAL, astNodeType,
- IBugzillaConstants.ECLIPSE_BUGZILLA_URL);
-
- // 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
- MylynBugsManager.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();
- BugzillaMylynSearch s = new BugzillaMylynSearch(BugzillaMylynSearch.UNQUAL, astNodeType,
- IBugzillaConstants.ECLIPSE_BUGZILLA_URL);
-
- 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
- MylynBugsManager.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();
- BugzillaMylynSearch s = new BugzillaMylynSearch(BugzillaMylynSearch.UNQUAL, astNodeType,
- IBugzillaConstants.ECLIPSE_BUGZILLA_URL);
-
- 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);
-
- // 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<BugzillaReportInfo> saved = MylynBugsManager.getBridge().getFromLandmarksHash(astNodeType,
- BugzillaMylynSearch.UNQUAL);
- assertTrue("Results not cached", saved != null);
- if (saved == null) {
- fail();
- } else {
- assertTrue("Results not the right size", saved.size() > 0);
- // TODO should be assertEquals on expected size
-
- assertTrue(c.containsAll(saved) && saved.containsAll(c));
- MylynBugsManager.getBridge().removeFromLandmarksHash(astNodeType);
- }
- }
-
- public void testLocalBugUnqual() throws InterruptedException {
- lists.clear();
-
- String bugPrefix = "<server>-";
-
- TaskListManager manager = TasksUiPlugin.getTaskListManager();
- TaskCategory cat = new TaskCategory("Testing Category");
- manager.getTaskList().addCategory(cat);
- AbstractTask bugTask1 = new TaskTask(bugPrefix, "" + 94185, "<bugzilla info>");
-
- manager.getTaskList().addTask(bugTask1, cat);
- // cat.addTask(bugTask1);
- while (bugTask1.isSynchronizing()) {
- Thread.sleep(500);
- }
- AbstractTask bugTask2 = new TaskTask(bugPrefix, "" + 3692, "<bugzilla info>");
- manager.getTaskList().addTask(bugTask2, cat);
- // cat.addTask(bugTask2);
- while (bugTask2.isSynchronizing()) {
- Thread.sleep(500);
- }
- AbstractTask bugTask3 = new TaskTask(bugPrefix, "" + 3693, "<bugzilla info>");
- manager.getTaskList().addTask(bugTask3, cat);
- // cat.addTask(bugTask3);
- while (bugTask3.isSynchronizing()) {
- Thread.sleep(500);
- }
-
- AbstractTask bugTask4 = new TaskTask(bugPrefix, "" + 9583, "<bugzilla info>");
- manager.getTaskList().addTask(bugTask4, cat);
- // cat.addTask(bugTask4);
- while (bugTask4.isSynchronizing()) {
- Thread.sleep(500);
- }
-
- BugzillaMylynSearch s = new BugzillaMylynSearch(BugzillaMylynSearch.LOCAL_UNQUAL, astNodeType,
- IBugzillaConstants.ECLIPSE_BUGZILLA_URL);
-
- 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);
-
- // 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());
-
- MylynBugsManager.getBridge().removeFromLandmarksHash(astNodeType);
- TasksUiPlugin.getTaskList().deleteCategory(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-";
-
- TaskListManager manager = TasksUiPlugin.getTaskListManager();
- TaskCategory cat = new TaskCategory("Testing Category");
- manager.getTaskList().addCategory(cat);
- AbstractTask bugTask1 = new TaskTask(bugPrefix, "" + 94185, "<bugzilla info>");
- manager.getTaskList().addTask(bugTask1, cat);
- // cat.addTask(bugTask1);
- while (bugTask1.isSynchronizing()) {
- Thread.sleep(500);
- }
-
- AbstractTask bugTask2 = new TaskTask(bugPrefix, "" + 9583, "<bugzilla info>");
- manager.getTaskList().addTask(bugTask2, cat);
- // cat.addTask(bugTask2);
- while (bugTask2.isSynchronizing()) {
- Thread.sleep(500);
- }
- AbstractTask bugTask3 = new TaskTask(bugPrefix, "" + 3693, "<bugzilla info>");
- manager.getTaskList().addTask(bugTask3, cat);
- // cat.addTask(bugTask3);
- while (bugTask3.isSynchronizing()) {
- Thread.sleep(500);
- }
-
- BugzillaMylynSearch s = new BugzillaMylynSearch(BugzillaMylynSearch.LOCAL_QUAL, astNodeType,
- IBugzillaConstants.ECLIPSE_BUGZILLA_URL);
-
- 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);
-
- // 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());
-
- MylynBugsManager.getBridge().removeFromLandmarksHash(astNodeType);
- TasksUiPlugin.getTaskList().deleteCategory(cat);
- }
-
-}
diff --git a/org.eclipse.mylyn.ide.dev/developer/src-old/bugs/BugzillaContextLabelProvider.java b/org.eclipse.mylyn.ide.dev/developer/src-old/bugs/BugzillaContextLabelProvider.java
deleted file mode 100644
index ae245e47..00000000
--- a/org.eclipse.mylyn.ide.dev/developer/src-old/bugs/BugzillaContextLabelProvider.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2008 Tasktop Technologies 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:
- * Tasktop Technologies - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.mylyn.internal.sandbox.bridge.bugs;
-
-import org.eclipse.mylyn.context.core.AbstractContextStructureBridge;
-import org.eclipse.mylyn.context.core.ContextCore;
-import org.eclipse.mylyn.context.core.IInteractionElement;
-import org.eclipse.mylyn.context.core.IInteractionRelation;
-import org.eclipse.mylyn.internal.context.ui.AbstractContextLabelProvider;
-import org.eclipse.mylyn.internal.context.ui.ContextUiImages;
-import org.eclipse.mylyn.internal.provisional.commons.ui.CommonImages;
-import org.eclipse.mylyn.tasks.ui.TasksUiImages;
-import org.eclipse.swt.graphics.Image;
-
-/**
- * @author Mik Kersten
- */
-public class BugzillaContextLabelProvider extends AbstractContextLabelProvider {
-
- @Override
- protected Image getImage(IInteractionElement node) {
- return CommonImages.getImage(TasksUiImages.TASK_REMOTE);
- }
-
- @Override
- protected Image getImage(IInteractionRelation edge) {
- return ContextUiImages.getImage(MylynBugsManager.EDGE_REF_BUGZILLA);
- }
-
- @Override
- protected Image getImageForObject(Object object) {
- return CommonImages.getImage(TasksUiImages.TASK_REMOTE);
- }
-
- @Override
- protected String getTextForObject(Object node) {
- return "" + node;
- }
-
- /**
- * TODO: slow?
- */
- @Override
- protected String getText(IInteractionElement node) {
- // try to get from the cache before downloading
- Object report;
- BugzillaReportInfo reportNode = MylynBugsManager.getReferenceProvider().getCached(node.getHandleIdentifier());
- AbstractContextStructureBridge bridge = ContextCore.getStructureBridge(BugzillaStructureBridge.CONTENT_TYPE);
-
- if (reportNode != null) {
- report = reportNode;
- } else {
- report = bridge.getObjectForHandle(node.getHandleIdentifier());
- }
- return bridge.getLabel(report);
- }
-
- @Override
- protected String getText(IInteractionRelation edge) {
- return BugzillaReferencesProvider.NAME;
- }
-}
diff --git a/org.eclipse.mylyn.ide.dev/developer/src-old/bugs/BugzillaEditingMonitor.java b/org.eclipse.mylyn.ide.dev/developer/src-old/bugs/BugzillaEditingMonitor.java
deleted file mode 100644
index bbc9fb63..00000000
--- a/org.eclipse.mylyn.ide.dev/developer/src-old/bugs/BugzillaEditingMonitor.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2008 Tasktop Technologies 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:
- * Tasktop Technologies - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.mylyn.internal.sandbox.bridge.bugs;
-
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.mylyn.internal.tasks.ui.deprecated.AbstractRepositoryTaskEditor;
-import org.eclipse.mylyn.internal.tasks.ui.editors.RepositoryTaskSelection;
-import org.eclipse.mylyn.monitor.ui.AbstractUserInteractionMonitor;
-import org.eclipse.mylyn.tasks.ui.editors.TaskEditor;
-import org.eclipse.ui.IWorkbenchPart;
-
-/**
- * @author Mik Kersten
- */
-public class BugzillaEditingMonitor extends AbstractUserInteractionMonitor {
-
- public BugzillaEditingMonitor() {
- super();
- }
-
- @Override
- protected void handleWorkbenchPartSelection(IWorkbenchPart part, ISelection selection, boolean contributeToContext) {
- if (!(part instanceof AbstractRepositoryTaskEditor) && !(part instanceof TaskEditor)) {
- return;
- }
-
- if (selection instanceof StructuredSelection) {
- StructuredSelection ss = (StructuredSelection) selection;
- Object object = ss.getFirstElement();
- if (object instanceof RepositoryTaskSelection) {
- super.handleElementSelection(part, object, contributeToContext);
- }
- }
- }
-
-}
diff --git a/org.eclipse.mylyn.ide.dev/developer/src-old/bugs/BugzillaMylynSearch.java b/org.eclipse.mylyn.ide.dev/developer/src-old/bugs/BugzillaMylynSearch.java
deleted file mode 100644
index 3c32e94e..00000000
--- a/org.eclipse.mylyn.ide.dev/developer/src-old/bugs/BugzillaMylynSearch.java
+++ /dev/null
@@ -1,188 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2008 Tasktop Technologies 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:
- * Tasktop Technologies - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.mylyn.internal.sandbox.bridge.bugs;
-
-import java.util.ArrayList;
-import java.util.Collections;
-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.mylyn.context.core.InterestComparator;
-import org.eclipse.mylyn.internal.context.core.IActiveSearchListener;
-import org.eclipse.mylyn.internal.context.core.IActiveSearchOperation;
-
-/**
- * Used to facilitate bugzilla searches based on IJavaElements
- *
- * @author Shawn Minto
- */
-public class BugzillaMylynSearch implements IActiveSearchOperation {
-
- // 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 final int scope;
-
- private final IJavaElement element;
-
- private String handle = "";
-
- private String serverUrl = "";
-
- /**
- * Constructor
- *
- * @param scope
- * The scope of this search
- */
- public BugzillaMylynSearch(int scope, IJavaElement element, String serverUrl) {
- this.scope = scope;
- this.element = element;
- this.serverUrl = serverUrl;
- }
-
- public IStatus run(IProgressMonitor monitor) {
- return run(monitor, Job.DECORATE);
- }
-
- public IStatus run(IProgressMonitor monitor, int priority) {
- handle = element.getHandleIdentifier() + " " + scope;
- List<IJavaElement> landmarks = new ArrayList<IJavaElement>();
- landmarks.add(element);
-
- if (!BugzillaSearchManager.doesJobExist(handle)) {
-
- // perform the bugzilla search
- // get only the useful landmarks (IMember)
- List<IMember> members = 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 =
- // MylarTaskListPlugin.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
- BugzillaMylynSearchOperation op = new BugzillaMylynSearchOperation(this, m, scope);
-
- // create a new search job so that it can be scheduled and
- // run as a background thread
- Job searchJob = new BugzillaMylynSearchJob("Querying Bugzilla Server - Mylar - "
- + op.getSearchMemberName(), op);
-
- // schedule the new search job
- searchJob.setPriority(priority);
- searchJob.schedule();
-
- // save this searchJobs handle so that we can cancel it if need
- // be
- BugzillaSearchManager.addJob(handle, searchJob);
- }
- }
- return Status.OK_STATUS;
- }
-
- /** List of listeners wanting to know about the searches */
- private final 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<BugzillaReportInfo> doiList) {
- // go through all of the listeners and call searchCompleted(colelctor,
- // member)
- BugzillaSearchManager.removeSearchJob(handle);
- for (IActiveSearchListener listener : listeners) {
- listener.searchCompleted(doiList);
- }
- }
-
- /**
- * 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;
- }
-
- public String getServerUrl() {
- return serverUrl;
- }
-
-}
diff --git a/org.eclipse.mylyn.ide.dev/developer/src-old/bugs/BugzillaMylynSearchJob.java b/org.eclipse.mylyn.ide.dev/developer/src-old/bugs/BugzillaMylynSearchJob.java
deleted file mode 100644
index d8a45db4..00000000
--- a/org.eclipse.mylyn.ide.dev/developer/src-old/bugs/BugzillaMylynSearchJob.java
+++ /dev/null
@@ -1,104 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2008 Tasktop Technologies 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:
- * Tasktop Technologies - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.mylyn.internal.sandbox.bridge.bugs;
-
-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.mylyn.internal.bugzilla.core.BugzillaCorePlugin;
-import org.eclipse.mylyn.internal.bugzilla.ui.BugzillaUiPlugin;
-import org.eclipse.ui.PlatformUI;
-
-/**
- * The bugzilla search job used to search a bugzilla site
- *
- * @author Shawn Minto
- * @author Mik Kersten
- */
-public class BugzillaMylynSearchJob extends Job {
-
- /** The search operation used to perform the query */
- private final BugzillaMylynSearchOperation operation;
-
- /**
- * Constructor
- *
- * @param name
- * Job name
- * @param operation
- * The operation to perform the search query
- */
- public BugzillaMylynSearchJob(String name, BugzillaMylynSearchOperation operation) {
- super(name);
- this.operation = operation;
- }
-
- @Override
- protected IStatus run(IProgressMonitor monitor) {
- 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] == null) {
-
- } else 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
- BugzillaSearchManager.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
- BugzillaSearchManager.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. ");
- BugzillaCorePlugin.log(new Status(IStatus.ERROR, BugzillaUiPlugin.ID_PLUGIN, IStatus.OK, "", e));
- } finally {
- // make sure that we know that this job is not running anymore
- BugzillaSearchManager.removeSearchJob(operation.getSearchMember().getHandleIdentifier() + " "
- + operation.getScope());// .runningJobs.remove(operation.getSearchMember());
- }
-
- return status[0];
- }
-}
diff --git a/org.eclipse.mylyn.ide.dev/developer/src-old/bugs/BugzillaMylynSearchOperation.java b/org.eclipse.mylyn.ide.dev/developer/src-old/bugs/BugzillaMylynSearchOperation.java
deleted file mode 100644
index 54f30e80..00000000
--- a/org.eclipse.mylyn.ide.dev/developer/src-old/bugs/BugzillaMylynSearchOperation.java
+++ /dev/null
@@ -1,540 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2008 Tasktop Technologies 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:
- * Tasktop Technologies - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.mylyn.internal.sandbox.bridge.bugs;
-
-import java.util.ArrayList;
-import java.util.Collection;
-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.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.MultiStatus;
-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.mylyn.commons.core.StatusHandler;
-import org.eclipse.mylyn.internal.bugzilla.core.BugzillaCorePlugin;
-import org.eclipse.mylyn.internal.sandbox.ui.SandboxUiPlugin;
-import org.eclipse.mylyn.internal.tasks.core.AbstractTask;
-import org.eclipse.mylyn.internal.tasks.core.AbstractTaskCategory;
-import org.eclipse.mylyn.internal.tasks.core.deprecated.RepositoryTaskData;
-import org.eclipse.mylyn.internal.tasks.core.deprecated.TaskComment;
-import org.eclipse.mylyn.internal.tasks.ui.TasksUiPlugin;
-import org.eclipse.mylyn.internal.tasks.ui.deprecated.TaskFactory;
-import org.eclipse.mylyn.internal.tasks.ui.search.AbstractRepositorySearchQuery;
-import org.eclipse.mylyn.internal.tasks.ui.util.TasksUiInternal;
-import org.eclipse.mylyn.tasks.core.ITask;
-import org.eclipse.mylyn.tasks.core.TaskRepository;
-import org.eclipse.mylyn.tasks.core.data.TaskData;
-import org.eclipse.mylyn.tasks.ui.TasksUi;
-import org.eclipse.ui.actions.WorkspaceModifyOperation;
-
-/**
- * Bugzilla search operation for Mylar
- *
- * @author Shawn Minto
- * @author Mik Kersten
- */
-public class BugzillaMylynSearchOperation extends WorkspaceModifyOperation implements IBugzillaSearchOperation {
-
- /** The IMember we are doing the search for */
- private final IMember javaElement;
-
- /** The bugzilla collector for the search */
- private ProgressQueryHitCollector collector = null;//SearchHitCollector
-
- /** 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 final String name;
-
- /** The bugzilla search query */
- private AbstractRepositorySearchQuery query;
-
- private final BugzillaMylynSearch search;
-
- private final int scope;
-
- public BugzillaMylynSearchOperation(BugzillaMylynSearch 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) {
-
- ProgressQueryHitCollector searchCollector = null;
-
- if (scope == BugzillaMylynSearch.FULLY_QUAL) {
- searchCollector = searchQualified(search.getServerUrl(), monitor);
- } else if (scope == BugzillaMylynSearch.UNQUAL) {
- searchCollector = searchUnqualified(search.getServerUrl(), monitor);
- } else if (scope == BugzillaMylynSearch.LOCAL_QUAL) {
- searchCollector = searchLocalQual(monitor);
- } else if (scope == BugzillaMylynSearch.LOCAL_UNQUAL) {
- searchCollector = searchLocalUnQual(monitor);
- } else {
- status = Status.OK_STATUS;
- return;
- }
-
- if (searchCollector == null) {
- search.notifySearchCompleted(new ArrayList<BugzillaReportInfo>());
- return;
- }
-
- Set<AbstractTask> l = searchCollector.getTasks();
-
- // get the list of doi elements
- List<BugzillaReportInfo> doiList = getDoiList(l);
-
- // we completed the search, so notify all of the listeners
- // that the search has been completed
- MylynBugsManager.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 QueryHitCollector with the results of the search
- */
- @SuppressWarnings("deprecation")
- private ProgressQueryHitCollector searchLocalQual(IProgressMonitor monitor) {
-
- // get the fully qualified name for searching
- String elementName = getFullyQualifiedName(javaElement);
-
- // setup the search result collector
- collector = new ProgressQueryHitCollector(TasksUiInternal.getTaskList(), new TaskFactory(null));//SearchHitCollector(TasksUiPlugin.getTaskList());
- //collector.setOperation(this);
- collector.setProgressMonitor(monitor);
-
- // get all of the root tasks and start the search
- // FIXME
-// Set<AbstractTask> tasks = TasksUiPlugin.getTaskList().getOrphanContainer(
-// LocalRepositoryConnector.REPOSITORY_URL).getChildren();
- Set<ITask> tasks = new HashSet<ITask>();
- searchLocal(tasks, collector, elementName, monitor);
- for (AbstractTaskCategory cat : TasksUiPlugin.getTaskList().getTaskCategories()) {
- searchLocal(cat.getChildren(), 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 QueryHitCollector with the results of the search
- */
- @SuppressWarnings("deprecation")
- private ProgressQueryHitCollector searchLocalUnQual(IProgressMonitor monitor) {
-
- // get the element name for searching
- String elementName = javaElement.getElementName();
-
- // setup the search result collector
- collector = new ProgressQueryHitCollector(TasksUiInternal.getTaskList(), new TaskFactory(null));//SearchHitCollector(TasksUiPlugin.getTaskList());
- //collector.setOperation(this);
- collector.setProgressMonitor(monitor);
-
- // get all of the root tasks and start the search
- // FIXME
-// Set<AbstractTask> tasks = TasksUiPlugin.getTaskList().getOrphanContainer(
-// LocalRepositoryConnector.REPOSITORY_URL).getChildren();
- Set<ITask> tasks = new HashSet<ITask>();
- searchLocal(tasks, collector, elementName, monitor);
- for (AbstractTaskCategory cat : TasksUiPlugin.getTaskList().getTaskCategories()) {
- searchLocal(cat.getChildren(), 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(Collection<ITask> tasks, ProgressQueryHitCollector 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;
- RepositoryTaskData bugTaskData = TasksUiPlugin.getTaskDataStorageManager().getNewTaskData(
- task.getRepositoryUrl(), task.getTaskId());
- //RepositoryTaskData bugTaskData = bugTask.getTaskData();
-
- // parse the bug report for the element that we are searching
- // for
- boolean isHit = search(elementName, bugTaskData);
-
- // determine if we have a hit or not
- if (isHit) {
-// // make a search hit from the bug and then add it to the collector
-// BugzillaQueryHit hit = new BugzillaQueryHit(TasksUiPlugin.getTaskList(), bugTaskData.getDescription(), "", bugTaskData.getRepositoryUrl(), bugTaskData.getId(), null, "");
-// BugzillaTask task = new BugzillaTask();
- // FIXME
- // searchCollector.accept(bugTask);
- }
-// }
- }
- 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, RepositoryTaskData bug) {
-
- if (bug == null) {
- return false; // MIK: added null check here
- }
- String description = bug.getDescription();
- String summary = bug.getSummary();
- List<TaskComment> taskComments = bug.getComments();
-
- // search the summary and the summary
- if (Util.hasElementName(elementName, summary)) {
- return true;
- }
-
- if (Util.hasElementName(elementName, description)) {
- return true;
- }
-
- Iterator<TaskComment> comItr = taskComments.iterator();
- while (comItr.hasNext()) {
- TaskComment taskComment = comItr.next();
- String commentText = taskComment.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 QueryHitCollector with the search results
- */
- private ProgressQueryHitCollector search(String url, TaskRepository repository,
- ProgressQueryHitCollector 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(repository, 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) {
- return null;
- } else if (!status.isOK()) {
- MultiStatus errorStatus = new MultiStatus(SandboxUiPlugin.ID_PLUGIN, 0, "Search error", null);
- errorStatus.add(status);
- StatusHandler.fail(errorStatus);
- 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 QueryHitCollector with the search results
- */
- @SuppressWarnings("deprecation")
- private ProgressQueryHitCollector searchQualified(String repositoryUrl, IProgressMonitor monitor) {
- // create a new collector for the results
- collector = new ProgressQueryHitCollector(TasksUiInternal.getTaskList(), new TaskFactory(null));//SearchHitCollector(TasksUiPlugin.getTaskList());
- //collector.setOperation(this);
- collector.setProgressMonitor(monitor);
-
- // get the search url
- String url = Util.getExactSearchURL(repositoryUrl, javaElement);
- TaskRepository repository = TasksUi.getRepositoryManager().getRepository(BugzillaCorePlugin.CONNECTOR_KIND,
- repositoryUrl);
- return search(url, repository, collector, monitor);
- }
-
- /**
- * Perform a search for unqualified instances of the member
- *
- * @param monitor
- * The progress monitor to use
- * @return The QueryHitCollector with the search results
- */
- @SuppressWarnings("deprecation")
- private ProgressQueryHitCollector searchUnqualified(String repositoryUrl, IProgressMonitor monitor) {
- // create a new collector for the results
- collector = new ProgressQueryHitCollector(TasksUiInternal.getTaskList(), new TaskFactory(null));//SearchHitCollector(TasksUiPlugin.getTaskList());
- //collector.setOperation(this);
- collector.setProgressMonitor(monitor);
-
- // get the search url
- String url = Util.getInexactSearchURL(repositoryUrl, javaElement);
- TaskRepository repository = TasksUi.getRepositoryManager().getRepository(BugzillaCorePlugin.CONNECTOR_KIND,
- repositoryUrl);
-
- return search(url, repository, collector, monitor);
- }
-
- /**
- * 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<BugzillaReportInfo> doiList) {
-
- // go through each of the items in the doiList
- for (BugzillaReportInfo info : doiList) {
-
- // get the bug report so that we have all of the data
- // - descriptions, comments, etc
- TaskData 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;
- }
-
- // Add back:
- // see if the summary 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);
-// }
-
- // Add back:
- // go through all of the comments for the bug
-// Iterator<TaskComment> comItr = b.getComments().iterator();
-// while (comItr.hasNext()) {
-// TaskComment taskComment = comItr.next();
-// String commentText = taskComment.getText();
-//
-// // see if the comment has a stack trace in it
-// stackTrace = StackTrace.getStackTrace(commentText, taskComment);
-// 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<BugzillaReportInfo> getDoiList(Set<AbstractTask> results) {
- List<BugzillaReportInfo> doiList = new ArrayList<BugzillaReportInfo>();
-
- boolean isExact = (scope == BugzillaMylynSearch.FULLY_QUAL || scope == BugzillaMylynSearch.LOCAL_QUAL) ? true
- : false;
-
- BugzillaReportInfo info = null;
- // go through all of the results and create a DoiInfo list
- for (ITask hit : results) {
-
- try {
- float value = 0;
- info = new BugzillaReportInfo(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 = BugzillaRepositoryUtil.getInstance().getBug(
- // hit.getId());
- // // add the bug to the doi info for future use
- // info.setBug(b);
- // }
-
- } catch (Exception e) {
- StatusHandler.log(new Status(IStatus.INFO, SandboxUiPlugin.ID_PLUGIN, "Search failed", e));
- } finally {
- doiList.add(info);
- }
- }
- return doiList;
- }
-
- /**
- * @see org.eclipse.mylyn.internal.bugs.core.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.mylyn.internal.bugs.core.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.mylyn.internal.bugs.core.search.IBugzillaSearchOperation#getQuery()
- */
- public AbstractRepositorySearchQuery getQuery() {
- return query;
- }
-
- /**
- * @see org.eclipse.mylyn.internal.bugs.core.search.IBugzillaSearchOperation#setQuery(org.eclipse.mylyn.internal.bugs.core.search.AbstractRepositorySearchQuery)
- */
- public void setQuery(AbstractRepositorySearchQuery 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;
- }
-}
diff --git a/org.eclipse.mylyn.ide.dev/developer/src-old/bugs/BugzillaReferencesProvider.java b/org.eclipse.mylyn.ide.dev/developer/src-old/bugs/BugzillaReferencesProvider.java
deleted file mode 100644
index fb3f4d3c..00000000
--- a/org.eclipse.mylyn.ide.dev/developer/src-old/bugs/BugzillaReferencesProvider.java
+++ /dev/null
@@ -1,199 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2008 Tasktop Technologies 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:
- * Tasktop Technologies - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.mylyn.internal.sandbox.bridge.bugs;
-
-import java.util.ArrayList;
-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.core.runtime.jobs.Job;
-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.mylyn.context.core.IInteractionContext;
-import org.eclipse.mylyn.context.core.IInteractionElement;
-import org.eclipse.mylyn.internal.context.core.AbstractRelationProvider;
-import org.eclipse.mylyn.internal.context.core.DegreeOfSeparation;
-import org.eclipse.mylyn.internal.context.core.IActiveSearchListener;
-import org.eclipse.mylyn.internal.context.core.IActiveSearchOperation;
-import org.eclipse.mylyn.internal.context.core.IDegreeOfSeparation;
-import org.eclipse.mylyn.internal.tasks.ui.TasksUiPlugin;
-import org.eclipse.mylyn.tasks.core.ITask;
-import org.eclipse.mylyn.tasks.core.TaskRepository;
-import org.eclipse.ui.PlatformUI;
-
-/**
- * @author Shawn Minto
- */
-public class BugzillaReferencesProvider extends AbstractRelationProvider {
-
- public static final String ID = "org.eclipse.mylyn.bugs.search.references";
-
- public static final String NAME = "referenced by";
-
- public static final int DEFAULT_DEGREE = 0;
-
- public BugzillaReferencesProvider() {
- super(BugzillaStructureBridge.CONTENT_TYPE, ID);
- }
-
- @Override
- public List<IDegreeOfSeparation> getDegreesOfSeparation() {
- List<IDegreeOfSeparation> separations = new ArrayList<IDegreeOfSeparation>();
- separations.add(new DegreeOfSeparation("disabled", 0));
- separations.add(new DegreeOfSeparation("local, fully qualified matches", 1));
- separations.add(new DegreeOfSeparation("local, unqualified matches", 2));
- separations.add(new DegreeOfSeparation("server, fully quaified matches", 3));
- separations.add(new DegreeOfSeparation("server, unqualified matches", 4));
-
- return separations;
- }
-
- protected boolean acceptElement(IJavaElement javaElement) {
- return javaElement != null && (javaElement instanceof IMember || javaElement instanceof IType)
- && javaElement.exists();
- }
-
- /**
- * HACK: checking kind as string - don't want the dependancy to mylar.java
- */
- @Override
- protected void findRelated(final IInteractionElement node, int degreeOfSeparation) {
- if (!node.getContentType().equals("java")) {
- return;
- }
- IJavaElement javaElement = JavaCore.create(node.getHandleIdentifier());
- if (!acceptElement(javaElement)) {
- return;
- }
- runJob(node, degreeOfSeparation);
- }
-
- @Override
- public IActiveSearchOperation getSearchOperation(IInteractionElement node, int limitTo, int degreeOfSepatation) {
- IJavaElement javaElement = JavaCore.create(node.getHandleIdentifier());
-
- ITask task = TasksUiPlugin.getTaskListManager().getActiveTask();
- TaskRepository repository = TasksUiPlugin.getRepositoryManager().getRepository(task.getConnectorKind(),
- task.getRepositoryUrl());
- return new BugzillaMylynSearch(degreeOfSepatation, javaElement, repository.getRepositoryUrl());
- }
-
- private void runJob(final IInteractionElement node, final int degreeOfSeparation) {
- BugzillaMylynSearch search = (BugzillaMylynSearch) getSearchOperation(node, 0, degreeOfSeparation);
-
- search.addListener(new IActiveSearchListener() {
-
- private boolean gathered = false;
-
- public void searchCompleted(List<?> nodes) {
- Iterator<?> itr = nodes.iterator();
-
- if (MylynBugsManager.getDefault() == null) {
- return;
- }
-
- while (itr.hasNext()) {
- Object o = itr.next();
- if (o instanceof BugzillaReportInfo) {
- BugzillaReportInfo bugzillaNode = (BugzillaReportInfo) o;
- final String handle = bugzillaNode.getElementHandle();
-// if (MylarBugsPlugin.getDefault().getCache().getCached(handle) == null)
-// cache(handle, bugzillaNode);
-
- PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() {
- public void run() {
- incrementInterest(node, BugzillaStructureBridge.CONTENT_TYPE, handle,
- degreeOfSeparation);
- }
- });
- }
- }
- gathered = true;
- BugzillaReferencesProvider.this.searchCompleted(node);
- }
-
- public boolean resultsGathered() {
- return gathered;
- }
-
- });
- search.run(new NullProgressMonitor(), Job.DECORATE - 10);
- }
-
- @Override
- public String getGenericId() {
- return ID;
- }
-
- @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, BugzillaReportInfo> reports = new HashMap<String, BugzillaReportInfo>();
-
- public BugzillaReportInfo getCached(String handle) {
- return reports.get(handle);
- }
-
- protected void cache(String handle, BugzillaReportInfo bugzillaNode) {
- reports.put(handle, bugzillaNode);
- }
-
- public void clearCachedReports() {
- reports.clear();
- }
-
- public Collection<? extends String> getCachedHandles() {
- return reports.keySet();
- }
-
- @Override
- public void stopAllRunningJobs() {
- BugzillaSearchManager.cancelAllRunningJobs();
-
- }
-
- @Override
- protected int getDefaultDegreeOfSeparation() {
- return DEFAULT_DEGREE;
- }
-
- @Override
- public void contextPreActivated(IInteractionContext context) {
- // ignore
- }
-
- @Override
- public void elementsDeleted(List<IInteractionElement> elements) {
- // ignore
- }
-}
diff --git a/org.eclipse.mylyn.ide.dev/developer/src-old/bugs/BugzillaReportInfo.java b/org.eclipse.mylyn.ide.dev/developer/src-old/bugs/BugzillaReportInfo.java
deleted file mode 100644
index bb69654c..00000000
--- a/org.eclipse.mylyn.ide.dev/developer/src-old/bugs/BugzillaReportInfo.java
+++ /dev/null
@@ -1,189 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2008 Tasktop Technologies 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:
- * Tasktop Technologies - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.mylyn.internal.sandbox.bridge.bugs;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.mylyn.internal.bugzilla.core.BugzillaCorePlugin;
-import org.eclipse.mylyn.internal.bugzilla.core.BugzillaRepositoryConnector;
-import org.eclipse.mylyn.internal.bugzilla.core.BugzillaTaskDataHandler;
-import org.eclipse.mylyn.internal.bugzilla.ui.tasklist.StackTrace;
-import org.eclipse.mylyn.tasks.core.ITask;
-import org.eclipse.mylyn.tasks.core.TaskRepository;
-import org.eclipse.mylyn.tasks.core.data.TaskData;
-import org.eclipse.mylyn.tasks.ui.TasksUi;
-
-/**
- * Class to store the DoiInfo of a BugzillaSearchHit
- *
- * TODO: refactor
- *
- * @author Shawn Minto
- */
-public class BugzillaReportInfo {
-
- private static final int MAX_LABEL_LENGTH = 150;
-
- private static final long serialVersionUID = 3257004367222419506L;
-
- /** The BugzillaSearchHit associated with this DoiInfo */
- private final ITask 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 final List<StackTrace> stackTraces;
-
- /** The bug report associated with this DoiInfo */
- private TaskData 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 BugzillaReportInfo(float initialValue, ITask 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 ITask 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
- */
- public TaskData getBug() throws CoreException {
- if (bug == null) {
- // get the bug report
- TaskRepository repository = TasksUi.getRepositoryManager().getRepository(BugzillaCorePlugin.CONNECTOR_KIND,
- hit.getRepositoryUrl());
- BugzillaRepositoryConnector bugzillaConnector = (BugzillaRepositoryConnector) TasksUi.getRepositoryManager()
- .getRepositoryConnector(BugzillaCorePlugin.CONNECTOR_KIND);
- BugzillaTaskDataHandler handler = new BugzillaTaskDataHandler(bugzillaConnector);
- bug = handler.getTaskData(repository, hit.getTaskId(), new NullProgressMonitor());
- }
- return bug;
- }
-
- /**
- * Set the bug report associated with this DoiInfo
- *
- * @param bug
- * - BugReport that this is associated with
- */
- public void setBug(TaskData 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 (StackTrace element : stackTracesToAdd) {
- this.stackTraces.add(element);
- }
- }
-
- /**
- * Get the name of the bug report
- *
- * @return The name of the bug report, max 20 characters
- */
- public String getName() {
- String description = hit.getSummary();
- int length = description.length();
- if (length > MAX_LABEL_LENGTH) {
- description = description.substring(0, MAX_LABEL_LENGTH) + "..";
- }
- return "bug " + hit.getTaskId() + ": " + description;
- }
-
- public String getElementHandle() {
- return hit.getRepositoryUrl() + ";" + hit.getTaskId();
- }
-}
diff --git a/org.eclipse.mylyn.ide.dev/developer/src-old/bugs/BugzillaSearchEngine.java b/org.eclipse.mylyn.ide.dev/developer/src-old/bugs/BugzillaSearchEngine.java
deleted file mode 100644
index 0f5e70de..00000000
--- a/org.eclipse.mylyn.ide.dev/developer/src-old/bugs/BugzillaSearchEngine.java
+++ /dev/null
@@ -1,545 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2008 Tasktop Technologies 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:
- * Tasktop Technologies - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.mylyn.internal.sandbox.bridge.bugs;
-
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.util.regex.Pattern;
-
-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.MultiStatus;
-import org.eclipse.core.runtime.OperationCanceledException;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.mylyn.internal.bugzilla.core.BugzillaCorePlugin;
-import org.eclipse.mylyn.internal.bugzilla.core.IBugzillaConstants;
-import org.eclipse.mylyn.internal.bugzilla.ui.BugzillaUiPlugin;
-import org.eclipse.mylyn.internal.tasks.ui.TasksUiPlugin;
-import org.eclipse.mylyn.tasks.core.TaskRepository;
-
-/**
- * Queries the Bugzilla server for the list of bugs matching search criteria.
- *
- * @author Mik Kersten (hardening of initial prototype)
- */
-// TODO: Delete once not needed by sandbox
-public class BugzillaSearchEngine {
-
- protected static final String QUERYING_SERVER = "Querying Bugzilla Server...";
-
- /**
- * regular expression matching values of query matches' attributes in Eclipse.org Bugzilla
- */
- public static final Pattern reValue = Pattern.compile("<td><nobr>([^<]*)</nobr>");
-
- public static final Pattern reValueBugzilla220 = Pattern.compile("<td style=\"white-space: nowrap\">([^<]*)");
-
-// private final String urlString;
-
- private final TaskRepository repository;
-
- private final boolean maxReached = false;
-
-// private String queryStringWithoutLogin;
-
- public BugzillaSearchEngine(TaskRepository repository, String queryUrl) {
-// urlString = queryUrl;
-// queryStringWithoutLogin = urlString;
- // urlString = urlString.concat(IBugzillaConstants.CONTENT_TYPE_RDF);
- this.repository = repository;
- // this.proxySettings = proxySettings;
- // if (repository.hasCredentials()) {
- // try {
- // urlString = BugzillaClient.addCredentials(urlString,
- // repository.getCharacterEncoding(), repository
- // .getUserName(), repository.getPassword());
- // } catch (UnsupportedEncodingException e) {
- // /*
- // * Do nothing. Every implementation of the Java platform is
- // * required to support the standard charset "UTF-8"
- // */
- // }
- // }
- }
-
- /**
- * Wrapper for search
- *
- * @param collector
- * - The collector for the results to go into
- */
- public IStatus search(ProgressQueryHitCollector collector) throws LoginException {
- return this.search(collector, 0, IBugzillaConstants.RETURN_ALL_HITS);
- }
-
- /**
- * Wrapper for search
- *
- * @param collector
- * - The collector for the results to go into
- * @param startMatches
- * - The number of matches to start with for the progress monitor
- */
- public IStatus search(ProgressQueryHitCollector collector, int startMatches) throws LoginException {
- return this.search(collector, startMatches, BugzillaUiPlugin.getDefault().getMaxResults());
- }
-
- /**
- * Executes the query, parses the response, and adds hits to the search result collector.
- *
- * @param collector
- * - The collector for the search results
- * @param startMatches
- * - The number of matches to start with for the progress monitor
- * @param maxHits
- * - the maximum number of matches to return or IBugzillaConstants.RETURN_ALL_HITS for unlimited
- */
- public IStatus search(ProgressQueryHitCollector collector, int startMatches, int maxHits) throws LoginException {
- IProgressMonitor monitor = collector.getProgressMonitor();
- IStatus status = null;
- boolean possibleBadLogin = false;
- int numCollected = 0;
- BufferedReader in = null;
-
- try {
- monitor.beginTask(QUERYING_SERVER, maxHits);// IProgressMonitor.UNKNOWN
- collector.aboutToStart(startMatches);
-
- throw new OperationCanceledException("Bugzilla Active Searchn not implemented");
-
-// if (monitor.isCanceled()) {
-// throw new OperationCanceledException("Search cancelled");
-// }
-//
-// BugzillaRepositoryQuery query = new BugzillaRepositoryQuery(repository.getRepositoryUrl(), urlString,
-// "summary");
-//
-// BugzillaRepositoryConnector bugzillaConnector = (BugzillaRepositoryConnector) TasksUi.getRepositoryManager()
-// .getRepositoryConnector(BugzillaCorePlugin.CONNECTOR_KIND);
-//
-// BugzillaClient client = bugzillaConnector.getClientManager().getClient(repository,
-// new NullProgressMonitor());
-// client.getSearchHits(query, collector, bugzillaConnector.getTaskDataHandler()
-// .getAttributeMapper(repository), new NullProgressMonitor());
- } catch (CoreException e) {
- status = new MultiStatus(BugzillaUiPlugin.ID_PLUGIN, IStatus.ERROR,
- "Core Exception occurred while querying Bugzilla Server " + repository.getRepositoryUrl() + ".\n"
- + "\nClick Details for more information.", e);
- ((MultiStatus) status).add(e.getStatus());
-
- // write error to log
- BugzillaCorePlugin.log(status);
- } catch (OperationCanceledException e) {
- status = new Status(IStatus.CANCEL, BugzillaUiPlugin.ID_PLUGIN, IStatus.CANCEL, "", null);
-// } catch (final UnrecognizedReponseException e) {
-//
-// PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() {
-// public void run() {
-// WebBrowserDialog.openAcceptAgreement(null, "Report Download Failed",
-// "Unrecognized response from server", e.getMessage());
-// }
-// });
-// status = new MultiStatus(BugzillaUiPlugin.ID_PLUGIN, IStatus.ERROR,
-// "Unrecognized response from Bugzilla server " + repository.getRepositoryUrl(), e);
-//
-// IStatus s = new Status(IStatus.ERROR, BugzillaUiPlugin.ID_PLUGIN, IStatus.ERROR, e.getClass().toString()
-// + ": ", e);
-// ((MultiStatus) status).add(s);
-// s = new Status(IStatus.ERROR, BugzillaUiPlugin.ID_PLUGIN, IStatus.OK, "search failed", e);
-// ((MultiStatus) status).add(s);
-
- } catch (Exception e) {
- status = new MultiStatus(BugzillaUiPlugin.ID_PLUGIN, IStatus.ERROR,
- "An error occurred while querying Bugzilla Server " + repository.getRepositoryUrl() + ".\n"
- + "\nCheck network connection and repository configuration in "
- + TasksUiPlugin.LABEL_VIEW_REPOSITORIES + ".", e);
-
- IStatus s = new Status(IStatus.ERROR, BugzillaUiPlugin.ID_PLUGIN, IStatus.ERROR, e.getClass().toString()
- + ": ", e);
- ((MultiStatus) status).add(s);
- s = new Status(IStatus.ERROR, BugzillaUiPlugin.ID_PLUGIN, IStatus.OK, "search failed", e);
- ((MultiStatus) status).add(s);
- } finally {
- if (monitor != null) {
- monitor.done();
- }
- collector.done();
- try {
- if (in != null) {
- in.close();
- }
- } catch (IOException e) {
- BugzillaCorePlugin.log(new Status(IStatus.ERROR, BugzillaUiPlugin.ID_PLUGIN, IStatus.ERROR,
- "Problem closing the stream", e));
- }
- }
-
- // if we haven't collected any serach results and we suspect a bad
- // login, we assume it was a bad login
- if (numCollected == 0 && possibleBadLogin) {
- throw new LoginException(IBugzillaConstants.MESSAGE_LOGIN_FAILURE + " for repository: "
- + repository.getRepositoryUrl() + " username: " + repository.getUserName());
- }
-
- if (status == null) {
- return new Status(IStatus.OK, BugzillaUiPlugin.ID_PLUGIN, IStatus.OK, "", null);
- } else {
- return status;
- }
- }
-
- // /** Old code used by a unit test. */
-// public static BugzillaQueryHit createHit(Pattern regularExpression, IProgressMonitor monitor, BufferedReader in,
-// String serverUrl, int id) throws IOException {
-// String line;
-// // String severity = null;
-// String priority = null;
-// // String platform = null;
-// // String owner = null;
-// String state = null;
-// // String result = null;
-// for (int i = 0; i < 6; i++) {
-// Matcher matcher;
-// do {
-// matcher = null;
-// if (monitor.isCanceled()) {
-// throw new OperationCanceledException("Search cancelled");
-// }
-// line = in.readLine();
-// if (line == null)
-// break;
-// line = line.trim();
-// matcher = regularExpression.matcher(line);
-// } while (!matcher.find());
-// if (null != matcher) {
-// switch (i) {
-// // case 0:
-// // severity = matcher.group(1);
-// // break;
-// case 1:
-// priority = matcher.group(1);
-// break;
-// // case 2:
-// // platform = matcher.group(1);
-// // break;
-// // case 3:
-// // owner = matcher.group(1);
-// // break;
-// case 4:
-// state = matcher.group(1);
-// break;
-// case 5:
-// // result = matcher.group(1);
-// // break;
-// }
-// }
-// }
-//
-// // two more
-// line = in.readLine();
-// line = in.readLine();
-//
-// String description = "<activate to view summary>";
-// if (line != null) {
-// description = line.substring(8);
-// }
-// if (description.startsWith(">")) {
-// description = description.substring(1);
-// }
-//
-// // String query = "";
-// // try {
-// // String recentQuery = BugzillaUiPlugin.getMostRecentQuery();
-// // if (recentQuery != null)
-// // query = recentQuery;
-// // } catch (Exception e) {
-// // // ignore, for testing
-// // }
-//
-// BugzillaQueryHit hit = new BugzillaQueryHit(TasksUiPlugin.getTaskList(), description,
-// priority, serverUrl, String.valueOf(id), null, state);
-//
-// return hit;
-// }
-
- public boolean isMaxReached() {
- return maxReached;
- }
-}
-
-// /** regular expression matching Bugzilla query results format used in
-// Eclipse.org Bugzilla */
-// protected static final Pattern re = Pattern.compile("<a
-// href=\"show_bug.cgi\\?taskId=(\\d+)\">", Pattern.CASE_INSENSITIVE);
-//
-//
-// /** regular expression matching Bugzilla query results format used in
-// v2.12 */
-// protected static final Pattern reOld = Pattern.compile("<a
-// href=\"show_bug.cgi\\?taskId=(\\d+)\">\\d+</a>\\s*<td
-// class=severity><nobr>([^>]+)</nobr><td
-// class=priority><nobr>([^>]+)</nobr><td
-// class=platform><nobr>([^>]*)</nobr><td
-// class=owner><nobr>([^>]*)</nobr><td class=status><nobr>([^>]*)</nobr><td
-// class=resolution><nobr>([^>]*)</nobr><td class=summary>(.*)$",
-// Pattern.CASE_INSENSITIVE);
-
-// /**
-// * Executes the query, parses the response, and adds hits to the search
-// result collector.
-// *
-// * <p>
-// * The output for a single match looks like this:
-// * <pre>
-// * <tr class="bz_enhancement bz_P5 ">
-// *
-// * <td>
-// * <a href="show_bug.cgi?taskId=6747">6747</a>
-// * </td>
-// *
-// * <td><nobr>enh</nobr>
-// * </td>
-// * <td><nobr>P5</nobr>
-// * </td>
-// * <td><nobr>All</nobr>
-// * </td>
-// * <td><nobr>Olivier_Thomann@oti.com</nobr>
-// * </td>
-// * <td><nobr>ASSI</nobr>
-// * </td>
-// * <td><nobr></nobr>
-// * </td>
-// * <td>Code Formatter exchange several blank lines w/ one
-// * </td>
-// *
-// * </tr>
-// * <pre>
-// *
-// * <p>Or in the older format:
-// * <pre>
-// * <A HREF="show_bug.cgi?taskId=8">8</A> <td
-// class=severity><nobr>blo</nobr><td class=priority><nobr>P1</nobr><td
-// class=platform><nobr>PC</nobr><td
-// class=owner><nobr>cubranic@cs.ubc.ca</nobr><td
-// class=status><nobr>CLOS</nobr><td class=resolution><nobr>DUPL</nobr><td
-// class=summary>"Document root" missing when querying on files and
-// revisions
-// * </pre>
-// * @param collector - The collector for the search results
-// * @param startMatches - The number of matches to start with for the
-// progress monitor
-// * @param maxMatches - the maximum number of matches to return or -1 for
-// unlimited
-// */
-// public IStatus search(IBugzillaSearchResultCollector collector, int
-// startMatches, int maxMatches)
-// throws LoginException {
-// IProgressMonitor monitor = collector.getProgressMonitor();
-// IStatus status = null;
-// boolean possibleBadLogin = false;
-// int numCollected = 0;
-// BufferedReader in = null;
-//
-// try {
-// monitor.beginTask(QUERYING_SERVER, IProgressMonitor.UNKNOWN);
-// collector.aboutToStart(startMatches);
-//
-// URLConnection cntx = BugzillaPlugin.getDefault().getUrlConnection(new
-// URL(urlString));
-// if (cntx == null || !(cntx instanceof HttpURLConnection)) {
-// return null;
-// }
-//
-// HttpURLConnection connect = (HttpURLConnection) cntx;
-// connect.connect();
-// int responseCode = connect.getResponseCode();
-// if (responseCode != HttpURLConnection.HTTP_OK) {
-// String msg;
-// if (responseCode == -1 || responseCode ==
-// HttpURLConnection.HTTP_FORBIDDEN)
-// msg = repository.getUrl()
-// + " does not seem to be a valid Bugzilla server. Check Bugzilla
-// preferences.";
-// else
-// msg = "HTTP Error " + responseCode + " (" + connect.getResponseMessage()
-// + ") while querying Bugzilla Server. Check Bugzilla preferences.";
-//
-// throw new BugzillaException(msg);
-// }
-//
-// if (monitor.isCanceled()) {
-// throw new OperationCanceledException("Search cancelled");
-// }
-//
-// in = new BufferedReader(new InputStreamReader(connect.getInputStream()));
-// if (monitor.isCanceled()) {
-// throw new OperationCanceledException("Search cancelled");
-// }
-//
-// String line;
-// while ((line = in.readLine()) != null) {
-// if (maxMatches != -1 && numCollected >= maxMatches) {
-// maxReached = true;
-// break;
-// }
-//
-// if (monitor.isCanceled()) {
-// throw new OperationCanceledException("Search cancelled");
-// }
-//
-// // create regular expressions that can be mathced to check if we
-// // have
-// // bad login information
-// Pattern loginRe = Pattern.compile("<title>.*login.*</title>.*");
-// Pattern invalidRe =
-// Pattern.compile(".*<title>.*invalid.*password.*</title>.*");
-// Pattern passwordRe =
-// Pattern.compile(".*<title>.*password.*invalid.*</title>.*");
-// Pattern emailRe = Pattern.compile(".*<title>.*check e-mail.*</title>.*");
-// Pattern errorRe = Pattern.compile(".*<title>.*error.*</title>.*");
-//
-// String lowerLine = line.toLowerCase(Locale.ENGLISH);
-//
-// // check if we have anything that suggests bad login info
-// if (loginRe.matcher(lowerLine).find() ||
-// invalidRe.matcher(lowerLine).find() ||
-// passwordRe.matcher(lowerLine).find()
-// || emailRe.matcher(lowerLine).find() ||
-// errorRe.matcher(lowerLine).find())
-// possibleBadLogin = true;
-//
-// Matcher matcher = reOld.matcher(line);
-// if (matcher.find()) {
-// int taskId = Integer.parseInt(matcher.group(1));
-// String severity = matcher.group(2);
-// String priority = matcher.group(3);
-// String platform = matcher.group(4);
-// String owner = matcher.group(5);
-// String state = matcher.group(6);
-// String result = matcher.group(7);
-// String summary = matcher.group(8);
-// String query = BugzillaPlugin.getMostRecentQuery();
-// if (query == null)
-// query = "";
-//
-// String server = repository.getUrl();
-//
-// BugzillaSearchHit hit = new BugzillaSearchHit(server, taskId, summary,
-// severity, priority,
-// platform, state, result, owner, query);
-// collector.accept(hit);
-// numCollected++;
-//
-// } else {
-// matcher = re.matcher(line);
-// if (matcher.find()) {
-// Pattern regularExpression;
-//
-// BugzillaServerVersion bugzillaServerVersion =
-// IBugzillaConstants.BugzillaServerVersion.fromString(repository.getVersion());
-// if (bugzillaServerVersion != null &&
-// bugzillaServerVersion.compareTo(BugzillaServerVersion.SERVER_220) >= 0) {
-// regularExpression = reValueBugzilla220;
-// } else {
-// regularExpression = reValue;
-// }
-//
-// int taskId = Integer.parseInt(matcher.group(1));
-// BugzillaSearchHit hit = createHit(regularExpression, monitor, in,
-// repository.getUrl(), taskId);
-// collector.accept(hit);
-// numCollected++;
-// }
-// }
-//
-// // } else if (re.matches(line, match)) {
-// // RegularExpression regularExpression;
-// // if
-// (repository.getVersion().equals(BugzillaServerVersion.SERVER_220.toString()))
-// {
-// // regularExpression = reValueBugzilla220;
-// // } else {
-// // regularExpression = reValue;
-// // }
-// //
-// // int taskId = Integer.parseInt(match.getCapturedText(1));
-// // BugzillaSearchHit hit = createHit(regularExpression, monitor, in,
-// match, repository.getUrl()
-// // .toExternalForm(), taskId);
-// // collector.accept(hit);
-// // numCollected++;
-// // }
-// if (monitor.isCanceled()) {
-// throw new OperationCanceledException("Search cancelled");
-// }
-// }
-// } catch (CoreException e) {
-// status = new MultiStatus(IBugzillaConstants.PLUGIN_ID, IStatus.ERROR,
-// "Core Exception occurred while querying Bugzilla Server " +
-// repository.getUrl()
-// + ".\n" + "\nClick Details for more information.", e);
-// ((MultiStatus) status).add(e.getStatus());
-//
-// // write error to log
-// BugzillaPlugin.log(status);
-// } catch (OperationCanceledException e) {
-// status = new Status(IStatus.CANCEL, IBugzillaConstants.PLUGIN_ID,
-// IStatus.CANCEL, "", null);
-// } catch (Exception e) {
-// status = new MultiStatus(IBugzillaConstants.PLUGIN_ID, IStatus.ERROR, "An
-// error occurred while querying Bugzilla Server " + repository.getUrl() +
-// ".\n"
-// + "\nCheck network connection repository configuration in Task
-// Repositories view.", e);
-//
-// IStatus s = new Status(IStatus.ERROR, IBugzillaConstants.PLUGIN_ID,
-// IStatus.ERROR, e.getClass().toString()
-// + ": ", e);
-// ((MultiStatus) status).add(s);
-// s = new Status(IStatus.ERROR, IBugzillaConstants.PLUGIN_ID, IStatus.OK,
-// "search failed", e);
-// ((MultiStatus) status).add(s);
-//
-// // write error to log
-// //BugzillaPlugin.log(status);
-//
-//
-// } finally {
-// monitor.done();
-// collector.done();
-// try {
-// if (in != null)
-// in.close();
-// } catch (IOException e) {
-// BugzillaPlugin.log(new Status(IStatus.ERROR,
-// IBugzillaConstants.PLUGIN_ID, IStatus.ERROR,
-// "Problem closing the stream", e));
-// }
-// }
-//
-// // if we haven't collected any serach results and we suspect a bad
-// // login, we assume it was a bad login
-// if (numCollected == 0 && possibleBadLogin) {
-// throw new LoginException(IBugzillaConstants.MESSAGE_LOGIN_FAILURE + " for
-// repository: " + repository.getUrl() + " username: " +
-// repository.getUserName());
-// }
-//
-// if (status == null)
-// return new Status(IStatus.OK, NewSearchUI.PLUGIN_ID, IStatus.OK, "",
-// null);
-// else
-// return status;
-// }
diff --git a/org.eclipse.mylyn.ide.dev/developer/src-old/bugs/BugzillaSearchManager.java b/org.eclipse.mylyn.ide.dev/developer/src-old/bugs/BugzillaSearchManager.java
deleted file mode 100644
index 6cabc262..00000000
--- a/org.eclipse.mylyn.ide.dev/developer/src-old/bugs/BugzillaSearchManager.java
+++ /dev/null
@@ -1,152 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2008 Tasktop Technologies 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:
- * Tasktop Technologies - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.mylyn.internal.sandbox.bridge.bugs;
-
-import java.util.Collection;
-import java.util.Collections;
-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 Mylyn and bugzilla
- *
- * @author Shawn Minto
- */
-public class BugzillaSearchManager {
-
- /** The hash of all of the landmarks and their related search hits */
- private final Map<String, Map<Integer, List<BugzillaReportInfo>>> landmarksHash;
-
- /**
- * The currently running search jobs so that we can cancel it if necessary <br>
- * KEY: IMember VALUE: Job
- */
- static Map<String, Job> runningJobs = Collections.synchronizedMap(new HashMap<String, Job>());
-
- /**
- * Constructor
- */
- public BugzillaSearchManager() {
- landmarksHash = Collections.synchronizedMap(new HashMap<String, Map<Integer, List<BugzillaReportInfo>>>());
- }
-
- /**
- * 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<BugzillaReportInfo> doiList, IMember m, int scope) {
- Map<Integer, List<BugzillaReportInfo>> searches = landmarksHash.get(m.getHandleIdentifier());
-
- if (searches == null) {
- searches = new HashMap<Integer, List<BugzillaReportInfo>>();
- }
- 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<BugzillaReportInfo> getFromLandmarksHash(IMember m, int scope) {
- Map<Integer, List<BugzillaReportInfo>> 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);
- }
-
- public static void cancelAllRunningJobs() {
- Collection<Job> jobs = runningJobs.values();
- for (Job j : jobs) {
- j.cancel();
- }
- runningJobs.clear();
- }
-}
diff --git a/org.eclipse.mylyn.ide.dev/developer/src-old/bugs/BugzillaStructureBridge.java b/org.eclipse.mylyn.ide.dev/developer/src-old/bugs/BugzillaStructureBridge.java
deleted file mode 100644
index 584951de..00000000
--- a/org.eclipse.mylyn.ide.dev/developer/src-old/bugs/BugzillaStructureBridge.java
+++ /dev/null
@@ -1,140 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2008 Tasktop Technologies 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:
- * Tasktop Technologies - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.mylyn.internal.sandbox.bridge.bugs;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.mylyn.context.core.AbstractContextStructureBridge;
-import org.eclipse.mylyn.internal.context.core.AbstractRelationProvider;
-import org.eclipse.mylyn.internal.tasks.ui.editors.ContentOutlineTools;
-import org.eclipse.mylyn.internal.tasks.ui.editors.RepositoryTaskOutlineNode;
-import org.eclipse.mylyn.internal.tasks.ui.editors.RepositoryTaskSelection;
-import org.eclipse.mylyn.tasks.core.ITask;
-import org.eclipse.ui.views.markers.internal.ProblemMarker;
-
-/**
- * @author Mik Kersten
- * @author Shawn Minto
- */
-public class BugzillaStructureBridge extends AbstractContextStructureBridge {
-
- public final static String CONTENT_TYPE = "bugzilla";
-
- public List<AbstractRelationProvider> providers;
-
- @Override
- public String getContentType() {
- return CONTENT_TYPE;
- }
-
- public BugzillaStructureBridge() {
- super();
- providers = new ArrayList<AbstractRelationProvider>();
- }
-
- /**
- * Handle format: <server-name:port>;<bug-taskId>;<comment#>
- *
- * Use: OutlineTools ???
- */
- @Override
- public String getHandleIdentifier(Object object) {
- if (object instanceof RepositoryTaskOutlineNode) {
- RepositoryTaskOutlineNode node = (RepositoryTaskOutlineNode) object;
- return ContentOutlineTools.getHandle(node);
- } else if (object instanceof RepositoryTaskSelection) {
- RepositoryTaskSelection n = (RepositoryTaskSelection) object;
- return ContentOutlineTools.getHandle(n);
- }
- return null;
- }
-
-// private BugzillaReport result;
-
- /**
- * TODO: this will not return a non-cached handle
- */
- @Override
- public Object getObjectForHandle(final String handle) {
- return null;
- }
-
- @Override
- 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;
- }
-
- RepositoryTaskOutlineNode bon = (RepositoryTaskOutlineNode) getObjectForHandle(handle);
- if (bon != null && bon.getParent() != null) {
- return ContentOutlineTools.getHandle(bon.getParent());
- } else {
- return null;
- }
- }
-
- @Override
- public String getLabel(Object object) {
- if (object instanceof RepositoryTaskOutlineNode) {
- RepositoryTaskOutlineNode b = (RepositoryTaskOutlineNode) object;
- return ContentOutlineTools.getName(b);
- } else if (object instanceof BugzillaReportInfo) {
- ITask hit = ((BugzillaReportInfo) object).getHit();
- return hit.getRepositoryUrl() + ": Bug#: " + hit.getTaskId() + ": " + hit.getSummary();
- }
- return "";
- }
-
- @Override
- public boolean canBeLandmark(String handle) {
- return false;
- }
-
- @Override
- public boolean acceptsObject(Object object) {
- return object instanceof RepositoryTaskOutlineNode || object instanceof RepositoryTaskSelection;
- }
-
- @Override
- public boolean canFilter(Object element) {
- return true;
- }
-
- @Override
- public boolean isDocument(String handle) {
- return (handle.indexOf(';') == handle.lastIndexOf(';') && handle.indexOf(";") != -1);
- }
-
- public String getHandleForMarker(ProblemMarker marker) {
- return null;
- }
-
- @Override
- public String getContentType(String elementHandle) {
- return getContentType();
- }
-
- @Override
- public String getHandleForOffsetInObject(Object resource, int offset) {
- return null;
- }
-
- @Override
- public List<String> getChildHandles(String handle) {
- return Collections.emptyList();
- }
-}
diff --git a/org.eclipse.mylyn.ide.dev/developer/src-old/bugs/BugzillaUiBridge.java b/org.eclipse.mylyn.ide.dev/developer/src-old/bugs/BugzillaUiBridge.java
deleted file mode 100644
index 08a740f6..00000000
--- a/org.eclipse.mylyn.ide.dev/developer/src-old/bugs/BugzillaUiBridge.java
+++ /dev/null
@@ -1,139 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2008 Tasktop Technologies 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:
- * Tasktop Technologies - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.mylyn.internal.sandbox.bridge.bugs;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.jface.text.TextSelection;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.mylyn.context.core.IInteractionElement;
-import org.eclipse.mylyn.context.ui.AbstractContextUiBridge;
-import org.eclipse.mylyn.internal.bugzilla.core.BugzillaClient;
-import org.eclipse.mylyn.internal.tasks.core.AbstractTask;
-import org.eclipse.mylyn.internal.tasks.ui.TasksUiPlugin;
-import org.eclipse.mylyn.internal.tasks.ui.deprecated.AbstractRepositoryTaskEditor;
-import org.eclipse.mylyn.internal.tasks.ui.editors.RepositoryTaskOutlinePage;
-import org.eclipse.mylyn.tasks.ui.TasksUiUtil;
-import org.eclipse.mylyn.tasks.ui.editors.TaskEditor;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IEditorReference;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.PlatformUI;
-
-/**
- * @author Mik Kersten
- * @author Shawn Minto
- */
-public class BugzillaUiBridge extends AbstractContextUiBridge {
-
- protected BugzillaContextLabelProvider labelProvider = new BugzillaContextLabelProvider();
-
- @Override
- public void open(IInteractionElement node) {
- String handle = node.getHandleIdentifier();
- String bugHandle = handle;
- String server = handle.substring(0, handle.indexOf(";"));
-
- handle = handle.substring(handle.indexOf(";") + 1);
- int next = handle.indexOf(";");
-
- int bugId;
- if (next == -1) {
- bugId = Integer.parseInt(handle);
- } else {
- bugId = Integer.parseInt(handle.substring(0, handle.indexOf(";")));
- bugHandle = bugHandle.substring(0, next);
- }
-
- final AbstractTask task = TasksUiPlugin.getTaskList().getTask(handle);
- if (task != null) {
- PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() {
- public void run() {
- TasksUiUtil.openTask(task);
- }
- });
- } else {
- String bugUrl = BugzillaClient.getBugUrlWithoutLogin(server, "" + bugId);
- TasksUiUtil.openTask(server, "" + bugId, bugUrl);
- }
- }
-
- public ILabelProvider getLabelProvider() {
- return labelProvider;
- }
-
- @Override
- public void close(IInteractionElement node) {
- IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
- if (page != null) {
- IEditorReference[] references = page.getEditorReferences();
- for (IEditorReference reference : references) {
- IEditorPart part = reference.getEditor(false);
- if (part != null) {
- if (part instanceof AbstractRepositoryTaskEditor) {
- ((AbstractRepositoryTaskEditor) part).close();
- } else if (part instanceof TaskEditor) {
- ((TaskEditor) part).close(true);
- }
- }
- }
- }
- }
-
- @Override
- public boolean acceptsEditor(IEditorPart editorPart) {
- return editorPart instanceof AbstractRepositoryTaskEditor;
- }
-
- @Override
- public List<TreeViewer> getContentOutlineViewers(IEditorPart editor) {
- List<TreeViewer> viewers = new ArrayList<TreeViewer>();
- TreeViewer outline = getOutlineTreeViewer(editor);
- if (outline != null) {
- viewers.add(outline);
- }
- return viewers;
- }
-
- protected TreeViewer getOutlineTreeViewer(IEditorPart editor) {
- if (editor instanceof AbstractRepositoryTaskEditor) {
- AbstractRepositoryTaskEditor abe = (AbstractRepositoryTaskEditor) editor;
- RepositoryTaskOutlinePage outline = abe.getOutline();
- if (outline != null) {
- return outline.getOutlineTreeViewer();
- }
- }
- return null;
- }
-
- @Override
- public Object getObjectForTextSelection(TextSelection selection, IEditorPart editor) {
- return null;
- }
-
- public void restoreEditor(IInteractionElement document) {
- // ignore
- }
-
- @Override
- public IInteractionElement getElement(IEditorInput input) {
- return null;
- }
-
- @Override
- public String getContentType() {
- return BugzillaStructureBridge.CONTENT_TYPE;
- }
-}
diff --git a/org.eclipse.mylyn.ide.dev/developer/src-old/bugs/IBugzillaSearchOperation.java b/org.eclipse.mylyn.ide.dev/developer/src-old/bugs/IBugzillaSearchOperation.java
deleted file mode 100644
index c2a33a5a..00000000
--- a/org.eclipse.mylyn.ide.dev/developer/src-old/bugs/IBugzillaSearchOperation.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2008 Tasktop Technologies 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:
- * Tasktop Technologies - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.mylyn.internal.sandbox.bridge.bugs;
-
-import javax.security.auth.login.LoginException;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.jface.operation.IRunnableWithProgress;
-import org.eclipse.mylyn.internal.tasks.ui.search.AbstractRepositorySearchQuery;
-
-/**
- * Interface for the bugzilla search operation
- *
- * @author Shawn Minto
- *
- * TODO: Delete once not requred by sandbox
- */
-public interface IBugzillaSearchOperation extends IRunnableWithProgress {
-
- /**
- * Get the status of the search operation
- *
- * @return The status of the search operation
- * @throws LoginException
- */
- public IStatus getStatus() throws LoginException;
-
- /**
- * Get the bugzilla search query
- *
- * @return The bugzilla search query
- */
- public AbstractRepositorySearchQuery getQuery();
-
- /**
- * Sets the bugzilla search query
- *
- * @param newQuery
- * The bugzilla search query to be set
- */
- public void setQuery(AbstractRepositorySearchQuery newQuery);
-
- public String getName();
-}
diff --git a/org.eclipse.mylyn.ide.dev/developer/src-old/bugs/MylynBugsManager.java b/org.eclipse.mylyn.ide.dev/developer/src-old/bugs/MylynBugsManager.java
deleted file mode 100644
index 1b8a3153..00000000
--- a/org.eclipse.mylyn.ide.dev/developer/src-old/bugs/MylynBugsManager.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2008 Tasktop Technologies 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:
- * Tasktop Technologies - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.mylyn.internal.sandbox.bridge.bugs;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-import org.osgi.framework.BundleContext;
-
-/**
- * The main plugin class to be used in the desktop.
- *
- * @author Mik Kersten
- * @author Shawn Minto
- */
-public class MylynBugsManager {
-
- public static ImageDescriptor EDGE_REF_BUGZILLA = getImageDescriptor("icons/elcl16/edge-ref-bug.gif");
-
- private static BugzillaSearchManager bridge = null;
-
- private static BugzillaReferencesProvider referencesProvider = new BugzillaReferencesProvider();
-
- private static MylynBugsManager INSTANCE;
-
-// private BugzillaReportCache cache
-
- public MylynBugsManager() {
- INSTANCE = this;
-// cache = new BugzillaReportCache();
-// cache.readCacheFile();
-
- IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
- if (window != null) {
- // create a new bridge and initialize it
- bridge = new BugzillaSearchManager();
- }
- final IWorkbench workbench = PlatformUI.getWorkbench();
- workbench.getDisplay().asyncExec(new Runnable() {
- public void run() {
- // bugzillaEditingMonitor = new BugzillaEditingMonitor();
- // ContextCore.getSelectionMonitors().add(bugzillaEditingMonitor);
- }
- });
- }
-
- public void dispose(BundleContext context) throws Exception {
- // ContextCore.getSelectionMonitors().remove(bugzillaEditingMonitor);
- }
-
- /**
- * Returns the shared instance.
- */
- public static MylynBugsManager getDefault() {
- return INSTANCE;
- }
-
- /**
- * 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.mylyn.internal.bugs.bridge", path);
- }
-
- public static BugzillaSearchManager getBridge() {
- // make sure that the bridge initialized, if not, make a new one
- if (bridge == null) {
- bridge = new BugzillaSearchManager();
- }
- return bridge;
- }
-
- public static BugzillaReferencesProvider getReferenceProvider() {
- return referencesProvider;
-
- }
-
-// public BugzillaReportCache getCache() {
-// return cache;
-// }
-}
diff --git a/org.eclipse.mylyn.ide.dev/developer/src-old/bugs/ProgressQueryHitCollector.java b/org.eclipse.mylyn.ide.dev/developer/src-old/bugs/ProgressQueryHitCollector.java
deleted file mode 100644
index 0994756a..00000000
--- a/org.eclipse.mylyn.ide.dev/developer/src-old/bugs/ProgressQueryHitCollector.java
+++ /dev/null
@@ -1,152 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2008 Tasktop Technologies 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:
- * Tasktop Technologies - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.mylyn.internal.sandbox.bridge.bugs;
-
-import java.text.MessageFormat;
-import java.util.HashSet;
-import java.util.Set;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.SubProgressMonitor;
-import org.eclipse.mylyn.internal.tasks.core.AbstractTask;
-import org.eclipse.mylyn.internal.tasks.core.ITaskList;
-import org.eclipse.mylyn.internal.tasks.core.deprecated.ITaskFactory;
-import org.eclipse.mylyn.internal.tasks.core.deprecated.LegacyTaskDataCollector;
-import org.eclipse.mylyn.internal.tasks.core.deprecated.RepositoryTaskData;
-
-/**
- * @author Shawn Minto
- */
-public class ProgressQueryHitCollector extends LegacyTaskDataCollector {
-
- public static final int MAX_HITS = 5000;
-
- public static final String MAX_HITS_REACHED = "Max allowed number of hits returned exceeded. Some hits may not be displayed. Please narrow query scope.";
-
- protected Set<AbstractTask> taskResults = new HashSet<AbstractTask>();
-
- /** The progress monitor for the search operation */
- private IProgressMonitor monitor = new NullProgressMonitor();
-
- /** The number of matches found */
- private int matchCount;
-
- /** 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 we have 1 match */
- private static final String MATCH = "1 match";
-
- /** The string to display to the user when we have multiple or no matches */
- private static final String MATCHES = "{0} matches";
-
- /** The string to display to the user when the query is done */
- private static final String DONE = "done";
-
- protected ITaskList taskList;
-
- protected ITaskFactory taskFactory;
-
- public ProgressQueryHitCollector(ITaskList tasklist, ITaskFactory taskFactory) {
- this.taskList = tasklist;
- this.taskFactory = taskFactory;
- }
-
- public void aboutToStart(int startMatchCount) throws CoreException {
- taskResults.clear();
- matchCount = startMatchCount;
- monitor.setTaskName(STARTING);
- }
-
-// public void accept(AbstractTask task) {
-//
-// if (!getProgressMonitor().isCanceled()) {
-// getProgressMonitor().subTask(getFormattedMatchesString(matchCount));
-// getProgressMonitor().worked(1);
-// }
-//
-// if (task == null) {
-// return;
-// }
-//
-// AbstractTask hitTask = taskList.getTask(task.getHandleIdentifier());
-// if (hitTask == null) {
-// hitTask = task;
-// // task is new, add to tasklist
-// taskList.addTask(hitTask);
-// }
-// taskResults.add(hitTask);
-// matchCount++;
-// }
-
- @Override
- public void accept(RepositoryTaskData taskData) {
- if (taskData == null) {
- return;
- }
-
- if (!getProgressMonitor().isCanceled()) {
- getProgressMonitor().subTask(getFormattedMatchesString(matchCount));
- getProgressMonitor().worked(1);
- }
-
- AbstractTask task;
- try {
- task = taskFactory.createTask(taskData, new SubProgressMonitor(monitor, 1));
- taskResults.add(task);
- matchCount++;
- } catch (CoreException e) {
- // FIXME
- e.printStackTrace();
- }
- }
-
- public void done() {
- if (monitor != null && !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.done();
- }
-
- // Cut no longer used references because the collector might be re-used
- monitor = null;
- }
-
- protected String getFormattedMatchesString(int count) {
- if (count == 1) {
- return MATCH;
- }
- Object[] messageFormatArgs = { new Integer(count) };
- return MessageFormat.format(MATCHES, messageFormatArgs);
- }
-
- public IProgressMonitor getProgressMonitor() {
- return monitor;
- }
-
- public void setProgressMonitor(IProgressMonitor monitor) {
- this.monitor = monitor;
- }
-
- public Set<AbstractTask> getTasks() {
- return taskResults;
- }
-
- public void clear() {
- taskResults.clear();
- }
-
-}
diff --git a/org.eclipse.mylyn.ide.dev/developer/src-old/bugs/Util.java b/org.eclipse.mylyn.ide.dev/developer/src-old/bugs/Util.java
deleted file mode 100644
index 48baef3d..00000000
--- a/org.eclipse.mylyn.ide.dev/developer/src-old/bugs/Util.java
+++ /dev/null
@@ -1,220 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2008 Tasktop Technologies 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:
- * Tasktop Technologies - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.mylyn.internal.sandbox.bridge.bugs;
-
-import java.io.UnsupportedEncodingException;
-import java.net.URLEncoder;
-import java.nio.charset.Charset;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.jdt.core.IMember;
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.mylyn.internal.bugzilla.core.BugzillaCorePlugin;
-import org.eclipse.mylyn.internal.bugzilla.core.IBugzillaConstants;
-import org.eclipse.mylyn.internal.bugzilla.core.RepositoryConfiguration;
-import org.eclipse.mylyn.internal.bugzilla.ui.BugzillaUiPlugin;
-import org.eclipse.mylyn.internal.tasks.ui.TasksUiPlugin;
-import org.eclipse.mylyn.tasks.core.TaskRepository;
-import org.eclipse.mylyn.tasks.ui.TasksUi;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.PlatformUI;
-
-/**
- * Utilities methods for the BugzillaMylarBridge
- *
- * @author Shawn Minto
- * @author Mik Kersten
- */
-public class Util {
-
- /**
- * List of all of the search repositoryOperations 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();
- // private static String[] resolutionValues =
- // BugzillaRepositoryUtil.convertQueryOptionsToArray(prefs.getString(IBugzillaConstants.VALUES_RESOLUTION));
- //
- // private static String[] statusValues =
- // BugzillaRepositoryUtil.convertQueryOptionsToArray(prefs.getString(IBugzillaConstants.VALUES_STATUS));
- /**
- * 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(String repositoryUrl, IMember je) {
- StringBuffer sb = getQueryURLStart(repositoryUrl);
-
- String long_desc = "";
-
- // get the fully qualified name of the element
- long_desc += BugzillaMylynSearchOperation.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(repositoryUrl));
-
- 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(String repositoryUrl, IMember je) {
- StringBuffer sb = getQueryURLStart(repositoryUrl);
-
- 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(repositoryUrl));
-
- 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(String repositoryUrl) {
-
- StringBuffer sb = new StringBuffer();
- TaskRepository repository = TasksUiPlugin.getRepositoryManager().getRepository(repositoryUrl);
- RepositoryConfiguration repositoryConfiguration = null;
- try {
- repositoryConfiguration = BugzillaCorePlugin.getRepositoryConfiguration(repository, false,
- new NullProgressMonitor());
- } catch (final CoreException e) {
- PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() {
- public void run() {
- MessageDialog.openError(Display.getDefault().getActiveShell(), "Bugzilla Search Page",
- "Unable to get configuration. Ensure proper repository configuration in "
- + TasksUiPlugin.LABEL_VIEW_REPOSITORIES + ".\n\n");
- }
- });
- }
-
- String[] resolutionValues = BugzillaUiPlugin.getQueryOptions(IBugzillaConstants.VALUES_RESOLUTION, null,
- repositoryConfiguration);
-
- String[] statusValues = BugzillaUiPlugin.getQueryOptions(IBugzillaConstants.VALUES_STATUS, null,
- repositoryConfiguration);
-
- // 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(String repositoryUrl) {
- StringBuffer sb = new StringBuffer(repositoryUrl);
-
- if (sb.charAt(sb.length() - 1) != '/') {
- sb.append('/');
- }
- sb.append("buglist.cgi?");
-
- TaskRepository repository = TasksUi.getRepositoryManager().getRepository(BugzillaCorePlugin.CONNECTOR_KIND,
- repositoryUrl);
- if (repository != null && repository.hasCredentials()) {
- // if (BugzillaPreferencePage.getUserName() != null
- // && !BugzillaPreferencePage.getUserName().equals("")
- // && BugzillaPreferencePage.getPassword() != null
- // && !BugzillaPreferencePage.getPassword().equals("")) {
- try {
- sb.append("GoAheadAndLogIn=1&Bugzilla_login=" + URLEncoder.encode(repository.getUserName(), // BugzillaPreferencePage.getUserName(),
- Charset.defaultCharset().toString()) + "&Bugzilla_password="
- + URLEncoder.encode(repository.getPassword(), // BugzillaPreferencePage.getPassword(),
- Charset.defaultCharset().toString()) + "&");
- } catch (UnsupportedEncodingException e) {
- // should never get here since we are using the default encoding
- }
- }
- // add the summary 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 (String line : lines) {
-
- if (line.matches(regexElement)) {
- return true;
- }
- }
- return false;
- }
-}
diff --git a/org.eclipse.mylyn.ide.dev/developer/src-old/bugzilla/AbstractBugzillaReportWizard.java b/org.eclipse.mylyn.ide.dev/developer/src-old/bugzilla/AbstractBugzillaReportWizard.java
deleted file mode 100644
index 710a38fb..00000000
--- a/org.eclipse.mylyn.ide.dev/developer/src-old/bugzilla/AbstractBugzillaReportWizard.java
+++ /dev/null
@@ -1,238 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003 - 2006 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.mylyn.internal.bugzilla.ui.wizard;
-
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.wizard.Wizard;
-import org.eclipse.mylyn.internal.bugzilla.core.NewBugzillaReport;
-import org.eclipse.mylyn.internal.bugzilla.ui.BugzillaUiPlugin;
-import org.eclipse.mylyn.provisional.tasklist.MylarTaskListPlugin;
-import org.eclipse.mylyn.provisional.tasklist.TaskRepository;
-import org.eclipse.ui.INewWizard;
-import org.eclipse.ui.IWorkbench;
-
-/**
- * Class that contains shared functions for the wizards that submit bug reports.
- *
- * @author Eric Booth
- * @author Mik Kersten (some hardening of prototype)
- * @author Rob Elves
- */
-public abstract class AbstractBugzillaReportWizard extends Wizard implements INewWizard {
-
- // /** The ID of the posted bug report. */
- // private String id;
-
- protected boolean fromDialog = false;
-
- /** The model used to store all of the data for the wizard */
- protected NewBugzillaReport model;
- // TODO: Change model to a RepositoryTaskData
- //protected RepositoryTaskData model;
-
- /**
- * Flag to indicate if the wizard can be completed based on the attributes
- * page
- */
- protected boolean completed = false;
-
- /** The workbench instance */
- protected IWorkbench workbenchInstance;
-
- private final TaskRepository repository;
-
- public AbstractBugzillaReportWizard(TaskRepository repository) {
- super();
- this.repository = repository;
- model = new NewBugzillaReport(repository.getUrl(), MylarTaskListPlugin.getDefault().getOfflineReportsFile()
- .getNextOfflineBugId());
- // id = null;
- super.setDefaultPageImageDescriptor(BugzillaUiPlugin.imageDescriptorFromPlugin(
- "org.eclipse.mylyn.internal.bugzilla.ui", "icons/wizban/bug-wizard.gif"));
- }
-
- public void init(IWorkbench workbench, IStructuredSelection selection) {
- this.workbenchInstance = workbench;
- }
-
- @Override
- public void addPages() {
- super.addPages();
- }
-
- /**
- * Saves the bug report offline on the user's hard-drive. All offline bug
- * reports are saved together in a single file in the plug-in's directory.
- */
- abstract protected void saveBugOffline();
-
- /**
- * @return the last page of this wizard
- */
- abstract protected AbstractBugzillaWizardPage getWizardDataPage();
-
- public TaskRepository getRepository() {
- return repository;
- }
-}
-
-// @Override
-// public boolean performFinish() {
-// getWizardDataPage().saveDataToModel();
-// return postBug();
-//
-// // if (postBug()) {
-// // // if (!fromDialog)
-// // // openBugEditor();
-// // return true;
-// // }
-// // // If the report was not sent, keep the wizard open
-// // else {
-// // return false;
-// // }
-// // }
-//
-// // if (getWizardDataPage().offlineSelected()) {
-// // saveBugOffline();
-// // return true;
-// // }
-//
-// // If no action was selected, keep the wizard open.
-// // return false;
-// }
-
-// /**
-// * Attempts to post the bug on the Bugzilla server. If it fails, an error
-// * message pops up.
-// *
-// * @return true if the bug is posted successfully, and false otherwise
-// */
-// protected boolean postBug() {
-//
-// final IRunnableWithProgress op = new IRunnableWithProgress() {
-// public void run(IProgressMonitor monitor) throws InvocationTargetException,
-// InterruptedException {
-// Proxy proxySettings = MylarTaskListPlugin.getDefault().getProxySettings();
-// boolean wrap =
-// IBugzillaConstants.BugzillaServerVersion.SERVER_218.equals(repository.getVersion());
-// try {
-// form = BugzillaReportSubmitForm.makeNewBugPost(repository.getUrl(),
-// repository.getUserName(),
-// repository.getPassword(), proxySettings, repository.getCharacterEncoding(),
-// model, wrap);
-// id = form.submitReportToRepository();
-// if (id != null) {
-// sentSuccessfully = true;
-// }
-// } catch (Exception e) {
-// throw new InvocationTargetException(e);
-// }
-// }
-// };
-//
-// IProgressService service = PlatformUI.getWorkbench().getProgressService();
-// try {
-// service.run(true, false, op);
-// } catch (InvocationTargetException e) {
-// if (e.getCause() instanceof BugzillaException) {
-// MessageDialog.openError(getWizardDataPage().getShell(), "I/O Error",
-// "Bugzilla could not post your bug.");
-// } else if (e.getCause() instanceof PossibleBugzillaFailureException) {
-// WebBrowserDialog.openAcceptAgreement(getWizardDataPage().getShell(),
-// "Bugzilla Submission Error Message", e.getCause().getMessage(),
-// form.getError());
-// } else if (e.getCause() instanceof LoginException) {
-// MessageDialog.openError(getWizardDataPage().getShell(), "Posting Error",
-// "Bugzilla could not post your bug since your login name or password is
-// incorrect."
-// + "\nPlease check your settings in the bugzilla preferences. ");
-// } else if (e.getCause() instanceof UnsupportedEncodingException) {
-// // should never get here but just in case...
-// MessageDialog.openError(getWizardDataPage().getShell(), "Posting Error",
-// "Ensure proper encoding selected in "
-// + TaskRepositoriesView.NAME + ".");
-// }
-// } catch (InterruptedException e) {
-// // ignore
-// }
-// return sentSuccessfully;
-//
-// // final WorkspaceModifyOperation op = new WorkspaceModifyOperation() {
-// // protected void execute(final IProgressMonitor monitor) throws
-// // CoreException {
-// // PlatformUI.getWorkbench().getDisplay().syncExec(new Runnable() {
-// // public void run() {
-// // Proxy proxySettings =
-// // MylarTaskListPlugin.getDefault().getProxySettings();
-// // boolean wrap =
-// //
-// IBugzillaConstants.BugzillaServerVersion.SERVER_218.equals(repository.getVersion());
-// // BugzillaReportSubmitForm form =
-// // BugzillaReportSubmitForm.makeNewBugPost(repository.getUrl(),
-// // repository.getUserName(), repository.getPassword(), proxySettings,
-// // model, wrap);
-// // try {
-// // id = form.submitReportToRepository();
-// //
-// // if (id != null) {
-// // sentSuccessfully = true;
-// // }
-// // } catch (BugzillaException e) {
-// // MessageDialog.openError(null, "I/O Error", "Bugzilla could not post
-// // your bug.");
-// // BugzillaPlugin.log(e);
-// // } catch (PossibleBugzillaFailureException e) {
-// // WebBrowserDialog.openAcceptAgreement(null, "Possible Bugzilla Client
-// // Failure",
-// // "Bugzilla may not have posted your bug.\n" + e.getMessage(),
-// // form.getError());
-// // BugzillaPlugin.log(e);
-// // } catch (LoginException e) {
-// // MessageDialog.openError(null, "Posting Error",
-// // "Bugzilla could not post your bug since your login name or password
-// // is incorrect."
-// // + "\nPlease check your settings in the bugzilla preferences. ");
-// // sentSuccessfully = false;
-// // }
-// // }
-// //
-// // });
-// // }
-// // };
-//
-// }
-
-// /**
-// * Try to open the editor with the newly created bug.
-// */
-// protected void openBugEditor() {
-//
-// IEditorInput input = null;
-// try {
-// input = new ExistingBugEditorInput(repository, Integer.parseInt(id));
-// PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().openEditor(input,
-// BugzillaUiPlugin.EXISTING_BUG_EDITOR_ID, false);
-// } catch (LoginException e) {
-// // if we had an error with logging in, display an error
-// MessageDialog.openError(null, "Posting Error",
-// "Bugzilla could not access and display your bug in the editor because your
-// login name or password is incorrect."
-// + "\nPlease check your settings in the bugzilla preferences. ");
-// } catch (PartInitException e) {
-// // if there was a problem, handle it and log it, then get out of
-// // here
-// ExceptionHandler.handle(e, SearchMessages.Search_Error_search_title,
-// SearchMessages.Search_Error_search_message);
-// BugzillaPlugin.log(e.getStatus());
-// } catch (Exception e) {
-// MylarStatusHandler.fail(e, "Failed to open Bugzilla report", false);
-// }
-// }
diff --git a/org.eclipse.mylyn.ide.dev/developer/src-old/bugzilla/AbstractBugzillaWizardPage.java b/org.eclipse.mylyn.ide.dev/developer/src-old/bugzilla/AbstractBugzillaWizardPage.java
deleted file mode 100644
index 572e3759..00000000
--- a/org.eclipse.mylyn.ide.dev/developer/src-old/bugzilla/AbstractBugzillaWizardPage.java
+++ /dev/null
@@ -1,780 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003 - 2006 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.mylyn.internal.bugzilla.ui.wizard;
-
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Set;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jface.wizard.IWizardPage;
-import org.eclipse.jface.wizard.WizardPage;
-import org.eclipse.mylyn.internal.bugzilla.core.BugzillaReportElement;
-import org.eclipse.mylyn.internal.bugzilla.core.NewBugzillaReport;
-import org.eclipse.mylyn.internal.core.util.MylarStatusHandler;
-import org.eclipse.mylyn.internal.tasklist.RepositoryTaskAttribute;
-import org.eclipse.mylyn.internal.tasklist.ui.editors.AbstractTaskEditor;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Font;
-import org.eclipse.swt.graphics.FontData;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Listener;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.internal.WorkbenchImages;
-import org.eclipse.ui.internal.ide.IDEInternalWorkbenchImages;
-import org.eclipse.ui.themes.IThemeManager;
-
-/**
- * Class that contains shared functions for the last page of the wizards that
- * submit bug reports. This page allows the user to set the bug report's
- * attributes before submitting it.
- *
- * @author Mik Kersten (hardening of initial prototype)
- */
-public abstract class AbstractBugzillaWizardPage extends WizardPage implements Listener {
-
- /** The instance of the workbench */
- protected IWorkbench workbench;
-
- /** Text field for the bugs url */
- protected Text urlText;
-
- /** Text field for the description of the bug */
- protected Text descriptionText;
-
- /** Text field for the summary of the bug */
- protected Text summaryText;
-
- /** Text field for the assignedTo of the bug */
- protected Text assignedToText;
-
- // /** Radio button to select when sending the new bug report to the server
- // */
- // protected Button serverButton;
- //
- // /** Radio button to select when saving the new bug report offline */
- // protected Button offlineButton;
-
- /** Combo box for the component that caused the bug */
- protected Combo componentCombo;
-
- /** Combo box for the priority of the bug */
- protected Combo priorityCombo;
-
- /** Combo box for the platform the bug occurred on */
- protected Combo platformCombo;
-
- /** Combo box for the severity of the bug */
- protected Combo severityCombo;
-
- /** Combo box for the products version */
- protected Combo versionCombo;
-
- /** Combo box for the OS that the bug occurred under */
- protected Combo oSCombo;
-
- /** Combo box for the Milestone that the bug addresses */
- protected Combo milestoneCombo;
-
- /** Enum for value */
- protected final String VALUE = "VALUE";
-
- /** Enum for property */
- protected final String PROPERTY = "PROPERTY";
-
- /** Enum for header */
- protected final String HEADER = "HEADER";
-
- /** The horizontal indentation of the labels */
- protected final int HORZ_INDENT = 0;
-
- /** Status variable for the possible errors on this page */
- protected IStatus attributeStatus;
-
- /**
- * Constructor for AbstractWizardDataPage
- *
- * @param pageName
- * the name of the page
- * @param title
- * the title of the page
- * @param description
- * the description text for the page
- * @param workbench
- * the instance of the workbench
- */
- public AbstractBugzillaWizardPage(String pageName, String title, String description, IWorkbench workbench) {
- super(pageName);
- setTitle(title);
- setDescription(description);
- this.workbench = workbench;
-
- // set the status for the page
- attributeStatus = new Status(IStatus.OK, "not_used", 0, "", null);
- }
-
- /**
- * Applies the status to the status line of a dialog page.
- *
- * @param status
- * The status to apply to the status line
- */
- protected void applyToStatusLine(IStatus status) {
- String message = status.getMessage();
- if (message.length() == 0)
- message = null;
- switch (status.getSeverity()) {
- case IStatus.OK:
- setErrorMessage(null);
- setMessage(message);
- break;
- case IStatus.WARNING:
- setErrorMessage(null);
- setMessage(message, WizardPage.WARNING);
- break;
- case IStatus.INFO:
- setErrorMessage(null);
- setMessage(message, WizardPage.INFORMATION);
- break;
- default:
- setErrorMessage(null);
- setMessage(message, WizardPage.ERROR);
- break;
- }
- }
-
- /**
- * 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 The string in its proper format
- */
- public String checkText(String text) {
- if (text == null)
- return "";
- else
- return text;
- }
-
- @Override
- public boolean canFlipToNextPage() {
- // no next page for this path through the wizard
- return false;
- }
-
- /**
- * Create a new layout for a component
- *
- * @param composite
- * The parent composite
- * @param colSpan
- * The number of columns that this can span
- * @param text
- * The text to add to the control
- * @param style
- * The style that the control should have
- */
- public void newLayout(Composite composite, int colSpan, String text, String style) {
- GridData data = new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING);
- data.horizontalSpan = colSpan;
-
- // create the proper layout for the style
- if (style.equalsIgnoreCase(VALUE)) {
- Label l = new Label(composite, SWT.NONE);
- FontData fontData = l.getFont().getFontData()[0];
- fontData.setStyle(SWT.BOLD | fontData.getStyle());
- Font font = new Font(null, fontData);
- l.setFont(font);
- l.setText(checkText(text));
-
- data.horizontalIndent = HORZ_INDENT;
- l.setLayoutData(data);
- } else if (style.equalsIgnoreCase(PROPERTY)) {
- Label l = new Label(composite, SWT.NONE);
- FontData fontData = l.getFont().getFontData()[0];
- fontData.setStyle(SWT.BOLD | fontData.getStyle());
- Font font = new Font(null, fontData);
- l.setFont(font);
- l.setText(checkText(text));
-
- data.horizontalIndent = HORZ_INDENT;
- l.setLayoutData(data);
- } 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);
-
- Label image = new Label(generalTitleGroup, SWT.NONE);
- image.setImage(WorkbenchImages.getImage(IDEInternalWorkbenchImages.IMG_OBJS_WELCOME_ITEM));
-
- GridData gd = new GridData(GridData.FILL_BOTH);
- gd.verticalAlignment = GridData.VERTICAL_ALIGN_BEGINNING;
- image.setLayoutData(gd);
- Label l = new Label(composite, SWT.NONE);
- FontData fontData = l.getFont().getFontData()[0];
- fontData.setStyle(SWT.BOLD | fontData.getStyle());
- Font font = new Font(null, fontData);
- l.setFont(font);
- l.setText(checkText(text));
-
- data.horizontalIndent = HORZ_INDENT;
- l.setLayoutData(data);
- }
- }
-
- /**
- * Determine if the page is complete when the summary is changed
- *
- * @param e
- * The event which occurred
- */
- public void handleEvent(Event e) {
- boolean pageComplete = isPageComplete();
-
- // Initialize a variable with the no error status
- Status status = new Status(IStatus.OK, "not_used", 0, "", null);
-
- setPageComplete(pageComplete);
-
- if (!pageComplete)
- status = new Status(IStatus.ERROR, "not_used", 0, "You must enter a summary and a description", null);
-
- attributeStatus = status;
-
- // Show the most serious error
- applyToStatusLine(attributeStatus);
-
- setPageComplete(pageComplete);
- getWizard().getContainer().updateButtons();
- }
-
- @Override
- public IWizardPage getNextPage() {
- saveDataToModel();
- return null;
- }
-
- /**
- * Sets the completed field on the wizard class when all the needed
- * information is entered and the wizard can be completed
- *
- * @return true if the wizard can be completed, false otherwise
- */
- @Override
- public boolean isPageComplete() {
- AbstractBugzillaReportWizard wizard = (AbstractBugzillaReportWizard) getWizard();
- if (summaryText.getText() == null || summaryText.getText().equals("") || descriptionText.getText() == null
- || descriptionText.getText().equals("")) {
- wizard.completed = false;
- return false;
- }
- // saveDataToModel();
- wizard.completed = true;
- return true;
- }
-
- /**
- * Save the data obtained from this point in the wizard to the model.
- */
- public void saveDataToModel() {
- // get the model that we are using
- AbstractBugzillaReportWizard wizard = (AbstractBugzillaReportWizard) getWizard();
- NewBugzillaReport nbm = wizard.model;
-
- nbm.setDescription(descriptionText.getText());
- nbm.setSummary(summaryText.getText());
-
- // go through each of the attributes and sync their values with the
- // combo boxes
- for (Iterator<RepositoryTaskAttribute> it = nbm.getAttributes().iterator(); it.hasNext();) {
- RepositoryTaskAttribute attribute = it.next();
- String key = attribute.getName();
- Map<String, String> values = attribute.getOptionValues();
-
- try {
- if (values == null)
- values = new HashMap<String, String>();
- if (key.equals(BugzillaReportElement.OP_SYS.toString())) {
- String os = oSCombo.getItem(oSCombo.getSelectionIndex());
- attribute.setValue(os);
- } else if (key.equals(BugzillaReportElement.VERSION.toString())) {
- String version = versionCombo.getItem(versionCombo.getSelectionIndex());
- attribute.setValue(version);
- } else if (key.equals(BugzillaReportElement.BUG_SEVERITY.toString())) {
- String severity = severityCombo.getItem(severityCombo.getSelectionIndex());
- attribute.setValue(severity);
- } else if (key.equals(BugzillaReportElement.REP_PLATFORM.toString())) {
- String platform = platformCombo.getItem(platformCombo.getSelectionIndex());
- attribute.setValue(platform);
- } else if (key.equals(BugzillaReportElement.TARGET_MILESTONE.toString())) {
- int index = milestoneCombo.getSelectionIndex();
- if(index >= 0) {
- String milestone = milestoneCombo.getItem(milestoneCombo.getSelectionIndex());
- attribute.setValue(milestone);
- }
- } else if (key.equals(BugzillaReportElement.COMPONENT.toString())) {
- String component = componentCombo.getItem(componentCombo.getSelectionIndex());
- attribute.setValue(component);
- } else if (key.equals(BugzillaReportElement.PRIORITY.toString())) {
- String priority = priorityCombo.getItem(priorityCombo.getSelectionIndex());
- attribute.setValue(priority);
- } else if (key.equals(BugzillaReportElement.BUG_FILE_LOC.toString())) {
- if (urlText != null) {
- String url = urlText.getText();
- if (url.equalsIgnoreCase("http://"))
- url = "";
- attribute.setValue(url);
- }
- } else if (key.equals(BugzillaReportElement.ASSIGNED_TO.toString())) {
- String assignTo = assignedToText.getText();
- attribute.setValue(assignTo);
- } else {
- // do nothing
- }
- } catch (IllegalArgumentException e) {
- MylarStatusHandler.fail(e, "could not set attribute: " + attribute, false);
- }
- }
- // wizard.attributeCompleted = true;
- }
-
- @Override
- protected void setControl(Control c) {
- super.setControl(c);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets.Composite)
- */
- public void createControl(Composite parent) {
- // whether the priority exists or not
- boolean priExist = false;
- boolean mileExist = false;
-
- String url = null;
-
- // get the model for the new bug
- AbstractBugzillaReportWizard wizard = (AbstractBugzillaReportWizard) getWizard();
- NewBugzillaReport nbm = wizard.model;
-
- // Set the current platform and OS on the model
- setPlatformOptions(nbm);
-
- // Attributes Composite- this holds all the combo fields and text
- // fields
- Composite attributesComposite = new Composite(parent, SWT.NONE);
- GridLayout attributesLayout = new GridLayout();
- attributesLayout.numColumns = 4;
- attributesLayout.horizontalSpacing = 14;
- attributesLayout.verticalSpacing = 6;
- attributesLayout.makeColumnsEqualWidth = false;
- attributesComposite.setLayout(attributesLayout);
-
- GridData attributesData = new GridData(GridData.FILL_BOTH);
- attributesData.horizontalSpan = 1;
- attributesData.grabExcessVerticalSpace = false;
- attributesComposite.setLayoutData(attributesData);
- // End Attributes Composite
-
- GridLayout attributesTitleLayout = new GridLayout();
- attributesTitleLayout.horizontalSpacing = 0;
- attributesTitleLayout.marginWidth = 0;
-
- GridData attributesTitleData = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
- attributesTitleData.horizontalSpan = 4;
-
- attributesTitleData.grabExcessVerticalSpace = false;
-
- // Add the product to the composite
- newLayout(attributesComposite, 1, "Product", PROPERTY);
- newLayout(attributesComposite, 1, nbm.getProduct(), VALUE);
-
- // Populate Attributes
- for (Iterator<RepositoryTaskAttribute> it = nbm.getAttributes().iterator(); it.hasNext();) {
- RepositoryTaskAttribute attribute = it.next();
- String key = attribute.getID();
- String name = attribute.getName();
- String value = checkText(attribute.getValue());
- Map<String, String> values = attribute.getOptionValues();
-
- // if it is a hidden field, don't try to display it
- if (attribute.isHidden())
- continue;
-
- if (key == null)
- key = "";
-
- if (values == null)
- values = new HashMap<String, String>();
-
- GridData data = new GridData(GridData.BEGINNING);
- data.horizontalSpan = 1;
- data.horizontalIndent = HORZ_INDENT;
- data.widthHint = 150;
- // create and populate the combo fields for the attributes
- if (key.equals(BugzillaReportElement.OP_SYS.getKeyString())) {
- newLayout(attributesComposite, 1, name, PROPERTY);
- oSCombo = new Combo(attributesComposite, SWT.NO_BACKGROUND | SWT.MULTI | SWT.V_SCROLL | SWT.READ_ONLY);
-
- oSCombo.setLayoutData(data);
- Set<String> s = values.keySet();
- String[] a = s.toArray(new String[s.size()]);
- for (int i = 0; i < a.length; i++) {
- oSCombo.add(a[i]);
- }
- int index;
- if ((index = oSCombo.indexOf(value)) == -1)
- index = 0;
- oSCombo.select(index);
- oSCombo.addListener(SWT.Modify, this);
- } else if (key.equals(BugzillaReportElement.VERSION.getKeyString())) {
- newLayout(attributesComposite, 1, name, PROPERTY);
-
- versionCombo = new Combo(attributesComposite, SWT.NO_BACKGROUND | SWT.MULTI | SWT.V_SCROLL
- | SWT.READ_ONLY);
-
- versionCombo.setLayoutData(data);
- Set<String> s = values.keySet();
- String[] a = s.toArray(new String[s.size()]);
- for (int i = 0; i < a.length; i++) {
- versionCombo.add(a[i]);
- }
- int index;
- if ((index = versionCombo.indexOf(value)) == -1)
- index = 0;
- versionCombo.select(index);
- versionCombo.addListener(SWT.Modify, this);
- } else if (key.equals(BugzillaReportElement.BUG_SEVERITY.getKeyString())) {
- newLayout(attributesComposite, 1, name, PROPERTY);
- severityCombo = new Combo(attributesComposite, SWT.NO_BACKGROUND | SWT.MULTI | SWT.V_SCROLL
- | SWT.READ_ONLY);
-
- severityCombo.setLayoutData(data);
- Set<String> s = values.keySet();
- String[] a = s.toArray(new String[s.size()]);
- for (int i = 0; i < a.length; i++) {
- severityCombo.add(a[i]);
- }
- int index;
- if ((index = severityCombo.indexOf(value)) == -1)
- index = 0;
- severityCombo.select(index);
- severityCombo.addListener(SWT.Modify, this);
-
- } else if (key.equals(BugzillaReportElement.REP_PLATFORM.getKeyString())) {
- newLayout(attributesComposite, 1, name, PROPERTY);
- platformCombo = new Combo(attributesComposite, SWT.NO_BACKGROUND | SWT.MULTI | SWT.V_SCROLL
- | SWT.READ_ONLY);
-
- platformCombo.setLayoutData(data);
- Set<String> s = values.keySet();
- String[] a = s.toArray(new String[s.size()]);
- for (int i = 0; i < a.length; i++) {
- platformCombo.add(a[i]);
- }
- int index;
- if ((index = platformCombo.indexOf(value)) == -1)
- index = 0;
- platformCombo.select(index);
- platformCombo.addListener(SWT.Modify, this);
- } else if (key.equals(BugzillaReportElement.TARGET_MILESTONE.getKeyString())) {
- newLayout(attributesComposite, 1, name, PROPERTY);
- milestoneCombo = new Combo(attributesComposite, SWT.NO_BACKGROUND | SWT.MULTI | SWT.V_SCROLL
- | SWT.READ_ONLY);
- milestoneCombo.setLayoutData(data);
- Set<String> s = values.keySet();
- String[] a = s.toArray(new String[s.size()]);
- for (int i = 0; i < a.length; i++) {
- milestoneCombo.add(a[i]);
- }
- int index;
- if ((index = milestoneCombo.indexOf(value)) == -1)
- index = 0;
- milestoneCombo.select(index);
- milestoneCombo.addListener(SWT.Modify, this);
- //if(s.isEmpty()) milestoneCombo.setEnabled(false);
- mileExist = true;
- } else if (key.equals(BugzillaReportElement.COMPONENT.getKeyString())) {
- newLayout(attributesComposite, 1, name, PROPERTY);
- componentCombo = new Combo(attributesComposite, SWT.NO_BACKGROUND | SWT.MULTI | SWT.V_SCROLL
- | SWT.READ_ONLY);
-
- componentCombo.setLayoutData(data);
- Set<String> s = values.keySet();
- String[] a = s.toArray(new String[s.size()]);
- for (int i = 0; i < a.length; i++) {
- componentCombo.add(a[i]);
- }
- int index;
- if ((index = componentCombo.indexOf(value)) == -1)
- index = 0;
- componentCombo.select(index);
- componentCombo.addListener(SWT.Modify, this);
- } else if (key.equals(BugzillaReportElement.PRIORITY.getKeyString())) {
- newLayout(attributesComposite, 1, name, PROPERTY);
- priorityCombo = new Combo(attributesComposite, SWT.NO_BACKGROUND | SWT.MULTI | SWT.V_SCROLL
- | SWT.READ_ONLY);
-
- priorityCombo.setLayoutData(data);
- Set<String> s = values.keySet();
- String[] a = s.toArray(new String[s.size()]);
- for (int i = 0; i < a.length; i++) {
- priorityCombo.add(a[i]);
- }
- int index;
- if ((index = priorityCombo.indexOf(value)) == -1)
- index = 0;
- priorityCombo.select(index);
- priorityCombo.addListener(SWT.Modify, this);
- priExist = true;
- } else if (key.equals(BugzillaReportElement.BUG_FILE_LOC.getKeyString())) {
- url = value;
- } else {
- // do nothing if it isn't a standard value to change
- }
- }
-
- if (priExist && !mileExist) {
- newLayout(attributesComposite, 1, "", PROPERTY);
- newLayout(attributesComposite, 1, "", PROPERTY);
- }
-
- Composite textComposite = new Composite(attributesComposite, SWT.NONE);
- textComposite.setLayout(new GridLayout(3, false));
- GridData textCompositeGD = new GridData();
- textCompositeGD.horizontalSpan = 4;
- textCompositeGD.grabExcessHorizontalSpace = true;
- textComposite.setLayoutData(textCompositeGD);
-
-
- GridData urlTextData;
- if (url != null) {
- newLayout(textComposite, 1, BugzillaReportElement.BUG_FILE_LOC.toString(), PROPERTY);
- urlText = new Text(textComposite, SWT.BORDER | SWT.SINGLE | SWT.WRAP);
- urlTextData = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
-
- urlTextData.horizontalSpan = 2;
- // summaryTextData.widthHint = 200;
- urlText.setLayoutData(urlTextData);
- urlText.setText(url);
- urlText.addListener(SWT.FocusOut, this);
- }
-
- GridData summaryTextData;
- newLayout(textComposite, 1, BugzillaReportElement.ASSIGNED_TO.toString(), PROPERTY);
- Label l = new Label(textComposite, SWT.NONE);
- l.setText("(if email is incorrect submit will not proceed)");
- summaryTextData = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
- summaryTextData.horizontalSpan = 1;
- l.setLayoutData(summaryTextData);
- assignedToText = new Text(textComposite, SWT.BORDER | SWT.SINGLE | SWT.WRAP);
- summaryTextData = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
-
- summaryTextData.horizontalSpan = 1;
- summaryTextData.widthHint = 200;
- assignedToText.setLayoutData(summaryTextData);
- assignedToText.setText("");
-
-
- IThemeManager themeManager = PlatformUI.getWorkbench().getThemeManager();
- Font repositoryFont = themeManager.getCurrentTheme().getFontRegistry().get(AbstractTaskEditor.REPOSITORY_TEXT_ID);
-
- // add the summary text field
- newLayout(textComposite, 1, BugzillaReportElement.SHORT_DESC.toString(), PROPERTY);
- summaryText = new Text(textComposite, SWT.BORDER | SWT.SINGLE | SWT.WRAP);
- summaryText.setFont(repositoryFont);
- summaryTextData = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
-
- summaryTextData.horizontalSpan = 2;
- summaryTextData.widthHint = 200;
- summaryText.setLayoutData(summaryTextData);
- summaryText.setText(nbm.getSummary());
- summaryText.addListener(SWT.Modify, this);
-
- // Description Text
- Composite descriptionComposite = new Composite(attributesComposite, SWT.NONE);
-
- descriptionComposite.setLayout(attributesTitleLayout);
-
- GridData descriptionData = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
- descriptionData.horizontalSpan = 4;
- descriptionData.grabExcessVerticalSpace = false;
- descriptionComposite.setLayoutData(descriptionData);
- newLayout(descriptionComposite, 4, "Description:", HEADER);
-
- // add the description text field
- descriptionText = new Text(attributesComposite, SWT.BORDER | SWT.MULTI | SWT.V_SCROLL | SWT.WRAP);
-
- //descriptionText.setFont(AbstractTaskEditor.COMMENT_FONT);
- descriptionText.setFont(repositoryFont);
- GridData descriptionTextData = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
- descriptionTextData.horizontalSpan = 4;
- descriptionTextData.widthHint = AbstractTaskEditor.DESCRIPTION_WIDTH;
- descriptionTextData.heightHint = AbstractTaskEditor.DESCRIPTION_HEIGHT;
- descriptionText.setLayoutData(descriptionTextData);
- descriptionText.addListener(SWT.Modify, this);
-
- // serverButton = new Button(attributesComposite, SWT.RADIO);
- // serverButton.setText("Submit bug report to the server.");
- // GridData toServerButtonData = new
- // GridData(GridData.HORIZONTAL_ALIGN_BEGINNING);
- // toServerButtonData.horizontalSpan = 4;
- // serverButton.setLayoutData(toServerButtonData);
- // serverButton.setSelection(true);
- //
- // offlineButton = new Button(attributesComposite, SWT.RADIO);
- // offlineButton.setText("Save bug report offline.");
- // GridData offlineButtonData = new
- // GridData(GridData.HORIZONTAL_ALIGN_BEGINNING);
- // offlineButtonData.horizontalSpan = 4;
- // offlineButton.setLayoutData(offlineButtonData);
- // offlineButton.setSelection(false);
-
- // if (wizard.fromDialog)
- // offlineButton.setEnabled(false);
-
- setControl(attributesComposite);
- return;
- }
-
- // /**
- // * @return <code>true</code> if the radio button to submit the bug to the
- // * server is selected.
- // */
- // public boolean serverSelected() {
- // return (serverButton == null) ? false : serverButton.getSelection();
- // }
- //
- // /**
- // * @return <code>true</code> if the radio button to save the bug offline
- // * is selected.
- // */
- // public boolean offlineSelected() {
- // return (offlineButton == null) ? false : offlineButton.getSelection();
- // }
-
- /*
- * The following are Bugzilla's: OS's All AIX Windows 95 Windows 98 Windows
- * CE Windows Mobile 2003 Windows Mobile 2005 Windows ME Windows 2000
- * Windows NT Windows XP Windows 2003 Server Windows All MacOS X Linux
- * Linux-GTK Linux-Motif HP-UX Neutrino QNX-Photon Solaris Solaris-GTK
- * Solaris-Motif SymbianOS-Series 80 Unix All other
- *
- * The following are the platforsm in Bugzilla: All Macintosh PC Power PC
- * Sun Other
- *
- * The following are Java's Archictures: [PA_RISC, ppc, sparc, x86, x86_64,
- * ia64, ia64_32]
- *
- * The following are Java's OS's: [aix, hpux, linux, macosx, qnx, solaris,
- * win32]
- */
- /**
- * Sets the OS and Platform for the new bug
- *
- * @param newBugModel
- * The bug to set the options for
- */
- public void setPlatformOptions(NewBugzillaReport newBugModel) {
- try {
- // A Map from Java's OS and Platform to Buzilla's
- Map<String, String> java2buzillaOSMap = new HashMap<String, String>();
- Map<String, String> java2buzillaPlatformMap = new HashMap<String, String>();
-
- java2buzillaPlatformMap.put("x86", "PC");
- java2buzillaPlatformMap.put("x86_64", "PC");
- java2buzillaPlatformMap.put("ia64", "PC");
- java2buzillaPlatformMap.put("ia64_32", "PC");
- java2buzillaPlatformMap.put("sparc", "Sun");
- java2buzillaPlatformMap.put("ppc", "Power");
-
- java2buzillaOSMap.put("aix", "AIX");
- java2buzillaOSMap.put("hpux", "HP-UX");
- java2buzillaOSMap.put("linux", "Linux");
- java2buzillaOSMap.put("macosx", "MacOS X");
- java2buzillaOSMap.put("qnx", "QNX-Photon");
- java2buzillaOSMap.put("solaris", "Solaris");
- java2buzillaOSMap.put("win32", "Windows");
-
- // Get OS Lookup Map
- // Check that the result is in Values, if it is not, set it to other
- RepositoryTaskAttribute opSysAttribute = newBugModel.getAttribute(BugzillaReportElement.OP_SYS.getKeyString());
- RepositoryTaskAttribute platformAttribute = newBugModel.getAttribute(BugzillaReportElement.REP_PLATFORM.getKeyString());
-
- String OS = Platform.getOS();
- String platform = Platform.getOSArch();
-
- String bugzillaOS = null; // Bugzilla String for OS
- String bugzillaPlatform = null; // Bugzilla String for Platform
-
- if (java2buzillaOSMap != null && java2buzillaOSMap.containsKey(OS) && opSysAttribute != null
- && opSysAttribute.getOptionValues() != null) {
- bugzillaOS = java2buzillaOSMap.get(OS);
- if (opSysAttribute != null && !opSysAttribute.getOptionValues().values().contains(bugzillaOS)) {
- // If the OS we found is not in the list of available
- // options, set bugzillaOS
- // to null, and just use "other"
- bugzillaOS = null;
- }
- } else {
- // If we have a strangeOS, then just set buzillaOS to null, and
- // use "other"
- bugzillaOS = null;
- }
-
- if (platform != null && java2buzillaPlatformMap.containsKey(platform)) {
- bugzillaPlatform = java2buzillaPlatformMap.get(platform);
-
- if (platformAttribute != null
- && !platformAttribute.getOptionValues().values().contains(bugzillaPlatform)) {
- // If the platform we found is not int the list of available
- // optinos, set the
- // Bugzilla Platform to null, and juse use "other"
- bugzillaPlatform = null;
- }
- } else {
- // If we have a strange platform, then just set bugzillaPatforrm
- // to null, and use "other"
- bugzillaPlatform = null;
- }
-
- // Set the OS and the Platform in the model
- if (bugzillaOS != null && opSysAttribute != null)
- opSysAttribute.setValue(bugzillaOS);
- if (bugzillaPlatform != null && platformAttribute != null)
- platformAttribute.setValue(bugzillaPlatform);
-
- } catch (Exception e) {
- MylarStatusHandler.fail(e, "could not set platform options", false);
- }
- }
-
-}
diff --git a/org.eclipse.mylyn.ide.dev/developer/src-old/bugzilla/AbstractFavoritesAction.java b/org.eclipse.mylyn.ide.dev/developer/src-old/bugzilla/AbstractFavoritesAction.java
deleted file mode 100644
index 891189bf..00000000
--- a/org.eclipse.mylyn.ide.dev/developer/src-old/bugzilla/AbstractFavoritesAction.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 - 2006 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.mylyn.internal.bugzilla.ui.actions;
-
-import java.net.MalformedURLException;
-import java.net.URL;
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.mylyn.internal.bugzilla.core.BugzillaPlugin;
-import org.eclipse.swt.widgets.Shell;
-
-/**
- * Class that contains shared functions for the favorites actions
- */
-public class AbstractFavoritesAction extends Action {
-
- /**
- * Set the actions icon
- *
- * @param filename
- * The icons file
- */
- protected void setIcon(String filename) {
- URL url = null;
- try {
- // try to change the default icon
- url = new URL(BugzillaPlugin.getDefault().getBundle().getEntry("/"), filename);
- setImageDescriptor(ImageDescriptor.createFromURL(url));
- } catch (MalformedURLException e) {
- // Simply don't change the default icon
- }
- }
-
- /**
- * Convienience method for getting the current shell
- *
- * @return The current shell
- */
- protected Shell getShell() {
- return PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();
- }
-
-}
diff --git a/org.eclipse.mylyn.ide.dev/developer/src-old/bugzilla/AbstractOfflineReportsAction.java b/org.eclipse.mylyn.ide.dev/developer/src-old/bugzilla/AbstractOfflineReportsAction.java
deleted file mode 100644
index 2bd98531..00000000
--- a/org.eclipse.mylyn.ide.dev/developer/src-old/bugzilla/AbstractOfflineReportsAction.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 - 2006 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.mylyn.internal.bugzilla.ui.actions;
-
-import java.net.MalformedURLException;
-import java.net.URL;
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.mylyn.internal.bugzilla.core.BugzillaPlugin;
-import org.eclipse.mylyn.internal.bugzilla.ui.BugzillaUiPlugin;
-import org.eclipse.swt.widgets.Shell;
-
-/**
- * Class that contains shared functions for the offline report actions
- */
-public class AbstractOfflineReportsAction extends Action {
-
- /**
- * Set the actions icon
- *
- * @param filename
- * The icons file
- */
- protected void setIcon(String filename) {
- URL url = null;
- try {
- // try to change the default icon
- url = new URL(BugzillaUiPlugin.getDefault().getBundle().getEntry("/"), filename);
- setImageDescriptor(ImageDescriptor.createFromURL(url));
- } catch (MalformedURLException e) {
- // Simply don't change the default icon
- }
- }
-
- /**
- * Convienience method for getting the current shell
- *
- * @return The current shell
- */
- protected Shell getShell() {
- return BugzillaPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getShell();
- }
-
-}
diff --git a/org.eclipse.mylyn.ide.dev/developer/src-old/bugzilla/AbstractWizardListPage.java b/org.eclipse.mylyn.ide.dev/developer/src-old/bugzilla/AbstractWizardListPage.java
deleted file mode 100644
index f7056757..00000000
--- a/org.eclipse.mylyn.ide.dev/developer/src-old/bugzilla/AbstractWizardListPage.java
+++ /dev/null
@@ -1,200 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003 - 2006 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.mylyn.internal.bugzilla.ui.wizard;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jface.wizard.WizardPage;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.List;
-import org.eclipse.swt.widgets.Listener;
-import org.eclipse.ui.IWorkbench;
-
-/**
- * Class that contains shared functions for the first page of the wizards that
- * submit bug reports. This page provides the user with a list of items to
- * choose from.
- *
- * TODO: get rid of this unused abstraction?
- *
- * @author Mik Kersten (hardening of prototype)
- */
-public abstract class AbstractWizardListPage extends WizardPage implements Listener {
-
- /** The instance of the workbench */
- protected IWorkbench workbench;
-
- /** The list box for the list of items to choose from */
- protected List listBox;
-
- /** Status variable for the possible errors on this page */
- protected IStatus listStatus;
-
- public AbstractWizardListPage(String pageName, String title, String description, IWorkbench workbench) {
- super(pageName);
- setTitle(title);
- setDescription(description);
- this.workbench = workbench;
-
- // set the status for the page
- listStatus = new Status(IStatus.OK, "not_used", 0, "", null);
- }
-
- public abstract void createAdditionalControls(Composite parent);
-
- public void createControl(Composite parent) {
- // create the composite to hold the widgets
- GridData gd;
- Composite composite = new Composite(parent, SWT.NULL);
-
- // create the desired layout for this wizard page
- GridLayout gl = new GridLayout();
- int ncol = 1;
- gl.numColumns = ncol;
- composite.setLayout(gl);
-
- // create the bug report label
-// Label label = new Label(composite, SWT.NONE);
-// label.setText(getTableName());
-// FontData fontData = label.getFont().getFontData()[0];
-// fontData.setStyle(SWT.BOLD | fontData.getStyle());
-// int height = (int) Math.abs(fontData.getHeight() * 1.25);
-// fontData.setHeight(height);
-// Font font = new Font(null, fontData);
-// label.setFont(font);
-
- // create the list of bug reports
- gd = new GridData(GridData.FILL_HORIZONTAL);
- gd.heightHint = 200;
- listBox = new List(composite, SWT.SINGLE | SWT.BORDER | SWT.READ_ONLY | SWT.V_SCROLL);
- listBox.setLayoutData(gd);
-
- createLine(composite, ncol);
-
- // Each wizard has different types of items to add to the list
- populateList(true);
-
- createAdditionalControls(composite);
-
- // set the composite as the control for this page
- setControl(composite);
- addListeners();
- }
-
- /**
- * Populate the list of items
- */
- abstract protected void populateList(boolean init);
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.swt.widgets.Listener#handleEvent(org.eclipse.swt.widgets.Event)
- */
- abstract public void handleEvent(Event event);
-
- /**
- * A helper function for "handleEvent"
- *
- * @param event
- * the event which occurred
- * @param errorMessage
- * the error message unique to the wizard calling this function
- */
- protected void handleEventHelper(Event event, String errorMessage) {
- // Initialize a variable with the no error status
- Status status = new Status(IStatus.OK, "not_used", 0, "", null);
-
- // If the event is triggered by the list of items, respond with the
- // corresponding status
- if (event.widget == listBox) {
- if (listBox.getSelectionIndex() == -1)
- status = new Status(IStatus.ERROR, "not_used", 0, errorMessage, null);
- listStatus = status;
- }
-
- // Show the most serious error
- applyToStatusLine(listStatus);
-
- getWizard().getContainer().updateButtons();
- }
-
- /**
- * Applies the status to the status line of a dialog page.
- *
- * @param status
- * The status to apply to the status line
- */
- protected void applyToStatusLine(IStatus status) {
- String message = status.getMessage();
- if (message.length() == 0)
- message = null;
- switch (status.getSeverity()) {
- case IStatus.OK:
- setErrorMessage(null);
- setMessage(message);
- break;
- case IStatus.WARNING:
- setErrorMessage(null);
- setMessage(message, WizardPage.WARNING);
- break;
- case IStatus.INFO:
- setErrorMessage(null);
- setMessage(message, WizardPage.INFORMATION);
- break;
- default:
- setErrorMessage(null);
- setMessage(message, WizardPage.ERROR);
- break;
- }
- }
-
- /**
- * Create a separator line in the dialog
- *
- * @param parent
- * The composite to create the line on
- * @param ncol
- * The number of columns to span
- */
- protected void createLine(Composite parent, int ncol) {
- Label line = new Label(parent, SWT.SEPARATOR | SWT.HORIZONTAL | SWT.BOLD);
- GridData gridData = new GridData(GridData.FILL_HORIZONTAL);
- gridData.horizontalSpan = ncol;
- line.setLayoutData(gridData);
- }
-
-// @Override
-// public boolean canFlipToNextPage() {
-// if (getErrorMessage() != null)
-// return false;
-// if (listBox.getSelectionIndex() != -1)
-// return true;
-// return false;
-// }
-
- /**
- * Add any listeners that we need
- */
- protected void addListeners() {
- listBox.addListener(SWT.Selection, this);
- }
-
- @Override
- public boolean isPageComplete() {
- return listBox.getSelectionIndex() != -1;
- }
-}
diff --git a/org.eclipse.mylyn.ide.dev/developer/src-old/bugzilla/AddFavoriteAction.java b/org.eclipse.mylyn.ide.dev/developer/src-old/bugzilla/AddFavoriteAction.java
deleted file mode 100644
index 84097618..00000000
--- a/org.eclipse.mylyn.ide.dev/developer/src-old/bugzilla/AddFavoriteAction.java
+++ /dev/null
@@ -1,123 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003 - 2006 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.mylyn.internal.bugzilla.ui.actions;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.core.resources.IMarker;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.mylyn.internal.bugzilla.core.BugzillaPlugin;
-import org.eclipse.mylyn.internal.bugzilla.core.IBugzillaConstants;
-import org.eclipse.mylyn.internal.bugzilla.core.internal.Favorite;
-import org.eclipse.mylyn.internal.bugzilla.ui.BugzillaImages;
-import org.eclipse.mylyn.internal.bugzilla.ui.FavoritesView;
-import org.eclipse.mylyn.internal.bugzilla.ui.search.BugzillaSearchResultView;
-
-/**
- * Bookmark a returned Bugzilla Search result.
- */
-public class AddFavoriteAction extends AbstractFavoritesAction {
-
- /** Selected objects */
- private List<Favorite> selected;
-
- /** The view where the Bugzilla search results are displayed */
- private BugzillaSearchResultView resultView;
-
- /**
- * Constructor
- *
- * @param text
- * The label for the context menu item
- * @param resultView
- * The view where the Bugzilla search results are displayed
- */
- public AddFavoriteAction(String text, BugzillaSearchResultView resultView) {
- setText(text);
- setImageDescriptor(BugzillaImages.IMG_TOOL_ADD_TO_FAVORITES);
- this.resultView = resultView;
- selected = null;
- }
-
- /**
- * Bookmark the selected items
- *
- * @see org.eclipse.ui.actions.ActionDelegate#run(IAction)
- */
- @Override
- public void run() {
- FavoritesView.checkWindow();
-
- selected = new ArrayList<Favorite>();
- buildSelection();
-
- // go through each of the selected items and add its data to the
- // favorites file
- for (int i = 0; i < selected.size(); i++) {
- BugzillaPlugin.getDefault().getFavorites().add(selected.get(i));
- }
- FavoritesView.add();
- FavoritesView.updateActionEnablement();
- }
-
- /**
- * Gets the entire selection and puts each bug report into a list. Only the
- * relevent parts of each bug report are put into the list.
- */
- @SuppressWarnings("unchecked")
- private void buildSelection() {
- ISelection s = resultView.getViewer().getSelection();
- if (s instanceof IStructuredSelection) {
- IStructuredSelection selection = (IStructuredSelection) s;
- for (Iterator<IMarker> it = selection.iterator(); it.hasNext();) {
- IMarker marker = it.next();
-
- try {
- // try to get the attribute for the marker
- Integer attributeId = (Integer) marker.getAttribute(IBugzillaConstants.HIT_MARKER_ATTR_ID);
- String repositoryUrl = (String) marker.getAttribute(IBugzillaConstants.HIT_MARKER_ATTR_REPOSITORY);
-
- // add the selected item to the list of items that are
- // selected
- String description = (String) marker.getAttribute(IBugzillaConstants.HIT_MARKER_ATTR_DESC);
- String query = (String) marker.getAttribute(IBugzillaConstants.HIT_MARKER_ATTR_QUERY);
-
- // create a map to add attributes to so that the favorites
- // file can sort
- HashMap<String, Object> attributes = new HashMap<String, Object>();
- attributes.put(IBugzillaConstants.HIT_MARKER_ATTR_ID, attributeId);
- attributes.put(IBugzillaConstants.HIT_MARKER_ATTR_REPOSITORY, repositoryUrl);
- attributes.put(IBugzillaConstants.HIT_MARKER_ATTR_PRIORITY, marker
- .getAttribute(IBugzillaConstants.HIT_MARKER_ATTR_PRIORITY));
- attributes.put(IBugzillaConstants.HIT_MARKER_ATTR_SEVERITY, marker
- .getAttribute(IBugzillaConstants.HIT_MARKER_ATTR_SEVERITY));
- attributes.put(IBugzillaConstants.HIT_MARKER_ATTR_STATE, marker
- .getAttribute(IBugzillaConstants.HIT_MARKER_ATTR_STATE));
- attributes.put(IBugzillaConstants.HIT_MARKER_ATTR_RESULT, marker
- .getAttribute(IBugzillaConstants.HIT_MARKER_ATTR_RESULT));
-
- Favorite favorite = new Favorite(repositoryUrl, attributeId.intValue(), description, query,
- attributes);
- selected.add(favorite);
- } catch (CoreException ignored) {
- // do nothing
- }
- }
- }
- }
-
-}
diff --git a/org.eclipse.mylyn.ide.dev/developer/src-old/bugzilla/AttachmentPartSource.java b/org.eclipse.mylyn.ide.dev/developer/src-old/bugzilla/AttachmentPartSource.java
deleted file mode 100644
index e287ae38..00000000
--- a/org.eclipse.mylyn.ide.dev/developer/src-old/bugzilla/AttachmentPartSource.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2008 Tasktop Technologies 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:
- * Tasktop Technologies - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.mylyn.bugzilla.deprecated;
-
-import java.io.IOException;
-import java.io.InputStream;
-
-import org.apache.commons.httpclient.methods.multipart.PartSource;
-import org.eclipse.mylyn.internal.tasks.core.deprecated.ITaskAttachment;
-
-/**
- * @author Steffen Pingel
- */
-public class AttachmentPartSource implements PartSource {
-
- private final ITaskAttachment attachment;
-
- public AttachmentPartSource(ITaskAttachment attachment) {
- this.attachment = attachment;
- }
-
- public InputStream createInputStream() throws IOException {
- return attachment.createInputStream();
- }
-
- public String getFileName() {
- return attachment.getFilename();
- }
-
- public long getLength() {
- return attachment.getLength();
- }
-
-}
diff --git a/org.eclipse.mylyn.ide.dev/developer/src-old/bugzilla/BugParser.java b/org.eclipse.mylyn.ide.dev/developer/src-old/bugzilla/BugParser.java
deleted file mode 100644
index e6215859..00000000
--- a/org.eclipse.mylyn.ide.dev/developer/src-old/bugzilla/BugParser.java
+++ /dev/null
@@ -1,1107 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003 - 2006 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.mylyn.internal.bugzilla.core.internal;
-
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStreamReader;
-import java.io.Reader;
-import java.net.URL;
-import java.net.URLConnection;
-import java.net.URLEncoder;
-import java.nio.charset.Charset;
-import java.text.ParseException;
-import java.text.SimpleDateFormat;
-import java.util.Calendar;
-import java.util.Date;
-import java.util.Iterator;
-import java.util.List;
-
-import javax.security.auth.login.LoginException;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.mylyn.bugzilla.core.AbstractRepositoryReportAttribute;
-import org.eclipse.mylyn.bugzilla.core.BugReport;
-import org.eclipse.mylyn.bugzilla.core.Comment;
-import org.eclipse.mylyn.bugzilla.core.Operation;
-import org.eclipse.mylyn.internal.bugzilla.core.BugzillaPlugin;
-import org.eclipse.mylyn.internal.bugzilla.core.IBugzillaConstants;
-import org.eclipse.mylyn.internal.bugzilla.core.internal.HtmlStreamTokenizer.Token;
-
-/**
- * @author Shawn Minto
- * @author Mik Kersten (hardening of prototype)
- * @author Rob Elves (attachments) This class parses bugs so that they can be
- * displayed using the bug editor
- */
-public class BugParser {
-
- private static final String VALUE_ATTACHMENT_OBSOLETE = "bz_obsolete";
-
- private static final String ATTRIBUTE_CLASS = "class";
-
- private static final String TAG_SPAN = "span";
-
- private static final String ATTRIBUTE_ID_TITLE = "title";
-
- private static final String ATTRIBUTE_ID_HREF = "href";
-
- private static final String ATTACHMENT_CGI_ID = "attachment.cgi?id=";
-
- private static final String KEY_BUG_NUM = "Bug#";
-
- private static final String KEY_RESOLUTION = "resolution";
-
- private static final String KEY_VALUE = "value";
-
- private static final String KEY_NAME = "name";
-
- private static final String ATTR_CHARSET = "charset";
-
- /** Parser for dates in the report */
- private static SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm");
-
- private static final String keywordsUrl = "describekeywords.cgi";
-
- /**
- * Parse the case where we have found an attribute name
- *
- * @param in
- * The input stream for the bug
- * @return The name of the attribute that we are parsing
- * @throws IOException
- */
- private static String parseAttributeName(HtmlStreamTokenizer tokenizer) throws IOException, ParseException {
- StringBuffer sb = new StringBuffer();
-
- parseTableCell(tokenizer, sb);
- HtmlStreamTokenizer.unescape(sb);
- // remove the colon if there is one
- if (sb.length() > 0 && sb.charAt(sb.length() - 1) == ':') {
- sb.deleteCharAt(sb.length() - 1);
- }
- return sb.toString();
- }
-
- /**
- * Parse the case where we have found attribute values
- *
- * @param in
- * The input stream of the bug
- * @param bug
- * The bug report for the current bug
- * @param attribute
- * The name of the attribute
- * @throws IOException
- */
- private static void parseAttributeValue(BugReport bug, String originalAttributeName, HtmlStreamTokenizer tokenizer,
- String serverUrl, String userName, String password) throws IOException, ParseException {
-
- // NOTE: special rule to deal with change in 2.20.1
- String attributeName = originalAttributeName;
- if (attributeName.endsWith(KEY_BUG_NUM) && attributeName.length() > KEY_BUG_NUM.length()) {
- attributeName = originalAttributeName.substring(attributeName.length() - KEY_BUG_NUM.length(),
- attributeName.length());
- }
-
- Token token = tokenizer.nextToken();
- if (token.getType() == Token.TAG) {
- HtmlTag tag = (HtmlTag) token.getValue();
-
- // make sure that we are on a tag that we care about, not a label
- // fix added so that we can parse the mozilla bug pages
- if (tag.getTagType() == HtmlTag.Type.LABEL) {
- token = tokenizer.nextToken();
- if (token.getType() == Token.TAG)
- tag = (HtmlTag) token.getValue();
- else {
- StringBuffer sb = new StringBuffer();
- if (token.getType() == Token.TEXT) {
- sb.append((StringBuffer) token.getValue());
- parseAttributeValueCell(bug, attributeName, tokenizer, sb);
- }
- }
- }
-
- if (tag.getTagType() == HtmlTag.Type.SELECT && !tag.isEndTag()) {
- String parameterName = tag.getAttribute(KEY_NAME);
- parseSelect(bug, attributeName, parameterName, tokenizer);
- } else if (tag.getTagType() == HtmlTag.Type.INPUT && !tag.isEndTag()) {
- parseInput(bug, attributeName, tag, serverUrl, userName, password);
- } else if (!tag.isEndTag() || attributeName.equalsIgnoreCase(KEY_RESOLUTION)) {
- if (tag.isEndTag() && attributeName.equalsIgnoreCase(KEY_RESOLUTION)) {
- AbstractRepositoryReportAttribute a = new AbstractRepositoryReportAttribute(attributeName);
- a.setValue("");
- bug.addAttribute(a);
- }
- parseAttributeValueCell(bug, attributeName, tokenizer);
- }
- } else {
- StringBuffer sb = new StringBuffer();
- if (token.getType() == Token.TEXT) {
- sb.append((StringBuffer) token.getValue());
- parseAttributeValueCell(bug, attributeName, tokenizer, sb);
- }
- }
- }
-
- /**
- * Parse the case where the attribute value is just text in a table cell
- *
- * @param in
- * The input stream of the bug
- * @param bug
- * The bug report for the current bug
- * @param attributeName
- * The name of the attribute that we are parsing
- * @throws IOException
- */
- private static void parseAttributeValueCell(BugReport bug, String attributeName, HtmlStreamTokenizer tokenizer)
- throws IOException, ParseException {
- StringBuffer sb = new StringBuffer();
- parseAttributeValueCell(bug, attributeName, tokenizer, sb);
- }
-
- private static void parseAttributeValueCell(BugReport bug, String attributeName, HtmlStreamTokenizer tokenizer,
- StringBuffer sb) throws IOException, ParseException {
-
- parseTableCell(tokenizer, sb);
- HtmlStreamTokenizer.unescape(sb);
-
- // create a new attribute and set its value to the value that we
- // retrieved
- AbstractRepositoryReportAttribute a = new AbstractRepositoryReportAttribute(attributeName);
- a.setValue(sb.toString());
-
- // if we found an attachment attribute, forget about it, else add the
- // attribute to the bug report
- if (attributeName.toLowerCase()).startsWith("attachments")) {
- // do nothing
- } else {
- if (attributeName.equals(KEY_BUG_NUM))
- a.setValue(a.getValue().replaceFirst("alias:", ""));
- bug.addAttribute(a);
- }
- }
-
- /**
- * Reads text into a StringBuffer until it encounters a close table cell tag
- * (&lt;/TD&gt;) or start of another cell. The text is appended to the
- * existing value of the buffer. <b>NOTE:</b> Does not handle nested cells!
- *
- * @param tokenizer
- * @param sb
- * @throws IOException
- * @throws ParseException
- */
- private static void parseTableCell(HtmlStreamTokenizer tokenizer, StringBuffer sb) throws IOException,
- ParseException {
- boolean noWhitespace = false;
- for (Token token = tokenizer.nextToken(); token.getType() != Token.EOF; token = tokenizer.nextToken()) {
- if (token.getType() == Token.TAG) {
- HtmlTag tag = (HtmlTag) token.getValue();
- if (tag.getTagType() == HtmlTag.Type.TD) {
- if (!tag.isEndTag()) {
- tokenizer.pushback(token);
- }
- break;
- }
- noWhitespace = token.getWhitespace().length() == 0;
- } else if (token.getType() == Token.TEXT) {
- // if there was no whitespace between the tag and the
- // preceding text, don't insert whitespace before this text
- // unless it is there in the source
- if (!noWhitespace && token.getWhitespace().length() > 0 && sb.length() > 0) {
- sb.append(' ');
- }
- sb.append((StringBuffer) token.getValue());
- }
- }
- }
-
- /**
- * Parse the case where the attribute value is an option
- *
- * @param in
- * The input stream for the bug
- * @param bug
- * The bug report for the current bug
- * @param attribute
- * The name of the attribute that we are parsing
- * @param parameterName
- * the SELECT tag's name
- * @throws IOException
- */
- private static void parseSelect(BugReport bug, String attributeName, String parameterName,
- HtmlStreamTokenizer tokenizer) throws IOException, ParseException {
-
- boolean first = false;
- AbstractRepositoryReportAttribute a = new AbstractRepositoryReportAttribute(attributeName);
- a.setID(parameterName);
-
- Token token = tokenizer.nextToken();
- while (token.getType() != Token.EOF) {
- if (token.getType() == Token.TAG) {
- HtmlTag tag = (HtmlTag) token.getValue();
- if (tag.getTagType() == HtmlTag.Type.SELECT && tag.isEndTag())
- break;
- if (tag.getTagType() == HtmlTag.Type.OPTION && !tag.isEndTag()) {
- String optionName = tag.getAttribute(KEY_VALUE);
- boolean selected = tag.hasAttribute("selected");
- StringBuffer optionText = new StringBuffer();
- for (token = tokenizer.nextToken(); token.getType() == Token.TEXT; token = tokenizer.nextToken()) {
- if (optionText.length() > 0) {
- optionText.append(' ');
- }
- optionText.append((StringBuffer) token.getValue());
- }
- a.addOptionValue(optionText.toString(), optionName);
- if (selected || first) {
- a.setValue(optionText.toString());
- first = false;
- }
- } else {
- token = tokenizer.nextToken();
- }
- } else {
- token = tokenizer.nextToken();
- }
- }
-
- // if we parsed the cc field add the e-mails to the bug report else add
- // the attribute to the bug report
- if (attributeName.toLowerCase().startsWith("cc")) {
- for (Iterator<String> it = a.getOptionValues().keySet().iterator(); it.hasNext();) {
- String email = it.next();
- bug.addCC(HtmlStreamTokenizer.unescape(email));
- }
- } else {
- bug.addAttribute(a);
- }
- }
-
- /**
- * Parse the case where the attribute value is an input
- *
- * @param bug
- * The bug report for the current bug
- * @param attributeName
- * The name of the attribute
- * @param tag
- * The INPUT tag
- * @throws IOException
- */
- private static void parseInput(BugReport bug, String attributeName, HtmlTag tag, String serverUrl, String userName,
- String password) throws IOException {
-
- AbstractRepositoryReportAttribute a = new AbstractRepositoryReportAttribute(attributeName);
- a.setID(tag.getAttribute(KEY_NAME));
- String name = tag.getAttribute(KEY_NAME);
- String value = tag.getAttribute(KEY_VALUE);
- if (value == null)
- value = "";
-
- // if we found the summary, add it to the bug report
- if (name.equalsIgnoreCase("short_desc")) {
- bug.setSummary(value);
- } else if (name.equalsIgnoreCase("bug_file_loc")) {
- a.setValue(value);
- bug.addAttribute(a);
- } else if (name.equalsIgnoreCase("newcc")) {
- a.setValue(value);
- bug.addAttribute(a);
- } else {
- // otherwise just add the attribute
- a.setValue(value);
- bug.addAttribute(a);
-
- if (attributeName.equalsIgnoreCase("keywords") && serverUrl != null) {
-
- BufferedReader input = null;
- try {
-
- String urlText = "";
-
- // if we have a user name, may as well log in just in case
- // it is required
- if (userName != null && !userName.equals("") && password != null && !password.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"
- */
- urlText += "?GoAheadAndLogIn=1&Bugzilla_login=" + URLEncoder.encode(userName, "UTF-8")
- + "&Bugzilla_password=" + URLEncoder.encode(password, "UTF-8");
- }
-
- // connect to the bugzilla server to get the keyword list
- URL url = new URL(serverUrl + "/" + keywordsUrl + urlText);
- URLConnection urlConnection = BugzillaPlugin.getDefault().getUrlConnection(url);
- input = new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));
-
- // parse the valid keywords and add them to the bug
- List<String> keywords = new KeywordParser(input).getKeywords();
- bug.setKeywords(keywords);
-
- } catch (Exception e) {
- // throw an exception if there is a problem reading the bug
- // from the server
- throw new IOException("Exception while fetching the list of keywords from the server: "
- + e.getMessage());
- } finally {
- try {
- if (input != null)
- input.close();
- } catch (IOException e) {
- BugzillaPlugin.log(new Status(IStatus.ERROR, IBugzillaConstants.PLUGIN_ID, IStatus.ERROR,
- "Problem closing the stream", e));
- }
- }
- }
- }
- }
-
- /**
- * Parse the case where we are dealing with the description
- *
- * @param bug
- * The bug report for the bug
- * @throws IOException
- */
- private static void parseDescription(BugReport bug, HtmlStreamTokenizer tokenizer) throws IOException,
- ParseException {
-
- StringBuffer sb = new StringBuffer();
- for (Token token = tokenizer.nextToken(); token.getType() != Token.EOF; token = tokenizer.nextToken()) {
- if (token.getType() == Token.TAG) {
- HtmlTag tag = (HtmlTag) token.getValue();
- if (sb.length() > 0) {
- sb.append(token.getWhitespace());
- }
- if (tag.getTagType() == HtmlTag.Type.PRE && tag.isEndTag())
- break;
- } else if (token.getType() == Token.TEXT) {
- if (sb.length() > 0) {
- sb.append(token.getWhitespace());
- }
- sb.append((StringBuffer) token.getValue());
- }
- }
-
- // set the bug to have the description we retrieved
- String text = HtmlStreamTokenizer.unescape(sb).toString();
- bug.setDescription(text);
- }
-
- // /**
- // * parses the description of an attachment on the report
- // */
- // private static String parseAttachementDescription(HtmlStreamTokenizer
- // tokenizer) throws IOException,
- // ParseException {
- //
- // StringBuffer sb = new StringBuffer();
- // for (Token token = tokenizer.nextToken(); token.getType() != Token.EOF;
- // token = tokenizer.nextToken()) {
- // if (token.getType() == Token.TAG) {
- // HtmlTag tag = (HtmlTag) token.getValue();
- // if (tag.getTagType() == HtmlTag.Type.A && tag.isEndTag())
- // break;
- // } else if (token.getType() == Token.TEXT) {
- // if (sb.length() > 0) {
- // sb.append(token.getWhitespace());
- // }
- // sb.append((StringBuffer) token.getValue());
- // }
- // }
- //
- // // set the bug to have the description we retrieved
- // String text = HtmlStreamTokenizer.unescape(sb).toString();
- // return text;
- // }
-
- /**
- * Parse the case where we have found the start of a comment
- *
- * @param in
- * The input stream of the bug
- * @param bug
- * The bug report for the current bug
- * @return The comment that we have created with the information
- * @throws IOException
- * @throws ParseException
- */
- private static Comment parseCommentHead(BugReport bug, HtmlStreamTokenizer tokenizer) throws IOException,
- ParseException {
- int number = 0;
- Date date = null;
- String author = null;
- String authorName = null;
-
- // get the comment's number
- for (Token token = tokenizer.nextToken(); token.getType() != Token.EOF; token = tokenizer.nextToken()) {
- if (token.getType() == Token.TAG) {
- HtmlTag tag = (HtmlTag) token.getValue();
- if (tag.getTagType() == HtmlTag.Type.A) {
- String href = tag.getAttribute(ATTRIBUTE_ID_HREF);
- if (href != null) {
- int index = href.toLowerCase().indexOf("#c");
- if (index == -1)
- continue;
- token = tokenizer.nextToken();
- number = Integer.parseInt(((StringBuffer) token.getValue()).toString().substring(1));
- break;
- }
- }
- }
- }
-
- for (Token token = tokenizer.nextToken(); token.getType() != Token.EOF; token = tokenizer.nextToken()) {
- if (token.getType() == Token.TAG) {
- HtmlTag tag = (HtmlTag) token.getValue();
- if (tag.getTagType() == HtmlTag.Type.A) {
- String href = tag.getAttribute(ATTRIBUTE_ID_HREF);
- if (href != null) {
- int index = href.toLowerCase().indexOf("mailto");
- if (index == -1)
- continue;
- author = href.substring(index + 7);
- break;
- }
- }
- }
- }
-
- // get the author's real name
- StringBuffer sb = new StringBuffer();
- for (Token token = tokenizer.nextToken(); token.getType() != Token.EOF; token = tokenizer.nextToken()) {
- if (token.getType() == Token.TAG) {
- HtmlTag tag = (HtmlTag) token.getValue();
- if (tag.getTagType() == HtmlTag.Type.A && tag.isEndTag())
- break;
- } else if (token.getType() == Token.TEXT) {
- if (sb.length() > 0) {
- sb.append(' ');
- }
- sb.append((StringBuffer) token.getValue());
- }
- }
- authorName = sb.toString();
-
- // get the comment's date
- sb.setLength(0);
- for (Token token = tokenizer.nextToken(); token.getType() != Token.EOF; token = tokenizer.nextToken()) {
- if (token.getType() == Token.TAG) {
- HtmlTag tag = (HtmlTag) token.getValue();
- if (tag.getTagType() == HtmlTag.Type.I && tag.isEndTag())
- break;
- } else if (token.getType() == Token.TEXT) {
- if (sb.length() > 0) {
- sb.append(' ');
- }
- sb.append((StringBuffer) token.getValue());
- }
- }
- try {
- if (sb.length() >= 16) {
- date = df.parse(sb.substring(0, 16));
- }
- } catch (Exception e) {
- date = Calendar.getInstance().getTime(); // XXX: could not
- // determine date
- }
- return new Comment(bug, number, date, author, authorName);
- }
-
- /**
- * Parse the case where we have comment text
- *
- * @param in
- * The input stream for the bug
- * @param bug
- * The bug report for the current bug
- * @param comment
- * The comment to add the text to
- * @throws IOException
- */
- private static void parseCommentText(BugReport bug, Comment comment, HtmlStreamTokenizer tokenizer)
- throws IOException, ParseException {
-
- StringBuffer commentStringBuffer = new StringBuffer();
- for (Token token = tokenizer.nextToken(); token.getType() != Token.EOF; token = tokenizer.nextToken()) {
- if (token.getType() == Token.TAG) {
- HtmlTag tag = (HtmlTag) token.getValue();
- if (tag.getTagName().equals(TAG_SPAN)) {
- if(tag.hasAttribute(ATTRIBUTE_CLASS) && tag.getAttribute(ATTRIBUTE_CLASS).equals("")) {
- parseAttachment(commentStringBuffer, comment, tokenizer, false);
- continue;
- } else if(tag.hasAttribute(ATTRIBUTE_CLASS) && tag.getAttribute(ATTRIBUTE_CLASS).equals(VALUE_ATTACHMENT_OBSOLETE)) {
- parseAttachment(commentStringBuffer, comment, tokenizer, true);
- continue;
- }
- }
- // added to ensure whitespace is not
- // lost if adding a tag within a tag
- if (commentStringBuffer.length() > 0) {
- commentStringBuffer.append(token.getWhitespace());
- }
- if (tag.getTagType() == HtmlTag.Type.PRE && tag.isEndTag())
- break;
- } else if (token.getType() == Token.TEXT) {
- if (commentStringBuffer.length() > 0) {
- commentStringBuffer.append(token.getWhitespace());
- }
- commentStringBuffer.append((StringBuffer) token.getValue());
- }
- // remove attachment description from comment body
- if (comment.hasAttachment() && commentStringBuffer.indexOf(comment.getAttachmentDescription()) == 0) {
- commentStringBuffer = new StringBuffer();
- }
- }
-
- HtmlStreamTokenizer.unescape(commentStringBuffer);
- comment.setText(commentStringBuffer.toString());
- bug.addComment(comment);
- }
-
- private static void parseAttachment(StringBuffer stringBuffer, Comment comment, HtmlStreamTokenizer tokenizer, boolean obsolete)
- throws IOException, ParseException {
-
- int attachmentID = -1;
- String attachmentDescription = "";
- for (Token token = tokenizer.nextToken(); token.getType() != Token.EOF; token = tokenizer.nextToken()) {
- if (token.getType() == Token.TAG) {
- HtmlTag tag = (HtmlTag) token.getValue();
-
- if (tag.getTagType() == HtmlTag.Type.A && !comment.hasAttachment()) {
- if (tag.getAttribute(ATTRIBUTE_ID_HREF) != null) {
- String link = tag.getAttribute(ATTRIBUTE_ID_HREF);
- if (link.startsWith(ATTACHMENT_CGI_ID)) {
- try {
- int endIndex = link.indexOf("&");
- if (endIndex > 0 && endIndex < link.length()) {
- attachmentID = Integer.parseInt(link
- .substring(ATTACHMENT_CGI_ID.length(), endIndex));
- }
- } catch (NumberFormatException e) {
- return;
- }
- }
- if (tag.getAttribute(ATTRIBUTE_ID_TITLE) != null) {
- attachmentDescription = tag.getAttribute(ATTRIBUTE_ID_TITLE);
- }
- if (attachmentID > 0) {
- comment.setHasAttachment(true);
- comment.setAttachmentId(attachmentID);
- comment.setAttachmentDescription(attachmentDescription);
- comment.setObsolete(obsolete);
- }
-
- }
- }
- if (tag.getTagName().equals(TAG_SPAN) && tag.isEndTag())
- break;
- }
- }
- }
-
- /**
- * Parse the full html version of the bug
- *
- * @param in -
- * the input stream for the bug
- * @param id -
- * the id of the bug that is to be parsed
- * @return A bug report for the bug that was parsed
- * @throws IOException
- * @throws ParseException
- */
- public static BugReport parseBug(Reader in, int id, String serverUrl, boolean is218, String userName,
- String password, String contentType) throws IOException, ParseException, LoginException {
- // create a new bug report and set the parser state to the start state
- BugReport bug = new BugReport(id, serverUrl);
- boolean contentTypeResolved = false;
- if (contentType != null) {
- String charsetFromContentType = getCharsetFromString(contentType);
- if (charsetFromContentType != null) {
- bug.setCharset(charsetFromContentType);
- contentTypeResolved = true;
- }
- }
- ParserState state = ParserState.START;
- Comment comment = null;
- String attribute = null;
-
- HtmlStreamTokenizer tokenizer = new HtmlStreamTokenizer(in, null);
-
- boolean isTitle = false;
- boolean possibleBadLogin = false;
- boolean checkBody = false;
- String title = "";
- StringBuffer body = new StringBuffer();
-
- for (Token token = tokenizer.nextToken(); token.getType() != Token.EOF; token = tokenizer.nextToken()) {
-
- // get the charset from the HTML if not specified
- if (!contentTypeResolved) {
- if (token.getType() == Token.TAG && ((HtmlTag) (token.getValue())).getTagType() == HtmlTag.Type.META
- && !((HtmlTag) (token.getValue())).isEndTag()) {
- String charsetFromHtml = getCharsetFromString(token.toString());
- if (charsetFromHtml != null)
- bug.setCharset(charsetFromHtml);
- }
- }
-
- // make sure that bugzilla doesn't want us to login
- if (token.getType() == Token.TAG && ((HtmlTag) (token.getValue())).getTagType() == HtmlTag.Type.TITLE
- && !((HtmlTag) (token.getValue())).isEndTag()) {
- isTitle = true;
- continue;
- }
-
- if (isTitle) {
- // get all of the data in the title tag
- if (token.getType() != Token.TAG) {
- title += ((StringBuffer) token.getValue()).toString().toLowerCase() + " ";
- continue;
- } else if (token.getType() == Token.TAG
- && ((HtmlTag) token.getValue()).getTagType() == HtmlTag.Type.TITLE
- && ((HtmlTag) token.getValue()).isEndTag()) {
- // check and see if the title seems as though we have wrong
- // login info
- if (title.indexOf("login") != -1
- || (title.indexOf("invalid") != -1 && title.indexOf("password") != -1)
- || title.indexOf("check e-mail") != -1)
- possibleBadLogin = true; // we possibly have a bad
- // login
-
- // if the title starts with error, we may have a login
- // problem, or
- // there is a problem with the bug (doesn't exist), so we
- // must do
- // some more checks
- if (title.startsWith("error"))
- checkBody = true;
-
- isTitle = false;
- title = "";
- }
- continue;
- }
-
- // if we have to add all of the text so that we can check it later
- // for problems with the username and password
- if (checkBody && token.getType() == Token.TEXT) {
- body.append((StringBuffer) token.getValue());
- body.append(" ");
- }
-
- // we have found the start of an attribute name
- if ((state == ParserState.ATT_NAME || state == ParserState.START) && token.getType() == Token.TAG) {
- HtmlTag tag = (HtmlTag) token.getValue();
- if (tag.getTagType() == HtmlTag.Type.TD && "right".equalsIgnoreCase(tag.getAttribute("align"))) {
- // parse the attribute's name
- attribute = parseAttributeName(tokenizer);
- if (attribute != null && attribute.contains(IBugzillaConstants.INVALID_2201_ATTRIBUTE_IGNORED)) {
- continue;
- }
- if (attribute.toLowerCase().startsWith("opened")) {
- // find the colon so we can get the date
- int index = attribute.toLowerCase().indexOf(":");
- String date;
- if (index != -1)
- date = attribute.substring(index + 1).trim();
- else
- date = attribute.substring(6).trim();
-
- // set the bugs opened date to be the date we parsed
- bug.setCreated(df.parse(date));
- state = ParserState.ATT_NAME;
- continue;
- }
-
- // in 2.18, the last modified looks like the opened so we
- // need to parse it differently
- if (attribute.toLowerCase().startsWith("last modified") && is218) {
- // find the colon so we can get the date
- int index = attribute.toLowerCase().indexOf(":");
- String date;
- if (index != -1)
- date = attribute.substring(index + 1).trim();
- else
- date = attribute.substring(6).trim();
-
- // create a new attribute and set the date
- AbstractRepositoryReportAttribute t = new AbstractRepositoryReportAttribute("Last Modified");
- t.setValue(date);
-
- // add the attribute to the bug report
- bug.addAttribute(t);
- bug.setLastModified(df.parse(date));
- state = ParserState.ATT_NAME;
- continue;
- }
-
- state = ParserState.ATT_VALUE;
- continue;
- } else if (tag.getTagType() == HtmlTag.Type.INPUT && "radio".equalsIgnoreCase(tag.getAttribute("type"))
- && "knob".equalsIgnoreCase(tag.getAttribute(KEY_NAME))) {
- // we found a radio button
- parseOperations(bug, tokenizer, tag, is218);
- }
- }
-
- // we have found the start of attribute values
- if (state == ParserState.ATT_VALUE && token.getType() == Token.TAG) {
- HtmlTag tag = (HtmlTag) token.getValue();
- if (tag.getTagType() == HtmlTag.Type.TD) {
- // parse the attribute values
- parseAttributeValue(bug, attribute, tokenizer, serverUrl, userName, password);
-
- state = ParserState.ATT_NAME;
- attribute = null;
- continue;
- }
- }
-
- // we have found the start of a comment
- if (state == ParserState.DESC_START && token.getType() == Token.TAG) {
- HtmlTag tag = (HtmlTag) token.getValue();
- if (tag.getTagType() == HtmlTag.Type.I) {
- // parse the comment's start
- comment = parseCommentHead(bug, tokenizer);
-
- state = ParserState.DESC_VALUE;
- continue;
- }
- }
-
- // we have found the start of the comment text
- if (state == ParserState.DESC_VALUE && token.getType() == Token.TAG) {
- HtmlTag tag = (HtmlTag) token.getValue();
- if (tag.getTagType() == HtmlTag.Type.PRE) {
- // parse the text of the comment
- parseCommentText(bug, comment, tokenizer);
-
- comment = null;
- state = ParserState.DESC_START;
- continue;
- }
- }
-
- // last modification date
- if (bug.getCreated() == null && (state == ParserState.ATT_NAME || state == ParserState.START) && token.getType() == Token.TAG) {
- HtmlTag tag = (HtmlTag) token.getValue();
- if (tag.getTagType() == HtmlTag.Type.DIV && tag.getAttribute("id") != null && "header".equalsIgnoreCase(tag.getAttribute("id"))) {
- StringBuffer sb = new StringBuffer();
- parseLastModified(sb, tokenizer);
- if(sb.length() > 0) {
- int index = sb.indexOf(":");
- String date;
- if (index != -1)
- date = sb.substring(index + 1).trim();
- else
- date = sb.substring(6).trim();
-
- // create a new attribute and set the date
- AbstractRepositoryReportAttribute t = new AbstractRepositoryReportAttribute("Last Modified");
- t.setValue(date);
-
- // add the attribute to the bug report
- bug.setLastModified(df.parse(date));
- bug.addAttribute(t);
- }
- continue;
- }
- }
-
-
- // look for date opened field
- if (bug.getCreated() == null && (state == ParserState.ATT_NAME || state == ParserState.START) && token.getType() == Token.TAG) {
- HtmlTag tag = (HtmlTag) token.getValue();
- if (tag.getTagType() == HtmlTag.Type.TD && tag.getAttribute("align") != null && "left".equalsIgnoreCase(tag.getAttribute("align")) && tag.getAttribute("width") != null && "30%".equals(tag.getAttribute("width"))) {
- StringBuffer sb = new StringBuffer();
- parseDateOpened(sb, tokenizer);
- if(sb.length() > 0) {
- int index = sb.indexOf(":");
- String date;
- if (index != -1)
- date = sb.substring(index + 1).trim();
- else
- date = sb.substring(6).trim();
-
- // set the bugs opened date to be the date we parsed
- bug.setCreated(df.parse(date));
- }
- continue;
- }
- }
-
- // we have found the description of the bug
- if ((state == ParserState.ATT_NAME || state == ParserState.START) && token.getType() == Token.TAG) {
- HtmlTag tag = (HtmlTag) token.getValue();
- if (tag.getTagType() == HtmlTag.Type.PRE) {
- // parse the description for the bug
- parseDescription(bug, tokenizer);
-
- state = ParserState.DESC_START;
- continue;
- }
- }
-
- // parse hidden fields
-
- if ((state == ParserState.ATT_NAME || state == ParserState.START) && token.getType() == Token.TAG) {
- HtmlTag tag = (HtmlTag) token.getValue();
- if (tag.getTagType() == HtmlTag.Type.INPUT && tag.getAttribute("type") != null
- && "hidden".equalsIgnoreCase(tag.getAttribute("type").trim())) {
-
- AbstractRepositoryReportAttribute a = new AbstractRepositoryReportAttribute(tag.getAttribute(KEY_NAME));
- a.setID(tag.getAttribute(KEY_NAME));
- a.setValue(tag.getAttribute(KEY_VALUE));
- a.setHidden(true);
- bug.addAttribute(a);
- continue;
- }
- }
-
- // // parse out attachments
- // if(token.getType() == Token.TAG) {
- // HtmlTag tag = (HtmlTag) token.getValue();
- // if(tag.getTagType() == HtmlTag.Type.A && tag.getAttribute("href")
- // != null) {
- // String link = tag.getAttribute("href");
- // if(link.startsWith("attachment.cgi?id=") &&
- // !link.contains("action")) {
- // int attachmentID = Integer.parseInt(link.substring(18));
- // String description = parseAttachementDescription(tokenizer);
- // bug.addAttachment(attachmentID, description);
- // }
- // }
- // }
-
- }
-
- // if we are to check the body, make sure that there wasn't a bad login
- if (checkBody) {
- String b = body.toString();
- if (b.indexOf("login") != -1
- || ((b.indexOf("invalid") != -1 || b.indexOf("not valid") != -1) && b.indexOf("password") != -1)
- || b.indexOf("check e-mail") != -1)
- possibleBadLogin = true; // we possibly have a bad login
- }
-
- // if there is no summary or created date, we expect that
- // the bug doesn't exist, so set it to null
-
- // if the bug seems like it doesn't exist, and we suspect a login
- // problem, assume that there was a login problem
- if (bug.getCreated() == null && bug.getAttributes().isEmpty()) {
- if (possibleBadLogin) {
- throw new LoginException(IBugzillaConstants.MESSAGE_LOGIN_FAILURE);
- } else {
- return null;
- }
- }
- // we are done...return the bug
- return bug;
- }
-
- private static void parseDateOpened(StringBuffer sb, HtmlStreamTokenizer tokenizer) throws IOException, ParseException {
- for (Token token = tokenizer.nextToken(); token.getType() != Token.EOF; token = tokenizer.nextToken()) {
- if (token.getType() == Token.TAG) {
- HtmlTag tag = (HtmlTag) token.getValue();
- if (tag.getTagType() == HtmlTag.Type.TD && tag.isEndTag())
- break;
- } else if (token.getType() == Token.TEXT) {
- if (sb.length() > 0) {
- sb.append(' ');
- }
- sb.append((StringBuffer) token.getValue());
- }
- }
-
- }
-
- private static void parseLastModified(StringBuffer sb, HtmlStreamTokenizer tokenizer) throws IOException, ParseException {
- boolean inH3 = false;
- for (Token token = tokenizer.nextToken(); token.getType() != Token.EOF; token = tokenizer.nextToken()) {
- if (token.getType() == Token.TAG) {
- HtmlTag tag = (HtmlTag) token.getValue();
- if (tag.getTagType() == HtmlTag.Type.H3 && !tag.isEndTag()) {
- inH3 = true;
- continue;
- } else if (tag.getTagType() == HtmlTag.Type.DIV && tag.isEndTag()) {
- break;
- }
- } else if (token.getType() == Token.TEXT && inH3) {
- if (sb.length() > 0) {
- sb.append(' ');
- }
- sb.append((StringBuffer) token.getValue());
- }
- }
-
- }
-
- public static String getCharsetFromString(String string) {
- int charsetStartIndex = string.indexOf(ATTR_CHARSET);
- if (charsetStartIndex != -1) {
- int charsetEndIndex = string.indexOf("\"", charsetStartIndex); // TODO:
- // could
- // be
- // space
- // after?
- if (charsetEndIndex == -1) {
- charsetEndIndex = string.length();
- }
- String charsetString = string.substring(charsetStartIndex + 8, charsetEndIndex);
- if (Charset.availableCharsets().containsKey(charsetString)) {
- return charsetString;
- }
- }
- return null;
- }
-
- /**
- * Parse the operations that are allowed on the bug (Assign, Re-open, fix)
- *
- * @param bug
- * The bug to add the operations to
- * @param tokenizer
- * The stream tokenizer for the bug
- * @param tag
- * The last tag that we were on
- */
- private static void parseOperations(BugReport bug, HtmlStreamTokenizer tokenizer, HtmlTag tag, boolean is218)
- throws ParseException, IOException {
-
- String knobName = tag.getAttribute(KEY_VALUE);
- boolean isChecked = false;
- if (tag.getAttribute("checked") != null && tag.getAttribute("checked").equals("checked"))
- isChecked = true;
- StringBuffer sb = new StringBuffer();
-
- Token lastTag = null;
-
- for (Token token = tokenizer.nextToken(); token.getType() != Token.EOF; token = tokenizer.nextToken()) {
- if (token.getType() == Token.TAG) {
- tag = (HtmlTag) token.getValue();
-
- if (!(tag.getTagType() == HtmlTag.Type.A || tag.getTagType() == HtmlTag.Type.B
- || tag.getTagType() == HtmlTag.Type.STRONG || tag.getTagType() == HtmlTag.Type.LABEL)) {
- lastTag = token;
- break;
- } else {
-
- if (is218 && tag.getTagType() == HtmlTag.Type.LABEL) {
- continue;
- } else if (tag.getTagType() == HtmlTag.Type.A || tag.getTagType() == HtmlTag.Type.B
- || tag.getTagType() == HtmlTag.Type.STRONG) {
- sb.append(tag.toString().trim() + " ");
- } else {
- break;
- }
- }
- } else if (token.getType() == Token.TEXT && !token.toString().trim().equals("\n"))
- sb.append(token.toString().trim() + " ");
- }
-
- String displayName = HtmlStreamTokenizer.unescape(sb).toString();
- Operation o = new Operation(knobName, displayName);
- o.setChecked(isChecked);
-
- if (lastTag != null) {
- tag = (HtmlTag) lastTag.getValue();
- if (tag.getTagType() != HtmlTag.Type.SELECT) {
- tokenizer.pushback(lastTag);
- if (tag.getTagType() == HtmlTag.Type.INPUT
- && !("radio".equalsIgnoreCase(tag.getAttribute("type")) && "knob".equalsIgnoreCase(tag
- .getAttribute(KEY_NAME)))) {
- o.setInputName(((HtmlTag) lastTag.getValue()).getAttribute(KEY_NAME));
- o.setInputValue(((HtmlTag) lastTag.getValue()).getAttribute(KEY_VALUE));
- }
- } else {
- Token token = tokenizer.nextToken();
- // parse the options
-
- tag = (HtmlTag) token.getValue();
- o.setUpOptions(((HtmlTag) lastTag.getValue()).getAttribute(KEY_NAME));
-
- while (token.getType() != Token.EOF) {
- if (token.getType() == Token.TAG) {
- tag = (HtmlTag) token.getValue();
- if (tag.getTagType() == HtmlTag.Type.SELECT && tag.isEndTag())
- break;
- if (tag.getTagType() == HtmlTag.Type.OPTION && !tag.isEndTag()) {
- String optionName = tag.getAttribute(KEY_VALUE);
- StringBuffer optionText = new StringBuffer();
- for (token = tokenizer.nextToken(); token.getType() == Token.TEXT; token = tokenizer
- .nextToken()) {
- if (optionText.length() > 0) {
- optionText.append(' ');
- }
- optionText.append((StringBuffer) token.getValue());
- }
- o.addOption(optionText.toString(), optionName);
- } else {
- token = tokenizer.nextToken();
- }
- } else {
- token = tokenizer.nextToken();
- }
- }
- }
- }
-
- bug.addOperation(o);
- }
-
- /**
- * Enum class for describing current state of Bugzilla report parser.
- */
- private static class ParserState {
- /** An instance of the start state */
- protected static final ParserState START = new ParserState("start");
-
- /** An instance of the state when the parser found an attribute name */
- protected static final ParserState ATT_NAME = new ParserState("att_name");
-
- /** An instance of the state when the parser found an attribute value */
- protected static final ParserState ATT_VALUE = new ParserState("att_value");
-
- /** An instance of the state when the parser found a description */
- protected static final ParserState DESC_START = new ParserState("desc_start");
-
- /** An instance of the state when the parser found a description value */
- protected static final ParserState DESC_VALUE = new ParserState("desc_value");
-
- /** State's human-readable name */
- private String name;
-
- /**
- * Constructor
- *
- * @param description -
- * The states human readable name
- */
- private ParserState(String description) {
- this.name = description;
- }
-
- @Override
- public String toString() {
- return name;
- }
- }
-}
diff --git a/org.eclipse.mylyn.ide.dev/developer/src-old/bugzilla/BugSubmissionHandler.java b/org.eclipse.mylyn.ide.dev/developer/src-old/bugzilla/BugSubmissionHandler.java
deleted file mode 100644
index 03300754..00000000
--- a/org.eclipse.mylyn.ide.dev/developer/src-old/bugzilla/BugSubmissionHandler.java
+++ /dev/null
@@ -1,186 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 - 2006 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.mylyn.internal.bugzilla.ui.editor;
-
-import java.io.IOException;
-import java.security.GeneralSecurityException;
-import java.util.Collections;
-import java.util.Set;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.jobs.IJobChangeListener;
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.mylyn.internal.bugzilla.core.BugzillaClient;
-import org.eclipse.mylyn.internal.bugzilla.core.BugzillaException;
-import org.eclipse.mylyn.internal.bugzilla.core.BugzillaReportSubmitForm;
-import org.eclipse.mylyn.internal.bugzilla.core.BugzillaRepositoryConnector;
-import org.eclipse.mylyn.internal.bugzilla.core.BugzillaTask;
-import org.eclipse.mylyn.internal.bugzilla.core.PossibleBugzillaFailureException;
-import org.eclipse.mylyn.internal.bugzilla.ui.BugzillaUiPlugin;
-import org.eclipse.mylyn.internal.tasks.core.UnrecognizedReponseException;
-import org.eclipse.mylyn.internal.tasks.ui.views.TaskRepositoriesView;
-import org.eclipse.mylyn.tasks.core.AbstractRepositoryConnector;
-import org.eclipse.mylyn.tasks.core.AbstractRepositoryQuery;
-import org.eclipse.mylyn.tasks.core.AbstractTask;
-import org.eclipse.mylyn.tasks.core.AbstractTaskContainer;
-import org.eclipse.mylyn.tasks.core.ITask;
-import org.eclipse.mylyn.tasks.core.RepositoryTaskData;
-import org.eclipse.mylyn.tasks.core.TaskRepository;
-import org.eclipse.mylyn.tasks.ui.TasksUiPlugin;
-
-/**
- * @author Mik Kersten
- */
-public class BugSubmissionHandler {
-
- private static final String LABEL_JOB_SUBMIT = "Submitting to Bugzilla repository";
-
- private AbstractRepositoryConnector connector;
-
- public BugSubmissionHandler(AbstractRepositoryConnector connector) {
- this.connector = connector;
- }
-
- public void submitBugReport(BugzillaReportSubmitForm form, IJobChangeListener listener, boolean synchExec,
- boolean addToTaskListRoot) {
- submitBugReport(form, listener, synchExec, addToTaskListRoot ? TasksUiPlugin.getTaskList()
- .getRootCategory() : null);
- }
-
- public void submitBugReport(final BugzillaReportSubmitForm form, IJobChangeListener listener, boolean synchExec,
- final AbstractTaskContainer container) {
- if (synchExec) {
- try {
- TaskRepository repository = TasksUiPlugin.getRepositoryManager().getRepository(
- form.getTaskData().getRepositoryKind(), form.getTaskData().getRepositoryUrl());
- if (repository != null) {
- BugzillaClient client = ((BugzillaRepositoryConnector) connector).getClientManager().getClient(
- repository);
- String submittedBugId = form.submitReportToRepository(client);
- if (form.isNewBugPost()) {
- handleNewBugPost(form.getTaskData(), submittedBugId, container);
- } else {
- handleExistingBugPost(form.getTaskData(), submittedBugId);
- }
- }
- } catch (Exception e) {
- throw new RuntimeException(e);
- }
- } else {
- Job submitJob = new Job(LABEL_JOB_SUBMIT) {
-
- @Override
- protected IStatus run(IProgressMonitor monitor) {
- try {
- String submittedBugId = "";
- TaskRepository repository = TasksUiPlugin.getRepositoryManager().getRepository(
- form.getTaskData().getRepositoryKind(), form.getTaskData().getRepositoryUrl());
- BugzillaClient client = ((BugzillaRepositoryConnector) connector).getClientManager().getClient(
- repository);
-
- submittedBugId = form.submitReportToRepository(client);
-
- if (form.isNewBugPost()) {
- handleNewBugPost(form.getTaskData(), submittedBugId, container);
- return new Status(Status.OK, BugzillaUiPlugin.PLUGIN_ID, Status.OK, submittedBugId, null);
- } else {
- // NOTE: sync now handled by editor
- //handleExistingBugPost(form.getTaskData(), submittedBugId);
- return Status.OK_STATUS;
- }
- } catch (GeneralSecurityException e) {
- return new Status(
- Status.OK,
- BugzillaUiPlugin.PLUGIN_ID,
- Status.ERROR,
- "Bugzilla could not post your bug, probably because your credentials are incorrect. Ensure proper repository configuration in "
- + TaskRepositoriesView.NAME + ".", e);
- } catch (UnrecognizedReponseException e) {
- return new Status(Status.OK, BugzillaUiPlugin.PLUGIN_ID, Status.INFO,
- "Unrecognized response from server", e);
- } catch (IOException e) {
- return new Status(Status.OK, BugzillaUiPlugin.PLUGIN_ID, Status.ERROR, "IO Error: \n\n"
- + e.getMessage(), e);
- } catch (BugzillaException e) {
- // MylarStatusHandler.fail(e, "Failed to submit",
- // false);
- String message = e.getMessage();
- return new Status(Status.OK, BugzillaUiPlugin.PLUGIN_ID, Status.ERROR,
- "Bugzilla could not post your bug. \n\n" + message, e);
- } catch (PossibleBugzillaFailureException e) {
- return new Status(Status.OK, BugzillaUiPlugin.PLUGIN_ID, Status.INFO,
- "Possible bugzilla failure", e);
- }
- }
- };
-
- submitJob.addJobChangeListener(listener);
- submitJob.schedule();
- }
- }
-
- private void handleNewBugPost(RepositoryTaskData taskData, String resultId, AbstractTaskContainer category)
- throws BugzillaException {
- int bugId = -1;
- try {
- bugId = Integer.parseInt(resultId);
- } catch (NumberFormatException e) {
- throw new BugzillaException("Invalid bug id returned by repository.");
- }
-
- TaskRepository repository = TasksUiPlugin.getRepositoryManager().getRepository(taskData.getRepositoryKind(),
- taskData.getRepositoryUrl());
-
- BugzillaTask newTask = new BugzillaTask(AbstractTask.getHandle(repository.getUrl(), bugId),
- "<bugzilla info>", true);
-
- if (category != null) {
- TasksUiPlugin.getTaskList().addTask(newTask, category);
- } else {
- TasksUiPlugin.getTaskList().addTask(newTask);
- }
- TasksUiPlugin.getSynchronizationScheduler().synchNow(0, Collections.singletonList(repository));
-
- }
-
- // Used when run in forced sync mode for testing
- private void handleExistingBugPost(RepositoryTaskData repositoryTaskData, String resultId) {
- try {
- String handle = AbstractTask.getHandle(repositoryTaskData.getRepositoryUrl(), repositoryTaskData
- .getId());
- final ITask task = TasksUiPlugin.getTaskList().getTask(handle);
- if (task != null) {
- Set<AbstractRepositoryQuery> queriesWithHandle = TasksUiPlugin.getTaskList()
- .getQueriesForHandle(task.getHandleIdentifier());
- TasksUiPlugin.getSynchronizationManager().synchronize(connector, queriesWithHandle, null, Job.SHORT, 0,
- false);
- TaskRepository repository = TasksUiPlugin.getRepositoryManager().getRepository(
- repositoryTaskData.getRepositoryKind(), repositoryTaskData.getRepositoryUrl());
- TasksUiPlugin.getSynchronizationManager().synchronizeChanged(connector, repository);
- if (task instanceof AbstractTask) {
- AbstractTask repositoryTask = (AbstractTask) task;
- // TODO: This is set to null in order for update to bypass
- // ui override check with user
- // Need to change how this is achieved.
- repositoryTask.setTaskData(null);
- TasksUiPlugin.getSynchronizationManager().synchronize(connector, repositoryTask, true, null);
- }
- }
-
- } catch (Exception e) {
- throw new RuntimeException(e);
- }
- }
-
-}
diff --git a/org.eclipse.mylyn.ide.dev/developer/src-old/bugzilla/Bugzilla220ParserTest.java b/org.eclipse.mylyn.ide.dev/developer/src-old/bugzilla/Bugzilla220ParserTest.java
deleted file mode 100644
index a102e794..00000000
--- a/org.eclipse.mylyn.ide.dev/developer/src-old/bugzilla/Bugzilla220ParserTest.java
+++ /dev/null
@@ -1,92 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 - 2006 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.mylyn.bugzilla.tests;
-
-import java.io.File;
-import java.io.FileReader;
-import java.io.Reader;
-
-import junit.framework.TestCase;
-
-import org.eclipse.core.runtime.Path;
-import org.eclipse.mylyn.bugzilla.core.BugReport;
-import org.eclipse.mylyn.core.tests.support.FileTool;
-import org.eclipse.mylyn.internal.bugzilla.core.IBugzillaConstants;
-import org.eclipse.mylyn.internal.bugzilla.core.NewBugzillaReport;
-import org.eclipse.mylyn.internal.bugzilla.core.internal.BugParser;
-import org.eclipse.mylyn.internal.bugzilla.core.internal.NewBugParser;
-
-/**
- * @author Mik Kersten
- * @author Rob Elves
- */
-public class Bugzilla220ParserTest extends TestCase {
-
- public static final String TEST_SERVER = IBugzillaConstants.ECLIPSE_BUGZILLA_URL;
-
- private static final String PRODUCT_MYLAR = "Mylar";
-
- private static final String PRODUCT_TEST = "TestProduct";
-
- public void testId220() throws Exception {
-
- File f = FileTool.getFileInPlugin(BugzillaTestPlugin.getDefault(), new Path(
- "testdata/pages/test-report-220.html"));
- Reader in = new FileReader(f);
-
- BugReport bug = BugParser.parseBug(in, 7, TEST_SERVER, false, null, null, null);
-
- assertEquals(7, bug.getId());
- assertEquals("summary", bug.getSummary());
- assertEquals("7", bug.getAttribute("Bug#").getValue());
- assertEquals("7", bug.getAttribute("id").getValue());
- }
-
- public void testId2201() throws Exception {
-
- File f = FileTool.getFileInPlugin(BugzillaTestPlugin.getDefault(), new Path(
- "testdata/pages/test-report-2201.html"));
- Reader in = new FileReader(f);
-
- BugReport bug = BugParser.parseBug(in, 125527, TEST_SERVER, false, null, null, null);
-
- assertEquals(125527, bug.getId());
- assertEquals("bugzilla refresh incorrect for new reports and newly opened hits", bug.getSummary());
- assertEquals("125527", bug.getAttribute("Bug#").getValue());
- assertEquals("125527", bug.getAttribute("id").getValue());
- }
-
- public void testNewBugProduct220() throws Exception {
-
- NewBugzillaReport nbm = new NewBugzillaReport();
-
- File f = FileTool
- .getFileInPlugin(BugzillaTestPlugin.getDefault(), new Path("testdata/pages/enter-bug220.html"));
- Reader in = new FileReader(f);
-
- new NewBugParser(in).parseBugAttributes(nbm, true);
- assertEquals(PRODUCT_TEST, nbm.getAttribute("product").getValue());
- }
-
- public void testNewBugProduct2201() throws Exception {
-
- NewBugzillaReport nbm = new NewBugzillaReport();
-
- File f = FileTool.getFileInPlugin(BugzillaTestPlugin.getDefault(),
- new Path("testdata/pages/enter-bug2201.html"));
- Reader in = new FileReader(f);
-
- new NewBugParser(in).parseBugAttributes(nbm, true);
- assertEquals(PRODUCT_MYLAR, nbm.getAttribute("product").getValue());
- }
-
-}
diff --git a/org.eclipse.mylyn.ide.dev/developer/src-old/bugzilla/BugzillaAttributeFactory.java b/org.eclipse.mylyn.ide.dev/developer/src-old/bugzilla/BugzillaAttributeFactory.java
deleted file mode 100644
index c9f0fa35..00000000
--- a/org.eclipse.mylyn.ide.dev/developer/src-old/bugzilla/BugzillaAttributeFactory.java
+++ /dev/null
@@ -1,161 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2008 Tasktop Technologies 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:
- * Tasktop Technologies - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.mylyn.bugzilla.deprecated;
-
-import java.text.SimpleDateFormat;
-import java.util.Date;
-import java.util.Locale;
-
-import org.eclipse.mylyn.internal.bugzilla.core.BugzillaAttribute;
-import org.eclipse.mylyn.internal.tasks.core.deprecated.AbstractAttributeFactory;
-import org.eclipse.mylyn.internal.tasks.core.deprecated.RepositoryTaskAttribute;
-
-/**
- * @author Rob Elves
- * @author Mik Kersten
- * @deprecated
- */
-@Deprecated
-public class BugzillaAttributeFactory extends AbstractAttributeFactory {
-
- private static final String DATE_FORMAT_1 = "yyyy-MM-dd HH:mm";
-
- private static final String DATE_FORMAT_2 = "yyyy-MM-dd HH:mm:ss";
-
- private static final String delta_ts_format = DATE_FORMAT_2;
-
- private static final String creation_ts_format = DATE_FORMAT_1;
-
- /**
- * public for testing Bugzilla 2.18 uses DATE_FORMAT_1 but later versions use DATE_FORMAT_2 Using lowest common
- * denominator DATE_FORMAT_1
- */
- public static final String comment_creation_ts_format = DATE_FORMAT_1;
-
- private static final String attachment_creation_ts_format = DATE_FORMAT_1;
-
- private static final long serialVersionUID = 5087501781682994759L;
-
- @Override
- public String mapCommonAttributeKey(String key) {
- if (key.equals(RepositoryTaskAttribute.NEW_CC)) {
- return BugzillaAttribute.NEWCC.getKey();
- } else if (key.equals(RepositoryTaskAttribute.COMMENT_DATE)) {
- return BugzillaAttribute.BUG_WHEN.getKey();
- } else if (key.equals(RepositoryTaskAttribute.COMMENT_AUTHOR)) {
- return BugzillaAttribute.WHO.getKey();
- } else if (key.equals(RepositoryTaskAttribute.COMMENT_AUTHOR_NAME)) {
- return BugzillaAttribute.WHO_NAME.getKey();
- } else if (key.equals(RepositoryTaskAttribute.USER_CC)) {
- return BugzillaAttribute.CC.getKey();
- } else if (key.equals(RepositoryTaskAttribute.COMMENT_TEXT)) {
- return BugzillaAttribute.THETEXT.getKey();
- } else if (key.equals(RepositoryTaskAttribute.DATE_CREATION)) {
- return BugzillaAttribute.CREATION_TS.getKey();
- } else if (key.equals(RepositoryTaskAttribute.DESCRIPTION)) {
- return BugzillaAttribute.DESC.getKey();
- } else if (key.equals(RepositoryTaskAttribute.ATTACHMENT_ID)) {
- return BugzillaAttribute.ATTACHID.getKey();
- } else if (key.equals(RepositoryTaskAttribute.ATTACHMENT_TYPE)) {
- return BugzillaAttribute.TYPE.getKey();
- } else if (key.equals(RepositoryTaskAttribute.ATTACHMENT_CTYPE)) {
- return BugzillaAttribute.CTYPE.getKey();
- } else if (key.equals(RepositoryTaskAttribute.USER_ASSIGNED)) {
- return BugzillaAttribute.ASSIGNED_TO.getKey();
- } else if (key.equals(RepositoryTaskAttribute.USER_ASSIGNED_NAME)) {
- return BugzillaAttribute.ASSIGNED_TO_NAME.getKey();
- } else if (key.equals(RepositoryTaskAttribute.RESOLUTION)) {
- return BugzillaAttribute.RESOLUTION.getKey();
- } else if (key.equals(RepositoryTaskAttribute.STATUS)) {
- return BugzillaAttribute.BUG_STATUS.getKey();
- } else if (key.equals(RepositoryTaskAttribute.DATE_MODIFIED)) {
- return BugzillaAttribute.DELTA_TS.getKey();
- } else if (key.equals(RepositoryTaskAttribute.USER_REPORTER)) {
- return BugzillaAttribute.REPORTER.getKey();
- } else if (key.equals(RepositoryTaskAttribute.USER_REPORTER_NAME)) {
- return BugzillaAttribute.REPORTER_NAME.getKey();
- } else if (key.equals(RepositoryTaskAttribute.SUMMARY)) {
- return BugzillaAttribute.SHORT_DESC.getKey();
- } else if (key.equals(RepositoryTaskAttribute.PRODUCT)) {
- return BugzillaAttribute.PRODUCT.getKey();
- } else if (key.equals(RepositoryTaskAttribute.KEYWORDS)) {
- return BugzillaAttribute.KEYWORDS.getKey();
- } else if (key.equals(RepositoryTaskAttribute.ATTACHMENT_DATE)) {
- return BugzillaAttribute.DATE.getKey();
- } else if (key.equals(RepositoryTaskAttribute.ATTACHMENT_SIZE)) {
- return BugzillaAttribute.SIZE.getKey();
- } else if (key.equals(RepositoryTaskAttribute.ADD_SELF_CC)) {
- return BugzillaAttribute.ADDSELFCC.getKey();
- } else if (key.equals(RepositoryTaskAttribute.PRIORITY)) {
- return BugzillaAttribute.PRIORITY.getKey();
- } else if (key.equals(RepositoryTaskAttribute.COMMENT_NEW)) {
- return BugzillaAttribute.NEW_COMMENT.getKey();
- } else if (key.equals(RepositoryTaskAttribute.COMPONENT)) {
- return BugzillaAttribute.COMPONENT.getKey();
- } else {
- return key;
- }
- }
-
- @Override
- public boolean isHidden(String key) {
- try {
- return BugzillaAttribute.valueOf(key.trim().toUpperCase(Locale.ENGLISH)).isHidden();
- } catch (IllegalArgumentException e) {
- return false;
- }
- }
-
- @Override
- public String getName(String key) {
- try {
- return BugzillaAttribute.valueOf(key.trim().toUpperCase(Locale.ENGLISH)).toString();
- } catch (IllegalArgumentException e) {
- return "<unknown>";
- }
- }
-
- @Override
- public boolean isReadOnly(String key) {
- try {
- return BugzillaAttribute.valueOf(key.trim().toUpperCase(Locale.ENGLISH)).isReadOnly();
- } catch (IllegalArgumentException e) {
- return true;
- }
- }
-
- @Override
- public Date getDateForAttributeType(String attributeKey, String dateString) {
- if (dateString == null || dateString.equals("")) {
- return null;
- }
- try {
- String mappedKey = mapCommonAttributeKey(attributeKey);
- Date parsedDate = null;
- if (mappedKey.equals(BugzillaAttribute.DELTA_TS.getKey())) {
- parsedDate = new SimpleDateFormat(delta_ts_format).parse(dateString);
- } else if (mappedKey.equals(BugzillaAttribute.CREATION_TS.getKey())) {
- parsedDate = new SimpleDateFormat(creation_ts_format).parse(dateString);
- } else if (mappedKey.equals(BugzillaAttribute.BUG_WHEN.getKey())) {
- parsedDate = new SimpleDateFormat(comment_creation_ts_format).parse(dateString);
- } else if (mappedKey.equals(BugzillaAttribute.DATE.getKey())) {
- parsedDate = new SimpleDateFormat(attachment_creation_ts_format).parse(dateString);
- }
- return parsedDate;
- } catch (Exception e) {
- return null;
- // throw new CoreException(new Status(IStatus.ERROR,
- // "Error parsing date string: " + dateString, e));
- }
- }
-
-}
diff --git a/org.eclipse.mylyn.ide.dev/developer/src-old/bugzilla/BugzillaCategorySearchOperation.java b/org.eclipse.mylyn.ide.dev/developer/src-old/bugzilla/BugzillaCategorySearchOperation.java
deleted file mode 100644
index a7c98b24..00000000
--- a/org.eclipse.mylyn.ide.dev/developer/src-old/bugzilla/BugzillaCategorySearchOperation.java
+++ /dev/null
@@ -1,163 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 - 2006 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.mylyn.internal.bugzilla.ui.tasklist;
-
-import java.net.Proxy;
-import java.util.ArrayList;
-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.jface.resource.ImageDescriptor;
-import org.eclipse.mylyn.internal.bugzilla.ui.search.BugzillaSearchEngine;
-import org.eclipse.mylyn.internal.bugzilla.ui.search.BugzillaSearchResultCollector;
-import org.eclipse.mylyn.internal.bugzilla.ui.search.IBugzillaSearchOperation;
-import org.eclipse.mylyn.internal.tasks.ui.search.AbstractRepositorySearchQuery;
-import org.eclipse.mylyn.tasks.core.QueryHitCollector;
-import org.eclipse.mylyn.tasks.core.TaskRepository;
-import org.eclipse.mylyn.tasks.ui.TasksUiPlugin;
-import org.eclipse.ui.actions.WorkspaceModifyOperation;
-
-/**
- * TODO: delete?
- *
- * @author Shawn Minto
- */
-public class BugzillaCategorySearchOperation extends WorkspaceModifyOperation implements IBugzillaSearchOperation {
- /** The IMember we are doing the search for */
-
- public interface ICategorySearchListener {
- public void searchCompleted(QueryHitCollector collector);
- }
-
- /** The bugzilla collector for the search */
- private QueryHitCollector 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;
-
- private String queryUrl;
-
- private TaskRepository repository;
-
- private int maxHits;
-
- private boolean isMaxReached;
-
- /**
- * Constructor
- *
- * @param m
- * The member that we are doing the search for
- */
- public BugzillaCategorySearchOperation(TaskRepository repository, String queryUrl, int maxHits,
- QueryHitCollector collector) {
- this.queryUrl = queryUrl;
- this.maxHits = maxHits;
- this.repository = repository;
- this.collector = collector;
- }
-
- @Override
- public void execute(IProgressMonitor monitor) {
- // XXX: Hack
- if (collector instanceof BugzillaSearchResultCollector) {
- ((BugzillaSearchResultCollector) collector).setOperation(this);
- }
- collector.setProgressMonitor(monitor);
- Proxy proxySettings = TasksUiPlugin.getDefault().getProxySettings();
- search(queryUrl, proxySettings, monitor);
- for (ICategorySearchListener listener : listeners)
- listener.searchCompleted(collector);
- }
-
- /**
- * Perform the actual search on the Bugzilla server
- *
- * @param queryUrl
- * The queryUrl 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 QueryHitCollector with the search results
- */
- private QueryHitCollector search(String queryUrl, Proxy proxySettings, IProgressMonitor monitor) {
-
- // set the initial number of matches to 0
- int matches = 0;
- // setup the progress monitor and start the search
- collector.setProgressMonitor(monitor);
- BugzillaSearchEngine engine = new BugzillaSearchEngine(repository, queryUrl, proxySettings);
- try {
- // perform the search
- status = engine.search(collector, matches, maxHits);
-
- // check the status so that we don't keep searching if there
- // is a problem
- if (status.getCode() == IStatus.CANCEL) {
- return null;
- } else if (!status.isOK()) {
- return null;
- }
- isMaxReached = engine.isMaxReached();
- return collector;
- } catch (LoginException e) {
- // save this exception to throw later
- this.loginException = e;
- }
- return null;
- }
-
- /**
- * @see org.eclipse.mylyn.internal.bugzilla.ui.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;
- }
-
- public ImageDescriptor getImageDescriptor() {
- return null;
- }
-
- public AbstractRepositorySearchQuery getQuery() {
- return null;
- }
-
- public void setQuery(AbstractRepositorySearchQuery newQuery) {
- }
-
- private List<ICategorySearchListener> listeners = new ArrayList<ICategorySearchListener>();
-
- public void addResultsListener(ICategorySearchListener listener) {
- listeners.add(listener);
- }
-
- public String getName() {
- return null;
- }
-
- public boolean isMaxReached() {
- return isMaxReached;
- }
-}
diff --git a/org.eclipse.mylyn.ide.dev/developer/src-old/bugzilla/BugzillaCompareInput.java b/org.eclipse.mylyn.ide.dev/developer/src-old/bugzilla/BugzillaCompareInput.java
deleted file mode 100644
index a481f8e6..00000000
--- a/org.eclipse.mylyn.ide.dev/developer/src-old/bugzilla/BugzillaCompareInput.java
+++ /dev/null
@@ -1,121 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2008 Tasktop Technologies 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:
- * Tasktop Technologies - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.mylyn.bugzilla.deprecated;
-
-import org.eclipse.compare.CompareConfiguration;
-import org.eclipse.compare.CompareEditorInput;
-import org.eclipse.compare.structuremergeviewer.Differencer;
-import org.eclipse.compare.structuremergeviewer.IStructureComparator;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.mylyn.internal.tasks.core.deprecated.RepositoryTaskData;
-
-/**
- * A two-way or three-way compare for <code>BugReport</code> objects.
- *
- * @author Shawn Minto
- * @author Mik Kersten
- */
-public class BugzillaCompareInput extends CompareEditorInput {
-
- private boolean threeWay = false;
-
- private Object root;
-
- private IStructureComparator ancestor = null;
-
- private IStructureComparator left = null;
-
- private IStructureComparator right = null;
-
- /**
- * Constructor.
- *
- * @param configuration
- * The compare configuration used in this compare input.
- * @see CompareConfiguration
- */
- public BugzillaCompareInput(CompareConfiguration configuration) {
- super(configuration);
- }
-
- @Override
- protected Object prepareInput(IProgressMonitor monitor) {
- if (left == null || right == null) {
- return null;
- }
- Differencer d = new Differencer();
- root = d.findDifferences(threeWay, monitor, null, ancestor, left, right);
- return root;
- }
-
- /**
- * @return The original object that's to be compared (appears on the top of the compare view).
- */
- public IStructureComparator getAncestor() {
- return ancestor;
- }
-
- /**
- * Sets the original object that's to be compared (appears on the top of the compare view).
- *
- * @param newAncestor
- * The new original object.
- */
- public void setAncestor(RepositoryTaskData newAncestor) {
- threeWay = (newAncestor != null);
- BugzillaCompareStructureCreator structureCreator = new BugzillaCompareStructureCreator();
- ancestor = structureCreator.getStructure(newAncestor);
- }
-
- /**
- * @return The local object that's to be compared (appears on the left side of the compare view).
- */
- public IStructureComparator getLeft() {
- return left;
- }
-
- /**
- * Sets the local object that's to be compared (appears on the left side of the compare view).
- *
- * @param newLeft
- * The new local object.
- */
- public void setLeft(RepositoryTaskData newLeft) {
- BugzillaCompareStructureCreator structureCreator = new BugzillaCompareStructureCreator();
- left = structureCreator.getStructure(newLeft);
- }
-
- /**
- * @return The online object that's to be compared (appears on the right side of the compare view).
- */
- public IStructureComparator getRight() {
- return right;
- }
-
- /**
- * Sets the online object that's to be compared (appears on the right side of the compare view).
- *
- * @param newRight
- * The new online object.
- */
- public void setRight(RepositoryTaskData newRight) {
- BugzillaCompareStructureCreator structureCreator = new BugzillaCompareStructureCreator();
- right = structureCreator.getStructure(newRight);
- }
-
- /**
- * @return <code>true</code> if a three-way comparison is to be done.
- */
- public boolean isThreeWay() {
- return threeWay;
- }
-}
diff --git a/org.eclipse.mylyn.ide.dev/developer/src-old/bugzilla/BugzillaCompareNode.java b/org.eclipse.mylyn.ide.dev/developer/src-old/bugzilla/BugzillaCompareNode.java
deleted file mode 100644
index abc8f987..00000000
--- a/org.eclipse.mylyn.ide.dev/developer/src-old/bugzilla/BugzillaCompareNode.java
+++ /dev/null
@@ -1,284 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2008 Tasktop Technologies 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:
- * Tasktop Technologies - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.mylyn.bugzilla.deprecated;
-
-import java.io.ByteArrayInputStream;
-import java.io.InputStream;
-import java.util.ArrayList;
-
-import org.eclipse.compare.IStreamContentAccessor;
-import org.eclipse.compare.ITypedElement;
-import org.eclipse.compare.structuremergeviewer.IStructureComparator;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.mylyn.internal.bugzilla.core.BugzillaAttribute;
-import org.eclipse.mylyn.internal.tasks.core.deprecated.RepositoryTaskAttribute;
-import org.eclipse.mylyn.internal.tasks.core.deprecated.RepositoryTaskData;
-import org.eclipse.mylyn.internal.tasks.core.deprecated.TaskComment;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.ui.ISharedImages;
-import org.eclipse.ui.PlatformUI;
-
-/**
- * A node for the tree used to compare bugs in the compare viewer.
- *
- * @author Rob Elves
- */
-public class BugzillaCompareNode implements IStreamContentAccessor, IStructureComparator, ITypedElement {
-
- /** The label for this piece of data. */
- private String key;
-
- /** The data for this node. */
- private String value;
-
- /** The children of this node. */
- private ArrayList<BugzillaCompareNode> nodeChildren;
-
- /** This node's image. */
- private Image image;
-
- /**
- * Constructor. The image for this node is set to <code>null</code>.
- *
- * @param key
- * The label for this node.
- * @param value
- * The data for this node.
- */
- public BugzillaCompareNode(String key, String value) {
- this(key, value, null);
- }
-
- /**
- * Constructor.
- *
- * @param key
- * The label for this node.
- * @param value
- * The data for this node.
- * @param image
- * The image for this node.
- */
- public BugzillaCompareNode(String key, String value, Image image) {
- super();
- this.key = key;
- this.value = checkText(value);
- this.nodeChildren = null;
- this.image = image;
- }
-
- /**
- * This function checks to make sure the given string is not <code>null</code>. If it is, the empty string is
- * returned instead.
- *
- * @param newValue
- * The string to be checked.
- * @return If the text is <code>null</code>, then return the null string (<code>""</code>). Otherwise, return the
- * text.
- */
- private String checkText(String newValue) {
- return ((newValue == null) ? "" : newValue);
- }
-
- public Object[] getChildren() {
- return (nodeChildren == null) ? new Object[0] : nodeChildren.toArray();
- }
-
- /**
- * Adds a node to this node's list of children.
- *
- * @param bugNode
- * The new child.
- */
- public void addChild(BugzillaCompareNode bugNode) {
- if (nodeChildren == null) {
- nodeChildren = new ArrayList<BugzillaCompareNode>();
- }
- nodeChildren.add(bugNode);
- }
-
- public InputStream getContents() throws CoreException {
- return new ByteArrayInputStream(getValue().getBytes());
- }
-
- /**
- * @return The label for this node.
- */
- public String getKey() {
- return key;
- }
-
- /**
- * Set the label for this node.
- *
- * @param key
- * The new label.
- */
- public void setKey(String key) {
- this.key = key;
- }
-
- /**
- * @return The data for this node.
- */
- public String getValue() {
- return value;
- }
-
- /**
- * Set the data for this node.
- *
- * @param value
- * The new data.
- */
- public void setValue(String value) {
- this.value = checkText(value);
- }
-
- public Image getImage() {
- return image;
- }
-
- /**
- * Sets the image for this object. This image is used when displaying this object in the UI.
- *
- * @param newImage
- * The new image.
- */
- public void setImage(Image newImage) {
- this.image = newImage;
- }
-
- @Override
- public boolean equals(Object arg0) {
- if (arg0 instanceof BugzillaCompareNode) {
- BugzillaCompareNode bugNode = (BugzillaCompareNode) arg0;
- return getKey().equals(bugNode.getKey());
- }
- return super.equals(arg0);
- }
-
- @Override
- public int hashCode() {
- return getKey().hashCode();
- }
-
- public String getName() {
- return getKey();
- }
-
- public String getType() {
- return "bug report";
- }
-
- /**
- * Parses the given <code>BugReport</code> into a tree of <code>BugzillaCompareNode</code>'s suitable for use in a
- * compare viewer.
- *
- * @param bug
- * The <code>BugReport</code> that needs parsing.
- * @return The tree of <code>BugzillaCompareNode</code>'s.
- */
- public static BugzillaCompareNode parseBugReport(RepositoryTaskData bug) {
- Image defaultImage = PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_DEF_VIEW);
- BugzillaCompareNode topNode = new BugzillaCompareNode("Bug #" + bug.getTaskId(), null, defaultImage);
-
- Image attributeImage = PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_OBJ_ELEMENT);
- BugzillaCompareNode attributes = new BugzillaCompareNode("Attributes", null, attributeImage);
- for (RepositoryTaskAttribute attribute : bug.getAttributes()) {
- BugzillaCompareNode child = new BugzillaCompareNode(attribute.toString(), attribute.getValue(),
- defaultImage);
- attributes.addChild(child);
- }
-
- BugzillaCompareNode comments = new BugzillaCompareNode("Comments", null, defaultImage);
- for (TaskComment taskComment : bug.getComments()) {
- String bodyString = "Comment from " + taskComment.getAuthorName() + ":\n\n" + taskComment.getText();
- comments.addChild(new BugzillaCompareNode(
- taskComment.getAttributeValue(BugzillaAttribute.BUG_WHEN.getKey()), bodyString, defaultImage));
- }
- topNode.addChild(comments);
-
- topNode.addChild(new BugzillaCompareNode("New Comment", bug.getNewComment(), defaultImage));
-
- BugzillaCompareNode ccList = new BugzillaCompareNode("CC List", null, defaultImage);
- for (String cc : bug.getCc()) {
- ccList.addChild(new BugzillaCompareNode("CC", cc, defaultImage));
- }
- topNode.addChild(ccList);
-
- BugzillaCompareNode titleNode = new BugzillaCompareNode("BugReport Object", null, defaultImage);
- titleNode.addChild(topNode);
-
- return titleNode;
- }
-
-// public static BugzillaCompareNode parseBugReport(BugzillaReport bug) {
-// Image defaultImage = PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_DEF_VIEW);
-// BugzillaCompareNode topNode = new BugzillaCompareNode("Bug #" + bug.getId(), null, defaultImage);
-// Date creationDate = bug.getCreated();
-// if (creationDate == null) {
-// // XXX: this could be backwards
-// creationDate = Calendar.getInstance().getTime();
-// }
-// BugzillaCompareNode child = new BugzillaCompareNode("Creation Date", creationDate.toString(), defaultImage);
-// topNode.addChild(child);
-//
-// String keywords = "";
-// if (bug.getKeywords() != null) {
-// for (Iterator<String> iter = bug.getKeywords().iterator(); iter.hasNext();) {
-// keywords += iter.next() + " ";
-// }
-// }
-// topNode.addChild(new BugzillaCompareNode("Keywords", keywords, defaultImage));
-//
-// Image attributeImage = PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_OBJ_ELEMENT);
-// BugzillaCompareNode attributes = new BugzillaCompareNode("Attributes", null, attributeImage);
-// for (Iterator<RepositoryTaskAttribute> iter = bug.getAttributes().iterator(); iter.hasNext();) {
-// RepositoryTaskAttribute attribute = iter.next();
-// if (attribute.getName().compareTo("delta_ts") == 0 || attribute.getName().compareTo("Last Modified") == 0
-// || attribute.getName().compareTo("longdesclength") == 0)
-// continue;
-// // Since the bug report may not be saved offline, get the
-// // attribute's new
-// // value, which is what is in the submit viewer.
-//
-// attributes.addChild(new BugzillaCompareNode(attribute.getName(), attribute.getValue(), attributeImage));
-// }
-// topNode.addChild(attributes);
-//
-// topNode.addChild(new BugzillaCompareNode("Description", bug.getDescription(), defaultImage));
-//
-// BugzillaCompareNode comments = new BugzillaCompareNode("Comments", null, defaultImage);
-// for (Iterator<Comment> iter = bug.getComments().iterator(); iter.hasNext();) {
-// Comment comment = iter.next();
-// String bodyString = "Comment from " + comment.getAuthorName() + ":\n\n" + comment.getText();
-// comments.addChild(new BugzillaCompareNode(comment.getAttributeValue(BugzillaReportElement.CREATION_TS), bodyString, defaultImage));
-// }
-// topNode.addChild(comments);
-//
-// topNode.addChild(new BugzillaCompareNode("New Comment", bug.getNewComment(), defaultImage));
-//
-// BugzillaCompareNode ccList = new BugzillaCompareNode("CC List", null, defaultImage);
-// for (Iterator<String> iter = bug.getCC().iterator(); iter.hasNext();) {
-// String cc = iter.next();
-// ccList.addChild(new BugzillaCompareNode("CC", cc, defaultImage));
-// }
-// topNode.addChild(ccList);
-//
-// BugzillaCompareNode titleNode = new BugzillaCompareNode("BugReport Object", null, defaultImage);
-// titleNode.addChild(topNode);
-//
-// return titleNode;
-// }
-
-}
diff --git a/org.eclipse.mylyn.ide.dev/developer/src-old/bugzilla/BugzillaCompareStructureCreator.java b/org.eclipse.mylyn.ide.dev/developer/src-old/bugzilla/BugzillaCompareStructureCreator.java
deleted file mode 100644
index 200492b6..00000000
--- a/org.eclipse.mylyn.ide.dev/developer/src-old/bugzilla/BugzillaCompareStructureCreator.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2008 Tasktop Technologies 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:
- * Tasktop Technologies - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.mylyn.bugzilla.deprecated;
-
-import org.eclipse.compare.structuremergeviewer.IStructureComparator;
-import org.eclipse.compare.structuremergeviewer.IStructureCreator;
-import org.eclipse.mylyn.internal.tasks.core.deprecated.RepositoryTaskData;
-
-/**
- * This implementation of the <code>IStructureCreator</code> interface makes the contents of a <code>BugReport</code>
- * object available as a hierarchical structure of <code>IStructureComparator</code>s.
- * <p>
- * It is used when comparing a modified bug report to the one on the corresponding server.
- *
- * @author Rob Elves
- */
-public class BugzillaCompareStructureCreator implements IStructureCreator {
-
- /**
- * Create a new BugzillaStructureCreator.
- */
- public BugzillaCompareStructureCreator() {
- super();
- }
-
- public String getName() {
- return "Bugzilla Structure Creator";
- }
-
- public IStructureComparator getStructure(Object input) {
- if (input instanceof RepositoryTaskData) {
- RepositoryTaskData bugReport = (RepositoryTaskData) input;
- return BugzillaCompareNode.parseBugReport(bugReport);
- } else {
- return null;
- }
- }
-
- public IStructureComparator locate(Object path, Object input) {
- return null;
- }
-
- public String getContents(Object node, boolean ignoreWhitespace) {
- if (node instanceof BugzillaCompareNode) {
- String s = ((BugzillaCompareNode) node).getValue();
- if (ignoreWhitespace) {
- s = s.trim();
- }
- return s;
- }
- return null;
- }
-
- /**
- * Called whenever a copy operation has been performed on a tree node. This implementation throws an
- * <code>AssertionFailedException</code> since we cannot update a bug report object.
- *
- * @param structure
- * the node for which to save the new content
- * @param input
- * the object from which the structure tree was created in <code>getStructure</code>
- */
- public void save(IStructureComparator node, Object input) {
- // ignore
- }
-
-}
diff --git a/org.eclipse.mylyn.ide.dev/developer/src-old/bugzilla/BugzillaException.java b/org.eclipse.mylyn.ide.dev/developer/src-old/bugzilla/BugzillaException.java
deleted file mode 100644
index b800a785..00000000
--- a/org.eclipse.mylyn.ide.dev/developer/src-old/bugzilla/BugzillaException.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 - 2006 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.mylyn.internal.bugzilla.core;
-
-import java.io.PrintStream;
-import java.io.PrintWriter;
-
-public class BugzillaException extends Exception {
-
- /** Automatically generated serialVersionUID */
- private static final long serialVersionUID = 3257849887386449974L;
-
- private Throwable cause;
-
- /**
- * Constructor for BugzillaException.
- */
- public BugzillaException() {
- super();
- }
-
- /**
- * Constructor for BugzillaException.
- *
- * @param detailMessage
- */
- public BugzillaException(String detailMessage) {
- super(detailMessage);
- }
-
- public BugzillaException(String detailMessage, Throwable cause) {
- super(detailMessage);
- this.cause = cause;
- }
-
- public BugzillaException(Throwable cause) {
- this.cause = cause;
- }
-
- @Override
- public synchronized void printStackTrace(PrintStream err) {
- super.printStackTrace(err);
- if (cause != null) {
- err.println("\n--- Cause was:");
- cause.printStackTrace(err);
- }
- }
-
- @Override
- public synchronized void printStackTrace(PrintWriter err) {
- super.printStackTrace(err);
- if (cause != null) {
- err.println("\n--- Cause was:");
- cause.printStackTrace(err);
- }
- }
-
-}
diff --git a/org.eclipse.mylyn.ide.dev/developer/src-old/bugzilla/BugzillaHyperLink.java b/org.eclipse.mylyn.ide.dev/developer/src-old/bugzilla/BugzillaHyperLink.java
deleted file mode 100644
index 33a2e171..00000000
--- a/org.eclipse.mylyn.ide.dev/developer/src-old/bugzilla/BugzillaHyperLink.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 - 2006 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.mylyn.internal.bugzilla.ui;
-
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.hyperlink.IHyperlink;
-import org.eclipse.mylyn.internal.bugzilla.core.IBugzillaConstants;
-import org.eclipse.mylyn.tasks.ui.TasksUiUtil;
-
-/**
- * @author Mik Kersten
- */
-public class BugzillaHyperLink implements IHyperlink {
-
- private static final String SHOW_BUG_CGI = "/show_bug.cgi?taskId=";
-
- private IRegion region;
-
- private String id;
-
- private String repositoryUrl;
-
- public BugzillaHyperLink(IRegion nlsKeyRegion, String id, String repositoryUrl) {
- this.region = nlsKeyRegion;
- this.id = id;
- this.repositoryUrl = repositoryUrl;
- }
-
- public IRegion getHyperlinkRegion() {
- return region;
- }
-
- public String getTypeLabel() {
- return null;
- }
-
- public String getHyperlinkText() {
- return SHOW_BUG_CGI + id;
- }
-
- public void open() {
- // TaskRepository repository =
- // MylarTaskListPlugin.getRepositoryManager().getRepositoryForActiveTask(BugzillaPlugin.REPOSITORY_KIND);
- // TaskRepository repository =
- // MylarTaskListPlugin.getRepositoryManager().getDefaultRepository(
- // BugzillaPlugin.REPOSITORY_KIND);
- if (repositoryUrl != null) {
- TasksUiUtil.openRepositoryTask(repositoryUrl, id, repositoryUrl + IBugzillaConstants.URL_GET_SHOW_BUG
- + id);
- // OpenBugzillaReportJob job = new
- // OpenBugzillaReportJob(repository.getUrl(), taskId);
- // IProgressService service =
- // PlatformUI.getWorkbench().getProgressService();
- // try {
- // service.run(true, false, job);
- // } catch (Exception e) {
- // MylarStatusHandler.fail(e, "Could not open report", true);
- // }
- } else {
- MessageDialog.openError(null, IBugzillaConstants.TITLE_MESSAGE_DIALOG,
- "Could not determine repository for report");
- }
- }
-
-}
diff --git a/org.eclipse.mylyn.ide.dev/developer/src-old/bugzilla/BugzillaLabelProvider.java b/org.eclipse.mylyn.ide.dev/developer/src-old/bugzilla/BugzillaLabelProvider.java
deleted file mode 100644
index 96e0c199..00000000
--- a/org.eclipse.mylyn.ide.dev/developer/src-old/bugzilla/BugzillaLabelProvider.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 - 2006 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.mylyn.internal.bugzilla.core.search;
-
-import org.eclipse.core.resources.IMarker;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.mylyn.internal.bugzilla.core.IBugzillaConstants;
-import org.eclipse.mylyn.internal.bugzilla.core.internal.HtmlStreamTokenizer;
-
-/**
- * Label provider for Bugzilla search items.
- */
-public class BugzillaLabelProvider extends LabelProvider {
- /** A list of the default severity labels */
- private static final String[] severityLabel = { "blocker", "critical", "major", "normal", "minor", "trivial",
- "enhancement" };
-
- /** A list of the default priority labels */
- private static final String[] priorityLabel = { "P1", "P2", "P3", "P4", "P5", "--" };
-
- /** A list of the default state labels */
- private static final String[] stateLabel = { "Unconfirmed", "New", "Assigned", "Reopened", "Resolved", "Verified",
- "Closed" };
-
- /** A list of the default result labels */
- private static final String[] resultLabel = { "", "fixed", "invalid", "wont fix", "later", "remind", "duplicate",
- "works for me" };
-
- /**
- * Returns the text for the label of the given element.
- *
- * @see org.eclipse.jface.viewers.ILabelProvider#getText(java.lang.Object)
- */
- @Override
- public String getText(Object element) {
- if (element instanceof IMarker) {
-
- try {
- IMarker marker = (IMarker) element;
-
- // get the severity of the bug
- String severity = severityLabel[((Integer) marker
- .getAttribute(IBugzillaConstants.HIT_MARKER_ATTR_SEVERITY)).intValue()];
-
- // get the priority of the bug
- String priority = priorityLabel[((Integer) marker
- .getAttribute(IBugzillaConstants.HIT_MARKER_ATTR_PRIORITY)).intValue()];
-
- // get the state of the bug
- String state = stateLabel[((Integer) marker.getAttribute(IBugzillaConstants.HIT_MARKER_ATTR_STATE))
- .intValue()];
-
- // get the resolution of the bug
- String result = resultLabel[((Integer) marker.getAttribute(IBugzillaConstants.HIT_MARKER_ATTR_RESULT))
- .intValue()];
-
- // return a string containing the information about the bug to
- // be displayed
- // in the searh window
- String assignedTo = HtmlStreamTokenizer.unescape(marker.getAttribute(
- IBugzillaConstants.HIT_MARKER_ATTR_OWNER).toString());
- String description = HtmlStreamTokenizer.unescape(marker.getAttribute(
- IBugzillaConstants.HIT_MARKER_ATTR_DESC).toString());
- return "Bug " + marker.getAttribute(IBugzillaConstants.HIT_MARKER_ATTR_ID) + " (" + severity + " - "
- + priority + " - " + state + (result.length() > 0 ? " " + result : "") + ") " + " - "
- + description + " (" + assignedTo + ") ";
- } catch (Exception ignored) {
- // ignore if there is a problem
- }
- }
-
- // return an empty string if there is a problem
- return "";
- }
-}
diff --git a/org.eclipse.mylyn.ide.dev/developer/src-old/bugzilla/BugzillaNewBugParserTestCDT.java b/org.eclipse.mylyn.ide.dev/developer/src-old/bugzilla/BugzillaNewBugParserTestCDT.java
deleted file mode 100644
index 819fc4c4..00000000
--- a/org.eclipse.mylyn.ide.dev/developer/src-old/bugzilla/BugzillaNewBugParserTestCDT.java
+++ /dev/null
@@ -1,213 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 - 2006 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.mylyn.bugzilla.tests;
-
-import java.io.File;
-import java.io.FileReader;
-import java.io.Reader;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import junit.framework.TestCase;
-
-import org.eclipse.core.runtime.Path;
-import org.eclipse.mylyn.bugzilla.core.AbstractRepositoryReportAttribute;
-import org.eclipse.mylyn.core.tests.support.FileTool;
-import org.eclipse.mylyn.internal.bugzilla.core.NewBugzillaReport;
-import org.eclipse.mylyn.internal.bugzilla.core.internal.NewBugParser;
-
-/**
- * Tests NewBugParser -- parses product attributes for new bug reports
- */
-public class BugzillaNewBugParserTestCDT extends TestCase {
-
- public BugzillaNewBugParserTestCDT() {
- super();
- }
-
- public BugzillaNewBugParserTestCDT(String arg0) {
- super(arg0);
- }
-
- public void testProductCDT() throws Exception {
-
- File f = FileTool.getFileInPlugin(BugzillaTestPlugin.getDefault(), new Path("testdata/pages/cdt-page.html"));
-
- Reader in = new FileReader(f);
-
- NewBugzillaReport nbm = new NewBugzillaReport();
- new NewBugParser(in).parseBugAttributes(nbm, true); // ** TRUE vs FALSE
- // **
-
- // attributes for this bug model
- List<AbstractRepositoryReportAttribute> attributes = nbm.getAttributes();
- // printList(attributes);
-
- Iterator<AbstractRepositoryReportAttribute> itr = attributes.iterator();
- AbstractRepositoryReportAttribute att = itr.next();
-
- // Attribute: Severity
- assertEquals("Attribute: Severity", "Severity", att.getName());
-
- Map<String, String> attOptions = att.getOptionValues(); // HashMap of
- // options for the
- // current
- // attribute
- Object[] options = attOptions.keySet().toArray(); // Array of keys for
- // the options of the
- // current attribute
- assertEquals("# Severity options", 7, options.length);
-
- int i = 0;
- while (i < options.length) {
- assertEquals("severity options", "blocker", options[i++]);
- assertEquals("severity options", "critical", options[i++]);
- assertEquals("severity options", "major", options[i++]);
- assertEquals("severity options", "normal", options[i++]);
- assertEquals("severity options", "minor", options[i++]);
- assertEquals("severity options", "trivial", options[i++]);
- assertEquals("severity options", "enhancement", options[i++]);
- }
-
- // Attribute: product
- att = itr.next();
- assertEquals("Attribute: product", "product", att.getName());
-
- attOptions = att.getOptionValues();
- options = attOptions.keySet().toArray();
- assertEquals("No product options", 0, options.length);
-
- // Attribute: AssignedTo
- att = itr.next();
- assertEquals("Attribute: AssignedTo", "AssignedTo", att.getName());
-
- attOptions = att.getOptionValues();
- options = attOptions.keySet().toArray();
- assertEquals("No AssignedTo options", 0, options.length);
-
- // Attribute: OS
- att = itr.next();
- assertEquals("Attribute: OS", "OS", att.getName());
-
- attOptions = att.getOptionValues();
- options = attOptions.keySet().toArray();
- assertEquals("# of options", 20, options.length);
-
- i = 0;
- while (i < options.length) {
- assertEquals("OS options", "All", options[i++]);
- assertEquals("OS options", "AIX Motif", options[i++]);
- assertEquals("OS options", "Windows 95", options[i++]);
- assertEquals("OS options", "Windows 98", options[i++]);
- assertEquals("OS options", "Windows CE", options[i++]);
- assertEquals("OS options", "Windows ME", options[i++]);
- assertEquals("OS options", "Windows 2000", options[i++]);
- assertEquals("OS options", "Windows NT", options[i++]);
- assertEquals("OS options", "Windows XP", options[i++]);
- assertEquals("OS options", "Windows All", options[i++]);
- assertEquals("OS options", "MacOS X", options[i++]);
- assertEquals("OS options", "Linux", options[i++]);
- assertEquals("OS options", "Linux-GTK", options[i++]);
- assertEquals("OS options", "Linux-Motif", options[i++]);
- assertEquals("OS options", "HP-UX", options[i++]);
- assertEquals("OS options", "Neutrino", options[i++]);
- assertEquals("OS options", "QNX-Photon", options[i++]);
- assertEquals("OS options", "Solaris", options[i++]);
- assertEquals("OS options", "Unix All", options[i++]);
- assertEquals("OS options", "other", options[i++]);
- }
-
- // Attribute: Version
- att = itr.next();
- assertEquals("Attribute: Version", "Version", att.getName());
-
- // attOptions = (HashMap) att.getOptionValues();
- options = att.getOptionValues().keySet().toArray();
- assertEquals("# Version options", 5, options.length);
-
- i = 0;
- while (i < options.length) {
- assertEquals("Version options", "1.0", options[i++]);
- assertEquals("Version options", "1.0.1", options[i++]);
- assertEquals("Version options", "1.1", options[i++]);
- assertEquals("Version options", "1.2", options[i++]);
- assertEquals("Version options", "2.0", options[i++]);
- }
-
- // Attribute: Platform
- att = itr.next();
- assertEquals("Attribute: Platform", "Platform", att.getName());
-
- options = att.getOptionValues().keySet().toArray();
- assertEquals("# Platform options", 6, options.length);
-
- i = 0;
- while (i < options.length) {
- assertEquals("Platform options", "All", options[i++]);
- assertEquals("Platform options", "Macintosh", options[i++]);
- assertEquals("Platform options", "PC", options[i++]);
- assertEquals("Platform options", "Power PC", options[i++]);
- assertEquals("Platform options", "Sun", options[i++]);
- assertEquals("Platform options", "Other", options[i++]);
- }
-
- // Attribute: Component
- att = itr.next();
- assertEquals("Attribute: Component", "Component", att.getName());
-
- options = att.getOptionValues().keySet().toArray();
- assertEquals("# Component options", 9, options.length);
-
- i = 0;
- while (i < options.length) {
- assertEquals("Component options", "CDT-parser", options[i++]);
- assertEquals("Component options", "Core", options[i++]);
- assertEquals("Component options", "Cpp-Extensions", options[i++]);
- assertEquals("Component options", "Debug", options[i++]);
- assertEquals("Component options", "Debug-MI", options[i++]);
- assertEquals("Component options", "Doc", options[i++]);
- assertEquals("Component options", "Generic-Extensions", options[i++]);
- assertEquals("Component options", "Launcher", options[i++]);
- assertEquals("Component options", "UI", options[i++]);
- }
-
- // Attribute: bug_status
- att = itr.next();
- assertEquals("Attribute: bug_status", "bug_status", att.getName());
-
- options = att.getOptionValues().keySet().toArray();
- assertEquals("# bug_status options [none]", 0, options.length);
-
- // Attribute: form_name
- att = itr.next();
- assertEquals("Attribute: form_name", "form_name", att.getName());
-
- options = att.getOptionValues().keySet().toArray();
- assertEquals("No form_name options", 0, options.length);
-
- // Attribute: bug_file_loc
- att = itr.next();
- assertEquals("Attribute: bug_file_loc", "bug_file_loc", att.getName());
-
- options = att.getOptionValues().keySet().toArray();
- assertEquals("No bug_file_loc options", 0, options.length);
-
- // Attribute: priority
- att = itr.next();
- assertEquals("Attribute: priority", "priority", att.getName());
-
- options = att.getOptionValues().keySet().toArray();
- assertEquals("No priority options", 0, options.length);
-
- }
-}
diff --git a/org.eclipse.mylyn.ide.dev/developer/src-old/bugzilla/BugzillaNewBugParserTestEquinox.java b/org.eclipse.mylyn.ide.dev/developer/src-old/bugzilla/BugzillaNewBugParserTestEquinox.java
deleted file mode 100644
index f7870d44..00000000
--- a/org.eclipse.mylyn.ide.dev/developer/src-old/bugzilla/BugzillaNewBugParserTestEquinox.java
+++ /dev/null
@@ -1,219 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 - 2006 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.mylyn.bugzilla.tests;
-
-import java.io.File;
-import java.io.FileReader;
-import java.io.Reader;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import junit.framework.TestCase;
-
-import org.eclipse.core.runtime.Path;
-import org.eclipse.mylyn.bugzilla.core.AbstractRepositoryReportAttribute;
-import org.eclipse.mylyn.core.tests.support.FileTool;
-import org.eclipse.mylyn.internal.bugzilla.core.NewBugzillaReport;
-import org.eclipse.mylyn.internal.bugzilla.core.internal.NewBugParser;
-
-/**
- * Tests NewBugParser -- parses product attributes
- */
-public class BugzillaNewBugParserTestEquinox extends TestCase {
-
- public BugzillaNewBugParserTestEquinox() {
- super();
- }
-
- public BugzillaNewBugParserTestEquinox(String arg0) {
- super(arg0);
- }
-
- public void testProductEquinox() throws Exception {
-
- File f = FileTool
- .getFileInPlugin(BugzillaTestPlugin.getDefault(), new Path("testdata/pages/equinox-page.html"));
-
- Reader in = new FileReader(f);
-
- NewBugzillaReport nbm = new NewBugzillaReport();
- new NewBugParser(in).parseBugAttributes(nbm, true); // ** TRUE vs FALSE
- // **
-
- // attributes for this bug model
- List<AbstractRepositoryReportAttribute> attributes = nbm.getAttributes();
- // printList(attributes);
-
- Iterator<AbstractRepositoryReportAttribute> itr = attributes.iterator();
- AbstractRepositoryReportAttribute att = itr.next();
-
- // Attribute: Severity
- assertEquals("Attribute: Severity", "Severity", att.getName());
-
- Map<String, String> attOptions = att.getOptionValues(); // HashMap of
- // options for the
- // current
- // attribute
- Object[] options = attOptions.keySet().toArray(); // Array of keys for
- // the options of the
- // current attribute
- assertEquals("# Severity options", 7, options.length);
-
- int i = 0;
- while (i < options.length) {
- assertEquals("severity options", "blocker", options[i++]);
- assertEquals("severity options", "critical", options[i++]);
- assertEquals("severity options", "major", options[i++]);
- assertEquals("severity options", "normal", options[i++]);
- assertEquals("severity options", "minor", options[i++]);
- assertEquals("severity options", "trivial", options[i++]);
- assertEquals("severity options", "enhancement", options[i++]);
- }
-
- // Attribute: product
- att = itr.next();
- assertEquals("Attribute: prodcut", "product", att.getName());
-
- options = att.getOptionValues().keySet().toArray();
- assertEquals("No product options", 0, options.length);
-
- // Attribute: AssignedTo
- att = itr.next();
- assertEquals("Attribute: AssignedTo", "AssignedTo", att.getName());
-
- options = att.getOptionValues().keySet().toArray();
- assertEquals("No AssignedTo options", 0, options.length);
-
- // Attribute: OS
- att = itr.next();
- assertEquals("Attribute: OS", "OS", att.getName());
-
- options = att.getOptionValues().keySet().toArray();
- assertEquals("# OS options", 20, options.length);
-
- i = 0;
- while (i < options.length) {
- assertEquals("OS options", "All", options[i++]);
- assertEquals("OS options", "AIX Motif", options[i++]);
- assertEquals("OS options", "Windows 95", options[i++]);
- assertEquals("OS options", "Windows 98", options[i++]);
- assertEquals("OS options", "Windows CE", options[i++]);
- assertEquals("OS options", "Windows ME", options[i++]);
- assertEquals("OS options", "Windows 2000", options[i++]);
- assertEquals("OS options", "Windows NT", options[i++]);
- assertEquals("OS options", "Windows XP", options[i++]);
- assertEquals("OS options", "Windows All", options[i++]);
- assertEquals("OS options", "MacOS X", options[i++]);
- assertEquals("OS options", "Linux", options[i++]);
- assertEquals("OS options", "Linux-GTK", options[i++]);
- assertEquals("OS options", "Linux-Motif", options[i++]);
- assertEquals("OS options", "HP-UX", options[i++]);
- assertEquals("OS options", "Neutrino", options[i++]);
- assertEquals("OS options", "QNX-Photon", options[i++]);
- assertEquals("OS options", "Solaris", options[i++]);
- assertEquals("OS options", "Unix All", options[i++]);
- assertEquals("OS options", "other", options[i++]);
- }
-
- // Attribute: Version
- att = itr.next();
- assertEquals("Attribute: Version", "Version", att.getName());
-
- options = att.getOptionValues().keySet().toArray();
- assertEquals("# Version options", 1, options.length);
-
- i = 0;
- while (i < options.length) {
- assertEquals("Version options", "unspecified", options[i++]);
- }
-
- // Attribute: Platform
- att = itr.next();
- assertEquals("Attribute: Platform", "Platform", att.getName());
-
- options = att.getOptionValues().keySet().toArray();
- assertEquals("# Platform options", 6, options.length);
-
- i = 0;
- while (i < options.length) {
- assertEquals("Platform options", "All", options[i++]);
- assertEquals("Platform options", "Macintosh", options[i++]);
- assertEquals("Platform options", "PC", options[i++]);
- assertEquals("Platform options", "Power PC", options[i++]);
- assertEquals("Platform options", "Sun", options[i++]);
- assertEquals("Platform options", "Other", options[i++]);
- }
-
- // Attribute: Component
- att = itr.next();
- assertEquals("Attribute: Component", "Component", att.getName());
-
- options = att.getOptionValues().keySet().toArray();
- assertEquals("# Component options", 3, options.length);
-
- i = 0;
- while (i < options.length) {
- assertEquals("Component options", "Dynamic Plugins", options[i++]);
- assertEquals("Component options", "General", options[i++]);
- assertEquals("Component options", "OSGi", options[i++]);
- }
-
- // Attribute: bug_status
- att = itr.next();
- assertEquals("Attribute: bug_status", "bug_status", att.getName());
-
- options = att.getOptionValues().keySet().toArray();
- assertEquals("No bug_status options", 0, options.length);
-
- // Attribute: form_name
- att = itr.next();
- assertEquals("Attribute: form_name", "form_name", att.getName());
-
- options = att.getOptionValues().keySet().toArray();
- assertEquals("No form_name options", 0, options.length);
-
- // Attribute: bug_file_loc
- att = itr.next();
- assertEquals("Attribute: bug_file_loc", "bug_file_loc", att.getName());
-
- options = att.getOptionValues().keySet().toArray();
- assertEquals("No bug_file_loc options", 0, options.length);
-
- // Attribute: priority
- att = itr.next();
- assertEquals("Attribute: priority", "priority", att.getName());
-
- options = att.getOptionValues().keySet().toArray();
- assertEquals("No priority options", 0, options.length);
-
- }
-
- // private void printList(List<Attribute> attributes) {
- //
- // Iterator<Attribute> itr = attributes.iterator();
- // System.out.println("Attributes for this Product:");
- // System.out.println("============================");
- //
- // while (itr.hasNext()) {
- // Attribute attr = itr.next();
- // System.out.println();
- // System.out.println(attr.getName() + ": ");
- // System.out.println("-----------");
- //
- // Map<String, String> options = attr.getOptionValues();
- // Object[] it = options.keySet().toArray();
- // for (int i = 0; i < it.length; i++)
- // System.out.println((String) it[i]);
- // }
- // }
-}
diff --git a/org.eclipse.mylyn.ide.dev/developer/src-old/bugzilla/BugzillaNewBugParserTestGMT.java b/org.eclipse.mylyn.ide.dev/developer/src-old/bugzilla/BugzillaNewBugParserTestGMT.java
deleted file mode 100644
index 738a40eb..00000000
--- a/org.eclipse.mylyn.ide.dev/developer/src-old/bugzilla/BugzillaNewBugParserTestGMT.java
+++ /dev/null
@@ -1,219 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 - 2006 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.mylyn.bugzilla.tests;
-
-import java.io.File;
-import java.io.FileReader;
-import java.io.Reader;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import junit.framework.TestCase;
-
-import org.eclipse.core.runtime.Path;
-import org.eclipse.mylyn.bugzilla.core.AbstractRepositoryReportAttribute;
-import org.eclipse.mylyn.core.tests.support.FileTool;
-import org.eclipse.mylyn.internal.bugzilla.core.NewBugzillaReport;
-import org.eclipse.mylyn.internal.bugzilla.core.internal.NewBugParser;
-
-/**
- * Tests NewBugParser -- parses product attributes
- */
-public class BugzillaNewBugParserTestGMT extends TestCase {
-
- public BugzillaNewBugParserTestGMT() {
- super();
- }
-
- public BugzillaNewBugParserTestGMT(String arg0) {
- super(arg0);
- }
-
- public void testProductGMT() throws Exception {
-
- File f = FileTool.getFileInPlugin(BugzillaTestPlugin.getDefault(), new Path("testdata/pages/gmt-page.html"));
-
- Reader in = new FileReader(f);
-
- NewBugzillaReport nbm = new NewBugzillaReport();
- new NewBugParser(in).parseBugAttributes(nbm, true); // ** TRUE vs FALSE
- // **
-
- // attributes for this bug model
- List<AbstractRepositoryReportAttribute> attributes = nbm.getAttributes();
- // printList(attributes);
-
- Iterator<AbstractRepositoryReportAttribute> itr = attributes.iterator();
- AbstractRepositoryReportAttribute att = itr.next();
-
- // Attribute: Severity
- assertEquals("Attribute: Severity", "Severity", att.getName());
-
- Map<String, String> attOptions = att.getOptionValues(); // HashMap of
- // options for the
- // current
- // attribute
- Object[] options = attOptions.keySet().toArray(); // Array of keys for
- // the options of the
- // current attribute
- assertEquals("# Severity options", 7, options.length);
-
- int i = 0;
- while (i < options.length) {
- assertEquals("severity options", "blocker", options[i++]);
- assertEquals("severity options", "critical", options[i++]);
- assertEquals("severity options", "major", options[i++]);
- assertEquals("severity options", "normal", options[i++]);
- assertEquals("severity options", "minor", options[i++]);
- assertEquals("severity options", "trivial", options[i++]);
- assertEquals("severity options", "enhancement", options[i++]);
- }
-
- // Attribute: product
- att = itr.next();
- assertEquals("Attribute: product", "product", att.getName());
-
- attOptions = att.getOptionValues();
- options = attOptions.keySet().toArray();
- assertEquals("No product options", 0, options.length);
-
- // Attribute: AssignedTo
- att = itr.next();
- assertEquals("Attribute: AssignedTo", "AssignedTo", att.getName());
-
- attOptions = att.getOptionValues();
- options = attOptions.keySet().toArray();
- assertEquals("No AssignedTo options", 0, options.length);
-
- // Attribute: OS
- att = itr.next();
- assertEquals("Attribute: OS", "OS", att.getName());
-
- attOptions = att.getOptionValues();
- options = attOptions.keySet().toArray();
- assertEquals("# of options", 20, options.length);
-
- i = 0;
- while (i < options.length) {
- assertEquals("OS options", "All", options[i++]);
- assertEquals("OS options", "AIX Motif", options[i++]);
- assertEquals("OS options", "Windows 95", options[i++]);
- assertEquals("OS options", "Windows 98", options[i++]);
- assertEquals("OS options", "Windows CE", options[i++]);
- assertEquals("OS options", "Windows ME", options[i++]);
- assertEquals("OS options", "Windows 2000", options[i++]);
- assertEquals("OS options", "Windows NT", options[i++]);
- assertEquals("OS options", "Windows XP", options[i++]);
- assertEquals("OS options", "Windows All", options[i++]);
- assertEquals("OS options", "MacOS X", options[i++]);
- assertEquals("OS options", "Linux", options[i++]);
- assertEquals("OS options", "Linux-GTK", options[i++]);
- assertEquals("OS options", "Linux-Motif", options[i++]);
- assertEquals("OS options", "HP-UX", options[i++]);
- assertEquals("OS options", "Neutrino", options[i++]);
- assertEquals("OS options", "QNX-Photon", options[i++]);
- assertEquals("OS options", "Solaris", options[i++]);
- assertEquals("OS options", "Unix All", options[i++]);
- assertEquals("OS options", "other", options[i++]);
- }
-
- // Attribute: Version
- att = itr.next();
- assertEquals("Attribute: Version", "Version", att.getName());
-
- // attOptions = (HashMap) att.getOptionValues();
- options = att.getOptionValues().keySet().toArray();
- assertEquals("# Version options", 1, options.length);
-
- i = 0;
- while (i < options.length) {
- assertEquals("Version options", "unspecified", options[i++]);
- }
-
- // Attribute: Platform
- att = itr.next();
- assertEquals("Attribute: Platform", "Platform", att.getName());
-
- options = att.getOptionValues().keySet().toArray();
- assertEquals("# Platform options", 6, options.length);
-
- i = 0;
- while (i < options.length) {
- assertEquals("Platform options", "All", options[i++]);
- assertEquals("Platform options", "Macintosh", options[i++]);
- assertEquals("Platform options", "PC", options[i++]);
- assertEquals("Platform options", "Power PC", options[i++]);
- assertEquals("Platform options", "Sun", options[i++]);
- assertEquals("Platform options", "Other", options[i++]);
- }
-
- att = itr.next();
- assertEquals("Attribute: Component", "Component", att.getName());
-
- options = att.getOptionValues().keySet().toArray();
- assertEquals("# Component options", 1, options.length);
-
- i = 0;
- while (i < options.length) {
- assertEquals("Component options", "Core", options[i++]);
- }
-
- // Attribute: bug_status
- att = itr.next();
- assertEquals("Attribute: bug_status", "bug_status", att.getName());
-
- options = att.getOptionValues().keySet().toArray();
- assertEquals("No bug_status options", 0, options.length);
-
- // Attribute: form_name
- att = itr.next();
- assertEquals("Attribute: form_name", "form_name", att.getName());
-
- options = att.getOptionValues().keySet().toArray();
- assertEquals("No form_name options", 0, options.length);
-
- // Attribute: bug_file_loc
- att = itr.next();
- assertEquals("Attribute: bug_file_loc", "bug_file_loc", att.getName());
-
- options = att.getOptionValues().keySet().toArray();
- assertEquals("No bug_file_loc options", 0, options.length);
-
- // Attribute: priority
- att = itr.next();
- assertEquals("Attribute: priority", "priority", att.getName());
-
- options = att.getOptionValues().keySet().toArray();
- assertEquals("No priority options", 0, options.length);
-
- }
-
- // private void printList(List<Attribute> attributes) {
- //
- // Iterator<Attribute> itr = attributes.iterator();
- // System.out.println("Attributes for this Product:");
- // System.out.println("============================");
- //
- // while (itr.hasNext()) {
- // Attribute attr = itr.next();
- // System.out.println();
- // System.out.println(attr.getName() + ": ");
- // System.out.println("-----------");
- //
- // Map<String, String> options = attr.getOptionValues();
- // Object[] it = options.keySet().toArray();
- // for (int i = 0; i < it.length; i++)
- // System.out.println((String) it[i]);
- // }
- // }
-}
diff --git a/org.eclipse.mylyn.ide.dev/developer/src-old/bugzilla/BugzillaNewBugParserTestPlatform.java b/org.eclipse.mylyn.ide.dev/developer/src-old/bugzilla/BugzillaNewBugParserTestPlatform.java
deleted file mode 100644
index 6fe1fc21..00000000
--- a/org.eclipse.mylyn.ide.dev/developer/src-old/bugzilla/BugzillaNewBugParserTestPlatform.java
+++ /dev/null
@@ -1,246 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 - 2006 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.mylyn.bugzilla.tests;
-
-import java.io.File;
-import java.io.FileReader;
-import java.io.Reader;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import junit.framework.TestCase;
-
-import org.eclipse.core.runtime.Path;
-import org.eclipse.mylyn.bugzilla.core.AbstractRepositoryReportAttribute;
-import org.eclipse.mylyn.core.tests.support.FileTool;
-import org.eclipse.mylyn.internal.bugzilla.core.NewBugzillaReport;
-import org.eclipse.mylyn.internal.bugzilla.core.internal.NewBugParser;
-
-/**
- * Tests NewBugParser -- parses product attributes
- */
-public class BugzillaNewBugParserTestPlatform extends TestCase {
-
- public BugzillaNewBugParserTestPlatform() {
- super();
- }
-
- public BugzillaNewBugParserTestPlatform(String arg0) {
- super(arg0);
- }
-
- public void testProductPlatform() throws Exception {
-
- File f = FileTool.getFileInPlugin(BugzillaTestPlugin.getDefault(),
- new Path("testdata/pages/platform-page.html"));
-
- Reader in = new FileReader(f);
-
- NewBugzillaReport nbm = new NewBugzillaReport();
- new NewBugParser(in).parseBugAttributes(nbm, true); // ** TRUE vs FALSE
- // **
-
- // attributes for this bug model
- List<AbstractRepositoryReportAttribute> attributes = nbm.getAttributes();
- // printList(attributes);
-
- // to iterator over the ArrayList of attributes
- Iterator<AbstractRepositoryReportAttribute> itr = attributes.iterator();
-
- // Attribute: Severity
- AbstractRepositoryReportAttribute att = itr.next(); // current attribute
-
- // Attribute: Severity
- assertEquals("Attribute: Severity", "Severity", att.getName());
-
- Map<String, String> attOptions = att.getOptionValues(); // HashMap of
- // options for the
- // current
- // attribute
- Object[] options = attOptions.keySet().toArray(); // Array of keys for
- // the options of the
- // current attribute
- assertEquals("# Severity options", 7, options.length);
-
- int i = 0;
- while (i < options.length) {
- assertEquals("severity options", "blocker", options[i++]);
- assertEquals("severity options", "critical", options[i++]);
- assertEquals("severity options", "major", options[i++]);
- assertEquals("severity options", "normal", options[i++]);
- assertEquals("severity options", "minor", options[i++]);
- assertEquals("severity options", "trivial", options[i++]);
- assertEquals("severity options", "enhancement", options[i++]);
- }
-
- // Attribute: product
- att = itr.next();
- assertEquals("Attribute: product", "product", att.getName());
-
- attOptions = att.getOptionValues();
- options = attOptions.keySet().toArray();
- assertEquals("No product optins", 0, options.length);
-
- // Attribute: AssignedTo
- att = itr.next();
- assertEquals("Attribute: Assigned To", "Assigned To", att.getName());
-
- options = att.getOptionValues().keySet().toArray();
- assertEquals("No AssingedTo options", 0, options.length);
-
- // Attribute: OS
- att = itr.next();
- assertEquals("Attribute: OS", "OS", att.getName());
-
- attOptions = att.getOptionValues();
- options = attOptions.keySet().toArray();
- assertEquals("# OS options", 20, options.length);
-
- i = 0;
- while (i < options.length) {
- assertEquals("OS options", "All", options[i++]);
- assertEquals("OS options", "AIX Motif", options[i++]);
- assertEquals("OS options", "Windows 95", options[i++]);
- assertEquals("OS options", "Windows 98", options[i++]);
- assertEquals("OS options", "Windows CE", options[i++]);
- assertEquals("OS options", "Windows ME", options[i++]);
- assertEquals("OS options", "Windows 2000", options[i++]);
- assertEquals("OS options", "Windows NT", options[i++]);
- assertEquals("OS options", "Windows XP", options[i++]);
- assertEquals("OS options", "Windows All", options[i++]);
- assertEquals("OS options", "MacOS X", options[i++]);
- assertEquals("OS options", "Linux", options[i++]);
- assertEquals("OS options", "Linux-GTK", options[i++]);
- assertEquals("OS options", "Linux-Motif", options[i++]);
- assertEquals("OS options", "HP-UX", options[i++]);
- assertEquals("OS options", "Neutrino", options[i++]);
- assertEquals("OS options", "QNX-Photon", options[i++]);
- assertEquals("OS options", "Solaris", options[i++]);
- assertEquals("OS options", "Unix All", options[i++]);
- assertEquals("OS options", "other", options[i++]);
- }
-
- // Attribute: Version
- att = itr.next();
- assertEquals("Attribute: Version", "Version", att.getName());
-
- attOptions = att.getOptionValues();
- options = attOptions.keySet().toArray();
- assertEquals("# Version options", 8, options.length);
-
- i = 0;
- while (i < options.length) {
- assertEquals("Version options", "1.0", options[i++]);
- assertEquals("Version options", "2.0", options[i++]);
- assertEquals("Version options", "2.0.1", options[i++]);
- assertEquals("Version options", "2.0.2", options[i++]);
- assertEquals("Version options", "2.1", options[i++]);
- assertEquals("Version options", "2.1.1", options[i++]);
- assertEquals("Version options", "2.1.2", options[i++]);
- assertEquals("Version options", "3.0", options[i++]);
- }
-
- // Attribute: Platform
- att = itr.next();
- assertEquals("Attribute: Platform", "Platform", att.getName());
-
- options = att.getOptionValues().keySet().toArray();
- assertEquals("# Platform options", 6, options.length);
-
- i = 0;
- while (i < options.length) {
- assertEquals("Platform options", "All", options[i++]);
- assertEquals("Platform options", "Macintosh", options[i++]);
- assertEquals("Platform options", "PC", options[i++]);
- assertEquals("Platform options", "Power PC", options[i++]);
- assertEquals("Platform options", "Sun", options[i++]);
- assertEquals("Platform options", "Other", options[i++]);
- }
-
- // Attribute: Component
- att = itr.next();
- assertEquals("Attribute: Component", "Component", att.getName());
-
- attOptions = att.getOptionValues();
- options = attOptions.keySet().toArray();
- assertEquals("# Component options", 16, options.length);
-
- i = 0;
- while (i < options.length) {
- assertEquals("Component options", "Ant", options[i++]);
- assertEquals("Component options", "Compare", options[i++]);
- assertEquals("Component options", "Core", options[i++]);
- assertEquals("Component options", "CVS", options[i++]);
- assertEquals("Component options", "Debug", options[i++]);
- assertEquals("Component options", "Doc", options[i++]);
- assertEquals("Component options", "Help", options[i++]);
- assertEquals("Component options", "Releng", options[i++]);
- assertEquals("Component options", "Scripting", options[i++]);
- assertEquals("Component options", "Search", options[i++]);
- assertEquals("Component options", "SWT", options[i++]);
- assertEquals("Component options", "Team", options[i++]);
- assertEquals("Component options", "Text", options[i++]);
- assertEquals("Component options", "UI", options[i++]);
- assertEquals("Component options", "Update", options[i++]);
- assertEquals("Component options", "WebDAV", options[i++]);
- }
-
- // Attribute: bug_status
- att = itr.next();
- assertEquals("Attribute: bug_status", "bug_status", att.getName());
-
- attOptions = att.getOptionValues();
- options = attOptions.keySet().toArray();
- assertEquals("No bug_status options", 0, options.length);
-
- // Attribute: form_name
- att = itr.next();
- assertEquals("Attribute: form_name", "form_name", att.getName());
-
- options = att.getOptionValues().keySet().toArray();
- assertEquals("No form_name options", 0, options.length);
-
- // Attribute: bug_file_loc
- att = itr.next();
- assertEquals("Attribute: bug_file_loc", "bug_file_loc", att.getName());
-
- options = att.getOptionValues().keySet().toArray();
- assertEquals("No bug_file_loc options", 0, options.length);
-
- // Attribute: priority
- att = itr.next();
- assertEquals("Attribute: priority", "priority", att.getName());
-
- options = att.getOptionValues().keySet().toArray();
- assertEquals("No priority options", 0, options.length);
- }
-
- // private void printList(List<Attribute> attributes) {
- //
- // Iterator<Attribute> itr = attributes.iterator();
- // System.out.println("Attributes for this Product:");
- // System.out.println("============================");
- //
- // while (itr.hasNext()) {
- // Attribute attr = itr.next();
- // System.out.println();
- // System.out.println(attr.getName() + ": ");
- // System.out.println("-----------");
- //
- // Map<String, String> options = attr.getOptionValues();
- // Object[] it = options.keySet().toArray();
- // for (int i = 0; i < it.length; i++)
- // System.out.println((String) it[i]);
- // }
- // }
-}
diff --git a/org.eclipse.mylyn.ide.dev/developer/src-old/bugzilla/BugzillaNewBugParserTestVE.java b/org.eclipse.mylyn.ide.dev/developer/src-old/bugzilla/BugzillaNewBugParserTestVE.java
deleted file mode 100644
index 7f6f0dc6..00000000
--- a/org.eclipse.mylyn.ide.dev/developer/src-old/bugzilla/BugzillaNewBugParserTestVE.java
+++ /dev/null
@@ -1,225 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 - 2006 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.mylyn.bugzilla.tests;
-
-import java.io.File;
-import java.io.FileReader;
-import java.io.Reader;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import junit.framework.TestCase;
-
-import org.eclipse.core.runtime.Path;
-import org.eclipse.mylyn.bugzilla.core.AbstractRepositoryReportAttribute;
-import org.eclipse.mylyn.core.tests.support.FileTool;
-import org.eclipse.mylyn.internal.bugzilla.core.NewBugzillaReport;
-import org.eclipse.mylyn.internal.bugzilla.core.internal.NewBugParser;
-
-/**
- * Tests NewBugParser -- parses product attributes
- */
-public class BugzillaNewBugParserTestVE extends TestCase {
-
- public BugzillaNewBugParserTestVE() {
- super();
- }
-
- public BugzillaNewBugParserTestVE(String arg0) {
- super(arg0);
- }
-
- public void testProductVE() throws Exception {
- File f = FileTool.getFileInPlugin(BugzillaTestPlugin.getDefault(), new Path("testdata/pages/ve-page.html"));
-
- Reader in = new FileReader(f);
-
- NewBugzillaReport nbm = new NewBugzillaReport();
- new NewBugParser(in).parseBugAttributes(nbm, true); // ** TRUE vs FALSE
- // **
-
- // attributes for this but model
- List<AbstractRepositoryReportAttribute> attributes = nbm.getAttributes();
- // printList(attributes);
-
- Iterator<AbstractRepositoryReportAttribute> itr = attributes.iterator();
- AbstractRepositoryReportAttribute att = itr.next();
-
- // Attribute: Severity
- assertEquals("Attribute: Severity", "Severity", att.getName());
-
- Map<String, String> attOptions = att.getOptionValues(); // HashMap of
- // options for the
- // current
- // attribute
- Object[] options = attOptions.keySet().toArray(); // Array of keys for
- // the options of the
- // current attribute
- assertEquals("# Severity options", 7, options.length);
-
- int i = 0;
- while (i < options.length) {
- assertEquals("severity options", "blocker", options[i++]);
- assertEquals("severity options", "critical", options[i++]);
- assertEquals("severity options", "major", options[i++]);
- assertEquals("severity options", "normal", options[i++]);
- assertEquals("severity options", "minor", options[i++]);
- assertEquals("severity options", "trivial", options[i++]);
- assertEquals("severity options", "enhancement", options[i++]);
- }
-
- // Attribute: product
- att = itr.next();
- assertEquals("Attribute: product", "product", att.getName());
-
- attOptions = att.getOptionValues();
- options = attOptions.keySet().toArray();
- assertEquals("No product options", 0, options.length);
-
- // Attribute: AssignedTo
- att = itr.next();
- assertEquals("Attribute: AssignedTo", "AssignedTo", att.getName());
-
- attOptions = att.getOptionValues();
- options = attOptions.keySet().toArray();
- assertEquals("No AssignedTo options", 0, options.length);
-
- // Attribute: OS
- att = itr.next();
- assertEquals("Attribute: OS", "OS", att.getName());
-
- attOptions = att.getOptionValues();
- options = attOptions.keySet().toArray();
- assertEquals("# of options", 20, options.length);
-
- i = 0;
- while (i < options.length) {
- assertEquals("OS options", "All", options[i++]);
- assertEquals("OS options", "AIX Motif", options[i++]);
- assertEquals("OS options", "Windows 95", options[i++]);
- assertEquals("OS options", "Windows 98", options[i++]);
- assertEquals("OS options", "Windows CE", options[i++]);
- assertEquals("OS options", "Windows ME", options[i++]);
- assertEquals("OS options", "Windows 2000", options[i++]);
- assertEquals("OS options", "Windows NT", options[i++]);
- assertEquals("OS options", "Windows XP", options[i++]);
- assertEquals("OS options", "Windows All", options[i++]);
- assertEquals("OS options", "MacOS X", options[i++]);
- assertEquals("OS options", "Linux", options[i++]);
- assertEquals("OS options", "Linux-GTK", options[i++]);
- assertEquals("OS options", "Linux-Motif", options[i++]);
- assertEquals("OS options", "HP-UX", options[i++]);
- assertEquals("OS options", "Neutrino", options[i++]);
- assertEquals("OS options", "QNX-Photon", options[i++]);
- assertEquals("OS options", "Solaris", options[i++]);
- assertEquals("OS options", "Unix All", options[i++]);
- assertEquals("OS options", "other", options[i++]);
- }
-
- // Attribute: Version
- att = itr.next();
- assertEquals("Attribute: Version", "Version", att.getName());
-
- // attOptions = (HashMap) att.getOptionValues();
- options = att.getOptionValues().keySet().toArray();
- assertEquals("# Version options", 3, options.length);
-
- i = 0;
- while (i < options.length) {
- assertEquals("Version options", "0.5.0", options[i++]);
- assertEquals("Version options", "1.0.0", options[i++]);
- assertEquals("Version options", "unspecified", options[i++]);
- }
-
- // Attribute: Platform
- att = itr.next();
- assertEquals("Attribute: Platform", "Platform", att.getName());
-
- options = att.getOptionValues().keySet().toArray();
- assertEquals("# Platform options", 6, options.length);
-
- i = 0;
- while (i < options.length) {
- assertEquals("Platform options", "All", options[i++]);
- assertEquals("Platform options", "Macintosh", options[i++]);
- assertEquals("Platform options", "PC", options[i++]);
- assertEquals("Platform options", "Power PC", options[i++]);
- assertEquals("Platform options", "Sun", options[i++]);
- assertEquals("Platform options", "Other", options[i++]);
- }
-
- att = itr.next();
- assertEquals("Attribute: Component", "Component", att.getName());
-
- options = att.getOptionValues().keySet().toArray();
- assertEquals("# Component options", 6, options.length);
-
- i = 0;
- while (i < options.length) {
- assertEquals("Component options", "CDE", options[i++]);
- assertEquals("Component options", "Doc", options[i++]);
- assertEquals("Component options", "Java Core", options[i++]);
- assertEquals("Component options", "Java Model (JEM)", options[i++]);
- assertEquals("Component options", "JFC/Swing", options[i++]);
- assertEquals("Component options", "SWT", options[i++]);
- }
-
- // Attribute: bug_status
- att = itr.next();
- assertEquals("Attribute: bug_status", "bug_status", att.getName());
-
- options = att.getOptionValues().keySet().toArray();
- assertEquals("No bug_status options", 0, options.length);
-
- // Attribute: form_name
- att = itr.next();
- assertEquals("Attribute: form_name", "form_name", att.getName());
-
- options = att.getOptionValues().keySet().toArray();
- assertEquals("No form_name options", 0, options.length);
-
- // Attribute: bug_file_loc
- att = itr.next();
- assertEquals("Attribute: bug_file_loc", "bug_file_loc", att.getName());
-
- options = att.getOptionValues().keySet().toArray();
- assertEquals("No bug_file_loc options", 0, options.length);
-
- // Attribute: priority
- att = itr.next();
- assertEquals("Attribute: priority", "priority", att.getName());
-
- options = att.getOptionValues().keySet().toArray();
- assertEquals("No priority options", 0, options.length);
-
- }
-
- // private void printList(List<Attribute> attributes) {
- //
- // Iterator<Attribute> itr = attributes.iterator();
- // System.out.println("Attributes for this Product:");
- // System.out.println("============================");
- //
- // while (itr.hasNext()) {
- // Attribute attr = itr.next();
- // System.out.println();
- // System.out.println(attr.getName() + ": ");
- // System.out.println("-----------");
- //
- // Map<String, String> options = attr.getOptionValues();
- // Object[] it = options.keySet().toArray();
- // for (int i = 0; i < it.length; i++)
- // System.out.println((String) it[i]);
- // }
- // }
-}
diff --git a/org.eclipse.mylyn.ide.dev/developer/src-old/bugzilla/BugzillaParserTest.java b/org.eclipse.mylyn.ide.dev/developer/src-old/bugzilla/BugzillaParserTest.java
deleted file mode 100644
index dea3c347..00000000
--- a/org.eclipse.mylyn.ide.dev/developer/src-old/bugzilla/BugzillaParserTest.java
+++ /dev/null
@@ -1,196 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003 - 2006 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.mylyn.bugzilla.tests;
-
-import java.io.File;
-import java.io.FileReader;
-import java.io.Reader;
-import java.util.Iterator;
-
-import junit.framework.TestCase;
-
-import org.eclipse.core.runtime.Path;
-import org.eclipse.mylyn.bugzilla.core.BugReport;
-import org.eclipse.mylyn.bugzilla.core.Comment;
-import org.eclipse.mylyn.core.tests.support.FileTool;
-import org.eclipse.mylyn.internal.bugzilla.core.internal.BugParser;
-
-/**
- * Tests for parsing Bugzilla reports
- */
-public class BugzillaParserTest extends TestCase {
-
- public BugzillaParserTest() {
- super();
- }
-
- public BugzillaParserTest(String arg0) {
- super(arg0);
- }
-
- public void testFullReportBug1() throws Exception {
-
- File f = FileTool.getFileInPlugin(BugzillaTestPlugin.getDefault(), new Path("testdata/pages/bug-1-full.html"));
-
- Reader in = new FileReader(f);
-
- BugReport bug = BugParser.parseBug(in, 1, "<server>", false, null, null, null);
-
- // displayBug(bug);
- assertEquals("Bug id", 1, bug.getId());
- assertEquals("Bug summary", "Usability issue with external editors (1GE6IRL)", bug.getSummary());
- assertEquals("Reporter", "andre_weinand@ch.ibm.com (Andre Weinand)", bug.getReporter());
- assertEquals("Reporter", "andre_weinand@ch.ibm.com (Andre Weinand)", bug.getAttribute("Reporter").getValue());
- assertEquals("Summary", "Usability issue with external editors (1GE6IRL)", bug.getSummary());
- assertEquals("Status", "VERIFIED", bug.getStatus());
- assertEquals("Resolution", "FIXED", bug.getResolution());
- assertEquals("Keywords", null, bug.getKeywords());
- assertEquals("Assigned To", "James_Moody@ca.ibm.com (James Moody)", bug.getAssignedTo());
- assertEquals("Priority", "P3", bug.getAttribute("Priority").getValue());
- assertEquals("OS", "All", bug.getAttribute("OS").getValue());
- assertEquals("Version", "2.0", bug.getAttribute("Version").getValue());
- assertEquals("Target Milestone", "---", bug.getAttribute("Target Milestone").getValue());
- assertEquals("Keywords", "", bug.getAttribute("Keywords").getValue());
- assertEquals("Severity", "normal", bug.getAttribute("Severity").getValue());
- assertEquals("Component", "VCM", bug.getAttribute("Component").getValue());
- assertEquals("CC", "Kevin_McGuire@oti.com", bug.getCC().iterator().next());
- assertEquals("Platform", "All", bug.getAttribute("Platform").getValue());
- assertEquals("Product", "Platform", bug.getAttribute("Product").getValue());
- assertEquals("URL", "", bug.getAttribute("URL").getValue());
- assertEquals("Bug#", "1", bug.getAttribute("Bug#").getValue());
-
- // Description
- String description = "- Setup a project that contains a *.gif resource\n"
- + "\t- release project to CVS\n"
- + "\t- edit the *.gif resource with an external editor, e.g. PaintShop\n"
- + "\t- save and close external editor\n"
- + "\t- in Navigator open the icon resource and verify that your changes are there\n"
- + "\t- release project\n"
- + "\t\t-> nothing to release!\n"
- + "\t- in Navigator open the icon resource and verify that your changes are still there\n\n"
- +
-
- "\tProblem: because I never \"Refreshed from local\", the workspace hasn't changed so \"Release\" didn't find anything.\n"
- + "\tHowever opening the resource with an external editor found the modified file on disk and showed the changes.\n\n"
- +
-
- "\tThe real problem occurs if \"Release\" actually finds something to release but you don't spot that some resources are missing.\n"
- + "\tThis is extremely error prone: one of my changes didn't made it into build 110 because of this!\n\n"
- +
-
- "NOTES:\n"
- + "EG (5/23/01 3:00:33 PM)\n"
- + "\tRelease should do a refresh from local before doing the release.\n"
- + "\tMoving to VCM\n\n\n"
- +
-
- "KM (05/27/01 5:10:19 PM)\n"
- + "\tComments from JM in related email:\n\n"
- +
-
- "\tShould not do this for free. Could have a setting which made it optoinal but should nt be mandatory. Default setting could be to have it on.\n"
- + "\tConsider the SWT team who keep their workspaces on network drives. This will be slow. \n\n"
- +
-
- "\tSide effects will be that a build runs when the refresh is completed unless you somehow do it in a workspace runnable and don't end the\n"
- + "\trunnable until after the release. This would be less than optimal as some builders may be responsible for maintaining some invariants and deriving resources which are releasable. If you don't run the builders before releasing, the invariants will not be maintained and you will release inconsistent state.\n\n"
- +
-
- "\tSummary: Offer to \"ensure local consistency\" before releasing.\n\n" +
-
- "KM (5/31/01 1:30:35 PM)\n"
- + "\tSee also 1GEAG1A: ITPVCM:WINNT - Internal error comparing with a document\n"
- + "\twhich failed with an error. Never got log from Tod though.";
-
- assert (description.length() == bug.getDescription().length());
- assertEquals("Description", description, bug.getDescription());
-
- // Comments:
- Iterator<Comment> it = bug.getComments().iterator();
- while (it.hasNext()) {
- // COMMENT #1
- Comment comment = it.next();
- assertEquals("Author1", "James_Moody@ca.ibm.com", comment.getAuthor());
- assertEquals("Name1", "James Moody", comment.getAuthorName());
- assertEquals("Text1", "*** Bug 183 has been marked as a duplicate of this bug. ***", comment.getText());
-
- // COMMENT #2
- comment = it.next();
- assertEquals("Author2", "James_Moody@ca.ibm.com", comment.getAuthor());
- assertEquals("Name2", "James Moody", comment.getAuthorName());
- assertEquals("Text2", "Implemented 'auto refresh' option. Default value is off.", comment.getText());
-
- // COMMENT 3
- comment = it.next();
- assertEquals("Author3", "dj_houghton@ca.ibm.com", comment.getAuthor());
- assertEquals("Name3", "DJ Houghton", comment.getAuthorName());
- assertEquals("Text3", "PRODUCT VERSION:\n\t109\n\n", comment.getText());
-
- // COMMENT 4
- comment = it.next();
- assertEquals("Author4", "James_Moody@ca.ibm.com", comment.getAuthor());
- assertEquals("Name4", "James Moody", comment.getAuthorName());
- assertEquals("Text4", "Fixed in v206", comment.getText());
- }
- }
-
- // private static void displayBug(BugReport bug) {
- // System.out.println("Bug " + bug.getId() + ": " + bug.getSummary());
- // System.out.println("Opened: " + bug.getCreated());
- // for (Iterator<Attribute> it = bug.getAttributes().iterator();
- // it.hasNext();) {
- // Attribute attribute = it.next();
- // String key = attribute.getName();
- // System.out.println(key + ": " + attribute.getValue()
- // + (attribute.isEditable() ? " [OK]" : " %%"));
- // }
- //
- // System.out.print("CC: ");
- // for (Iterator<String> it = bug.getCC().iterator(); it.hasNext();) {
- // String email = it.next();
- // System.out.print(email + " ");
- // }
- // System.out.println();
- //
- // System.out.println(bug.getDescription());
- // for (Iterator<Comment> it = bug.getComments().iterator(); it.hasNext();)
- // {
- // Comment comment = it.next();
- // System.out.println(comment.getAuthorName() + " <"
- // + comment.getAuthor() + "> (" + comment.getCreated() + ")");
- // System.out.print(comment.getText());
- // System.out.println();
- // }
- // }
- //
- // private static void printComments(BugReport bug) {
- // for (Iterator<Comment> it = bug.getComments().iterator(); it.hasNext();)
- // {
- // Comment comment = it.next();
- // System.out.println("Author: " + comment.getAuthor());
- // System.out.println("Name: " + comment.getAuthorName());
- // System.out.println("Date: " + comment.getCreated());
- // System.out.println("Bug ID: " + comment.getBug().getId());
- // System.out.println("Comment: " + comment.getText());
- // System.out.println();
- // }
- // }
- //
- // /** prints names of attributes */
- // private static void printAttributes(BugReport bug) {
- // System.out.println("ATTRIBUTE KEYS:");
- // for (Iterator<Attribute> it = bug.getAttributes().iterator();
- // it.hasNext();) {
- // Attribute att = it.next();
- // System.out.println(att.getName());
- // }
- // }
-}
diff --git a/org.eclipse.mylyn.ide.dev/developer/src-old/bugzilla/BugzillaParserTestNoBug.java b/org.eclipse.mylyn.ide.dev/developer/src-old/bugzilla/BugzillaParserTestNoBug.java
deleted file mode 100644
index 3f888fcc..00000000
--- a/org.eclipse.mylyn.ide.dev/developer/src-old/bugzilla/BugzillaParserTestNoBug.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003 - 2006 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.mylyn.bugzilla.tests;
-
-import java.io.File;
-import java.io.FileReader;
-import java.io.Reader;
-
-import junit.framework.TestCase;
-
-import org.eclipse.core.runtime.Path;
-import org.eclipse.mylyn.bugzilla.core.BugReport;
-import org.eclipse.mylyn.core.tests.support.FileTool;
-import org.eclipse.mylyn.internal.bugzilla.core.internal.BugParser;
-
-/**
- * Tests for parsing Bugzilla reports
- */
-public class BugzillaParserTestNoBug extends TestCase {
-
- public BugzillaParserTestNoBug() {
- super();
- }
-
- public BugzillaParserTestNoBug(String arg0) {
- super(arg0);
- }
-
- public void testBugNotFound() throws Exception {
-
- File f = FileTool.getFileInPlugin(BugzillaTestPlugin.getDefault(), new Path(
- "testdata/pages/bug-not-found-eclipse.html"));
-
- Reader in = new FileReader(f);
-
- BugReport bug = BugParser.parseBug(in, 666, "<server>", false, null, null, null);
- assertNull(bug);
- }
-}
diff --git a/org.eclipse.mylyn.ide.dev/developer/src-old/bugzilla/BugzillaPreferencePage.java b/org.eclipse.mylyn.ide.dev/developer/src-old/bugzilla/BugzillaPreferencePage.java
deleted file mode 100644
index 3d5f93dd..00000000
--- a/org.eclipse.mylyn.ide.dev/developer/src-old/bugzilla/BugzillaPreferencePage.java
+++ /dev/null
@@ -1,235 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003 - 2006 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.mylyn.internal.bugzilla.ui.preferences;
-
-import org.eclipse.jface.preference.FieldEditorPreferencePage;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.preference.RadioGroupFieldEditor;
-import org.eclipse.mylyn.internal.bugzilla.core.BugzillaPlugin;
-import org.eclipse.mylyn.internal.bugzilla.core.IBugzillaConstants;
-import org.eclipse.mylyn.internal.bugzilla.ui.BugzillaUiPlugin;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchPreferencePage;
-
-/**
- * @author Gail Murphy
- * @author Mik Kersten
- */
-public class BugzillaPreferencePage extends FieldEditorPreferencePage implements IWorkbenchPreferencePage {
-
- private RadioGroupFieldEditor bugzillaVersionEditor;
-
-// private static final String bugzillaMaxResultsLabel = "Maximum returned results: ";
-
-// private IntegerFieldEditor maxResults;
-
- /**
- * Constructor for the preferences page
- */
- public BugzillaPreferencePage() {
- super(GRID);
-
- // set the preference store for this preference page
- setPreferenceStore(BugzillaUiPlugin.getDefault().getPreferenceStore());
- }
-
- @Override
- protected Control createContents(Composite parent) {
- return super.createContents(parent);
- }
-
- @Override
- public void createControl(Composite parent) {
- super.createControl(parent);
-
- // HACK: there has to be an easier way
- Control[] radios = bugzillaVersionEditor.getRadioBoxControl(getFieldEditorParent()).getChildren();
- String currentVersion = BugzillaPlugin.getDefault().getPreferenceStore().getString(
- IBugzillaConstants.SERVER_VERSION);
- for (int i = 0; i < radios.length; i++) {
- Button button = (Button) radios[i];
- if (button.getText().equals(currentVersion)) {
- button.setSelection(true);
- } else {
- button.setSelection(false);
- }
- }
- }
-
- @Override
- protected void createFieldEditors() {
-
-// maxResults = new IntegerFieldEditor(IBugzillaConstants.MAX_RESULTS, bugzillaMaxResultsLabel,
-// getFieldEditorParent());
-
- // bugzillaVersionEditor.setPreferenceStore(BugzillaPlugin.getDefault().getPreferenceStore());
- bugzillaVersionEditor = new RadioGroupFieldEditor(IBugzillaConstants.SERVER_VERSION, "Bugzilla Version", 3,
- new String[][] { { IBugzillaConstants.SERVER_220, IBugzillaConstants.SERVER_VERSION },
- { IBugzillaConstants.SERVER_218, IBugzillaConstants.SERVER_VERSION } }, getFieldEditorParent());
-// refreshQueries = new BooleanFieldEditor(IBugzillaConstants.REFRESH_QUERY,
-// "Automatically refresh Bugzilla reports and queries on startup", BooleanFieldEditor.DEFAULT,
-// getFieldEditorParent());
-
-// addField(maxResults);
- addField(bugzillaVersionEditor);
-// addField(refreshQueries);
- }
-
- public static void initDefaults(IPreferenceStore store) {
- store.setDefault(IBugzillaConstants.MOST_RECENT_QUERY, "");
- store.setDefault(IBugzillaConstants.SERVER_VERSION, IBugzillaConstants.SERVER_220);
- store.setDefault(IBugzillaConstants.REFRESH_QUERY, false);
- store.setDefault(IBugzillaConstants.MAX_RESULTS, 100);
- }
-
- @Override
- protected void performDefaults() {
- super.performDefaults();
- }
-
- @Override
- public boolean performOk() {
- // HACK: there has to be an easier way
- Control[] radios = bugzillaVersionEditor.getRadioBoxControl(getFieldEditorParent()).getChildren();
- for (int i = 0; i < radios.length; i++) {
- Button button = (Button) radios[i];
- if (button.getSelection()) {
- BugzillaPlugin.getDefault().getPreferenceStore().setValue(IBugzillaConstants.SERVER_VERSION,
- button.getText());
- }
- }
-
-// BugzillaPlugin.getDefault().getPreferenceStore().setValue(IBugzillaConstants.REFRESH_QUERY,
-// refreshQueries.getBooleanValue());
-
-// try {
-// int numMaxResults = maxResults.getIntValue();
-// BugzillaPlugin.getDefault().getPreferenceStore().setValue(IBugzillaConstants.MAX_RESULTS, numMaxResults);
-// } catch (NumberFormatException nfe) {
-// // ignore and leave as default
-// BugzillaPlugin.getDefault().getPreferenceStore().setValue(IBugzillaConstants.MAX_RESULTS,
-// BugzillaPlugin.getDefault().getPreferenceStore().getDefaultInt(IBugzillaConstants.MAX_RESULTS));
-// }
-
- // ProductConfiguration configuration = null;
- // String urlString = bugzillaServer.getStringValue();
- // try {
- // URL serverURL = new URL(urlString + "/show_bug.cgi");
- // URLConnection cntx =
- // BugzillaPlugin.getDefault().getUrlConnection(serverURL);
- // if (cntx == null || !(cntx instanceof HttpURLConnection))
- // return false;
- //
- // HttpURLConnection serverConnection = (HttpURLConnection) cntx;
- //
- // serverConnection.connect();
- //
- // int responseCode = serverConnection.getResponseCode();
- //
- // if (responseCode != HttpURLConnection.HTTP_OK)
- // throw new BugzillaException("No Bugzilla server detected at " +
- // bugzillaServer.getStringValue() + ".");
- //
- // try {
- // configuration =
- // ProductConfigurationFactory.getInstance().getConfiguration(
- // bugzillaServer.getStringValue());
- // } catch (IOException ex) {
- // MessageDialog.openInformation(null, "Bugzilla query parameters
- // check",
- // "An error occurred while pre-fetching valid search attributes: \n\n"
- // + ex.getClass().getName()
- // + ": " + ex.getMessage() + "\n\nOffline submission of new bugs will
- // be disabled.");
- // }
- // } catch (Exception e) {
- // if (!MessageDialog.openQuestion(null, "Bugzilla Server Error", "Error
- // validating Bugzilla Server.\n\n"
- // + e.getMessage() + "\n\nKeep specified server location anyway?")) {
- // return false;
- // }
- // }
- // BugzillaPlugin.getDefault().setProductConfiguration(urlString,
- // configuration);
- // IPath configFile =
- // BugzillaPlugin.getDefault().getProductConfigurationCachePath(urlString);
- // if (configuration != null) {
- //
- // try {
- // ProductConfigurationFactory.getInstance().writeConfiguration(configuration,
- // configFile.toFile());
- // } catch (IOException e) {
- // BugzillaPlugin.log(e);
- // configFile.toFile().delete();
- // }
- // } else {
- // configFile.toFile().delete();
- // }
-
- // save the preferences that were changed
- // BugzillaPlugin.getDefault().savePluginPreferences();
-
- // bugzillaServer.store();
-
- // store the username and password from the editor field
- // user = bugzillaUser.getStringValue();
- // password = bugzillaPassword.getStringValue();
- // storeCache(user, password, true);
- return true;
- }
-
- @Override
- public boolean performCancel() {
- // refreshQueries.setSelection(getPreferenceStore().getBoolean(MylarTasksPlugin.REFRESH_QUERIES));
- return true;
- }
-
- @Override
- protected void initialize() {
- super.initialize();
- }
-
- public void init(IWorkbench workbench) {
- // Don't need to do anything here with the workbench
- }
-
- // /**
- // * Hack private class to make StringFieldEditor.refreshValidState() a
- // * publicly acessible method.
- // *
- // * @see org.eclipse.jface.preference.StringFieldEditor#refreshValidState()
- // */
- // private static class MyStringFieldEditor extends StringFieldEditor {
- // public MyStringFieldEditor(String name, String labelText, int style,
- // Composite parent) {
- // super(name, labelText, style, parent);
- // }
- //
- // @Override
- // public void refreshValidState() {
- // super.refreshValidState();
- // }
- //
- // @Override
- // public Text getTextControl() {
- // return super.getTextControl();
- // }
- // }
-
- public static final String INFO_PASSWORD = "org.eclipse.team.cvs.core.password"; //$NON-NLS-1$
-
- public static final String INFO_USERNAME = "org.eclipse.team.cvs.core.username"; //$NON-NLS-1$
-
- public static final String AUTH_SCHEME = "";
-}
diff --git a/org.eclipse.mylyn.ide.dev/developer/src-old/bugzilla/BugzillaProductPage.java b/org.eclipse.mylyn.ide.dev/developer/src-old/bugzilla/BugzillaProductPage.java
deleted file mode 100644
index 6e55e01f..00000000
--- a/org.eclipse.mylyn.ide.dev/developer/src-old/bugzilla/BugzillaProductPage.java
+++ /dev/null
@@ -1,472 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2008 Tasktop Technologies 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:
- * Tasktop Technologies - initial API and implementation
- * Eugene Kuleshov - improvements
- * Willian Mitsuda - improvements
- *******************************************************************************/
-
-package org.eclipse.mylyn.internal.bugzilla.ui.wizard;
-
-import java.io.IOException;
-import java.io.UnsupportedEncodingException;
-import java.lang.reflect.InvocationTargetException;
-import java.net.URLDecoder;
-import java.security.GeneralSecurityException;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.dialogs.IMessageProvider;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.layout.GridDataFactory;
-import org.eclipse.jface.operation.IRunnableWithProgress;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.viewers.IOpenListener;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.viewers.OpenEvent;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.wizard.WizardDialog;
-import org.eclipse.jface.wizard.WizardPage;
-import org.eclipse.mylyn.commons.core.StatusHandler;
-import org.eclipse.mylyn.internal.bugzilla.core.BugzillaAttribute;
-import org.eclipse.mylyn.internal.bugzilla.core.BugzillaCorePlugin;
-import org.eclipse.mylyn.internal.bugzilla.core.IBugzillaConstants;
-import org.eclipse.mylyn.internal.bugzilla.core.RepositoryConfiguration;
-import org.eclipse.mylyn.internal.bugzilla.ui.BugzillaUiPlugin;
-import org.eclipse.mylyn.tasks.core.AbstractRepositoryConnector;
-import org.eclipse.mylyn.tasks.core.IRepositoryQuery;
-import org.eclipse.mylyn.tasks.core.ITask;
-import org.eclipse.mylyn.tasks.core.TaskRepository;
-import org.eclipse.mylyn.tasks.ui.TasksUi;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.TreeItem;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.dialogs.FilteredTree;
-import org.eclipse.ui.dialogs.PatternFilter;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-import org.eclipse.ui.progress.UIJob;
-
-/**
- * Product selection page of new bug wizard
- *
- * @author Shawn Minto
- * @author Rob Elves
- * @author Mik Kersten
- */
-public class BugzillaProductPage extends WizardPage {
-
- private static final String NEW_BUGZILLA_TASK_ERROR_TITLE = Messages.BugzillaProductPage_New_Bugzilla_Task_Error;
-
- private static final String DESCRIPTION = Messages.BugzillaProductPage_PICK_PRODUCT_TO_OPEN_NEW_BUG_EDITOR
- + Messages.BugzillaProductPage_PRESS_UPDATE_BUTTON;
-
- private static final String LABEL_UPDATE = Messages.BugzillaProductPage_Update_Products_from_Repository;
-
- /** The list of products to submit a bug report for */
- private List<String> products = null;
-
- /**
- * Handle product selection
- */
- private FilteredTree productList;
-
- private final TaskRepository repository;
-
- protected IPreferenceStore prefs = BugzillaUiPlugin.getDefault().getPreferenceStore();
-
- /**
- * Constructor for BugzillaProductPage
- *
- * @param repository
- * The repository the data is coming from
- * @param workbench
- * The instance of the workbench
- * @param selection
- */
- public BugzillaProductPage(TaskRepository repository) {
- super(Messages.BugzillaProductPage_PAGE_1);
- setTitle(IBugzillaConstants.TITLE_NEW_BUG);
- setDescription(DESCRIPTION);
- this.repository = repository;
- setImageDescriptor(AbstractUIPlugin.imageDescriptorFromPlugin("org.eclipse.mylyn.bugzilla.ui", //$NON-NLS-1$
- "icons/wizban/bug-wizard.gif")); //$NON-NLS-1$
-
- }
-
- private class ComponentFilter extends PatternFilter {
-
- @Override
- public void setPattern(String patternString) {
- // ignore
- super.setPattern(patternString);
- // HACK: waiting on delayed refresh of filtered tree after setting the new pattern
- new UIJob("") { //$NON-NLS-1$
- @Override
- public IStatus runInUIThread(IProgressMonitor monitor) {
- if (BugzillaProductPage.this.getControl() != null
- && BugzillaProductPage.this.getControl().isDisposed()) {
- return Status.OK_STATUS;
- }
- final TreeViewer productViewer = productList.getViewer();
- if (productViewer.getTree().getItemCount() == 1) {
- TreeItem aq = productViewer.getTree().getItem(0);
- String qq = aq.getText();
- productViewer.setSelection(new StructuredSelection(qq));
- }
- return Status.OK_STATUS;
- }
- }.schedule(300L);
-
- }
- }
-
- @SuppressWarnings("deprecation")
- public void createControl(Composite parent) {
- // create the composite to hold the widgets
- Composite composite = new Composite(parent, SWT.NULL);
-
- // create the desired layout for this wizard page
- composite.setLayout(new GridLayout());
-
- // create the list of bug reports
- // TODO e3.5 move to new FilteredTree API
- productList = new FilteredTree(composite, SWT.SINGLE | SWT.BORDER, new ComponentFilter());
- productList.setLayoutData(GridDataFactory.swtDefaults().align(SWT.FILL, SWT.FILL).grab(true, true).hint(
- SWT.DEFAULT, 200).create());
- final TreeViewer productViewer = productList.getViewer();
- productViewer.setLabelProvider(new LabelProvider());
- productViewer.setContentProvider(new ITreeContentProvider() {
-
- public Object[] getChildren(Object parentElement) {
- if (parentElement instanceof Collection<?>) {
- return ((Collection<?>) parentElement).toArray();
- }
- return null;
- }
-
- public Object getParent(Object element) {
- return null;
- }
-
- public boolean hasChildren(Object element) {
- return false;
- }
-
- public Object[] getElements(Object inputElement) {
- return getChildren(inputElement);
- }
-
- public void dispose() {
- }
-
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
- }
- });
-
- productViewer.addOpenListener(new IOpenListener() {
- public void open(OpenEvent event) {
- if (getWizard().canFinish()) {
- if (getWizard().performFinish()) {
- ((WizardDialog) getContainer()).close();
- }
- }
- }
- });
-
- initProducts();
- productViewer.setInput(products);
- productViewer.addPostSelectionChangedListener(new ISelectionChangedListener() {
-
- public void selectionChanged(SelectionChangedEvent event) {
- // Initialize a variable with the no error status
- Status status = new Status(IStatus.OK, BugzillaUiPlugin.ID_PLUGIN, 0, "", null); //$NON-NLS-1$
- if (productViewer.getSelection().isEmpty()) {
- status = new Status(IStatus.ERROR, BugzillaUiPlugin.ID_PLUGIN, 0,
- Messages.BugzillaProductPage_YOU_MUST_SELECT_PRODUCT, null);
- }
-
- // Show the most serious error
- applyToStatusLine(status);
- isPageComplete();
- getWizard().getContainer().updateButtons();
- }
-
- });
-
- // HACK: waiting on delayed refresh of filtered tree
- final String[] selectedProducts = getSelectedProducts();
- if (selectedProducts.length > 0) {
- new UIJob("") { //$NON-NLS-1$
- @Override
- public IStatus runInUIThread(IProgressMonitor monitor) {
- if (BugzillaProductPage.this.getControl() != null
- && BugzillaProductPage.this.getControl().isDisposed()) {
- return Status.OK_STATUS;
- }
- productViewer.setSelection(new StructuredSelection(selectedProducts), true);
- productViewer.getControl().setFocus();
- return Status.OK_STATUS;
- }
- }.schedule(300L);
- } else {
- productList.setFocus();
- }
-
- Button updateButton = new Button(composite, SWT.LEFT | SWT.PUSH);
- updateButton.setText(LABEL_UPDATE);
- updateButton.setLayoutData(new GridData());
-
- updateButton.addSelectionListener(new SelectionAdapter() {
-
- @Override
- public void widgetSelected(SelectionEvent e) {
- updateProdcts();
- productViewer.setInput(products);
- }
- });
-
- Dialog.applyDialogFont(composite);
- // set the composite as the control for this page
- setControl(composite);
-
- isPageComplete();
- getWizard().getContainer().updateButtons();
- }
-
- private void initProducts() {
- // try to get the list of products from the server
- try {
- products = BugzillaCorePlugin.getRepositoryConfiguration(repository, false, new NullProgressMonitor())
- .getProducts();
-
- if (products.isEmpty()) {
- updateProdcts();
- }
-
- } catch (final CoreException e) {
- PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() {
- public void run() {
- MessageDialog.openError(Display.getDefault().getActiveShell(), NEW_BUGZILLA_TASK_ERROR_TITLE,
- Messages.BugzillaProductPage_Unable_to_get_products);
- }
- });
- }
- }
-
- private String[] getSelectedProducts() {
- IStructuredSelection selection = getSelection();
- if (selection == null) {
- return new String[0];
- }
-
- ArrayList<String> products = new ArrayList<String>();
-
- Object element = selection.getFirstElement();
- if (element instanceof ITask) {
- ITask bugzillaTask = (ITask) element;
- if (bugzillaTask.getAttribute(BugzillaAttribute.PRODUCT.getKey()) != null) {
- products.add(bugzillaTask.getAttribute(BugzillaAttribute.PRODUCT.getKey()));
- }
- } else {
- IRepositoryQuery query = null;
- if (element instanceof IRepositoryQuery) {
- query = (IRepositoryQuery) element;
- }
-
- if (query != null && query.getConnectorKind().equals(BugzillaCorePlugin.CONNECTOR_KIND)) {
- String queryUrl = query.getUrl();
- queryUrl = queryUrl.substring(queryUrl.indexOf("?") + 1); //$NON-NLS-1$
- String[] options = queryUrl.split("&"); //$NON-NLS-1$
-
- for (String option : options) {
- int index = option.indexOf("="); //$NON-NLS-1$
- if (index != -1) {
- String key = option.substring(0, index);
- if ("product".equals(key)) { //$NON-NLS-1$
- try {
- products.add(URLDecoder.decode(option.substring(index + 1),
- repository.getCharacterEncoding()));
- // TODO: list box only accepts a single selection so
- // we break on first found
- break;
- } catch (UnsupportedEncodingException ex) {
- // ignore
- }
- }
- }
- }
- } else {
- if (element instanceof IAdaptable) {
- IAdaptable adaptable = (IAdaptable) element;
- ITask task = (ITask) adaptable.getAdapter(ITask.class);
- if (task != null) {
- ITask bugzillaTask = (ITask) element;
- if (bugzillaTask.getAttribute(BugzillaAttribute.PRODUCT.getKey()) != null) {
- products.add(bugzillaTask.getAttribute(BugzillaAttribute.PRODUCT.getKey()));
- }
- }
- }
- }
- }
-
- return products.toArray(new String[products.size()]);
- }
-
- private IStructuredSelection getSelection() {
- IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
- ISelection selection = window.getSelectionService().getSelection();
- if (selection instanceof IStructuredSelection) {
- return (IStructuredSelection) selection;
- }
- return null;
- }
-
- /**
- * Applies the status to the status line of a dialog page.
- *
- * @param status
- * The status to apply to the status line
- */
- protected void applyToStatusLine(IStatus status) {
- String message = status.getMessage();
- if (message.length() == 0) {
- message = null;
- }
- switch (status.getSeverity()) {
- case IStatus.OK:
- setErrorMessage(null);
- setMessage(message);
- break;
- case IStatus.WARNING:
- setErrorMessage(null);
- setMessage(message, IMessageProvider.WARNING);
- break;
- case IStatus.INFO:
- setErrorMessage(null);
- setMessage(message, IMessageProvider.INFORMATION);
- break;
- default:
- setErrorMessage(null);
- setMessage(message, IMessageProvider.ERROR);
- break;
- }
- }
-
-// /**
-// * Save the currently selected product to the taskData when next is clicked
-// */
-// public void saveDataToModel() throws CoreException {
-// RepositoryTaskData model = bugWizard.taskData;
-// model.setAttributeValue(BugzillaReportElement.PRODUCT.getKey(), getSelectedProduct());
-// AbstractLegacyRepositoryConnector connector = (AbstractLegacyRepositoryConnector) TasksUi.getRepositoryManager()
-// .getRepositoryConnector(repository.getConnectorKind());
-// if (connector == null) {
-// throw new CoreException(new Status(IStatus.ERROR, BugzillaUiPlugin.PLUGIN_ID,
-// "Error AbstractRepositoryConnector could not been retrieved.\n\n"));
-// }
-// AbstractTaskDataHandler taskDataHandler = connector.getLegacyTaskDataHandler();
-// if (taskDataHandler == null) {
-// throw new CoreException(new Status(IStatus.ERROR, BugzillaUiPlugin.PLUGIN_ID,
-// "Error AbstractTaskDataHandler could not been retrieved.\n\n"));
-// }
-// taskDataHandler.initializeTaskData(repository, model, null);
-//
-// // platform/os are now set to All/All
-// BugzillaCorePlugin.getDefault().setPlatformDefaultsOrGuess(repository, model);
-// }
-
- public String getSelectedProduct() {
- return (String) ((IStructuredSelection) productList.getViewer().getSelection()).getFirstElement();
- }
-
- @Override
- public boolean isPageComplete() {
- return !productList.getViewer().getSelection().isEmpty();
-// return bugWizard.completed;
- }
-
- private void updateProdcts() {
- final AbstractRepositoryConnector connector = TasksUi.getRepositoryManager().getRepositoryConnector(
- repository.getConnectorKind());
- try {
- getContainer().run(true, true, new IRunnableWithProgress() {
- public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
- monitor.beginTask(Messages.BugzillaProductPage_Updating_repository_report_options_,
- IProgressMonitor.UNKNOWN);
- try {
- connector.updateRepositoryConfiguration(repository, monitor);
- } catch (CoreException e) {
- // TODO: remove exceptions from communication of connectivity errors to the user
- if (e.getStatus().getException() instanceof GeneralSecurityException) {
- StatusHandler.fail(new Status(IStatus.WARNING, BugzillaUiPlugin.ID_PLUGIN,
- "Bugzilla could not log you in to get the information you requested since login name or password is incorrect.\n" //$NON-NLS-1$
- + "Please ensure your task repository is properly configured.", e)); //$NON-NLS-1$
- } else if (e.getStatus().getException() instanceof IOException) {
- StatusHandler.fail(new Status(IStatus.WARNING, BugzillaUiPlugin.ID_PLUGIN,
- "Connection Error, please ensure your task repository is properly configured.", e)); //$NON-NLS-1$
- } else {
- StatusHandler.fail(new Status(IStatus.WARNING, BugzillaUiPlugin.ID_PLUGIN,
- "Error updating repository attributes for " + repository.getRepositoryUrl(), e)); //$NON-NLS-1$
- }
- return;
- }
-
- RepositoryConfiguration repositoryConfiguration = null;
- try {
- repositoryConfiguration = BugzillaCorePlugin.getRepositoryConfiguration(repository, false,
- monitor);
- } catch (final CoreException e) {
- PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() {
- public void run() {
- MessageDialog.openError(Display.getDefault().getActiveShell(),
- Messages.BugzillaProductPage_Bugzilla_Search_Page,
- Messages.BugzillaProductPage_Unable_to_get_configuration);
- }
- });
- }
- products = new ArrayList<String>();
- if (repositoryConfiguration != null) {
- for (String product : repositoryConfiguration.getProducts()) {
- products.add(product);
- }
- }
- }
- });
-
- } catch (InvocationTargetException ex) {
- MessageDialog.openError(null, Messages.BugzillaProductPage_Error_updating_product_list,
- Messages.BugzillaProductPage_Error_reported + ex.getCause().getMessage());
- } catch (InterruptedException ex) {
- // canceled
- }
- }
-
-}
diff --git a/org.eclipse.mylyn.ide.dev/developer/src-old/bugzilla/BugzillaQueryHit.java b/org.eclipse.mylyn.ide.dev/developer/src-old/bugzilla/BugzillaQueryHit.java
deleted file mode 100644
index fa123b7b..00000000
--- a/org.eclipse.mylyn.ide.dev/developer/src-old/bugzilla/BugzillaQueryHit.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 - 2006 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.mylyn.internal.bugzilla.core;
-
-import org.eclipse.mylyn.tasks.core.AbstractQueryHit;
-import org.eclipse.mylyn.tasks.core.AbstractTask;
-import org.eclipse.mylyn.tasks.core.TaskList;
-
-/**
- * @author Ken Sueda
- * @author Mik Kersten (hardening of prototype)
- */
-public class BugzillaQueryHit extends AbstractQueryHit {
-
- private String status;
-
- public BugzillaQueryHit(TaskList taskList, String description, String priority, String repositoryUrl, String id,
- BugzillaTask task, String status) {
- super(taskList, repositoryUrl, description, id);
- super.priority = priority;
- this.task = task;
- this.status = status;
- }
-
- @Override
- protected AbstractTask createTask() {
- return new BugzillaTask(this, true);
- }
-
- @Override
- public String getUrl() {
- return BugzillaClient.getBugUrlWithoutLogin(repositoryUrl, taskId);
- }
-
- @Override
- public boolean isCompleted() {
- if (status != null
- && (status.startsWith("RESO") || status.startsWith("CLO") || status.startsWith("VERI") || status
- .startsWith("FIXED"))) {
- return true;
- }
- return false;
- }
-}
diff --git a/org.eclipse.mylyn.ide.dev/developer/src-old/bugzilla/BugzillaQueryPageParser.java b/org.eclipse.mylyn.ide.dev/developer/src-old/bugzilla/BugzillaQueryPageParser.java
deleted file mode 100644
index 81e91fc9..00000000
--- a/org.eclipse.mylyn.ide.dev/developer/src-old/bugzilla/BugzillaQueryPageParser.java
+++ /dev/null
@@ -1,540 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003 - 2006 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.mylyn.internal.bugzilla.core.search;
-
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.Reader;
-import java.io.UnsupportedEncodingException;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.net.URLConnection;
-import java.net.URLEncoder;
-import java.text.ParseException;
-import java.util.ArrayList;
-
-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.jface.dialogs.ErrorDialog;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.mylyn.internal.bugzilla.core.BugzillaPlugin;
-import org.eclipse.mylyn.internal.bugzilla.core.IBugzillaConstants;
-import org.eclipse.mylyn.internal.bugzilla.core.internal.HtmlStreamTokenizer;
-import org.eclipse.mylyn.internal.bugzilla.core.internal.HtmlTag;
-import org.eclipse.mylyn.internal.bugzilla.core.internal.HtmlStreamTokenizer.Token;
-import org.eclipse.mylyn.provisional.tasklist.TaskRepository;
-
-/**
- * Class to parse the update data from the server
- *
- * author: kvesik
- *
- * created on: Feb 25, 2003
- *
- */
-public class BugzillaQueryPageParser {
-
- private static final String POST_ARGS_PASSWORD = "&Bugzilla_password=";
-
- private static final String POST_ARGS_LOGIN_FIRST = "&GoAheadAndLogIn=1&Bugzilla_login=";
-
- /** The name of the bugzilla server */
- private String urlString;
-
- /** The input stream */
- private BufferedReader in = null;
-
- /** True if the operation was successful */
- private boolean successful;
-
- /** Exception to be displayed if there was an error */
- private Exception exception;
-
- /** The progress monitor for the update */
- private IProgressMonitor monitor;
-
- /** Selection lists as ArrayLists */
- private ArrayList<String> statusValues = new ArrayList<String>();
-
- private ArrayList<String> preselectedStatusValues = new ArrayList<String>();
-
- private ArrayList<String> resolutionValues = new ArrayList<String>();
-
- private ArrayList<String> severityValues = new ArrayList<String>();
-
- private ArrayList<String> priorityValues = new ArrayList<String>();
-
- private ArrayList<String> hardwareValues = new ArrayList<String>();
-
- private ArrayList<String> osValues = new ArrayList<String>();
-
- private ArrayList<String> productValues = new ArrayList<String>();
-
- private ArrayList<String> componentValues = new ArrayList<String>();
-
- private ArrayList<String> versionValues = new ArrayList<String>();
-
- private ArrayList<String> targetValues = new ArrayList<String>();
-
- public BugzillaQueryPageParser(TaskRepository repository, IProgressMonitor monitor) throws LoginException, IOException {
- this.monitor = monitor;
-
- // get the servers url
- urlString = repository.getUrl() + "/query.cgi";
-
- // if we are dealing with 2.18 or higher we need to use the folowing in the
- // query string to get the right search page
- // UPDATE: There doesn't appear to be any harm in appending this to 2.18, 2.20, 2.20.1 and without it we
- // don't get the advanced view so 2.20 and 2.20.1 break
- //if (repository.getVersion().equals(BugzillaServerVersion.SERVER_218.toString())) {
- urlString += "?format=advanced";
- //}
-
- // use the user name and password if we have it
- if (repository.hasCredentials()) {
- try {
- // if we are dealing with 2.18 we already have the ? from before
- // so we need
- // an & instead. If other version, still add ?
- // if (repository.getVersion().equals(BugzillaServerVersion.SERVER_218.toString()))
- // urlString += "&";
- // else
- // urlString += "?";
-
- urlString += POST_ARGS_LOGIN_FIRST
- + URLEncoder.encode(repository.getUserName(), BugzillaPlugin.ENCODING_UTF_8)
- + POST_ARGS_PASSWORD
- + URLEncoder.encode(repository.getPassword(), BugzillaPlugin.ENCODING_UTF_8);
- } catch (UnsupportedEncodingException e) {
- /*
- * Do nothing. Every implementation of the Java platform is
- * required to support the standard charset
- * BugzillaPlugin.ENCODING_UTF_8
- */
- }
- }
-
- successful = false;
-
- // try to get the new options from the page
- parseDocument();
- if (!successful) {
- if (exception instanceof MalformedURLException) {
- MessageDialog
- .openError(
- null,
- "Unsupported Protocol",
- "The server that was specified for Bugzilla is not supported by your JVM.\nPlease make sure that you are using a JDK that supports SSL.");
- } else {
-// throw exception
- // if there was a problem with the operation, display an error
- // message
- ErrorDialog.openError(null, IBugzillaConstants.TITLE_MESSAGE_DIALOG, "Bugzilla could not complete the the update.",
- new Status(IStatus.ERROR, IBugzillaConstants.PLUGIN_ID, IStatus.OK, "url may be invalid",
- exception));
- }
- }
- }
-
- /**
- * Get whether the update was successful
- *
- * @return <code>true</code> if the update was successful
- */
- public boolean wasSuccessful() {
- return successful;
- }
-
- /**
- * Parse the data from the server for the query options
- * @throws IOException
- */
- private void parseDocument() throws LoginException, IOException {
- try {
- // if the operation has been cancelled already, return
- if (monitor.isCanceled()) {
- monitor.done();
- return;
- }
-
- // try to connect to the server
- monitor.subTask("Connecting to server");
-
- URL url = new URL(this.urlString);
- URLConnection cntx = BugzillaPlugin.getDefault().getUrlConnection(url);
-
- if (cntx != null) {
- InputStream input = cntx.getInputStream();
- if (input != null) {
-
- monitor.worked(1);
-
- // initialize the input stream
- in = new BufferedReader(new InputStreamReader(input));
-
- // increment the position of the status monitor
- monitor.worked(2);
-
- // check if the operation has been cancelled so we can end
- // if it has been
- if (monitor.isCanceled())
- monitor.done();
- else
- monitor.subTask("Reading values from server");
-
- // parse the data from the server
- parseQueryPage(in);
-
- // set the operation to being successful
- successful = true;
- }
- }
-
- } catch (LoginException e) {
- throw e;
- } catch (IOException e) {
- throw e;
- } catch (Exception e) {
- // if we can't connect, log the problem and save the exception to
- // handle later
- monitor.done();
- exception = e;
- BugzillaPlugin.log(new Status(IStatus.ERROR, IBugzillaConstants.PLUGIN_ID, IStatus.OK,
- "Failed to create URL and open input stream: " + urlString, e));
- return;
- } finally {
- try {
- if (in != null)
- in.close();
- } catch (IOException exitAnyway) {
- in = null;
- }
- }
- }
-
- /**
- * Check if all of the lists of options are empty
- *
- * @return true if all of the options lists are empty
- */
- private boolean allListsEmpty() {
- return statusValues.isEmpty() && preselectedStatusValues.isEmpty() && resolutionValues.isEmpty()
- && severityValues.isEmpty() && priorityValues.isEmpty() && hardwareValues.isEmpty()
- && osValues.isEmpty() && productValues.isEmpty() && componentValues.isEmpty()
- && versionValues.isEmpty() && targetValues.isEmpty();
- }
-
- /**
- * Get the new status values
- *
- * @return An array of the new status values
- */
- public String[] getStatusValues() {
- String[] array = new String[statusValues.size()];
-
- // create the array and return it
- for (int i = 0; i < statusValues.size(); i++)
- array[i] = statusValues.get(i);
- return array;
- }
-
- /**
- * Get the new preselected status values
- *
- * @return An array of the new preselected status values
- */
- public String[] getPreselectedStatusValues() {
- String[] array = new String[preselectedStatusValues.size()];
-
- // create the array and return it
- for (int i = 0; i < preselectedStatusValues.size(); i++)
- array[i] = preselectedStatusValues.get(i);
- return array;
- }
-
- /**
- * Get the new resolution values
- *
- * @return An array of the new resolution values
- */
- public String[] getResolutionValues() {
- String[] array = new String[resolutionValues.size()];
-
- // create the array and return it
- for (int i = 0; i < resolutionValues.size(); i++)
- array[i] = resolutionValues.get(i);
- return array;
- }
-
- /**
- * Get the new severity values
- *
- * @return An array of the new severity values
- */
- public String[] getSeverityValues() {
- String[] array = new String[severityValues.size()];
-
- // create the array and return it
- for (int i = 0; i < severityValues.size(); i++)
- array[i] = severityValues.get(i);
- return array;
- }
-
- /**
- * Get the new priority values
- *
- * @return An array of the new priority values
- */
- public String[] getPriorityValues() {
- String[] array = new String[priorityValues.size()];
-
- // create the array and return it
- for (int i = 0; i < priorityValues.size(); i++)
- array[i] = priorityValues.get(i);
- return array;
- }
-
- /**
- * Get the new hardware values
- *
- * @return An array of the new hardware values
- */
- public String[] getHardwareValues() {
- String[] array = new String[hardwareValues.size()];
-
- // create the array and return it
- for (int i = 0; i < hardwareValues.size(); i++)
- array[i] = hardwareValues.get(i);
- return array;
- }
-
- /**
- * Get the new OS values
- *
- * @return An array of the new OS values
- */
- public String[] getOSValues() {
- String[] array = new String[osValues.size()];
-
- // create the array and return it
- for (int i = 0; i < osValues.size(); i++)
- array[i] = osValues.get(i);
- return array;
- }
-
- /**
- * Get the new product values
- *
- * @return An array of the new product values
- */
- public String[] getProductValues() {
- String[] array = new String[productValues.size()];
-
- // create the array and return it
- for (int i = 0; i < productValues.size(); i++)
- array[i] = productValues.get(i);
- return array;
- }
-
- /**
- * Get the new component values
- *
- * @return An array of the new component values
- */
- public String[] getComponentValues() {
- String[] array = new String[componentValues.size()];
-
- // create the array and return it
- for (int i = 0; i < componentValues.size(); i++)
- array[i] = componentValues.get(i);
- return array;
- }
-
- /**
- * Get the new version values
- *
- * @return An array of the new version values
- */
- public String[] getVersionValues() {
- String[] array = new String[versionValues.size()];
-
- // create the array and return it
- for (int i = 0; i < versionValues.size(); i++)
- array[i] = versionValues.get(i);
- return array;
- }
-
- /**
- * Get the new milestone values
- *
- * @return An array of the new milestone values
- */
- public String[] getTargetValues() {
- String[] array = new String[targetValues.size()];
-
- // create the array and return it
- for (int i = 0; i < targetValues.size(); i++)
- array[i] = targetValues.get(i);
- return array;
- }
-
- /**
- * Parse the bugzilla query.cgi page for some seach options
- *
- * @param inputReader
- * The input stream for the page
- * @throws LoginException
- * @throws ParseException
- * @throws IOException
- */
- private void parseQueryPage(Reader inputReader) throws LoginException, ParseException, IOException {
- HtmlStreamTokenizer tokenizer = new HtmlStreamTokenizer(inputReader, null);
-
- boolean isTitle = false;
- boolean possibleBadLogin = false;
- String title = "";
-
- for (HtmlStreamTokenizer.Token token = tokenizer.nextToken(); token.getType() != Token.EOF; token = tokenizer
- .nextToken()) {
-
- // make sure that bugzilla doesn't want us to login
- if (token.getType() == Token.TAG && ((HtmlTag) (token.getValue())).getTagType() == HtmlTag.Type.TITLE
- && !((HtmlTag) (token.getValue())).isEndTag()) {
- isTitle = true;
- continue;
- }
-
- if (isTitle) {
- // get all of the data in the title tag to compare with
- if (token.getType() != Token.TAG) {
- title += ((StringBuffer) token.getValue()).toString().toLowerCase() + " ";
- continue;
- } else if (token.getType() == Token.TAG
- && ((HtmlTag) token.getValue()).getTagType() == HtmlTag.Type.TITLE
- && ((HtmlTag) token.getValue()).isEndTag()) {
- // check if the title looks like we may have a problem with
- // login
- if ((title.indexOf("login") != -1
- || (title.indexOf("invalid") != -1 && title.indexOf("password") != -1)
- || title.indexOf("check e-mail") != -1 || title.indexOf("error") != -1))
- possibleBadLogin = true;
- isTitle = false;
- title = "";
- }
- continue;
- }
-
- // we have found the start of attribute values
- if (token.getType() == Token.TAG) {
- HtmlTag tag = (HtmlTag) token.getValue();
- if (tag.getTagType() == HtmlTag.Type.TD && "left".equalsIgnoreCase(tag.getAttribute("align"))) {
- // parse the attribute values
- parseAttributeValue(tokenizer);
- continue;
- }
- }
- }
-
- // if all of the lists are empty and we suspect bad login info, assume
- // that it was a bad login
- if (possibleBadLogin && allListsEmpty())
- throw new LoginException(IBugzillaConstants.MESSAGE_LOGIN_FAILURE);
- }
-
- /**
- * Parse the case where the attribute value is an option
- *
- * @param parameterName
- * The name of the attribute value
- * @param tokenizer
- * The tokenizer to get data from the stream
- * @throws IOException
- * @throws ParseException
- */
- private void parseSelect(String parameterName, HtmlStreamTokenizer tokenizer) throws IOException, ParseException {
-
- HtmlStreamTokenizer.Token token = tokenizer.nextToken();
- while (token.getType() != Token.EOF) {
- if (token.getType() == Token.TAG) {
- HtmlTag tag = (HtmlTag) token.getValue();
- if (tag.getTagType() == HtmlTag.Type.SELECT && tag.isEndTag())
- break;
- if (tag.getTagType() == HtmlTag.Type.OPTION && !tag.isEndTag()) {
- String optionName = tag.getAttribute("value");
- boolean selected = tag.hasAttribute("selected");
- StringBuffer optionText = new StringBuffer();
- for (token = tokenizer.nextToken(); token.getType() == Token.TEXT; token = tokenizer.nextToken()) {
- if (optionText.length() > 0) {
- optionText.append(' ');
- }
- optionText.append((StringBuffer) token.getValue());
- }
- // add the value to the appropriate list of attributes
- if (parameterName.equals("bug_status")) {
- statusValues.add(optionName);
-
- // check if the status is to be preselected or not
- if (selected)
- preselectedStatusValues.add(optionName);
- } else if (parameterName.equals("resolution"))
- resolutionValues.add(optionName);
- else if (parameterName.equals("bug_severity"))
- severityValues.add(optionName);
- else if (parameterName.equals("priority"))
- priorityValues.add(optionName);
- else if (parameterName.equals("rep_platform"))
- hardwareValues.add(optionName);
- else if (parameterName.equals("op_sys"))
- osValues.add(optionName);
- else if (parameterName.equals("product"))
- productValues.add(optionName);
- else if (parameterName.equals("component"))
- componentValues.add(optionName);
- else if (parameterName.equals("version"))
- versionValues.add(optionName);
- else if (parameterName.equals("target_milestone"))
- targetValues.add(optionName);
- } else {
- token = tokenizer.nextToken();
- }
- } else {
- token = tokenizer.nextToken();
- }
- }
- }
-
- /**
- * Parse the case where we think we found an attribute value
- *
- * @param tokenizer
- * The tokenizer to get the data from the stream
- * @throws IOException
- * @throws ParseException
- */
- private void parseAttributeValue(HtmlStreamTokenizer tokenizer) throws IOException, ParseException {
-
- HtmlStreamTokenizer.Token token = tokenizer.nextToken();
- if (token.getType() == Token.TAG) {
- HtmlTag tag = (HtmlTag) token.getValue();
- if (tag.getTagType() == HtmlTag.Type.SELECT && !tag.isEndTag()) {
- String parameterName = tag.getAttribute("name");
- parseSelect(parameterName, tokenizer);
- } else if (tag.getTagType() == HtmlTag.Type.LABEL && !tag.isEndTag()) {
- parseAttributeValue(tokenizer);
- }
- }
- }
-}
diff --git a/org.eclipse.mylyn.ide.dev/developer/src-old/bugzilla/BugzillaReportSubmitForm.java b/org.eclipse.mylyn.ide.dev/developer/src-old/bugzilla/BugzillaReportSubmitForm.java
deleted file mode 100644
index 604027d0..00000000
--- a/org.eclipse.mylyn.ide.dev/developer/src-old/bugzilla/BugzillaReportSubmitForm.java
+++ /dev/null
@@ -1,738 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003 - 2006 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.mylyn.internal.bugzilla.core;
-
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.StringReader;
-import java.io.UnsupportedEncodingException;
-import java.security.GeneralSecurityException;
-import java.text.ParseException;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import org.apache.commons.httpclient.NameValuePair;
-import org.apache.commons.httpclient.methods.PostMethod;
-import org.eclipse.mylyn.internal.tasks.core.HtmlStreamTokenizer;
-import org.eclipse.mylyn.internal.tasks.core.HtmlTag;
-import org.eclipse.mylyn.internal.tasks.core.HtmlStreamTokenizer.Token;
-import org.eclipse.mylyn.tasks.core.RepositoryOperation;
-import org.eclipse.mylyn.tasks.core.RepositoryTaskAttribute;
-import org.eclipse.mylyn.tasks.core.RepositoryTaskData;
-
-/**
- *
- * @author Shawn Minto
- * @author Mik Kersten (hardening of prototype)
- * @author Rob Elves
- *
- * Class to handle the positing of a bug
- */
-public class BugzillaReportSubmitForm {
-
- private static final String KEY_ID = "id";
-
- private static final String VAL_TRUE = "true";
-
- private static final String KEY_REMOVECC = "removecc";
-
- private static final String KEY_CC = "cc";
-
- // private static final String POST_CONTENT_TYPE =
- // "application/x-www-form-urlencoded";
- //
- // private static final String REQUEST_PROPERTY_CONTENT_TYPE =
- // "Content-Type";
- //
- // private static final String REQUEST_PROPERTY_CONTENT_LENGTH =
- // "Content-Length";
- //
- // private static final String METHOD_POST = "POST";
- //
- // private static final String KEY_BUGZILLA_PASSWORD = "Bugzilla_password";
- //
- // private static final String KEY_BUGZILLA_LOGIN = "Bugzilla_login";
- // private URL postUrl;
- // private Proxy proxySettings = Proxy.NO_PROXY;
- // private String charset;
-
- private static final String POST_BUG_CGI = "/post_bug.cgi";
-
- private static final String PROCESS_BUG_CGI = "/process_bug.cgi";
-
- public static final int WRAP_LENGTH = 90;
-
- private static final String VAL_PROCESS_BUG = "process_bug";
-
- private static final String KEY_FORM_NAME = "form_name";
-
- private static final String VAL_NONE = "none";
-
- private static final String KEY_KNOB = "knob";
-
- // TODO change to BugzillaReportElement.ADD_COMMENT
- private static final String KEY_COMMENT = "comment";
-
- private static final String KEY_SHORT_DESC = "short_desc";
-
- public static final String FORM_POSTFIX_218 = IBugzillaConstants.FORM_POSTFIX_218;
-
- public static final String FORM_POSTFIX_216 = IBugzillaConstants.FORM_POSTFIX_216;
-
- public static final String FORM_PREFIX_BUG_218 = IBugzillaConstants.FORM_PREFIX_BUG_218;
-
- public static final String FORM_PREFIX_BUG_220 = IBugzillaConstants.FORM_PREFIX_BUG_220;
-
- /** The fields that are to be changed/maintained */
- // private List<NameValuePair> fields = new ArrayList<NameValuePair>();
- private Map<String, NameValuePair> fields = new HashMap<String, NameValuePair>();
-
- /** The prefix for how to find the bug number from the return */
- private String prefix;
-
- private String prefix2;
-
- /** The postfix for how to find the bug number from the return */
- private String postfix;
-
- /** An alternate postfix for how to find the bug number from the return */
- private String postfix2;
-
- private String error = null;
-
- private RepositoryTaskData taskData = null;
-
- public boolean isNewBugPost = false;
-
- public BugzillaReportSubmitForm() {
- // charset = charEncoding;
- }
-
- public static BugzillaReportSubmitForm makeNewBugPost(String repositoryUrl, String userName, String password,
- String characterEncoding, RepositoryTaskData model, boolean wrapDescription)
- throws UnsupportedEncodingException {
-
- BugzillaReportSubmitForm form = new BugzillaReportSubmitForm();
-
- // if (characterEncoding != null) {
- // form = new BugzillaReportSubmitForm(characterEncoding);
- // } else {
- // form = new
- // BugzillaReportSubmitForm(IBugzillaConstants.ENCODING_UTF_8);
- // }
-
- form.setTaskData(model);
-
- form.setPrefix(IBugzillaConstants.FORM_PREFIX_BUG_218);
- form.setPrefix2(IBugzillaConstants.FORM_PREFIX_BUG_220);
-
- form.setPostfix(IBugzillaConstants.FORM_POSTFIX_216);
- form.setPostfix2(IBugzillaConstants.FORM_POSTFIX_218);
-
- // setConnectionsSettings(form, repositoryUrl, userName, password,
- // proxySettings, POST_BUG_CGI);
-
- // go through all of the attributes and add them to
- // the bug post
- Iterator<RepositoryTaskAttribute> itr = model.getAttributes().iterator();
- while (itr.hasNext()) {
- RepositoryTaskAttribute a = itr.next();
- if (a != null && a.getID() != null && a.getID().compareTo("") != 0) {
- String value = null;
- value = a.getValue();
- if (value == null)
- continue;
- form.add(a.getID(), value);
- }
- }
-
- // form.add(KEY_BUG_FILE_LOC, "");
-
- // specify the product
- form.add(BugzillaReportElement.PRODUCT.getKeyString(), model.getProduct());
-
- // add the summary to the bug post
- form.add(BugzillaReportElement.SHORT_DESC.getKeyString(), model.getSummary());
-
- String formattedDescription = formatTextToLineWrap(model.getDescription(), wrapDescription);
-