From 216f5da396b8504ab78a7a3df368f018b7f6070a Mon Sep 17 00:00:00 2001 From: Laszlo Kishalmi Date: Fri, 4 Apr 2025 19:12:15 -0700 Subject: [PATCH 1/2] Removed old, now defunct, Mylyn Integration --- ide/bugtracking.commons/nbproject/project.xml | 7 - .../bugtracking/jira/Bundle.properties | 21 - .../bugtracking/jira/FakeJiraConnector.java | 200 - .../ui/selectors/RepositorySelector.java | 19 - ide/bugzilla/build.xml | 25 - ide/bugzilla/licenseinfo.xml | 39 - ide/bugzilla/manifest.mf | 6 - .../org-netbeans-modules-bugzilla.sig | 30 - ide/bugzilla/nbproject/project.properties | 31 - ide/bugzilla/nbproject/project.xml | 312 -- .../netbeans/modules/bugzilla/Bugzilla.java | 259 - .../modules/bugzilla/BugzillaConfig.java | 226 - .../modules/bugzilla/BugzillaConnector.java | 77 - .../bugzilla/BugzillaIssueProvider.java | 99 - .../bugzilla/BugzillaQueryProvider.java | 77 - .../bugzilla/BugzillaRepositoryProvider.java | 117 - .../modules/bugzilla/Bundle.properties | 32 - .../MylynRepositoryConnectorProvider.java | 57 - .../modules/bugzilla/api/NBBugzillaUtils.java | 148 - .../autoupdate/BugzillaAutoupdate.java | 135 - .../commands/AddAttachmentCommand.java | 94 - .../bugzilla/commands/BugzillaExecutor.java | 612 --- .../bugzilla/commands/Bundle.properties | 36 - .../commands/GetAttachmentCommand.java | 69 - .../commands/GetConfigurationCommand.java | 70 - .../modules/bugzilla/commands/HtmlPanel.form | 89 - .../modules/bugzilla/commands/HtmlPanel.java | 117 - .../bugzilla/commands/ValidateCommand.java | 93 - .../issue/AttachmentHyperlinkSupport.java | 172 - .../modules/bugzilla/issue/BugzillaIssue.java | 1694 ------ .../issue/BugzillaIssueController.java | 102 - .../bugzilla/issue/BugzillaIssueNode.java | 277 - .../modules/bugzilla/issue/Bundle.properties | 267 - .../modules/bugzilla/issue/CommentsPanel.java | 592 --- .../modules/bugzilla/issue/IssuePanel.form | 1967 ------- .../modules/bugzilla/issue/IssuePanel.java | 4542 ----------------- .../bugzilla/issue/ResolveIssuePanel.form | 195 - .../bugzilla/issue/ResolveIssuePanel.java | 247 - .../modules/bugzilla/query/BugzillaQuery.java | 426 -- .../query/BugzillaQueryCellRenderer.java | 55 - .../modules/bugzilla/query/Bundle.properties | 149 - .../bugzilla/query/QueryController.java | 1307 ----- .../bugzilla/query/QueryNotifyListener.java | 52 - .../modules/bugzilla/query/QueryPanel.form | 2109 -------- .../modules/bugzilla/query/QueryPanel.java | 1479 ------ .../bugzilla/query/QueryParameter.java | 675 --- .../repository/BugzillaConfiguration.java | 324 -- .../repository/BugzillaRepository.java | 757 --- .../BugzillaRepositoryController.java | 472 -- .../bugzilla/repository/Bundle.properties | 118 - .../bugzilla/repository/CustomIssueField.java | 64 - .../bugzilla/repository/IssueField.java | 106 - .../bugzilla/repository/NBLoginPanel.form | 160 - .../bugzilla/repository/NBLoginPanel.java | 227 - .../repository/NBRepositorySupport.java | 185 - .../bugzilla/repository/RepositoryPanel.form | 392 -- .../bugzilla/repository/RepositoryPanel.java | 306 -- .../modules/bugzilla/resources/conflict.png | Bin 746 -> 0 bytes .../modules/bugzilla/resources/error.gif | Bin 723 -> 0 bytes .../modules/bugzilla/resources/error.svg | 49 - .../modules/bugzilla/resources/info.png | Bin 766 -> 0 bytes .../modules/bugzilla/resources/info.svg | 45 - .../modules/bugzilla/resources/p1.png | Bin 324 -> 0 bytes .../modules/bugzilla/resources/p2.png | Bin 310 -> 0 bytes .../modules/bugzilla/resources/p3.png | Bin 367 -> 0 bytes .../modules/bugzilla/resources/p4.png | Bin 370 -> 0 bytes .../modules/bugzilla/resources/p5.png | Bin 438 -> 0 bytes .../modules/bugzilla/resources/remote.png | Bin 723 -> 0 bytes .../modules/bugzilla/resources/repository.png | Bin 597 -> 0 bytes .../bugzilla/resources/unsubmitted.png | Bin 748 -> 0 bytes .../modules/bugzilla/resources/warning.gif | Bin 585 -> 0 bytes .../modules/bugzilla/resources/warning.svg | 43 - .../bugzilla/util/BugzillaConstants.java | 72 - .../modules/bugzilla/util/BugzillaUtil.java | 196 - .../modules/bugzilla/util/Bundle.properties | 20 - .../modules/bugzilla/util/FileUtils.java | 308 -- .../bugzilla/util/NbBugzillaConstants.java | 29 - .../modules/bugzilla/BugzillaTest.java | 483 -- .../netbeans/modules/bugzilla/HtmlPanel.form | 67 - .../netbeans/modules/bugzilla/HtmlPanel.java | 76 - .../netbeans/modules/bugzilla/LogHandler.java | 121 - .../modules/bugzilla/MylynStorageTest.java | 1220 ----- .../modules/bugzilla/TestConstants.java | 46 - .../bugzilla/TestQueryNotifyListener.java | 69 - .../netbeans/modules/bugzilla/TestUtil.java | 199 - .../autoupdate/BugzillaNotSupportedTest.java | 52 - .../autoupdate/BugzillaPluginUCTest.java | 210 - .../autoupdate/BugzillaSupportedTest.java | 53 - .../commands/ExceptionHandlerTest.java | 232 - .../issue/AttachmentHyperlinkSupportTest.java | 243 - .../bugzilla/issue/CurrentNBVersionTest.java | 59 - .../modules/bugzilla/issue/IssueTest.java | 376 -- .../bugzilla/issue/IssueTestUtils.java | 32 - .../modules/bugzilla/issue/OpenIssueTest.java | 68 - .../bugzilla/issue/ShowLogActionTest.java | 55 - .../bugzilla/query/ControllerTest.java | 205 - .../bugzilla/query/IssueTableTest.java | 115 - .../bugzilla/query/QueryConstants.java | 39 - .../bugzilla/query/QueryParameterTest.java | 284 -- .../bugzilla/query/QueryRefreshTest.java | 113 - .../modules/bugzilla/query/QueryTest.java | 411 -- .../modules/bugzilla/query/QueryTestUtil.java | 52 - .../repository/RepositoryControllerTest.java | 211 - .../bugzilla/repository/RepositoryTest.java | 167 - ide/localtasks/build.xml | 25 - ide/localtasks/licenseinfo.xml | 31 - ide/localtasks/manifest.mf | 5 - ide/localtasks/nbproject/project.properties | 21 - ide/localtasks/nbproject/project.xml | 157 - .../modules/localtasks/Bundle.properties | 24 - .../modules/localtasks/IssueProviderImpl.java | 101 - .../IssueSchedulingProviderImpl.java | 48 - .../localtasks/IssueStatusProviderImpl.java | 58 - .../modules/localtasks/LocalQuery.java | 115 - .../modules/localtasks/LocalRepository.java | 322 -- .../localtasks/LocalRepositoryConfig.java | 77 - .../localtasks/LocalTaskConnector.java | 48 - .../modules/localtasks/QueryProviderImpl.java | 77 - .../localtasks/RepositoryProviderImpl.java | 102 - .../modules/localtasks/resources/error.gif | Bin 723 -> 0 bytes .../modules/localtasks/resources/error.svg | 49 - .../modules/localtasks/resources/info.png | Bin 766 -> 0 bytes .../modules/localtasks/resources/info.svg | 45 - .../localtasks/resources/local_repo.png | Bin 669 -> 0 bytes .../modules/localtasks/resources/warning.gif | Bin 585 -> 0 bytes .../modules/localtasks/resources/warning.svg | 43 - .../localtasks/task/AddSubtaskPanel.form | 91 - .../localtasks/task/AddSubtaskPanel.java | 137 - .../modules/localtasks/task/Bundle.properties | 45 - .../modules/localtasks/task/LocalTask.java | 793 --- .../localtasks/task/SubtaskTableModel.java | 114 - .../localtasks/task/TaskController.java | 135 - .../modules/localtasks/task/TaskPanel.form | 590 --- .../modules/localtasks/task/TaskPanel.java | 1429 ------ .../modules/localtasks/util/FileUtils.java | 354 -- ide/mylyn.util/build.xml | 25 - ide/mylyn.util/licenseinfo.xml | 29 - ide/mylyn.util/manifest.mf | 8 - .../org-netbeans-modules-mylyn-util.sig | 1049 ---- ide/mylyn.util/nbproject/project.properties | 19 - ide/mylyn.util/nbproject/project.xml | 162 - .../mylyn/util/AbstractNbTaskWrapper.java | 832 --- .../modules/mylyn/util/AccessorImpl.java | 88 - .../mylyn/util/BugtrackingCommand.java | 55 - .../modules/mylyn/util/Bundle.properties | 23 - .../mylyn/util/CancelableProgressMonitor.java | 65 - .../mylyn/util/GetAttachmentCommand.java | 98 - .../mylyn/util/GetMultiTaskDataCommand.java | 89 - .../mylyn/util/GetTaskDataCommand.java | 76 - .../modules/mylyn/util/MylynSupport.java | 861 ---- .../modules/mylyn/util/MylynUtils.java | 211 - .../modules/mylyn/util/NbDateRange.java | 94 - .../netbeans/modules/mylyn/util/NbTask.java | 278 - .../modules/mylyn/util/NbTaskDataModel.java | 265 - .../modules/mylyn/util/NbTaskDataState.java | 52 - .../modules/mylyn/util/NbTaskListener.java | 70 - .../mylyn/util/PerformQueryCommand.java | 90 - .../mylyn/util/PostAttachmentCommand.java | 104 - .../util/RepositoryConnectorProvider.java | 35 - .../modules/mylyn/util/SubmitCommand.java | 91 - .../modules/mylyn/util/TaskDataListener.java | 60 - .../mylyn/util/UnsubmittedTasksContainer.java | 132 - .../modules/mylyn/util/WikiPanel.java | 46 - .../modules/mylyn/util/WikiUtils.java | 110 - .../mylyn/util/commands/CommandFactory.java | 201 - .../util/commands/CommandsAccessorImpl.java | 39 - .../util/commands/GetAttachmentCommand.java | 99 - .../commands/GetRepositoryTasksCommand.java | 129 - .../util/commands/PostAttachmentCommand.java | 105 - .../util/commands/SimpleQueryCommand.java | 127 - .../util/commands/SubmitTaskCommand.java | 163 - .../commands/SynchronizeQueryCommand.java | 242 - .../commands/SynchronizeTasksCommand.java | 106 - .../modules/mylyn/util/internal/Accessor.java | 68 - .../mylyn/util/internal/CommandsAccessor.java | 51 - .../util/internal/ModuleLifecycleManager.java | 43 - .../mylyn/util/internal/TaskListener.java | 33 - .../util/localtasks/AbstractLocalTask.java | 48 - .../mylyn/util/localtasks/IssueField.java | 55 - .../internal/LocalTaskDataHandler.java | 69 - .../modules/mylyn/util/resources/edit.png | Bin 658 -> 0 bytes .../modules/mylyn/util/resources/layer.xml | 36 - .../modules/mylyn/util/resources/preview.png | Bin 788 -> 0 bytes .../modules/mylyn/util/wiki/Bundle.properties | 20 - .../mylyn/util/wiki/WikiEditPanel.form | 169 - .../mylyn/util/wiki/WikiEditPanel.java | 365 -- ide/o.apache.commons.httpclient/build.xml | 38 - .../external/binaries-list | 17 - .../commons-httpclient-3.1-license.txt | 208 - .../commons-httpclient-3.1-notice.txt | 5 - ide/o.apache.commons.httpclient/manifest.mf | 2 - .../nbproject/project.properties | 18 - .../nbproject/project.xml | 51 - ide/o.apache.commons.lang/build.xml | 25 - .../external/binaries-list | 17 - .../external/commons-lang-2.6-license.txt | 208 - .../external/commons-lang-2.6-notice.txt | 6 - ide/o.apache.commons.lang/manifest.mf | 1 - .../nbproject/project.properties | 19 - .../nbproject/project.xml | 35 - ide/o.apache.ws.commons.util/build.xml | 37 - .../external/binaries-list | 17 - .../ws-commons-util-1.0.1-license.txt | 208 - ide/o.apache.ws.commons.util/manifest.mf | 1 - .../nbproject/project.properties | 18 - .../nbproject/project.xml | 35 - ide/o.apache.xmlrpc/build.xml | 39 - ide/o.apache.xmlrpc/external/binaries-list | 19 - .../external/xmlrpc-3.1.3-license.txt | 209 - ide/o.apache.xmlrpc/manifest.mf | 1 - .../nbproject/project.properties | 20 - ide/o.apache.xmlrpc/nbproject/project.xml | 50 - ide/o.eclipse.mylyn.bugzilla.core/build.xml | 25 - .../external/binaries-list | 17 - ...lla.core_3.17.0.v20150828-2026-license.txt | 72 - ide/o.eclipse.mylyn.bugzilla.core/manifest.mf | 1 - .../nbproject/project.properties | 19 - .../nbproject/project.xml | 35 - ide/o.eclipse.mylyn.commons.core/build.xml | 25 - .../external/binaries-list | 17 - ...ons.core_3.17.0.v20150625-2042-license.txt | 72 - ide/o.eclipse.mylyn.commons.core/manifest.mf | 1 - .../nbproject/project.properties | 19 - .../nbproject/project.xml | 35 - ide/o.eclipse.mylyn.commons.net/build.xml | 25 - .../external/binaries-list | 17 - ...mons.net_3.17.0.v20150706-2057-license.txt | 72 - ide/o.eclipse.mylyn.commons.net/manifest.mf | 1 - .../nbproject/project.properties | 19 - .../nbproject/project.xml | 35 - .../build.xml | 25 - .../external/binaries-list | 17 - ...ries.core_1.9.0.v20150625-2042-license.txt | 72 - .../manifest.mf | 1 - .../nbproject/project.properties | 19 - .../nbproject/project.xml | 35 - ide/o.eclipse.mylyn.commons.xmlrpc/build.xml | 25 - .../external/binaries-list | 17 - ...s.xmlrpc_3.17.0.v20150625-2042-license.txt | 72 - .../manifest.mf | 1 - .../nbproject/project.properties | 19 - .../nbproject/project.xml | 35 - ide/o.eclipse.mylyn.tasks.core/build.xml | 25 - .../external/binaries-list | 17 - ...sks.core_3.17.0.v20150828-2026-license.txt | 72 - ide/o.eclipse.mylyn.tasks.core/manifest.mf | 1 - .../nbproject/project.properties | 19 - .../nbproject/project.xml | 35 - .../build.xml | 25 - .../external/binaries-list | 17 - ...ence.core_2.6.0.v20150901-2143-license.txt | 94 - .../manifest.mf | 1 - .../nbproject/project.properties | 19 - .../nbproject/project.xml | 35 - ide/o.eclipse.mylyn.wikitext.core/build.xml | 25 - .../external/binaries-list | 17 - ...50901-2143-patched-nosignature-license.txt | 94 - ide/o.eclipse.mylyn.wikitext.core/manifest.mf | 1 - .../nbproject/project.properties | 19 - .../nbproject/project.xml | 35 - .../build.xml | 25 - .../external/binaries-list | 17 - ...down.core_2.6.0.v20150901-2143-license.txt | 95 - .../manifest.mf | 1 - .../nbproject/project.properties | 19 - .../nbproject/project.xml | 35 - .../build.xml | 25 - .../external/binaries-list | 17 - ...tile.core_2.6.0.v20150901-2143-license.txt | 94 - .../manifest.mf | 1 - .../nbproject/project.properties | 19 - .../nbproject/project.xml | 35 - ide/team.commons/nbproject/project.xml | 1 - nb/bugzilla.exceptionreporter/build.xml | 25 - nb/bugzilla.exceptionreporter/manifest.mf | 7 - .../nbproject/project.properties | 19 - .../nbproject/project.xml | 88 - .../exceptionreporter/Bundle.properties | 21 - .../NBBugzillaAccessorImpl.java | 72 - nbbuild/cluster.properties | 18 - 280 files changed, 44190 deletions(-) delete mode 100644 ide/bugtracking/src/org/netbeans/modules/bugtracking/jira/Bundle.properties delete mode 100644 ide/bugtracking/src/org/netbeans/modules/bugtracking/jira/FakeJiraConnector.java delete mode 100644 ide/bugzilla/build.xml delete mode 100644 ide/bugzilla/licenseinfo.xml delete mode 100644 ide/bugzilla/manifest.mf delete mode 100644 ide/bugzilla/nbproject/org-netbeans-modules-bugzilla.sig delete mode 100644 ide/bugzilla/nbproject/project.properties delete mode 100644 ide/bugzilla/nbproject/project.xml delete mode 100644 ide/bugzilla/src/org/netbeans/modules/bugzilla/Bugzilla.java delete mode 100644 ide/bugzilla/src/org/netbeans/modules/bugzilla/BugzillaConfig.java delete mode 100644 ide/bugzilla/src/org/netbeans/modules/bugzilla/BugzillaConnector.java delete mode 100644 ide/bugzilla/src/org/netbeans/modules/bugzilla/BugzillaIssueProvider.java delete mode 100644 ide/bugzilla/src/org/netbeans/modules/bugzilla/BugzillaQueryProvider.java delete mode 100644 ide/bugzilla/src/org/netbeans/modules/bugzilla/BugzillaRepositoryProvider.java delete mode 100644 ide/bugzilla/src/org/netbeans/modules/bugzilla/Bundle.properties delete mode 100644 ide/bugzilla/src/org/netbeans/modules/bugzilla/MylynRepositoryConnectorProvider.java delete mode 100644 ide/bugzilla/src/org/netbeans/modules/bugzilla/api/NBBugzillaUtils.java delete mode 100644 ide/bugzilla/src/org/netbeans/modules/bugzilla/autoupdate/BugzillaAutoupdate.java delete mode 100644 ide/bugzilla/src/org/netbeans/modules/bugzilla/commands/AddAttachmentCommand.java delete mode 100644 ide/bugzilla/src/org/netbeans/modules/bugzilla/commands/BugzillaExecutor.java delete mode 100644 ide/bugzilla/src/org/netbeans/modules/bugzilla/commands/Bundle.properties delete mode 100644 ide/bugzilla/src/org/netbeans/modules/bugzilla/commands/GetAttachmentCommand.java delete mode 100644 ide/bugzilla/src/org/netbeans/modules/bugzilla/commands/GetConfigurationCommand.java delete mode 100644 ide/bugzilla/src/org/netbeans/modules/bugzilla/commands/HtmlPanel.form delete mode 100644 ide/bugzilla/src/org/netbeans/modules/bugzilla/commands/HtmlPanel.java delete mode 100644 ide/bugzilla/src/org/netbeans/modules/bugzilla/commands/ValidateCommand.java delete mode 100644 ide/bugzilla/src/org/netbeans/modules/bugzilla/issue/AttachmentHyperlinkSupport.java delete mode 100644 ide/bugzilla/src/org/netbeans/modules/bugzilla/issue/BugzillaIssue.java delete mode 100644 ide/bugzilla/src/org/netbeans/modules/bugzilla/issue/BugzillaIssueController.java delete mode 100644 ide/bugzilla/src/org/netbeans/modules/bugzilla/issue/BugzillaIssueNode.java delete mode 100644 ide/bugzilla/src/org/netbeans/modules/bugzilla/issue/Bundle.properties delete mode 100644 ide/bugzilla/src/org/netbeans/modules/bugzilla/issue/CommentsPanel.java delete mode 100644 ide/bugzilla/src/org/netbeans/modules/bugzilla/issue/IssuePanel.form delete mode 100644 ide/bugzilla/src/org/netbeans/modules/bugzilla/issue/IssuePanel.java delete mode 100644 ide/bugzilla/src/org/netbeans/modules/bugzilla/issue/ResolveIssuePanel.form delete mode 100644 ide/bugzilla/src/org/netbeans/modules/bugzilla/issue/ResolveIssuePanel.java delete mode 100644 ide/bugzilla/src/org/netbeans/modules/bugzilla/query/BugzillaQuery.java delete mode 100644 ide/bugzilla/src/org/netbeans/modules/bugzilla/query/BugzillaQueryCellRenderer.java delete mode 100644 ide/bugzilla/src/org/netbeans/modules/bugzilla/query/Bundle.properties delete mode 100644 ide/bugzilla/src/org/netbeans/modules/bugzilla/query/QueryController.java delete mode 100644 ide/bugzilla/src/org/netbeans/modules/bugzilla/query/QueryNotifyListener.java delete mode 100644 ide/bugzilla/src/org/netbeans/modules/bugzilla/query/QueryPanel.form delete mode 100644 ide/bugzilla/src/org/netbeans/modules/bugzilla/query/QueryPanel.java delete mode 100644 ide/bugzilla/src/org/netbeans/modules/bugzilla/query/QueryParameter.java delete mode 100644 ide/bugzilla/src/org/netbeans/modules/bugzilla/repository/BugzillaConfiguration.java delete mode 100644 ide/bugzilla/src/org/netbeans/modules/bugzilla/repository/BugzillaRepository.java delete mode 100644 ide/bugzilla/src/org/netbeans/modules/bugzilla/repository/BugzillaRepositoryController.java delete mode 100644 ide/bugzilla/src/org/netbeans/modules/bugzilla/repository/Bundle.properties delete mode 100644 ide/bugzilla/src/org/netbeans/modules/bugzilla/repository/CustomIssueField.java delete mode 100644 ide/bugzilla/src/org/netbeans/modules/bugzilla/repository/IssueField.java delete mode 100644 ide/bugzilla/src/org/netbeans/modules/bugzilla/repository/NBLoginPanel.form delete mode 100644 ide/bugzilla/src/org/netbeans/modules/bugzilla/repository/NBLoginPanel.java delete mode 100644 ide/bugzilla/src/org/netbeans/modules/bugzilla/repository/NBRepositorySupport.java delete mode 100644 ide/bugzilla/src/org/netbeans/modules/bugzilla/repository/RepositoryPanel.form delete mode 100644 ide/bugzilla/src/org/netbeans/modules/bugzilla/repository/RepositoryPanel.java delete mode 100644 ide/bugzilla/src/org/netbeans/modules/bugzilla/resources/conflict.png delete mode 100644 ide/bugzilla/src/org/netbeans/modules/bugzilla/resources/error.gif delete mode 100644 ide/bugzilla/src/org/netbeans/modules/bugzilla/resources/error.svg delete mode 100644 ide/bugzilla/src/org/netbeans/modules/bugzilla/resources/info.png delete mode 100644 ide/bugzilla/src/org/netbeans/modules/bugzilla/resources/info.svg delete mode 100644 ide/bugzilla/src/org/netbeans/modules/bugzilla/resources/p1.png delete mode 100644 ide/bugzilla/src/org/netbeans/modules/bugzilla/resources/p2.png delete mode 100644 ide/bugzilla/src/org/netbeans/modules/bugzilla/resources/p3.png delete mode 100644 ide/bugzilla/src/org/netbeans/modules/bugzilla/resources/p4.png delete mode 100644 ide/bugzilla/src/org/netbeans/modules/bugzilla/resources/p5.png delete mode 100644 ide/bugzilla/src/org/netbeans/modules/bugzilla/resources/remote.png delete mode 100644 ide/bugzilla/src/org/netbeans/modules/bugzilla/resources/repository.png delete mode 100644 ide/bugzilla/src/org/netbeans/modules/bugzilla/resources/unsubmitted.png delete mode 100644 ide/bugzilla/src/org/netbeans/modules/bugzilla/resources/warning.gif delete mode 100644 ide/bugzilla/src/org/netbeans/modules/bugzilla/resources/warning.svg delete mode 100644 ide/bugzilla/src/org/netbeans/modules/bugzilla/util/BugzillaConstants.java delete mode 100644 ide/bugzilla/src/org/netbeans/modules/bugzilla/util/BugzillaUtil.java delete mode 100644 ide/bugzilla/src/org/netbeans/modules/bugzilla/util/Bundle.properties delete mode 100644 ide/bugzilla/src/org/netbeans/modules/bugzilla/util/FileUtils.java delete mode 100644 ide/bugzilla/src/org/netbeans/modules/bugzilla/util/NbBugzillaConstants.java delete mode 100644 ide/bugzilla/test/unit/src/org/netbeans/modules/bugzilla/BugzillaTest.java delete mode 100644 ide/bugzilla/test/unit/src/org/netbeans/modules/bugzilla/HtmlPanel.form delete mode 100644 ide/bugzilla/test/unit/src/org/netbeans/modules/bugzilla/HtmlPanel.java delete mode 100644 ide/bugzilla/test/unit/src/org/netbeans/modules/bugzilla/LogHandler.java delete mode 100644 ide/bugzilla/test/unit/src/org/netbeans/modules/bugzilla/MylynStorageTest.java delete mode 100644 ide/bugzilla/test/unit/src/org/netbeans/modules/bugzilla/TestConstants.java delete mode 100644 ide/bugzilla/test/unit/src/org/netbeans/modules/bugzilla/TestQueryNotifyListener.java delete mode 100644 ide/bugzilla/test/unit/src/org/netbeans/modules/bugzilla/TestUtil.java delete mode 100644 ide/bugzilla/test/unit/src/org/netbeans/modules/bugzilla/autoupdate/BugzillaNotSupportedTest.java delete mode 100644 ide/bugzilla/test/unit/src/org/netbeans/modules/bugzilla/autoupdate/BugzillaPluginUCTest.java delete mode 100644 ide/bugzilla/test/unit/src/org/netbeans/modules/bugzilla/autoupdate/BugzillaSupportedTest.java delete mode 100644 ide/bugzilla/test/unit/src/org/netbeans/modules/bugzilla/commands/ExceptionHandlerTest.java delete mode 100644 ide/bugzilla/test/unit/src/org/netbeans/modules/bugzilla/issue/AttachmentHyperlinkSupportTest.java delete mode 100644 ide/bugzilla/test/unit/src/org/netbeans/modules/bugzilla/issue/CurrentNBVersionTest.java delete mode 100644 ide/bugzilla/test/unit/src/org/netbeans/modules/bugzilla/issue/IssueTest.java delete mode 100644 ide/bugzilla/test/unit/src/org/netbeans/modules/bugzilla/issue/IssueTestUtils.java delete mode 100644 ide/bugzilla/test/unit/src/org/netbeans/modules/bugzilla/issue/OpenIssueTest.java delete mode 100644 ide/bugzilla/test/unit/src/org/netbeans/modules/bugzilla/issue/ShowLogActionTest.java delete mode 100644 ide/bugzilla/test/unit/src/org/netbeans/modules/bugzilla/query/ControllerTest.java delete mode 100644 ide/bugzilla/test/unit/src/org/netbeans/modules/bugzilla/query/IssueTableTest.java delete mode 100644 ide/bugzilla/test/unit/src/org/netbeans/modules/bugzilla/query/QueryConstants.java delete mode 100644 ide/bugzilla/test/unit/src/org/netbeans/modules/bugzilla/query/QueryParameterTest.java delete mode 100644 ide/bugzilla/test/unit/src/org/netbeans/modules/bugzilla/query/QueryRefreshTest.java delete mode 100644 ide/bugzilla/test/unit/src/org/netbeans/modules/bugzilla/query/QueryTest.java delete mode 100644 ide/bugzilla/test/unit/src/org/netbeans/modules/bugzilla/query/QueryTestUtil.java delete mode 100644 ide/bugzilla/test/unit/src/org/netbeans/modules/bugzilla/repository/RepositoryControllerTest.java delete mode 100644 ide/bugzilla/test/unit/src/org/netbeans/modules/bugzilla/repository/RepositoryTest.java delete mode 100644 ide/localtasks/build.xml delete mode 100644 ide/localtasks/licenseinfo.xml delete mode 100644 ide/localtasks/manifest.mf delete mode 100644 ide/localtasks/nbproject/project.properties delete mode 100644 ide/localtasks/nbproject/project.xml delete mode 100644 ide/localtasks/src/org/netbeans/modules/localtasks/Bundle.properties delete mode 100644 ide/localtasks/src/org/netbeans/modules/localtasks/IssueProviderImpl.java delete mode 100644 ide/localtasks/src/org/netbeans/modules/localtasks/IssueSchedulingProviderImpl.java delete mode 100644 ide/localtasks/src/org/netbeans/modules/localtasks/IssueStatusProviderImpl.java delete mode 100644 ide/localtasks/src/org/netbeans/modules/localtasks/LocalQuery.java delete mode 100644 ide/localtasks/src/org/netbeans/modules/localtasks/LocalRepository.java delete mode 100644 ide/localtasks/src/org/netbeans/modules/localtasks/LocalRepositoryConfig.java delete mode 100644 ide/localtasks/src/org/netbeans/modules/localtasks/LocalTaskConnector.java delete mode 100644 ide/localtasks/src/org/netbeans/modules/localtasks/QueryProviderImpl.java delete mode 100644 ide/localtasks/src/org/netbeans/modules/localtasks/RepositoryProviderImpl.java delete mode 100644 ide/localtasks/src/org/netbeans/modules/localtasks/resources/error.gif delete mode 100644 ide/localtasks/src/org/netbeans/modules/localtasks/resources/error.svg delete mode 100644 ide/localtasks/src/org/netbeans/modules/localtasks/resources/info.png delete mode 100644 ide/localtasks/src/org/netbeans/modules/localtasks/resources/info.svg delete mode 100644 ide/localtasks/src/org/netbeans/modules/localtasks/resources/local_repo.png delete mode 100644 ide/localtasks/src/org/netbeans/modules/localtasks/resources/warning.gif delete mode 100644 ide/localtasks/src/org/netbeans/modules/localtasks/resources/warning.svg delete mode 100644 ide/localtasks/src/org/netbeans/modules/localtasks/task/AddSubtaskPanel.form delete mode 100644 ide/localtasks/src/org/netbeans/modules/localtasks/task/AddSubtaskPanel.java delete mode 100644 ide/localtasks/src/org/netbeans/modules/localtasks/task/Bundle.properties delete mode 100644 ide/localtasks/src/org/netbeans/modules/localtasks/task/LocalTask.java delete mode 100644 ide/localtasks/src/org/netbeans/modules/localtasks/task/SubtaskTableModel.java delete mode 100644 ide/localtasks/src/org/netbeans/modules/localtasks/task/TaskController.java delete mode 100644 ide/localtasks/src/org/netbeans/modules/localtasks/task/TaskPanel.form delete mode 100644 ide/localtasks/src/org/netbeans/modules/localtasks/task/TaskPanel.java delete mode 100644 ide/localtasks/src/org/netbeans/modules/localtasks/util/FileUtils.java delete mode 100644 ide/mylyn.util/build.xml delete mode 100644 ide/mylyn.util/licenseinfo.xml delete mode 100644 ide/mylyn.util/manifest.mf delete mode 100644 ide/mylyn.util/nbproject/org-netbeans-modules-mylyn-util.sig delete mode 100644 ide/mylyn.util/nbproject/project.properties delete mode 100644 ide/mylyn.util/nbproject/project.xml delete mode 100644 ide/mylyn.util/src/org/netbeans/modules/mylyn/util/AbstractNbTaskWrapper.java delete mode 100644 ide/mylyn.util/src/org/netbeans/modules/mylyn/util/AccessorImpl.java delete mode 100644 ide/mylyn.util/src/org/netbeans/modules/mylyn/util/BugtrackingCommand.java delete mode 100644 ide/mylyn.util/src/org/netbeans/modules/mylyn/util/Bundle.properties delete mode 100644 ide/mylyn.util/src/org/netbeans/modules/mylyn/util/CancelableProgressMonitor.java delete mode 100644 ide/mylyn.util/src/org/netbeans/modules/mylyn/util/GetAttachmentCommand.java delete mode 100644 ide/mylyn.util/src/org/netbeans/modules/mylyn/util/GetMultiTaskDataCommand.java delete mode 100644 ide/mylyn.util/src/org/netbeans/modules/mylyn/util/GetTaskDataCommand.java delete mode 100644 ide/mylyn.util/src/org/netbeans/modules/mylyn/util/MylynSupport.java delete mode 100644 ide/mylyn.util/src/org/netbeans/modules/mylyn/util/MylynUtils.java delete mode 100644 ide/mylyn.util/src/org/netbeans/modules/mylyn/util/NbDateRange.java delete mode 100644 ide/mylyn.util/src/org/netbeans/modules/mylyn/util/NbTask.java delete mode 100644 ide/mylyn.util/src/org/netbeans/modules/mylyn/util/NbTaskDataModel.java delete mode 100644 ide/mylyn.util/src/org/netbeans/modules/mylyn/util/NbTaskDataState.java delete mode 100644 ide/mylyn.util/src/org/netbeans/modules/mylyn/util/NbTaskListener.java delete mode 100644 ide/mylyn.util/src/org/netbeans/modules/mylyn/util/PerformQueryCommand.java delete mode 100644 ide/mylyn.util/src/org/netbeans/modules/mylyn/util/PostAttachmentCommand.java delete mode 100644 ide/mylyn.util/src/org/netbeans/modules/mylyn/util/RepositoryConnectorProvider.java delete mode 100644 ide/mylyn.util/src/org/netbeans/modules/mylyn/util/SubmitCommand.java delete mode 100644 ide/mylyn.util/src/org/netbeans/modules/mylyn/util/TaskDataListener.java delete mode 100644 ide/mylyn.util/src/org/netbeans/modules/mylyn/util/UnsubmittedTasksContainer.java delete mode 100644 ide/mylyn.util/src/org/netbeans/modules/mylyn/util/WikiPanel.java delete mode 100644 ide/mylyn.util/src/org/netbeans/modules/mylyn/util/WikiUtils.java delete mode 100644 ide/mylyn.util/src/org/netbeans/modules/mylyn/util/commands/CommandFactory.java delete mode 100644 ide/mylyn.util/src/org/netbeans/modules/mylyn/util/commands/CommandsAccessorImpl.java delete mode 100644 ide/mylyn.util/src/org/netbeans/modules/mylyn/util/commands/GetAttachmentCommand.java delete mode 100644 ide/mylyn.util/src/org/netbeans/modules/mylyn/util/commands/GetRepositoryTasksCommand.java delete mode 100644 ide/mylyn.util/src/org/netbeans/modules/mylyn/util/commands/PostAttachmentCommand.java delete mode 100644 ide/mylyn.util/src/org/netbeans/modules/mylyn/util/commands/SimpleQueryCommand.java delete mode 100644 ide/mylyn.util/src/org/netbeans/modules/mylyn/util/commands/SubmitTaskCommand.java delete mode 100644 ide/mylyn.util/src/org/netbeans/modules/mylyn/util/commands/SynchronizeQueryCommand.java delete mode 100644 ide/mylyn.util/src/org/netbeans/modules/mylyn/util/commands/SynchronizeTasksCommand.java delete mode 100644 ide/mylyn.util/src/org/netbeans/modules/mylyn/util/internal/Accessor.java delete mode 100644 ide/mylyn.util/src/org/netbeans/modules/mylyn/util/internal/CommandsAccessor.java delete mode 100644 ide/mylyn.util/src/org/netbeans/modules/mylyn/util/internal/ModuleLifecycleManager.java delete mode 100644 ide/mylyn.util/src/org/netbeans/modules/mylyn/util/internal/TaskListener.java delete mode 100644 ide/mylyn.util/src/org/netbeans/modules/mylyn/util/localtasks/AbstractLocalTask.java delete mode 100644 ide/mylyn.util/src/org/netbeans/modules/mylyn/util/localtasks/IssueField.java delete mode 100644 ide/mylyn.util/src/org/netbeans/modules/mylyn/util/localtasks/internal/LocalTaskDataHandler.java delete mode 100644 ide/mylyn.util/src/org/netbeans/modules/mylyn/util/resources/edit.png delete mode 100644 ide/mylyn.util/src/org/netbeans/modules/mylyn/util/resources/layer.xml delete mode 100644 ide/mylyn.util/src/org/netbeans/modules/mylyn/util/resources/preview.png delete mode 100644 ide/mylyn.util/src/org/netbeans/modules/mylyn/util/wiki/Bundle.properties delete mode 100644 ide/mylyn.util/src/org/netbeans/modules/mylyn/util/wiki/WikiEditPanel.form delete mode 100644 ide/mylyn.util/src/org/netbeans/modules/mylyn/util/wiki/WikiEditPanel.java delete mode 100644 ide/o.apache.commons.httpclient/build.xml delete mode 100644 ide/o.apache.commons.httpclient/external/binaries-list delete mode 100644 ide/o.apache.commons.httpclient/external/commons-httpclient-3.1-license.txt delete mode 100644 ide/o.apache.commons.httpclient/external/commons-httpclient-3.1-notice.txt delete mode 100644 ide/o.apache.commons.httpclient/manifest.mf delete mode 100644 ide/o.apache.commons.httpclient/nbproject/project.properties delete mode 100644 ide/o.apache.commons.httpclient/nbproject/project.xml delete mode 100644 ide/o.apache.commons.lang/build.xml delete mode 100644 ide/o.apache.commons.lang/external/binaries-list delete mode 100644 ide/o.apache.commons.lang/external/commons-lang-2.6-license.txt delete mode 100644 ide/o.apache.commons.lang/external/commons-lang-2.6-notice.txt delete mode 100644 ide/o.apache.commons.lang/manifest.mf delete mode 100644 ide/o.apache.commons.lang/nbproject/project.properties delete mode 100644 ide/o.apache.commons.lang/nbproject/project.xml delete mode 100644 ide/o.apache.ws.commons.util/build.xml delete mode 100644 ide/o.apache.ws.commons.util/external/binaries-list delete mode 100644 ide/o.apache.ws.commons.util/external/ws-commons-util-1.0.1-license.txt delete mode 100644 ide/o.apache.ws.commons.util/manifest.mf delete mode 100644 ide/o.apache.ws.commons.util/nbproject/project.properties delete mode 100644 ide/o.apache.ws.commons.util/nbproject/project.xml delete mode 100644 ide/o.apache.xmlrpc/build.xml delete mode 100644 ide/o.apache.xmlrpc/external/binaries-list delete mode 100644 ide/o.apache.xmlrpc/external/xmlrpc-3.1.3-license.txt delete mode 100644 ide/o.apache.xmlrpc/manifest.mf delete mode 100644 ide/o.apache.xmlrpc/nbproject/project.properties delete mode 100644 ide/o.apache.xmlrpc/nbproject/project.xml delete mode 100644 ide/o.eclipse.mylyn.bugzilla.core/build.xml delete mode 100644 ide/o.eclipse.mylyn.bugzilla.core/external/binaries-list delete mode 100644 ide/o.eclipse.mylyn.bugzilla.core/external/org.eclipse.mylyn.bugzilla.core_3.17.0.v20150828-2026-license.txt delete mode 100644 ide/o.eclipse.mylyn.bugzilla.core/manifest.mf delete mode 100644 ide/o.eclipse.mylyn.bugzilla.core/nbproject/project.properties delete mode 100644 ide/o.eclipse.mylyn.bugzilla.core/nbproject/project.xml delete mode 100644 ide/o.eclipse.mylyn.commons.core/build.xml delete mode 100644 ide/o.eclipse.mylyn.commons.core/external/binaries-list delete mode 100644 ide/o.eclipse.mylyn.commons.core/external/org.eclipse.mylyn.commons.core_3.17.0.v20150625-2042-license.txt delete mode 100644 ide/o.eclipse.mylyn.commons.core/manifest.mf delete mode 100644 ide/o.eclipse.mylyn.commons.core/nbproject/project.properties delete mode 100644 ide/o.eclipse.mylyn.commons.core/nbproject/project.xml delete mode 100644 ide/o.eclipse.mylyn.commons.net/build.xml delete mode 100644 ide/o.eclipse.mylyn.commons.net/external/binaries-list delete mode 100644 ide/o.eclipse.mylyn.commons.net/external/org.eclipse.mylyn.commons.net_3.17.0.v20150706-2057-license.txt delete mode 100644 ide/o.eclipse.mylyn.commons.net/manifest.mf delete mode 100644 ide/o.eclipse.mylyn.commons.net/nbproject/project.properties delete mode 100644 ide/o.eclipse.mylyn.commons.net/nbproject/project.xml delete mode 100644 ide/o.eclipse.mylyn.commons.repositories.core/build.xml delete mode 100644 ide/o.eclipse.mylyn.commons.repositories.core/external/binaries-list delete mode 100644 ide/o.eclipse.mylyn.commons.repositories.core/external/org.eclipse.mylyn.commons.repositories.core_1.9.0.v20150625-2042-license.txt delete mode 100644 ide/o.eclipse.mylyn.commons.repositories.core/manifest.mf delete mode 100644 ide/o.eclipse.mylyn.commons.repositories.core/nbproject/project.properties delete mode 100644 ide/o.eclipse.mylyn.commons.repositories.core/nbproject/project.xml delete mode 100644 ide/o.eclipse.mylyn.commons.xmlrpc/build.xml delete mode 100644 ide/o.eclipse.mylyn.commons.xmlrpc/external/binaries-list delete mode 100644 ide/o.eclipse.mylyn.commons.xmlrpc/external/org.eclipse.mylyn.commons.xmlrpc_3.17.0.v20150625-2042-license.txt delete mode 100644 ide/o.eclipse.mylyn.commons.xmlrpc/manifest.mf delete mode 100644 ide/o.eclipse.mylyn.commons.xmlrpc/nbproject/project.properties delete mode 100644 ide/o.eclipse.mylyn.commons.xmlrpc/nbproject/project.xml delete mode 100644 ide/o.eclipse.mylyn.tasks.core/build.xml delete mode 100644 ide/o.eclipse.mylyn.tasks.core/external/binaries-list delete mode 100644 ide/o.eclipse.mylyn.tasks.core/external/org.eclipse.mylyn.tasks.core_3.17.0.v20150828-2026-license.txt delete mode 100644 ide/o.eclipse.mylyn.tasks.core/manifest.mf delete mode 100644 ide/o.eclipse.mylyn.tasks.core/nbproject/project.properties delete mode 100644 ide/o.eclipse.mylyn.tasks.core/nbproject/project.xml delete mode 100644 ide/o.eclipse.mylyn.wikitext.confluence.core/build.xml delete mode 100644 ide/o.eclipse.mylyn.wikitext.confluence.core/external/binaries-list delete mode 100644 ide/o.eclipse.mylyn.wikitext.confluence.core/external/org.eclipse.mylyn.wikitext.confluence.core_2.6.0.v20150901-2143-license.txt delete mode 100644 ide/o.eclipse.mylyn.wikitext.confluence.core/manifest.mf delete mode 100644 ide/o.eclipse.mylyn.wikitext.confluence.core/nbproject/project.properties delete mode 100644 ide/o.eclipse.mylyn.wikitext.confluence.core/nbproject/project.xml delete mode 100644 ide/o.eclipse.mylyn.wikitext.core/build.xml delete mode 100644 ide/o.eclipse.mylyn.wikitext.core/external/binaries-list delete mode 100644 ide/o.eclipse.mylyn.wikitext.core/external/org.eclipse.mylyn.wikitext.core_2.6.0.v20150901-2143-patched-nosignature-license.txt delete mode 100644 ide/o.eclipse.mylyn.wikitext.core/manifest.mf delete mode 100644 ide/o.eclipse.mylyn.wikitext.core/nbproject/project.properties delete mode 100644 ide/o.eclipse.mylyn.wikitext.core/nbproject/project.xml delete mode 100644 ide/o.eclipse.mylyn.wikitext.markdown.core/build.xml delete mode 100644 ide/o.eclipse.mylyn.wikitext.markdown.core/external/binaries-list delete mode 100644 ide/o.eclipse.mylyn.wikitext.markdown.core/external/org.eclipse.mylyn.wikitext.markdown.core_2.6.0.v20150901-2143-license.txt delete mode 100644 ide/o.eclipse.mylyn.wikitext.markdown.core/manifest.mf delete mode 100644 ide/o.eclipse.mylyn.wikitext.markdown.core/nbproject/project.properties delete mode 100644 ide/o.eclipse.mylyn.wikitext.markdown.core/nbproject/project.xml delete mode 100644 ide/o.eclipse.mylyn.wikitext.textile.core/build.xml delete mode 100644 ide/o.eclipse.mylyn.wikitext.textile.core/external/binaries-list delete mode 100644 ide/o.eclipse.mylyn.wikitext.textile.core/external/org.eclipse.mylyn.wikitext.textile.core_2.6.0.v20150901-2143-license.txt delete mode 100644 ide/o.eclipse.mylyn.wikitext.textile.core/manifest.mf delete mode 100644 ide/o.eclipse.mylyn.wikitext.textile.core/nbproject/project.properties delete mode 100644 ide/o.eclipse.mylyn.wikitext.textile.core/nbproject/project.xml delete mode 100644 nb/bugzilla.exceptionreporter/build.xml delete mode 100644 nb/bugzilla.exceptionreporter/manifest.mf delete mode 100644 nb/bugzilla.exceptionreporter/nbproject/project.properties delete mode 100644 nb/bugzilla.exceptionreporter/nbproject/project.xml delete mode 100644 nb/bugzilla.exceptionreporter/src/org/netbeans/modules/bugzilla/exceptionreporter/Bundle.properties delete mode 100644 nb/bugzilla.exceptionreporter/src/org/netbeans/modules/bugzilla/exceptionreporter/NBBugzillaAccessorImpl.java diff --git a/ide/bugtracking.commons/nbproject/project.xml b/ide/bugtracking.commons/nbproject/project.xml index c393881ab53f..fbc2074982d2 100644 --- a/ide/bugtracking.commons/nbproject/project.xml +++ b/ide/bugtracking.commons/nbproject/project.xml @@ -147,15 +147,8 @@ - org.netbeans.modules.bugzilla - org.netbeans.modules.jira org.netbeans.modules.odcs.tasks - org.netbeans.modules.localtasks com.oracle.netbeans.bugdb - - com.junichi11.netbeans.github.issues - - com.junichi11.netbeans.backlog.plugin org.netbeans.modules.bugtracking.issuetable diff --git a/ide/bugtracking/src/org/netbeans/modules/bugtracking/jira/Bundle.properties b/ide/bugtracking/src/org/netbeans/modules/bugtracking/jira/Bundle.properties deleted file mode 100644 index dd4d3361425d..000000000000 --- a/ide/bugtracking/src/org/netbeans/modules/bugtracking/jira/Bundle.properties +++ /dev/null @@ -1,21 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - -MissingJiraSupportPanel.downloadButton.text=Download JIRA plugin -LBL_FakeJiraNameTooltip=Jira Task Repository -LBL_FakeJiraName=JIRA -MSG_NOT_YET_INSTALLED=The JIRA plugin is not installed. \ No newline at end of file diff --git a/ide/bugtracking/src/org/netbeans/modules/bugtracking/jira/FakeJiraConnector.java b/ide/bugtracking/src/org/netbeans/modules/bugtracking/jira/FakeJiraConnector.java deleted file mode 100644 index bdedf180d733..000000000000 --- a/ide/bugtracking/src/org/netbeans/modules/bugtracking/jira/FakeJiraConnector.java +++ /dev/null @@ -1,200 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.netbeans.modules.bugtracking.jira; - -import java.awt.Image; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.beans.PropertyChangeListener; -import java.util.Collection; -import java.util.Collections; -import javax.swing.GroupLayout; -import javax.swing.JButton; -import javax.swing.JComponent; -import javax.swing.JLabel; -import javax.swing.JPanel; -import javax.swing.LayoutStyle; -import javax.swing.event.ChangeListener; -import org.netbeans.modules.bugtracking.DelegatingConnector; -import org.netbeans.modules.bugtracking.api.Repository; -import org.netbeans.modules.bugtracking.spi.BugtrackingConnector; -import org.netbeans.modules.bugtracking.spi.BugtrackingSupport; -import org.netbeans.modules.bugtracking.spi.RepositoryController; -import org.netbeans.modules.bugtracking.spi.RepositoryInfo; -import org.netbeans.modules.bugtracking.spi.RepositoryProvider; -import org.netbeans.modules.bugtracking.commons.JiraUpdater; -import org.openide.util.HelpCtx; -import org.openide.util.ImageUtilities; -import org.openide.util.NbBundle; - -/** - * - * @author Tomas Stupka - */ -public class FakeJiraConnector { - private static DelegatingConnector connector; - - /** - * Returns a fake {@link BugtrackingConnector} to be shown in the create - * repository dialog. The repository controller panel notifies a the missing - * JIRA plugin and comes with a button to download it from the Update Center. - * - * @return - */ - public static synchronized DelegatingConnector getConnector() { - if(connector == null) { - connector = new DelegatingConnector( - new JiraProxyConnector(), - "fake.jira.connector", // NOI18N - NbBundle.getMessage(FakeJiraConnector.class, "LBL_FakeJiraName"), // NOI18N - NbBundle.getMessage(FakeJiraConnector.class, "LBL_FakeJiraNameTooltip"), // NOI18N - ImageUtilities.loadImage("org/netbeans/modules/bugtracking/ui/resources/repository.png", true)); - } - return connector; - } - - private static class JiraProxyConnector implements BugtrackingConnector { - private BugtrackingSupport f = new BugtrackingSupport(new JiraProxyRepositoryProvider(), null, null); - @Override - public Repository createRepository() { - return f.createRepository(f, null, null, null, null); - } - @Override - public Repository createRepository(RepositoryInfo info) { - throw new UnsupportedOperationException("Not supported yet."); // NOI18N - } - } - private static class JiraProxyRepositoryProvider implements RepositoryProvider { - @Override - public Image getIcon(Object r) { - return null; - } - @Override - public RepositoryInfo getInfo(Object r) { - return null; - } - @Override - public Collection getIssues(Object r, String... id) { - throw new UnsupportedOperationException("Not supported yet."); // NOI18N - } - @Override - public void removed(Object r) { } - @Override - public RepositoryController getController(Object r) { - return new JiraProxyController(); - } - @Override - public Object createIssue(Object r) { - throw new UnsupportedOperationException("Not supported yet."); // NOI18N - } - @Override - public Object createQuery(Object r) { - throw new UnsupportedOperationException("Not supported yet."); // NOI18N - } - @Override - public Collection getQueries(Object r) { - return Collections.emptyList(); - } - @Override - public Collection simpleSearch(Object r, String criteria) { - return Collections.emptyList(); - } - @Override - public void removePropertyChangeListener(Object r, PropertyChangeListener listener) { - // do nothing - } - @Override - public void addPropertyChangeListener(Object r, PropertyChangeListener listener) { - // do nothing - } - @Override - public Object createIssue(Object r, String summary, String description) { - throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. - } - @Override - public boolean canAttachFiles(Object r) { - throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. - } - } - - private static class JiraProxyController implements RepositoryController { - private JPanel panel; - @Override - public JComponent getComponent() { - if(panel == null) { - panel = createControllerPanel(); - } - return panel; - } - @Override - public HelpCtx getHelpCtx() { - return new HelpCtx(this.getClass()); - } - @Override - public boolean isValid() { - return false; - } - private JPanel createControllerPanel() { - JPanel controllerPanel = new JPanel(); - - JLabel pane = new JLabel(); - pane.setText(NbBundle.getMessage(FakeJiraConnector.class, "MSG_NOT_YET_INSTALLED")); // NOI18N - - JButton downloadButton = new JButton(); - downloadButton.addActionListener(new ActionListener() { - @Override - public void actionPerformed(ActionEvent e) { - JiraUpdater.getInstance().downloadAndInstall(null); - } - }); - - org.openide.awt.Mnemonics.setLocalizedText(downloadButton, org.openide.util.NbBundle.getMessage(FakeJiraConnector.class, "MissingJiraSupportPanel.downloadButton.text")); // NOI18N - - GroupLayout layout = new GroupLayout(controllerPanel); - controllerPanel.setLayout(layout); - layout.setHorizontalGroup( - layout.createParallelGroup(GroupLayout.Alignment.LEADING) - .addGroup(layout.createSequentialGroup() - .addGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING) - .addComponent(pane, GroupLayout.PREFERRED_SIZE, 100, Short.MAX_VALUE)) - .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED) - .addComponent(downloadButton)) - ); - layout.setVerticalGroup( - layout.createParallelGroup(GroupLayout.Alignment.LEADING) - .addGroup(GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() - .addComponent(pane) - .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED) - .addGroup(layout.createParallelGroup(GroupLayout.Alignment.BASELINE) - .addComponent(downloadButton)) - .addContainerGap()) - ); - - return controllerPanel; - } - - @Override public String getErrorMessage() { return null; } - @Override public void applyChanges() { } - @Override public void cancelChanges() { } - @Override public void populate() {} - @Override public void addChangeListener(ChangeListener l) {} - @Override public void removeChangeListener(ChangeListener l) {} - } -} diff --git a/ide/bugtracking/src/org/netbeans/modules/bugtracking/ui/selectors/RepositorySelector.java b/ide/bugtracking/src/org/netbeans/modules/bugtracking/ui/selectors/RepositorySelector.java index 5bd6d0bd3a5b..1651c8406fce 100644 --- a/ide/bugtracking/src/org/netbeans/modules/bugtracking/ui/selectors/RepositorySelector.java +++ b/ide/bugtracking/src/org/netbeans/modules/bugtracking/ui/selectors/RepositorySelector.java @@ -26,10 +26,7 @@ import org.netbeans.modules.bugtracking.DelegatingConnector; import org.netbeans.modules.bugtracking.RepositoryRegistry; import org.netbeans.modules.bugtracking.RepositoryImpl; -import org.netbeans.modules.bugtracking.jira.FakeJiraConnector; import org.netbeans.modules.bugtracking.tasks.DashboardTopComponent; -import org.netbeans.modules.bugtracking.util.BugtrackingUtil; -import org.netbeans.modules.team.ide.spi.IDEServices; /** * @@ -51,7 +48,6 @@ public RepositoryImpl create(boolean selectNode) { } } connectors = l.toArray(new DelegatingConnector[0]); - connectors = addJiraProxyIfNeeded(connectors); selectorPanel.setConnectors(connectors); boolean didCreate = selectorPanel.create(); final RepositoryImpl repo = selectorPanel.getRepository(); @@ -88,19 +84,4 @@ public boolean edit(RepositoryImpl repository, String errorMessage) { RepositoryRegistry.getInstance().addRepository(repo); return true; } - - private DelegatingConnector[] addJiraProxyIfNeeded(DelegatingConnector[] connectors) { - if(!BugtrackingUtil.isJiraInstalled() && supportsDownload()) { - DelegatingConnector[] ret = new DelegatingConnector[connectors.length + 1]; - System.arraycopy(connectors, 0, ret, 0, connectors.length); - ret[ret.length - 1] = FakeJiraConnector.getConnector(); - connectors = ret; - } - return connectors; - } - - static boolean supportsDownload() { - IDEServices ideServices = BugtrackingManager.getInstance().getIDEServices(); - return ideServices != null && ideServices.providesPluginUpdate(); - } } diff --git a/ide/bugzilla/build.xml b/ide/bugzilla/build.xml deleted file mode 100644 index beefe06721d4..000000000000 --- a/ide/bugzilla/build.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - Builds, tests, and runs the project org.netbeans.modules.bugzilla - - diff --git a/ide/bugzilla/licenseinfo.xml b/ide/bugzilla/licenseinfo.xml deleted file mode 100644 index f479d5d6c16a..000000000000 --- a/ide/bugzilla/licenseinfo.xml +++ /dev/null @@ -1,39 +0,0 @@ - - - - - src/org/netbeans/modules/bugzilla/resources/p4.png - src/org/netbeans/modules/bugzilla/resources/conflict.png - src/org/netbeans/modules/bugzilla/resources/p5.png - src/org/netbeans/modules/bugzilla/resources/p2.png - src/org/netbeans/modules/bugzilla/resources/p1.png - src/org/netbeans/modules/bugzilla/resources/p3.png - src/org/netbeans/modules/bugzilla/resources/error.gif - src/org/netbeans/modules/bugzilla/resources/info.png - src/org/netbeans/modules/bugzilla/resources/remote.png - src/org/netbeans/modules/bugzilla/resources/unsubmitted.png - src/org/netbeans/modules/bugzilla/resources/warning.gif - src/org/netbeans/modules/bugzilla/resources/repository.png - - - - diff --git a/ide/bugzilla/manifest.mf b/ide/bugzilla/manifest.mf deleted file mode 100644 index 22423e3996ab..000000000000 --- a/ide/bugzilla/manifest.mf +++ /dev/null @@ -1,6 +0,0 @@ -Manifest-Version: 1.0 -AutoUpdate-Show-In-Client: true -OpenIDE-Module: org.netbeans.modules.bugzilla -OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/bugzilla/Bundle.properties -OpenIDE-Module-Specification-Version: 1.108 - diff --git a/ide/bugzilla/nbproject/org-netbeans-modules-bugzilla.sig b/ide/bugzilla/nbproject/org-netbeans-modules-bugzilla.sig deleted file mode 100644 index cb7843f91610..000000000000 --- a/ide/bugzilla/nbproject/org-netbeans-modules-bugzilla.sig +++ /dev/null @@ -1,30 +0,0 @@ -#Signature file v4.1 -#Version 1.107 - -CLSS public java.lang.Object -cons public init() -meth protected java.lang.Object clone() throws java.lang.CloneNotSupportedException -meth protected void finalize() throws java.lang.Throwable -meth public boolean equals(java.lang.Object) -meth public final java.lang.Class getClass() -meth public final void notify() -meth public final void notifyAll() -meth public final void wait() throws java.lang.InterruptedException -meth public final void wait(long) throws java.lang.InterruptedException -meth public final void wait(long,int) throws java.lang.InterruptedException -meth public int hashCode() -meth public java.lang.String toString() - -CLSS public org.netbeans.modules.bugzilla.api.NBBugzillaUtils -cons public init() -meth public static boolean isNbRepository(java.net.URL) -meth public static char[] getNBPassword() -meth public static java.lang.String getNBUsername() -meth public static org.netbeans.modules.bugtracking.api.Repository findNBRepository() -meth public static void attachFiles(java.lang.String,java.lang.String,java.lang.String[],java.lang.String[],java.io.File[]) -meth public static void openIssue(java.lang.String) -meth public static void reportAnIssue() -meth public static void saveNBPassword(char[]) -meth public static void saveNBUsername(java.lang.String) -supr java.lang.Object - diff --git a/ide/bugzilla/nbproject/project.properties b/ide/bugzilla/nbproject/project.properties deleted file mode 100644 index d6b7b56cc770..000000000000 --- a/ide/bugzilla/nbproject/project.properties +++ /dev/null @@ -1,31 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - -javac.source=1.8 -javac.compilerargs=-Xlint -Xlint:-serial - -test.config.stableBTD.includes=**/*Test.class -test.config.stableBTD.excludes=\ - org/netbeans/modules/bugzilla/commands/*,\ - org/netbeans/modules/bugzilla/repository/*,\ - **/BugzillaNotSupportedTest.class,\ - **/BugzillaSupportedTest.class,\ - **/BugzillaTest.class,\ - **/IssueTest.class,\ - **/MylynStorageTest.class,\ - **/QueryRefreshTest.class,\ - **/QueryTest.class diff --git a/ide/bugzilla/nbproject/project.xml b/ide/bugzilla/nbproject/project.xml deleted file mode 100644 index fb4543705b6c..000000000000 --- a/ide/bugzilla/nbproject/project.xml +++ /dev/null @@ -1,312 +0,0 @@ - - - - org.netbeans.modules.apisupport.project - - - org.netbeans.modules.bugzilla - - - org.apache.commons.httpclient - - - - 3.1.0 - - - - org.eclipse.core.runtime - - - - 3.7.0 - - - - org.eclipse.equinox.common - - - - 3.6.0 - - - - org.eclipse.mylyn.bugzilla.core - - - - 3.9.0 - - - - org.eclipse.mylyn.commons.net - - - - 3.9.0 - - - - org.eclipse.mylyn.tasks.core - - - - 3.9.0 - - - - org.netbeans.api.progress - - - - 1 - 1.40 - - - - org.netbeans.api.progress.nb - - - - 1.40 - - - - org.netbeans.libs.osgi - - - - 1.6 - - - - org.netbeans.modules.bugtracking - - - - 1.95 - - - - org.netbeans.modules.bugtracking.commons - - - - 1.1 - - - - org.netbeans.modules.mylyn.util - - - - 1.24 - - - - org.netbeans.modules.options.api - - - - 1 - 1.29 - - - - org.netbeans.modules.spellchecker.apimodule - - - - 1.3 - - - - org.netbeans.modules.team.commons - - - - 1.50 - - - - org.openide.awt - - - - 7.3 - - - - org.openide.dialogs - - - - 7.9 - - - - org.openide.filesystems - - - - 9.0 - - - - org.openide.filesystems.nb - - - - 9.0 - - - - org.openide.loaders - - - - 7.61 - - - - org.openide.modules - - - - 6.0 - - - - org.openide.nodes - - - - 7.23 - - - - org.openide.util - - - - 9.3 - - - - org.openide.util.lookup - - - - 8.0 - - - - org.openide.util.ui - - - - 9.3 - - - - org.openide.windows - - - - 6.24 - - - - - - unit - - org.apache.xmlrpc - - - - com.google.guava - - - - org.eclipse.mylyn.commons.repositories.core - - - - org.eclipse.core.net - - - - org.eclipse.equinox.security - - - - - org.eclipse.mylyn.commons.core - - - - org.netbeans.libs.junit4 - - - - org.netbeans.modules.bugtracking - - - - - org.netbeans.modules.bugtracking.commons - - - - - org.netbeans.modules.team.commons - - - - - org.netbeans.modules.bugzilla - - - - org.netbeans.modules.nbjunit - - - - - org.netbeans.modules.netbinox - - - - org.openide.util.lookup - - - - - - - org.netbeans.modules.bugzilla.exceptionreporter - org.netbeans.modules.bugzilla.api - - - - diff --git a/ide/bugzilla/src/org/netbeans/modules/bugzilla/Bugzilla.java b/ide/bugzilla/src/org/netbeans/modules/bugzilla/Bugzilla.java deleted file mode 100644 index 17c2618b09ab..000000000000 --- a/ide/bugzilla/src/org/netbeans/modules/bugzilla/Bugzilla.java +++ /dev/null @@ -1,259 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.netbeans.modules.bugzilla; - -import java.beans.PropertyChangeListener; -import org.eclipse.mylyn.internal.bugzilla.core.BugzillaClientManager; -import org.netbeans.modules.bugzilla.repository.BugzillaRepository; -import java.net.MalformedURLException; -import java.util.Collection; -import java.util.Date; -import java.util.List; -import java.util.logging.Logger; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.NullProgressMonitor; -import org.eclipse.mylyn.internal.bugzilla.core.BugzillaClient; -import org.eclipse.mylyn.internal.bugzilla.core.BugzillaRepositoryConnector; -import org.eclipse.mylyn.internal.bugzilla.core.RepositoryConfiguration; -import org.netbeans.modules.bugtracking.commons.SimpleIssueFinder; -import org.netbeans.modules.bugtracking.issuetable.IssueNode; -import org.netbeans.modules.bugtracking.spi.BugtrackingSupport; -import org.netbeans.modules.bugtracking.spi.IssueFinder; -import org.netbeans.modules.bugtracking.spi.IssuePriorityInfo; -import org.netbeans.modules.bugtracking.spi.IssuePriorityProvider; -import org.netbeans.modules.bugtracking.spi.IssueScheduleInfo; -import org.netbeans.modules.bugtracking.spi.IssueScheduleProvider; -import org.netbeans.modules.bugtracking.spi.IssueStatusProvider; -import org.netbeans.modules.bugzilla.issue.BugzillaIssue; -import org.netbeans.modules.bugzilla.query.BugzillaQuery; -import org.netbeans.modules.mylyn.util.MylynSupport; -import org.openide.util.RequestProcessor; - -/** - * - * @author Tomas Stupka - */ -public class Bugzilla { - - private BugzillaRepositoryConnector brc; - private static Bugzilla instance; - - public static final Logger LOG = Logger.getLogger("org.netbeans.modules.bugzilla.Bugzilla"); // NOI18N - - private RequestProcessor rp; - private BugzillaClientManager clientManager; - - private BugtrackingSupport bf; - private BugzillaIssueProvider bip; - private BugzillaQueryProvider bqp; - private BugzillaRepositoryProvider brp; - private IssueStatusProvider sp; - private IssuePriorityProvider pp; - private IssueNode.ChangesProvider bcp; - private IssueScheduleProvider schedulingProvider; - private IssueFinder issueFinder; - - private Bugzilla() { - brc = MylynRepositoryConnectorProvider.getInstance().getConnector(); - clientManager = brc.getClientManager(); - MylynSupport.getInstance().addRepositoryListener(clientManager); - } - - public static synchronized Bugzilla getInstance() { - if(instance == null) { - instance = new Bugzilla(); - } - return instance; - } - - static synchronized void init() { - getInstance(); - } - - public BugzillaRepositoryConnector getRepositoryConnector() { - return brc; - } - - public RepositoryConfiguration getRepositoryConfiguration(BugzillaRepository repository, boolean forceRefresh) throws CoreException, MalformedURLException { - getClient(repository); // XXX mylyn 3.1.1 workaround. initialize the client, otherwise the configuration will be downloaded twice - RepositoryConfiguration rc = brc.getRepositoryConfiguration(repository.getTaskRepository(), forceRefresh, new NullProgressMonitor()); - return rc; - } - - /** - * Returns a BugzillaClient for the given repository - * @param repository - * @return - * @throws java.net.MalformedURLException - * @throws org.eclipse.core.runtime.CoreException - */ - public BugzillaClient getClient(BugzillaRepository repository) throws MalformedURLException, CoreException { - return clientManager.getClient(repository.getTaskRepository(), new NullProgressMonitor()); - } - - /** - * Returns the request processor for common tasks in bugzilla. - * Do not use this when accesing a remote repository. - * - * @return - */ - public final RequestProcessor getRequestProcessor() { - if(rp == null) { - rp = new RequestProcessor("Bugzilla", 1, true); // NOI18N - } - return rp; - } - - public BugtrackingSupport getBugtrackingFactory() { - if(bf == null) { - bf = new BugtrackingSupport<>(getRepositoryProvider(), getQueryProvider(), getIssueProvider()); - } - return bf; - } - - public BugzillaIssueProvider getIssueProvider() { - if(bip == null) { - bip = new BugzillaIssueProvider(); - } - return bip; - } - public BugzillaQueryProvider getQueryProvider() { - if(bqp == null) { - bqp = new BugzillaQueryProvider(); - } - return bqp; - } - public BugzillaRepositoryProvider getRepositoryProvider() { - if(brp == null) { - brp = new BugzillaRepositoryProvider(); - } - return brp; - } - - public IssueStatusProvider getStatusProvider() { - if(sp == null) { - sp = new IssueStatusProvider() { - @Override - public IssueStatusProvider.Status getStatus(BugzillaIssue issue) { - return issue.getStatus(); - } - @Override - public void setSeenIncoming(BugzillaIssue issue, boolean uptodate) { - issue.setUpToDate(uptodate); - } - @Override - public void removePropertyChangeListener(BugzillaIssue issue, PropertyChangeListener listener) { - issue.removePropertyChangeListener(listener); - } - @Override - public void addPropertyChangeListener(BugzillaIssue issue, PropertyChangeListener listener) { - issue.addPropertyChangeListener(listener); - } - @Override - public Collection getUnsubmittedIssues(BugzillaRepository r) { - return r.getUnsubmittedIssues(); - } - @Override - public void discardOutgoing(BugzillaIssue i) { - i.discardLocalEdits(); - } - @Override - public boolean submit (BugzillaIssue data) { - return data.submitAndRefresh(); - } - }; - } - return sp; - } - - public IssuePriorityProvider createPriorityProvider(final BugzillaRepository repository) { - return new IssuePriorityProvider() { - private IssuePriorityInfo[] infos; - @Override - public String getPriorityID(BugzillaIssue i) { - return i.getPriority(); - } - - @Override - public synchronized IssuePriorityInfo[] getPriorityInfos() { - if(infos == null) { - List priorities = repository.getConfiguration().getPriorities(); - infos = new IssuePriorityInfo[priorities.size()]; - for (int i = 0; i < priorities.size(); i++) { - String p = priorities.get(i); - infos[i] = new IssuePriorityInfo(p, p); - } - } - return infos; - } - }; - } - - public IssueScheduleProvider getSchedulingProvider() { - if(schedulingProvider == null) { - schedulingProvider = new IssueScheduleProvider() { - - @Override - public void setSchedule (BugzillaIssue i, IssueScheduleInfo date) { - i.setTaskScheduleDate(date, true); - } - - @Override - public Date getDueDate (BugzillaIssue i) { - return i.getPersistentDueDate(); - } - - @Override - public IssueScheduleInfo getSchedule (BugzillaIssue i) { - return i.getPersistentScheduleInfo(); - } - }; - } - return schedulingProvider; - } - - public IssueNode.ChangesProvider getChangesProvider() { - if(bcp == null) { - bcp = new IssueNode.ChangesProvider() { - @Override - public String getRecentChanges(BugzillaIssue i) { - return i.getRecentChanges(); - } - }; - } - return bcp; - } - - public IssueFinder getBugzillaIssueFinder() { - if(issueFinder == null) { - issueFinder = new IssueFinder() { - @Override - public int[] getIssueSpans(CharSequence text) { - return SimpleIssueFinder.getInstance().getIssueSpans(text); - } - @Override - public String getIssueId(String issueHyperlinkText) { - return SimpleIssueFinder.getInstance().getIssueId(issueHyperlinkText); - } - }; - } - return issueFinder; - } -} diff --git a/ide/bugzilla/src/org/netbeans/modules/bugzilla/BugzillaConfig.java b/ide/bugzilla/src/org/netbeans/modules/bugzilla/BugzillaConfig.java deleted file mode 100644 index 40a7c9545c65..000000000000 --- a/ide/bugzilla/src/org/netbeans/modules/bugzilla/BugzillaConfig.java +++ /dev/null @@ -1,226 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.netbeans.modules.bugzilla; - -import java.net.URL; -import org.netbeans.modules.bugzilla.repository.BugzillaRepository; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.logging.Level; -import java.util.prefs.BackingStoreException; -import java.util.prefs.Preferences; -import javax.swing.Icon; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.mylyn.tasks.core.IRepositoryQuery; -import org.netbeans.modules.bugzilla.query.BugzillaQuery; -import org.netbeans.modules.bugzilla.util.BugzillaUtil; -import org.netbeans.modules.mylyn.util.MylynSupport; -import org.openide.modules.Places; -import org.openide.util.ImageUtilities; -import org.openide.util.NbPreferences; - -/** - * - * @author Tomas Stupka - */ -public class BugzillaConfig { - - private static BugzillaConfig instance = null; - private static final String LAST_CHANGE_FROM = "bugzilla.last_change_from"; // NOI18N // XXX - private static final String QUERY_NAME = "bugzilla.query_"; // NOI18N - private static final String QUERY_LAST_REFRESH = "bugzilla.query_last_refresh"; // NOI18N - private static final String DELIMITER = "<=>"; // NOI18N - private static final String ATTACH_LOG = "bugzilla.attach_log"; // NOI18N; - private static final String PREF_SECTION_COLLAPSED = "collapsedSection"; //NOI18N - private static final String PREF_TASK = "task."; //NOI18N - private static final Level LOG_LEVEL = BugzillaUtil.isAssertEnabled() ? Level.SEVERE : Level.INFO; - - public static final int DEFAULT_QUERY_REFRESH = 30; - public static final int DEFAULT_ISSUE_REFRESH = 15; - private Map priorityIcons; - private Map priorityIconsURL; - - private BugzillaConfig() { } - - public static BugzillaConfig getInstance() { - if(instance == null) { - instance = new BugzillaConfig(); - } - return instance; - } - - private Preferences getPreferences() { - return NbPreferences.forModule(BugzillaConfig.class); - } - - public boolean getAttachLogFile() { - return getPreferences().getBoolean(ATTACH_LOG, true); - } - - public void putAttachLogFile(boolean attach) { - getPreferences().putBoolean(ATTACH_LOG, attach); - } - - public void putQuery(BugzillaRepository repository, BugzillaQuery query) { - getPreferences().put( - getQueryKey(repository.getID(), query.getDisplayName()), - query.getUrlParameters() + DELIMITER + /* skip query.getLastRefresh() + */ DELIMITER + query.isUrlDefined()); - } - - public void removeQuery(BugzillaRepository repository, BugzillaQuery query) { - getPreferences().remove(getQueryKey(repository.getID(), query.getDisplayName())); - try { - String storedName = query.getStoredQueryName(); - IRepositoryQuery iquery = storedName == null ? null - : MylynSupport.getInstance().getRepositoryQuery(repository.getTaskRepository(), storedName); - if (iquery != null) { - MylynSupport.getInstance().deleteQuery(iquery); - } - } catch (CoreException ex) { - Bugzilla.LOG.log(Level.WARNING, null, ex); - } - } - - public BugzillaQuery getQuery(BugzillaRepository repository, String queryName) { - String value = getStoredQuery(repository, queryName); - if(value == null) { - return null; - } - String[] values = value.split(DELIMITER); - assert values.length >= 2 : "wrong amount of stored query data [" + values.length + "] in query '" + queryName + "'"; // NOI18N - String urlParams = values[0]; - boolean urlDef = values.length > 2 ? Boolean.parseBoolean(values[2]) : false; - return repository.createPersistentQuery(queryName, urlParams, urlDef); - } - - public String getUrlParams(BugzillaRepository repository, String queryName) { - String value = getStoredQuery(repository, queryName); - if(value == null) { - return null; - } - String[] values = value.split(DELIMITER); - assert values.length >= 2; - return values[0]; - } - - public String[] getQueries(String repoID) { - return getKeysWithPrefix(QUERY_NAME + repoID + DELIMITER); - } - - public long getLastQueryRefresh(BugzillaRepository repository, String queryName) { - return getPreferences().getLong(QUERY_LAST_REFRESH + "_" + getQueryKey(repository.getID(), queryName), -1); // NOI18N - } - - public void putLastQueryRefresh(BugzillaRepository repository, String queryName, long lastRefresh) { - getPreferences().putLong(QUERY_LAST_REFRESH + "_" + getQueryKey(repository.getID(), queryName), lastRefresh); // NOI18N - } - - private String[] getKeysWithPrefix(String prefix) { - String[] keys = null; - try { - keys = getPreferences().keys(); - } catch (BackingStoreException ex) { - Bugzilla.LOG.log(Level.SEVERE, null, ex); // XXX - } - if (keys == null || keys.length == 0) { - return new String[0]; - } - List ret = new ArrayList<>(); - for (String key : keys) { - if (key.startsWith(prefix)) { - ret.add(key.substring(prefix.length())); - } - } - return ret.toArray(new String[0]); - } - - private String getQueryKey(String repositoryID, String queryName) { - return QUERY_NAME + repositoryID + DELIMITER + queryName; - } - - private String getStoredQuery(BugzillaRepository repository, String queryName) { - String value = getPreferences().get(getQueryKey(repository.getID(), queryName), null); - return value; - } - - public void setLastChangeFrom(String value) { - getPreferences().put(LAST_CHANGE_FROM, value); - } - - public String getLastChangeFrom() { - return getPreferences().get(LAST_CHANGE_FROM, ""); // NOI18N - } - - public Icon getPriorityIcon(String priority) { - if(priorityIcons == null) { - priorityIcons = new HashMap(); - priorityIcons.put("P1", ImageUtilities.loadImageIcon("org/netbeans/modules/bugzilla/resources/p1.png", true)); // NOI18N - priorityIcons.put("P2", ImageUtilities.loadImageIcon("org/netbeans/modules/bugzilla/resources/p2.png", true)); // NOI18N - priorityIcons.put("P3", ImageUtilities.loadImageIcon("org/netbeans/modules/bugzilla/resources/p3.png", true)); // NOI18N - priorityIcons.put("P4", ImageUtilities.loadImageIcon("org/netbeans/modules/bugzilla/resources/p4.png", true)); // NOI18N - priorityIcons.put("P5", ImageUtilities.loadImageIcon("org/netbeans/modules/bugzilla/resources/p5.png", true)); // NOI18N - } - return priorityIcons.get(priority); - } - - public URL getPriorityIconURL(String priority) { - if(priorityIconsURL == null) { - priorityIconsURL = new HashMap<>(); - priorityIconsURL.put("P1", BugzillaConfig.class.getClassLoader().getResource("org/netbeans/modules/bugzilla/resources/p1.png")); // NOI18N - priorityIconsURL.put("P2", BugzillaConfig.class.getClassLoader().getResource("org/netbeans/modules/bugzilla/resources/p2.png")); // NOI18N - priorityIconsURL.put("P3", BugzillaConfig.class.getClassLoader().getResource("org/netbeans/modules/bugzilla/resources/p3.png")); // NOI18N - priorityIconsURL.put("P4", BugzillaConfig.class.getClassLoader().getResource("org/netbeans/modules/bugzilla/resources/p4.png")); // NOI18N - priorityIconsURL.put("P5", BugzillaConfig.class.getClassLoader().getResource("org/netbeans/modules/bugzilla/resources/p5.png")); // NOI18N - } - return priorityIconsURL.get(priority); - } - - public void setEditorSectionCollapsed (String repositoryId, String taskId, String sectionName, boolean collapsed) { - String key = getTaskKey(repositoryId, taskId) + PREF_SECTION_COLLAPSED + sectionName; - getPreferences().putBoolean(key, collapsed); - } - - public boolean isEditorSectionCollapsed (String repositoryId, String taskId, String sectionName, boolean defaultValue) { - String key = getTaskKey(repositoryId, taskId) + PREF_SECTION_COLLAPSED + sectionName; - return getPreferences().getBoolean(key, defaultValue); - } - - private String getTaskKey (String repositoryId, String taskId) { - return PREF_TASK + repositoryId + "." + taskId + "."; - } - - /** - * Returns the path for the Bugzilla configuration directory. - * - * @return the path - * - */ - private static String getNBConfigPath() { - //T9Y - nb bugzilla confing should be changable - String t9yNbConfigPath = System.getProperty("netbeans.t9y.bugzilla.nb.config.path"); //NOI18N - if (t9yNbConfigPath != null && t9yNbConfigPath.length() > 0) { - return t9yNbConfigPath; - } - String nbHome = Places.getUserDirectory().getAbsolutePath(); //NOI18N - return nbHome + "/config/issue-tracking/org-netbeans-modules-bugzilla"; //NOI18N - } -} diff --git a/ide/bugzilla/src/org/netbeans/modules/bugzilla/BugzillaConnector.java b/ide/bugzilla/src/org/netbeans/modules/bugzilla/BugzillaConnector.java deleted file mode 100644 index 04df3ab58e0d..000000000000 --- a/ide/bugzilla/src/org/netbeans/modules/bugzilla/BugzillaConnector.java +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.netbeans.modules.bugzilla; - -import org.netbeans.modules.bugtracking.api.Repository; -import org.netbeans.modules.team.spi.TeamBugtrackingConnector; -import org.netbeans.modules.bugzilla.repository.BugzillaRepository; -import org.netbeans.modules.bugtracking.spi.BugtrackingConnector; -import org.netbeans.modules.bugtracking.spi.RepositoryInfo; -import org.netbeans.modules.bugzilla.api.NBBugzillaUtils; -import org.netbeans.modules.bugzilla.repository.NBRepositorySupport; -import org.netbeans.modules.bugzilla.util.BugzillaUtil; -import org.openide.util.NbBundle; - -/** - * - * @author Tomas Stupka - */ -@BugtrackingConnector.Registration ( - id=BugzillaConnector.ID, - displayName="#LBL_ConnectorName", - tooltip="#LBL_ConnectorTooltip", - iconPath = "org/netbeans/modules/bugzilla/resources/repository.png" -) -public class BugzillaConnector implements BugtrackingConnector, TeamBugtrackingConnector { - - public static final String ID = "org.netbeans.modules.bugzilla"; - - public BugzillaConnector() {} - - @Override - public Repository createRepository(RepositoryInfo info) { - BugzillaRepository bugzillaRepository = new BugzillaRepository(info); - if(BugzillaUtil.isNbRepository(bugzillaRepository)) { - NBRepositorySupport.getInstance().setNBBugzillaRepository(bugzillaRepository); - } - return BugzillaUtil.createRepository(bugzillaRepository); - } - - @Override - public Repository createRepository() { - Bugzilla.init(); - return BugzillaUtil.createRepository(new BugzillaRepository()); - } - - public static String getConnectorName() { - return NbBundle.getMessage(BugzillaConnector.class, "LBL_ConnectorName"); // NOI18N - } - - @Override - public BugtrackingType getType() { - return BugtrackingType.BUGZILLA; - } - - @Override - public String findNBRepository() { - return NBBugzillaUtils.findNBRepository().getId(); - } - -} diff --git a/ide/bugzilla/src/org/netbeans/modules/bugzilla/BugzillaIssueProvider.java b/ide/bugzilla/src/org/netbeans/modules/bugzilla/BugzillaIssueProvider.java deleted file mode 100644 index ecc52eb59a12..000000000000 --- a/ide/bugzilla/src/org/netbeans/modules/bugzilla/BugzillaIssueProvider.java +++ /dev/null @@ -1,99 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.netbeans.modules.bugzilla; - -import java.beans.PropertyChangeListener; -import java.io.File; -import java.util.Collection; -import org.netbeans.modules.bugtracking.spi.IssueController; -import org.netbeans.modules.bugtracking.spi.IssueProvider; -import org.netbeans.modules.bugzilla.issue.BugzillaIssue; -import org.netbeans.modules.bugzilla.repository.IssueField; - -/** - * - * @author Tomas Stupka - */ -public class BugzillaIssueProvider implements IssueProvider { - - @Override - public String getDisplayName(BugzillaIssue data) { - return data.getDisplayName(); - } - - @Override - public String getTooltip(BugzillaIssue data) { - return data.getTooltip(); - } - - @Override - public String getID(BugzillaIssue data) { - return data.getID(); - } - - @Override - public Collection getSubtasks(BugzillaIssue data) { - return data.getRepositoryFieldValues(IssueField.BLOCKS); - } - - @Override - public String getSummary(BugzillaIssue data) { - return data.getSummary(); - } - - @Override - public boolean isNew(BugzillaIssue data) { - return data.isNew(); - } - - @Override - public boolean isFinished(BugzillaIssue data) { - return data.isFinished(); - } - - @Override - public boolean refresh(BugzillaIssue data) { - return data.refresh(); - } - - @Override - public void addComment(BugzillaIssue data, String comment, boolean closeAsFixed) { - data.addComment(comment, closeAsFixed); - } - - @Override - public void attachFile(BugzillaIssue data, File file, String description, boolean isPatch) { - data.attachPatch(file, description, isPatch); - } - - @Override - public IssueController getController(BugzillaIssue data) { - return data.getController(); - } - - @Override - public void removePropertyChangeListener(BugzillaIssue data, PropertyChangeListener listener) { - data.removePropertyChangeListener(listener); - } - - @Override - public void addPropertyChangeListener(BugzillaIssue data, PropertyChangeListener listener) { - data.addPropertyChangeListener(listener); - } -} diff --git a/ide/bugzilla/src/org/netbeans/modules/bugzilla/BugzillaQueryProvider.java b/ide/bugzilla/src/org/netbeans/modules/bugzilla/BugzillaQueryProvider.java deleted file mode 100644 index 116d93b50089..000000000000 --- a/ide/bugzilla/src/org/netbeans/modules/bugzilla/BugzillaQueryProvider.java +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.netbeans.modules.bugzilla; - -import org.netbeans.modules.bugtracking.spi.QueryController; -import org.netbeans.modules.bugtracking.spi.QueryProvider; -import org.netbeans.modules.bugzilla.issue.BugzillaIssue; -import org.netbeans.modules.bugzilla.query.BugzillaQuery; - -/** - * - * @author Tomas Stupka - */ -public class BugzillaQueryProvider implements QueryProvider { - - @Override - public String getDisplayName(BugzillaQuery query) { - return query.getDisplayName(); - } - - @Override - public String getTooltip(BugzillaQuery query) { - return query.getTooltip(); - } - - @Override - public QueryController getController(BugzillaQuery query) { - return query.getController(); - } - - @Override - public boolean canRemove(BugzillaQuery q) { - return q.canRemove(); - } - - @Override - public void remove(BugzillaQuery q) { - q.remove(); - } - - @Override - public boolean canRename(BugzillaQuery q) { - return true; - } - - @Override - public void rename(BugzillaQuery q, String displayName) { - throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. - } - - @Override - public void setIssueContainer(BugzillaQuery query, IssueContainer c) { - query.getController().setContainer(c); - } - - @Override - public void refresh(BugzillaQuery query) { - query.getController().refresh(true); - } - -} diff --git a/ide/bugzilla/src/org/netbeans/modules/bugzilla/BugzillaRepositoryProvider.java b/ide/bugzilla/src/org/netbeans/modules/bugzilla/BugzillaRepositoryProvider.java deleted file mode 100644 index 29ca911f5551..000000000000 --- a/ide/bugzilla/src/org/netbeans/modules/bugzilla/BugzillaRepositoryProvider.java +++ /dev/null @@ -1,117 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.netbeans.modules.bugzilla; - -import java.awt.Image; -import java.beans.PropertyChangeListener; -import java.util.Collection; -import org.netbeans.modules.bugtracking.spi.RepositoryController; -import org.netbeans.modules.bugtracking.spi.RepositoryInfo; -import org.netbeans.modules.bugtracking.spi.RepositoryProvider; -import org.netbeans.modules.bugzilla.issue.BugzillaIssue; -import org.netbeans.modules.bugzilla.query.BugzillaQuery; -import org.netbeans.modules.bugzilla.repository.BugzillaRepository; -import org.netbeans.modules.team.spi.NBRepositoryProvider; -import org.netbeans.modules.team.spi.OwnerInfo; - -/** - * - * @author Tomas Stupka - */ -public class BugzillaRepositoryProvider implements RepositoryProvider, NBRepositoryProvider { - - @Override - public Image getIcon(BugzillaRepository r) { - return r.getIcon(); - } - - @Override - public RepositoryInfo getInfo(BugzillaRepository r) { - return r.getInfo(); - } - - @Override - public void removed(BugzillaRepository r) { - r.remove(); - } - - @Override - public RepositoryController getController(BugzillaRepository r) { - return r.getController(); - } - - @Override - public BugzillaQuery createQuery(BugzillaRepository r) { - return r.createQuery(); - } - - @Override - public BugzillaIssue createIssue(BugzillaRepository r) { - return r.createIssue(); - } - - @Override - public Collection getQueries(BugzillaRepository r) { - return r.getQueries(); - } - - @Override - public Collection simpleSearch(BugzillaRepository r, String criteria) { - return r.simpleSearch(criteria); - } - - @Override - public Collection getIssues(BugzillaRepository r, String... id) { - return r.getIssues(id); - } - - @Override - public boolean canAttachFiles(BugzillaRepository r) { - return true; - } - - @Override - public void removePropertyChangeListener(BugzillaRepository r, PropertyChangeListener listener) { - r.removePropertyChangeListener(listener); - } - - @Override - public void addPropertyChangeListener(BugzillaRepository r, PropertyChangeListener listener) { - r.addPropertyChangeListener(listener); - } - - @Override - public BugzillaIssue createIssue(BugzillaRepository r, String summary, String description) { - throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. - } - - /************************************************************************************ - * NB Bugzilla - ************************************************************************************/ - - @Override - public void setIssueOwnerInfo(BugzillaIssue i, OwnerInfo info) { - i.setOwnerInfo(info); - } - - @Override - public void setQueryOwnerInfo(BugzillaQuery q, OwnerInfo info) { - q.setOwnerInfo(info); - } -} diff --git a/ide/bugzilla/src/org/netbeans/modules/bugzilla/Bundle.properties b/ide/bugzilla/src/org/netbeans/modules/bugzilla/Bundle.properties deleted file mode 100644 index 75f05652ac00..000000000000 --- a/ide/bugzilla/src/org/netbeans/modules/bugzilla/Bundle.properties +++ /dev/null @@ -1,32 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - -OpenIDE-Module-Display-Category=Base IDE -OpenIDE-Module-Long-Description=\ - Support for Bugzilla task repository up to version 4.0 -## libs/jsch/manifest.mf -OpenIDE-Module-Name=Bugzilla -HtmlPanel.pane.contentType=text/html - -IssueTopComponent.addCommentButton.text=Add Comment -LBL_Validating=Validating... - -LBL_ConnectorName = Bugzilla -LBL_ConnectorTooltip = Bugzilla Task Repository -OpenIDE-Module-Short-Description=Bugzilla - -LBL_NotLoggedIn=(Not logged in) \ No newline at end of file diff --git a/ide/bugzilla/src/org/netbeans/modules/bugzilla/MylynRepositoryConnectorProvider.java b/ide/bugzilla/src/org/netbeans/modules/bugzilla/MylynRepositoryConnectorProvider.java deleted file mode 100644 index 8706d3b23d71..000000000000 --- a/ide/bugzilla/src/org/netbeans/modules/bugzilla/MylynRepositoryConnectorProvider.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.netbeans.modules.bugzilla; - -import org.eclipse.mylyn.internal.bugzilla.core.BugzillaRepositoryConnector; -import org.netbeans.modules.mylyn.util.RepositoryConnectorProvider; -import org.openide.util.Lookup; -import org.openide.util.lookup.ServiceProvider; -import org.openide.util.lookup.ServiceProviders; - -/** - * - * @author Ondrej Vrabec - */ -@ServiceProviders({ - @ServiceProvider(service = RepositoryConnectorProvider.class), - @ServiceProvider(service = MylynRepositoryConnectorProvider.class) -}) -public final class MylynRepositoryConnectorProvider implements RepositoryConnectorProvider { - - private static MylynRepositoryConnectorProvider INSTANCE; - - private final BugzillaRepositoryConnector rc; - - public MylynRepositoryConnectorProvider () { - rc = new BugzillaRepositoryConnector(); - } - - static MylynRepositoryConnectorProvider getInstance () { - if (INSTANCE == null) { - INSTANCE = Lookup.getDefault().lookup(MylynRepositoryConnectorProvider.class); - } - return INSTANCE; - } - - @Override - public BugzillaRepositoryConnector getConnector () { - return rc; - } - -} diff --git a/ide/bugzilla/src/org/netbeans/modules/bugzilla/api/NBBugzillaUtils.java b/ide/bugzilla/src/org/netbeans/modules/bugzilla/api/NBBugzillaUtils.java deleted file mode 100644 index c9c1bdaa00bb..000000000000 --- a/ide/bugzilla/src/org/netbeans/modules/bugzilla/api/NBBugzillaUtils.java +++ /dev/null @@ -1,148 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.netbeans.modules.bugzilla.api; - -import java.io.File; -import java.net.URL; -import org.netbeans.modules.bugtracking.api.Repository; -import org.netbeans.modules.bugtracking.api.Util; -import org.netbeans.modules.bugzilla.Bugzilla; -import org.netbeans.modules.bugzilla.issue.BugzillaIssue; -import org.netbeans.modules.bugzilla.repository.BugzillaRepository; -import org.netbeans.modules.bugzilla.repository.NBRepositorySupport; -import org.netbeans.modules.bugzilla.util.BugzillaUtil; -import org.openide.util.RequestProcessor; - -/** - * - * @author Tomas Stupka - */ -public class NBBugzillaUtils { - - /** - * Opens in the IDE the given issue from the netbeans repository - * - * @param issueID issue identifier - */ - public static void openIssue(String issueID) { - Repository nbRepo = NBRepositorySupport.getInstance().getNBRepository(false); - assert nbRepo != null; - if(nbRepo == null) { - Bugzilla.LOG.warning("No bugzilla repository available for netbeans.org"); // NOI18N - return; - } - if(issueID != null) { - Util.openIssue(nbRepo, issueID); - } else { - Util.createNewIssue(nbRepo); - } - } - - public static void reportAnIssue() { - RequestProcessor.getDefault().post(new Runnable() { - @Override - public void run() { - Repository nbRepo = NBRepositorySupport.getInstance().getNBRepository(true); - if(nbRepo != null) { - Util.createNewIssue(nbRepo); - } - } - }); - } - - /** - * Returns the netbeans.org username - * Shouldn't be called in awt - * - * @return username - */ - public static String getNBUsername() { - return org.netbeans.modules.bugtracking.commons.NBBugzillaUtils.getNBUsername(); - } - - /** - * Returns the netbeans.org password - * Shouldn't be called in awt - * - * @return password - */ - public static char[] getNBPassword() { - return org.netbeans.modules.bugtracking.commons.NBBugzillaUtils.getNBPassword(); - } - - /** - * Save the given username as a netbeans.org username. - * Shouldn't be called in awt - */ - public static void saveNBUsername(String username) { - org.netbeans.modules.bugtracking.commons.NBBugzillaUtils.saveNBUsername(username); - } - - /** - * Saves the given value as a netbeans.org password - * Shouldn't be called in awt - */ - public static void saveNBPassword(char[] password) { - org.netbeans.modules.bugtracking.commons.NBBugzillaUtils.saveNBPassword(password); - } - - /** - * Determines wheter the given url is a netbeans.org url or not - * - * @return true if the given url is netbeans.org url, otherwise false - */ - public static boolean isNbRepository(URL url) { - assert url != null; - return org.netbeans.modules.bugtracking.commons.NBBugzillaUtils.isNbRepository(url.toString()); - } - - public static Repository findNBRepository() { - return NBRepositorySupport.getInstance().getNBRepository(false); - } - - /** - * Attaches files to the issue with the given id. - * - * @param id issue id - * @param comment comment to be added to the issue - * @param desc attachment description per file - * @param contentType content type per file - * @param files files to be attached - */ - public static void attachFiles(String id, String comment, String[] desc, String[] contentType, File[] files) { - assert id != null; - assert desc != null; - assert files != null; - assert contentType != null; - assert desc.length == files.length; - assert contentType.length == files.length; - - BugzillaRepository nbRepo = NBRepositorySupport.getInstance().getNBBugzillaRepository(false); - BugzillaIssue issue = nbRepo.getIssue(id); - if(issue == null) { - return; - } - for (int i = 0; i < files.length; i++) { - issue.addAttachment(files[i], comment, desc[i], contentType[i], false); - } - BugzillaUtil.openIssue(issue); - } - -} diff --git a/ide/bugzilla/src/org/netbeans/modules/bugzilla/autoupdate/BugzillaAutoupdate.java b/ide/bugzilla/src/org/netbeans/modules/bugzilla/autoupdate/BugzillaAutoupdate.java deleted file mode 100644 index 2e08ea8acc9f..000000000000 --- a/ide/bugzilla/src/org/netbeans/modules/bugzilla/autoupdate/BugzillaAutoupdate.java +++ /dev/null @@ -1,135 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.netbeans.modules.bugzilla.autoupdate; - -import java.util.Collections; -import java.util.Set; -import java.util.WeakHashMap; -import java.util.regex.Matcher; -import java.util.regex.Pattern; -import org.eclipse.mylyn.internal.bugzilla.core.BugzillaVersion; -import org.netbeans.modules.bugtracking.commons.AutoupdateSupport; -import org.netbeans.modules.bugzilla.Bugzilla; -import org.netbeans.modules.bugzilla.repository.BugzillaConfiguration; -import org.netbeans.modules.bugzilla.repository.BugzillaRepository; -import org.openide.util.NbBundle; - -/** - * - * @author Tomas Stupka - */ -public class BugzillaAutoupdate { - - public static final BugzillaVersion SUPPORTED_BUGZILLA_VERSION; - static { - String version = System.getProperty("netbeans.t9y.bugzilla.supported.version"); // NOI18N - SUPPORTED_BUGZILLA_VERSION = version != null ? new BugzillaVersion(version) : BugzillaVersion.BUGZILLA_4_0; // NOI18N - } - static final String BUGZILLA_MODULE_CODE_NAME = "org.netbeans.modules.bugzilla"; // NOI18N - - private static final Pattern VERSION_PATTERN = Pattern.compile("^.*version ((\\d+?\\.\\d+?\\.\\d+?)|(\\d+?\\.\\d+?)).*$"); - - private static BugzillaAutoupdate instance; - - private final Set repos = Collections.newSetFromMap(new WeakHashMap<>()); - - private final AutoupdateSupport support = new AutoupdateSupport(new AutoupdateCallback(), BUGZILLA_MODULE_CODE_NAME, NbBundle.getMessage(Bugzilla.class, "LBL_ConnectorName")); - - private BugzillaAutoupdate() { } - - public static BugzillaAutoupdate getInstance() { - if(instance == null) { - instance = new BugzillaAutoupdate(); - } - return instance; - } - - /** - * Checks if the remote Bugzilla repository has a version higher then actually - * supported and if an update is available on the UC. - * - * @param repository the repository to check the version for - */ - public void checkAndNotify(final BugzillaRepository repository) { - synchronized(repos) { - repos.add(repository); - } - support.checkAndNotify(repository.getUrl()); - } - - public boolean isSupportedVersion(BugzillaVersion version) { - return version.compareTo(SUPPORTED_BUGZILLA_VERSION) <= 0; - } - - public BugzillaVersion getVersion(String desc) { - String[] lines = desc.split("\n"); - for (String l : lines) { - Matcher m = VERSION_PATTERN.matcher(l); - if(m.matches()) { - return new BugzillaVersion(m.group(1)) ; - } - } - return null; - } - - public BugzillaVersion getServerVersion(BugzillaRepository repository) { - BugzillaConfiguration conf = repository.getConfiguration(); - if(!conf.isValid()) { - return null; // do not force the wrong version notification - } - BugzillaVersion version = conf.getInstalledVersion(); - return version; - } - - public AutoupdateSupport getAutoupdateSupport() { - return support; - } - - class AutoupdateCallback implements AutoupdateSupport.Callback { - @Override - public String getServerVersion(String url) { - BugzillaRepository repository = null; - synchronized (repos) { - for (BugzillaRepository r : repos) { - if(r.getUrl().equals(url)) { - repository = r; - } - } - } - assert repository != null : "no repository found for url " + url; - if(repository == null) { - return null; - } - BugzillaVersion version = BugzillaAutoupdate.this.getServerVersion(repository); - return version != null ? version.toString() : null; - } - - @Override - public boolean checkIfShouldDownload(String desc) { - BugzillaVersion version = getVersion(desc); - return version != null && SUPPORTED_BUGZILLA_VERSION.compareTo(version) < 0; - } - - @Override - public boolean isSupportedVersion(String version) { - return BugzillaAutoupdate.this.isSupportedVersion(new BugzillaVersion(version)); - } - }; -} diff --git a/ide/bugzilla/src/org/netbeans/modules/bugzilla/commands/AddAttachmentCommand.java b/ide/bugzilla/src/org/netbeans/modules/bugzilla/commands/AddAttachmentCommand.java deleted file mode 100644 index 1e61660164e4..000000000000 --- a/ide/bugzilla/src/org/netbeans/modules/bugzilla/commands/AddAttachmentCommand.java +++ /dev/null @@ -1,94 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.netbeans.modules.bugzilla.commands; - -import java.io.File; -import java.io.IOException; -import java.net.MalformedURLException; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.NullProgressMonitor; -import org.eclipse.mylyn.internal.tasks.core.data.FileTaskAttachmentSource; -import org.eclipse.mylyn.tasks.core.data.TaskAttribute; -import org.netbeans.modules.bugzilla.Bugzilla; -import org.netbeans.modules.bugzilla.repository.BugzillaRepository; -import org.netbeans.modules.mylyn.util.BugtrackingCommand; - -/** - * - * @author Tomas Stupka - */ -public class AddAttachmentCommand extends BugtrackingCommand { - - private final String id; - private final BugzillaRepository repository; - private final String comment; - private final FileTaskAttachmentSource attachmentSource; - private final TaskAttribute attAttribute; - private final File file; - private String stringValue; - - public AddAttachmentCommand(String id, BugzillaRepository repository, String comment, FileTaskAttachmentSource attachmentSource, File file, TaskAttribute attAttribute) { - this.id = id; - this.repository = repository; - this.comment = comment; - this.attachmentSource = attachmentSource; - this.file = file; - this.attAttribute = attAttribute; - } - - @Override - public void execute() throws CoreException, IOException, MalformedURLException { - Bugzilla.getInstance().getClient(repository) - .postAttachment( - id, - comment, - attachmentSource, - attAttribute, - new NullProgressMonitor()); - } - - @Override - public String toString() { - if(stringValue == null) { - StringBuilder sb = new StringBuilder(); - sb.append("AddAttachmentCommand [repository="); // NOI18N - sb.append(repository.getUrl()); - sb.append(",id="); // NOI18N - sb.append(id); - sb.append(",comment="); // NOI18N - sb.append(comment); - sb.append(",file="); // NOI18N - sb.append(file.getAbsolutePath()); - sb.append(",desc="); // NOI18N - TaskAttribute ta = attAttribute.getMappedAttribute(TaskAttribute.ATTACHMENT_DESCRIPTION); - sb.append(ta != null ? ta.getValue() : ""); // NOI18N - sb.append(",patch="); // NOI18N - ta = attAttribute.getMappedAttribute(TaskAttribute.ATTACHMENT_IS_PATCH); - sb.append(ta != null ? ta.getValue() : ""); // NOI18N - sb.append(",contentType="); // NOI18N - ta = attAttribute.getMappedAttribute(TaskAttribute.ATTACHMENT_CONTENT_TYPE); - sb.append(ta != null ? ta.getValue() : ""); // NOI18N - sb.append("]"); // NOI18N - stringValue = sb.toString(); - } - return stringValue; - } - -} diff --git a/ide/bugzilla/src/org/netbeans/modules/bugzilla/commands/BugzillaExecutor.java b/ide/bugzilla/src/org/netbeans/modules/bugzilla/commands/BugzillaExecutor.java deleted file mode 100644 index e7ecaa411ab7..000000000000 --- a/ide/bugzilla/src/org/netbeans/modules/bugzilla/commands/BugzillaExecutor.java +++ /dev/null @@ -1,612 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.netbeans.modules.bugzilla.commands; - -import java.io.IOException; -import java.net.ConnectException; -import java.net.MalformedURLException; -import java.net.NoRouteToHostException; -import java.net.SocketTimeoutException; -import java.net.UnknownHostException; -import java.text.MessageFormat; -import java.util.HashMap; -import java.util.Map; -import java.util.MissingResourceException; -import java.util.concurrent.Callable; -import java.util.logging.Level; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.mylyn.internal.bugzilla.core.BugzillaStatus; -import org.eclipse.mylyn.internal.bugzilla.core.BugzillaUserMatchResponse; -import org.eclipse.mylyn.internal.bugzilla.core.BugzillaVersion; -import org.eclipse.mylyn.tasks.core.RepositoryStatus; -import org.netbeans.modules.bugtracking.commons.NBBugzillaUtils; -import org.netbeans.modules.bugzilla.Bugzilla; -import org.netbeans.modules.bugzilla.autoupdate.BugzillaAutoupdate; -import org.netbeans.modules.bugzilla.repository.BugzillaConfiguration; -import org.netbeans.modules.bugzilla.repository.BugzillaRepository; -import org.netbeans.modules.mylyn.util.BugtrackingCommand; -import org.netbeans.modules.mylyn.util.SubmitCommand; -import org.netbeans.modules.mylyn.util.commands.SynchronizeQueryCommand; -import org.openide.DialogDescriptor; -import org.openide.DialogDisplayer; -import org.openide.NotifyDescriptor; -import org.openide.util.Exceptions; -import org.openide.util.HelpCtx; -import org.openide.util.NbBundle; - -/** - * Executes commands against one bugzilla Repository and handles errors - * - * @author Tomas Stupka - */ -public class BugzillaExecutor { - - private static final String HTTP_ERROR_NOT_FOUND = "http error: not found"; // NOI18N - private static final String EMPTY_PASSWORD = "Empty password not allowed to login"; // NOI18N - private static final String USERNAME_CONFIRM_MATCH = "Confirm Match"; // NOI18N - private static final String INVALID_USERNAME_OR_PASSWORD = "invalid username or password"; // NOI18N - private static final String REPOSITORY_LOGIN_FAILURE = "unable to login to"; // NOI18N - private static final String COULD_NOT_BE_FOUND = "could not be found"; // NOI18N - private static final String REPOSITORY = "repository"; // NOI18N - private static final String MIDAIR_COLLISION = "mid-air collision occurred while submitting to"; // NOI18N - - private final BugzillaRepository repository; - - private static final Map> handlerCalls = new HashMap<>(); - - public BugzillaExecutor(BugzillaRepository repository) { - this.repository = repository; - } - - public void execute(BugtrackingCommand cmd) { - execute(cmd, true); - } - - public void execute(BugtrackingCommand cmd, boolean handleExceptions) { - execute(cmd, handleExceptions, true); - } - - public void execute(BugtrackingCommand cmd, boolean handleExceptions, boolean checkVersion) { - execute(cmd, handleExceptions ? 0 : -1, checkVersion, true, true); - } - - public void execute(BugtrackingCommand cmd, boolean handleExceptions, boolean checkVersion, boolean ensureCredentials) { - execute(cmd, handleExceptions ? 0 : -1, checkVersion, ensureCredentials, true); - } - - private void execute(BugtrackingCommand cmd, int handleCounter, boolean checkVersion, boolean ensureCredentials, boolean reexecute) { - boolean handleExceptions = handleCounter++ > -1 && handleCounter < 10; - - try { - - cmd.setFailed(true); - - if(checkVersion) { - checkAutoupdate(); - } - - if(ensureCredentials) { - if( ( cmd instanceof AddAttachmentCommand || - cmd instanceof SubmitCommand ) - && !checkAndEnsureNBCredentials()) - { - return; - } - repository.ensureCredentials(); - } - - Bugzilla.LOG.log(Level.FINE, "execute {0}", cmd); // NOI18N - cmd.execute(); - - if(cmd instanceof SynchronizeQueryCommand) { - SynchronizeQueryCommand pqc = (SynchronizeQueryCommand) cmd; - if(handleStatus(pqc, handleExceptions)) { - return; - } - } - - cmd.setFailed(false); - cmd.setErrorMessage(null); - - synchronized ( handlerCalls ) { - handlerCalls.remove(repository.getUrl()); - } - - } catch (CoreException ce) { - Bugzilla.LOG.log(Level.FINE, null, ce); - - ExceptionHandler handler; - if(cmd instanceof ValidateCommand) { - handler = ExceptionHandler.createHandler(ce, this, null, ((ValidateCommand)cmd), reexecute); - } else { - handler = ExceptionHandler.createHandler(ce, this, repository, null, reexecute); - } - assert handler != null; - - String msg = handler.getMessage(); - - cmd.setFailed(true); - cmd.setErrorMessage(msg); - - if(handleExceptions) { - if(handler.handle()) { - // execute again - execute(cmd, handleCounter, checkVersion, ensureCredentials, !handler.reexecuteOnce()); - } - } - return; - - } catch(MalformedURLException me) { - cmd.setErrorMessage(me.getMessage()); - Bugzilla.LOG.log(Level.SEVERE, null, me); - } catch(IOException ioe) { - cmd.setErrorMessage(ioe.getMessage()); - - if(!handleExceptions) { - Bugzilla.LOG.log(Level.FINE, null, ioe); - return; - } - - handleIOException(ioe); - } catch(RuntimeException re) { - Throwable t = re.getCause(); - if(t instanceof InterruptedException || !handleExceptions) { - Bugzilla.LOG.log(Level.FINE, null, t); - } else { - Bugzilla.LOG.log(Level.SEVERE, null, re); - } - } - } - - /** - * Returnes true if the given commands status != ok - * @param cmd - * @param handleExceptions - * @return - * @throws CoreException - */ - private boolean handleStatus(SynchronizeQueryCommand cmd, boolean handleExceptions) throws CoreException { - IStatus status = cmd.getStatus(); - if(status == null || status.isOK()) { - return false; - } - Bugzilla.LOG.log(Level.FINE, "command {0} returned status : {1}", new Object[] {cmd, status.getMessage()}); // NOI18N - - if (status.getException() instanceof CoreException) { - throw (CoreException) status.getException(); - } - - boolean isHtml = false; - String errMsg = null; - if(status instanceof RepositoryStatus) { - RepositoryStatus rstatus = (RepositoryStatus) status; - errMsg = rstatus.getHtmlMessage(); - isHtml = errMsg != null; - } - if(errMsg == null) { - errMsg = status.getMessage(); - } - cmd.setErrorMessage(errMsg); - cmd.setFailed(true); - - if(!handleExceptions) { - return true; - } - - BugzillaConfiguration conf = repository.getConfiguration(); - if(conf.isValid()) { - BugzillaVersion version = conf.getInstalledVersion(); - if(version.compareMajorMinorOnly(BugzillaAutoupdate.SUPPORTED_BUGZILLA_VERSION) > 0) { - notifyErrorMessage( - NbBundle.getMessage(BugzillaExecutor.class, "MSG_BUGZILLA_ERROR_WARNING", status.getMessage()) + "\n\n" + - NbBundle.getMessage(BugzillaExecutor.class, "MSG_BUGZILLA_VERSION_WARNING1", version) + "\n" + // NOI18N - (true ? NbBundle.getMessage(BugzillaExecutor.class, "MSG_BUGZILLA_VERSION_WARNING2") : "")); // NOI18N - return true; - } - } - if(isHtml) { - notifyHtmlMessage(errMsg, repository, true); - } else { - notifyErrorMessage(NbBundle.getMessage(BugzillaExecutor.class, "MSG_BUGZILLA_ERROR_WARNING", errMsg)); // NOI18N - } - return true; - } - - static void notifyErrorMessage(String msg) { - if("true".equals(System.getProperty("netbeans.t9y.throwOnClientError", "false"))) { // NOI18N - Bugzilla.LOG.info(msg); - throw new AssertionError(msg); - } - NotifyDescriptor nd = - new NotifyDescriptor( - msg, - NbBundle.getMessage(BugzillaExecutor.class, "LBLError"), // NOI18N - NotifyDescriptor.DEFAULT_OPTION, - NotifyDescriptor.ERROR_MESSAGE, - new Object[] {NotifyDescriptor.OK_OPTION}, - NotifyDescriptor.OK_OPTION); - DialogDisplayer.getDefault().notify(nd); - } - - private static boolean notifyHtmlMessage(String html, BugzillaRepository repository, boolean htmlTextIsAllYouGot) throws MissingResourceException { - if (html != null && !html.trim().equals("")) { // NOI18N - html = parseHtmlMessage(html, htmlTextIsAllYouGot); - if(html == null) { - return false; - } - final HtmlPanel p = new HtmlPanel(); - String label = NbBundle.getMessage( - BugzillaExecutor.class, - "MSG_ServerResponse", // NOI18N - new Object[] { repository.getDisplayName() } - ); - p.setHtml(repository.getUrl(), html, label); - DialogDescriptor dialogDescriptor = - new DialogDescriptor( - p, - NbBundle.getMessage(BugzillaExecutor.class, "CTL_ServerResponse"), // NOI18N - true, - new Object[] { NotifyDescriptor.CANCEL_OPTION }, - NotifyDescriptor.CANCEL_OPTION, - DialogDescriptor.DEFAULT_ALIGN, - new HelpCtx(p.getClass()), - null - ); - DialogDisplayer.getDefault().notify(dialogDescriptor); - return true; - } - return false; - } - - @SuppressWarnings("empty-statement") - private static String parseHtmlMessage(String html, boolean htmlTextIsAllYouGot) { - int idxS = html.indexOf("
"); // NOI18N - if(idxS < 0) { - return html; - } - int idx = idxS; - int idxE = html.indexOf("
", idx); // NOI18N - if(!htmlTextIsAllYouGot && idxE < 0) { - // there is no closing tag and we don't have to relly on the html text - // as on the only msg we got, so skip parsing - return null; - } - - int levels = 1; - while(true) { - idx = html.indexOf(" idxE) { - break; - } - levels++; - } - idxE = idxS; - for (int i = 0; i < levels; i++) { - idxE = html.indexOf("", idxE + 1); // NOI18N - } - idxE = idxE > 6 ? idxE + 6 : html.length(); - html = html.substring(idxS, idxE); - - // very nice - html = html.replace("Please press Back and try again.", ""); // NOI18N - - return html; - } - - public boolean handleIOException(IOException io) { - Bugzilla.LOG.log(Level.SEVERE, null, io); - return true; - } - - @NbBundle.Messages({"MSG_MissingUsername=Missing username."}) - private boolean checkAndEnsureNBCredentials() { - if( NBBugzillaUtils.isNbRepository(repository.getUrl()) && - (repository.getUsername() == null || repository.getUsername().trim().equals("")) ) - { - boolean ret = repository.authenticate(Bundle.MSG_MissingUsername()); - if(!ret) { - notifyErrorMessage(NbBundle.getMessage(BugzillaExecutor.class, "MSG_ActionCanceledByUser")); // NOI18N - } - return ret; - } - return true; - } - - private abstract static class ExceptionHandler { - - protected String errroMsg; - protected CoreException ce; - protected BugzillaExecutor executor; - protected BugzillaRepository repository; - - protected ExceptionHandler(CoreException ce, String msg, BugzillaExecutor executor, BugzillaRepository repository) { - this.errroMsg = msg; - this.ce = ce; - this.executor = executor; - this.repository = repository; - } - - static ExceptionHandler createHandler(CoreException ce, BugzillaExecutor executor, BugzillaRepository repository, ValidateCommand validateCommand, boolean forRexecute) { - String errormsg = getLoginError(repository, validateCommand, ce); - if(errormsg != null) { - return new LoginHandler(ce, errormsg, executor, repository); - } - errormsg = getNotFoundError(ce); - if(errormsg != null) { - return new NotFoundHandler(ce, errormsg, executor, repository); - } - errormsg = getMidAirColisionError(ce); - if(errormsg != null) { - if(forRexecute) { - return new MidAirHandler(ce, errormsg, executor, repository); - } else { - errormsg = MessageFormat.format(errormsg, repository.getDisplayName()); - return new DefaultHandler(ce, errormsg, executor, repository); - } - } - return new DefaultHandler(ce, null, executor, repository); - } - - abstract boolean handle(); - - boolean reexecuteOnce() { - return false; - } - - private static String getLoginError(BugzillaRepository repository, ValidateCommand validateCommand, CoreException ce) { - String msg = getMessage(ce); - if(msg != null) { - msg = msg.trim().toLowerCase(); - if(INVALID_USERNAME_OR_PASSWORD.equals(msg) || - msg.contains(INVALID_USERNAME_OR_PASSWORD) || - msg.contains(EMPTY_PASSWORD) || - msg.contains(USERNAME_CONFIRM_MATCH)) - { - Bugzilla.LOG.log(Level.FINER, "returned error message [{0}]", msg); // NOI18N - String url; - if(validateCommand != null) { - url = validateCommand.getUrl(); - } else { - url = repository.getUrl(); - } - if(url != null && NBBugzillaUtils.isNbRepository(url)) { - String user; - if(validateCommand != null) { - user = validateCommand.getUser(); - } else { - user = repository.getUsername(); - } - if(user != null && user.contains("@")) { - return NbBundle.getMessage(BugzillaExecutor.class, "MSG_INVALID_USERNAME_OR_PASSWORD") + // NOI18N - " " + // NOI18N - NbBundle.getMessage(BugzillaExecutor.class, "MSG_INVALID_USERNAME_OR_PASSWORD_NO_MAIL"); // NOI18N - } - } - return NbBundle.getMessage(BugzillaExecutor.class, "MSG_INVALID_USERNAME_OR_PASSWORD"); // NOI18N - } else if(msg.startsWith(REPOSITORY_LOGIN_FAILURE) || - (msg.startsWith(REPOSITORY) && msg.endsWith(COULD_NOT_BE_FOUND))) - { - Bugzilla.LOG.log(Level.FINER, "returned error message [{0}]", msg); // NOI18N - return NbBundle.getMessage(BugzillaExecutor.class, "MSG_UNABLE_LOGIN_TO_REPOSITORY"); // NOI18N - } - } - return null; - } - - private static String getMidAirColisionError(CoreException ce) { - String msg = getMessage(ce); - if(msg != null) { - msg = msg.trim().toLowerCase(); - if(msg.startsWith(MIDAIR_COLLISION)) { - Bugzilla.LOG.log(Level.FINER, "returned error message [{0}]", msg); // NOI18N - return NbBundle.getMessage(BugzillaExecutor.class, "MSG_MID-AIR_COLLISION"); // NOI18N - } - } - return null; - } - - private static String getNotFoundError(CoreException ce) { - IStatus status = ce.getStatus(); - Throwable t = status.getException(); - if(t instanceof UnknownHostException || - // XXX maybe a different msg ? - t instanceof SocketTimeoutException || - t instanceof NoRouteToHostException || - t instanceof ConnectException) - { - Bugzilla.LOG.log(Level.FINER, null, t); - return NbBundle.getMessage(BugzillaExecutor.class, "MSG_HOST_NOT_FOUND"); // NOI18N - } - String msg = getMessage(ce); - if(msg != null) { - msg = msg.trim().toLowerCase(); - if(HTTP_ERROR_NOT_FOUND.equals(msg)) { - Bugzilla.LOG.log(Level.FINER, "returned error message [{0}]", msg); // NOI18N - return NbBundle.getMessage(BugzillaExecutor.class, "MSG_HOST_NOT_FOUND"); // NOI18N - } - } - return null; - } - - static String getMessage(CoreException ce) { - String msg = ce.getMessage(); - if(msg != null && !msg.trim().equals("")) { // NOI18N - return msg; - } - IStatus status = ce.getStatus(); - msg = status != null ? status.getMessage() : null; - return msg != null ? msg.trim() : null; - } - - String getMessage() { - return errroMsg; - } - - private static void notifyError(CoreException ce, BugzillaRepository repository) { - String msg = getMessage(ce); - IStatus status = ce.getStatus(); - if (status instanceof BugzillaStatus) { - BugzillaStatus bs = (BugzillaStatus) status; - BugzillaUserMatchResponse res = bs.getUserMatchResponse(); - - if(res != null) { - String assignedMsg = res.getAssignedToMsg(); - String newCCMsg = res.getNewCCMsg(); - String qaContactMsg = res.getQaContactMsg(); - - StringBuilder sb = new StringBuilder(); - if(msg != null) { - sb.append(msg); - } - if(assignedMsg != null) { - sb.append('\n'); - sb.append(assignedMsg); - } - if (newCCMsg != null) { - sb.append('\n'); - sb.append(newCCMsg); - } - if (qaContactMsg != null) { - sb.append('\n'); - sb.append(qaContactMsg); - } - msg = sb.toString(); - } - } - - if (msg == null && status instanceof RepositoryStatus) { - RepositoryStatus rs = (RepositoryStatus) status; - String html = rs.getHtmlMessage(); - if(notifyHtmlMessage(html, repository, msg == null)) return; - } - notifyErrorMessage(msg); - } - - private static class LoginHandler extends ExceptionHandler { - public LoginHandler(CoreException ce, String msg, BugzillaExecutor executor, BugzillaRepository repository) { - super(ce, msg, executor, repository); - } - @Override - String getMessage() { - return errroMsg; - } - @Override - protected boolean handle() { - boolean ret = repository.authenticate(errroMsg); - if(!ret) { - notifyErrorMessage(NbBundle.getMessage(BugzillaExecutor.class, "MSG_ActionCanceledByUser")); // NOI18N - } - return ret; - } - } - - private static class MidAirHandler extends ExceptionHandler { - public MidAirHandler(CoreException ce, String msg, BugzillaExecutor executor, BugzillaRepository repository) { - super(ce, msg, executor, repository); - } - @Override - String getMessage() { - return errroMsg; - } - @Override - protected boolean handle() { - repository.refreshConfiguration(); - BugzillaConfiguration bc = repository.getConfiguration(); - return bc != null && bc.isValid(); - } - @Override - boolean reexecuteOnce() { - return true; - } - } - - private static class NotFoundHandler extends ExceptionHandler { - public NotFoundHandler(CoreException ce, String msg, BugzillaExecutor executor, BugzillaRepository repository) { - super(ce, msg, executor, repository); - } - @Override - String getMessage() { - return errroMsg; - } - @Override - protected boolean handle() { - Callable c; - synchronized ( handlerCalls ) { - final String key = repository.getUrl(); - c = handlerCalls.get(key); - if(c == null) { - c = new Callable() { - private boolean alreadyCalled = false; - @Override - public Boolean call() { - if(alreadyCalled) { - Bugzilla.LOG.log(Level.INFO, key, ce); - return false; - } - // do not handle this kind of erorr until flag turned false by a succesfull command - alreadyCalled = true; - boolean ret = Bugzilla.getInstance().getBugtrackingFactory().editRepository(executor.repository, errroMsg); - if(!ret) { - notifyErrorMessage(NbBundle.getMessage(BugzillaExecutor.class, "MSG_ActionCanceledByUser")); // NOI18N - } - return ret; - } - }; - handlerCalls.put(key, c); - } - } - try { - return c.call(); - } catch (Exception ex) { - Exceptions.printStackTrace(ex); - } - return false; - } - } - private static class DefaultHandler extends ExceptionHandler { - public DefaultHandler(CoreException ce, String msg, BugzillaExecutor executor, BugzillaRepository repository) { - super(ce, msg, executor, repository); - } - @Override - String getMessage() { - return errroMsg; - } - @Override - protected boolean handle() { - if(errroMsg != null) { - notifyErrorMessage(errroMsg); - } else { - notifyError(ce, repository); - } - return false; - } - } - } - - private void checkAutoupdate() { - try { - BugzillaAutoupdate.getInstance().checkAndNotify(repository); - } catch (Throwable t) { - Bugzilla.LOG.log(Level.SEVERE, "Exception in Bugzilla autoupdate check.", t); // NOI18N - } - } -} - diff --git a/ide/bugzilla/src/org/netbeans/modules/bugzilla/commands/Bundle.properties b/ide/bugzilla/src/org/netbeans/modules/bugzilla/commands/Bundle.properties deleted file mode 100644 index 89d8c0ca3987..000000000000 --- a/ide/bugzilla/src/org/netbeans/modules/bugzilla/commands/Bundle.properties +++ /dev/null @@ -1,36 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - -## libs/jsch/manifest.mf -LBL_Authenticate=Invalid Username or Password -LBLError=Error - -MSG_ActionCanceledByUser = Action canceled by user - -CTL_ServerResponse = Server response -MSG_ServerResponse = The Bugzilla task repository ''{0}'' returned the following response: -MSG_INVALID_USERNAME_OR_PASSWORD=Invalid Username or Password. -MSG_INVALID_USERNAME_OR_PASSWORD_NO_MAIL=Do not use email for username. -NO_URLDISPLAYER_FOUND.=No URLDisplayer found. -HTMLBROWSER.URLDISPLAYER_FOUND.=HtmlBrowser.URLDisplayer found. -MSG_HOST_NOT_FOUND=Host not found -MSG_MID-AIR_COLLISION=Mid-air collision occurred while submitting to ''{0}''.\nRefresh the task and re-submit changes. -MSG_UNABLE_LOGIN_TO_REPOSITORY=Unable login to repository. -MSG_BUGZILLA_VERSION_WARNING1=The installed Bugzilla plugin does not support Bugzilla {0}. -MSG_BUGZILLA_VERSION_WARNING2=You can use the Plugin manager to update the plugin from the Update Center. -MSG_BUGZILLA_ERROR_WARNING=The following error was returned:\n\n{0} - diff --git a/ide/bugzilla/src/org/netbeans/modules/bugzilla/commands/GetAttachmentCommand.java b/ide/bugzilla/src/org/netbeans/modules/bugzilla/commands/GetAttachmentCommand.java deleted file mode 100644 index bda8c394bf3b..000000000000 --- a/ide/bugzilla/src/org/netbeans/modules/bugzilla/commands/GetAttachmentCommand.java +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.netbeans.modules.bugzilla.commands; - -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.net.MalformedURLException; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.NullProgressMonitor; -import org.netbeans.modules.bugzilla.Bugzilla; -import org.netbeans.modules.bugzilla.repository.BugzillaRepository; -import org.netbeans.modules.bugzilla.util.FileUtils; -import org.netbeans.modules.mylyn.util.BugtrackingCommand; - -/** - * - * @author Tomas Stupka - */ -public class GetAttachmentCommand extends BugtrackingCommand { - private BugzillaRepository repository; - private final String id; - private final OutputStream os; - private String stringValue; - - public GetAttachmentCommand(BugzillaRepository repository, String id, OutputStream os) { - this.repository = repository; - this.id = id; - this.os = os; - } - - @Override - public void execute() throws CoreException, IOException, MalformedURLException { - InputStream is = Bugzilla.getInstance().getClient(repository).getAttachmentData(id, new NullProgressMonitor()); - FileUtils.copyStream(is, os); - } - - @Override - public String toString() { - if(stringValue == null) { - StringBuilder sb = new StringBuilder(); - sb.append("GetAttachmentCommand [repository="); // NOI18N - sb.append(repository.getUrl()); - sb.append(",attachmentID="); // NOI18N - sb.append(id); - sb.append("]"); // NOI18N - stringValue = sb.toString(); - } - return stringValue; - } - -} diff --git a/ide/bugzilla/src/org/netbeans/modules/bugzilla/commands/GetConfigurationCommand.java b/ide/bugzilla/src/org/netbeans/modules/bugzilla/commands/GetConfigurationCommand.java deleted file mode 100644 index 4dea45383a33..000000000000 --- a/ide/bugzilla/src/org/netbeans/modules/bugzilla/commands/GetConfigurationCommand.java +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.netbeans.modules.bugzilla.commands; - -import java.io.IOException; -import java.net.MalformedURLException; -import java.util.logging.Level; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.mylyn.internal.bugzilla.core.RepositoryConfiguration; -import org.netbeans.modules.bugzilla.Bugzilla; -import org.netbeans.modules.bugzilla.repository.BugzillaRepository; -import org.netbeans.modules.mylyn.util.BugtrackingCommand; - -/** - * - * @author Tomas Stupka - */ -public class GetConfigurationCommand extends BugtrackingCommand { - - private final boolean forceRefresh; - private BugzillaRepository repository; - private RepositoryConfiguration conf; - - public GetConfigurationCommand(boolean forceRefresh, BugzillaRepository repository) { - this.forceRefresh = forceRefresh; - this.repository = repository; - } - - @Override - public void execute() throws CoreException, IOException, MalformedURLException { - boolean refresh = forceRefresh; - String b = System.getProperty("org.netbeans.modules.bugzilla.persistentRepositoryConfiguration", "false"); // NOI18N - if("true".equals(b)) { // NOI18N - refresh = true; - } - Bugzilla.LOG.log(Level.FINE, " Refresh bugzilla configuration [{0}, forceRefresh={1}]", new Object[]{repository.getUrl(), refresh}); // NOI18N - conf = Bugzilla.getInstance().getRepositoryConfiguration(repository, refresh); - } - - public RepositoryConfiguration getConf() { - return hasFailed() ? null : conf; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("GetConfigurationCommand [repository="); // NOI18N - sb.append(repository.getUrl()); - sb.append("]"); // NOI18N - return sb.toString(); - } - -} diff --git a/ide/bugzilla/src/org/netbeans/modules/bugzilla/commands/HtmlPanel.form b/ide/bugzilla/src/org/netbeans/modules/bugzilla/commands/HtmlPanel.form deleted file mode 100644 index ebce4a88a64c..000000000000 --- a/ide/bugzilla/src/org/netbeans/modules/bugzilla/commands/HtmlPanel.form +++ /dev/null @@ -1,89 +0,0 @@ - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
diff --git a/ide/bugzilla/src/org/netbeans/modules/bugzilla/commands/HtmlPanel.java b/ide/bugzilla/src/org/netbeans/modules/bugzilla/commands/HtmlPanel.java deleted file mode 100644 index ceb3a8dce1af..000000000000 --- a/ide/bugzilla/src/org/netbeans/modules/bugzilla/commands/HtmlPanel.java +++ /dev/null @@ -1,117 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.netbeans.modules.bugzilla.commands; - -import java.net.MalformedURLException; -import java.net.URL; -import java.util.logging.Level; -import javax.swing.event.HyperlinkEvent; -import javax.swing.event.HyperlinkListener; -import org.netbeans.modules.bugzilla.Bugzilla; -import org.openide.awt.HtmlBrowser; -import org.openide.util.NbBundle; - -/** - * - * @author Tomas Stupka - */ -public class HtmlPanel extends javax.swing.JPanel { - - /** Creates new form HtmlPanel */ - public HtmlPanel() { - initComponents(); - } - - void setHtml(final String baseUrl, String html, String label) { - pane.setText(html); - pane.addHyperlinkListener(new HyperlinkListener() { - public void hyperlinkUpdate(HyperlinkEvent e) { - if(e.getEventType() != HyperlinkEvent.EventType.ACTIVATED) return; - String desc = e.getDescription(); - URL url = null; - try { - url = new URL(baseUrl + "/" + desc); // NOI18N - } catch (MalformedURLException mue) { - Bugzilla.LOG.log(Level.WARNING, null, mue); - return; - } - HtmlBrowser.URLDisplayer displayer = HtmlBrowser.URLDisplayer.getDefault (); - assert displayer != null : NbBundle.getMessage(HtmlPanel.class, "HTMLBROWSER.URLDISPLAYER_FOUND."); // NOI18N - if (displayer != null) { - displayer.showURL(url); - } else { - Bugzilla.LOG.info(NbBundle.getMessage(HtmlPanel.class, "NO_URLDISPLAYER_FOUND.")); // NOI18N - } - } - }); - this.label.setText(label); - } - - /** This method is called from within the constructor to - * initialize the form. - * WARNING: Do NOT modify this code. The content of this method is - * always regenerated by the Form Editor. - */ - @SuppressWarnings("unchecked") - // //GEN-BEGIN:initComponents - private void initComponents() { - - jScrollPane1 = new javax.swing.JScrollPane(); - pane = new javax.swing.JTextPane(); - label = new javax.swing.JLabel(); - - pane.setContentType("text/html"); - pane.setEditable(false); - jScrollPane1.setViewportView(pane); - - label.setText(org.openide.util.NbBundle.getMessage(HtmlPanel.class, "MSG_ServerResponse")); // NOI18N - - javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); - this.setLayout(layout); - layout.setHorizontalGroup( - layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(layout.createSequentialGroup() - .addContainerGap() - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(layout.createSequentialGroup() - .addComponent(label) - .addGap(0, 173, Short.MAX_VALUE)) - .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 575, Short.MAX_VALUE)) - .addContainerGap()) - ); - layout.setVerticalGroup( - layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(layout.createSequentialGroup() - .addContainerGap() - .addComponent(label) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 377, Short.MAX_VALUE) - .addContainerGap()) - ); - }// //GEN-END:initComponents - - - // Variables declaration - do not modify//GEN-BEGIN:variables - private javax.swing.JScrollPane jScrollPane1; - private javax.swing.JLabel label; - private javax.swing.JTextPane pane; - // End of variables declaration//GEN-END:variables - -} diff --git a/ide/bugzilla/src/org/netbeans/modules/bugzilla/commands/ValidateCommand.java b/ide/bugzilla/src/org/netbeans/modules/bugzilla/commands/ValidateCommand.java deleted file mode 100644 index 009722a554b1..000000000000 --- a/ide/bugzilla/src/org/netbeans/modules/bugzilla/commands/ValidateCommand.java +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.netbeans.modules.bugzilla.commands; - -import java.io.IOException; -import java.util.logging.Level; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.NullProgressMonitor; -import org.eclipse.mylyn.commons.net.AuthenticationCredentials; -import org.eclipse.mylyn.commons.net.AuthenticationType; -import org.eclipse.mylyn.internal.bugzilla.core.BugzillaClient; -import org.eclipse.mylyn.tasks.core.TaskRepository; -import org.netbeans.modules.team.commons.LogUtils; -import org.netbeans.modules.bugzilla.Bugzilla; -import org.netbeans.modules.mylyn.util.BugtrackingCommand; - -/** - * - * @author Tomas Stupka - */ -public class ValidateCommand extends BugtrackingCommand { - - private final TaskRepository taskRepository; - - public ValidateCommand(TaskRepository taskRepository) { - this.taskRepository = taskRepository; - } - - @Override - public void execute() throws CoreException { - log(); - try { - BugzillaClient client = Bugzilla.getInstance().getRepositoryConnector().getClientManager().getClient(taskRepository, new NullProgressMonitor()); - client.validate(new NullProgressMonitor()); - } catch (IOException ex) { - Bugzilla.LOG.log(Level.SEVERE, null, ex); // XXX handle errors - } - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("ValidateCommand [repository="); // NOI18N - sb.append(taskRepository.getUrl()); - sb.append("]"); // NOI18N - return sb.toString(); - } - - String getUrl() { - return taskRepository.getUrl(); - } - - String getUser() { - return taskRepository.getCredentials(AuthenticationType.REPOSITORY).getUserName(); - } - - private void log() { - Bugzilla.LOG.log( - Level.INFO, - "validating [{0},{1},{2},{3}]", // NOI18N - new Object[]{ - taskRepository.getUrl(), - getCredentialsString(taskRepository.getCredentials(AuthenticationType.REPOSITORY)), - getCredentialsString(taskRepository.getCredentials(AuthenticationType.HTTP)), - getCredentialsString(taskRepository.getCredentials(AuthenticationType.PROXY))}); - } - - private String getCredentialsString(AuthenticationCredentials c) { - if(c == null) { - return "null, null"; // NOI18N - } - return c.getUserName() + "," + LogUtils.getPasswordLog(c.getPassword().toCharArray()); // NOI18N - } - - -} diff --git a/ide/bugzilla/src/org/netbeans/modules/bugzilla/issue/AttachmentHyperlinkSupport.java b/ide/bugzilla/src/org/netbeans/modules/bugzilla/issue/AttachmentHyperlinkSupport.java deleted file mode 100644 index c7099139cb38..000000000000 --- a/ide/bugzilla/src/org/netbeans/modules/bugzilla/issue/AttachmentHyperlinkSupport.java +++ /dev/null @@ -1,172 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.netbeans.modules.bugzilla.issue; - -import java.util.Collection; - -/** - * Determines boundaries of text that should be rendered as a hyperlink - * to an issue attachment (screenshot, full thread-dump, app. output etc.). - * - * @author Marian Petras - */ -class AttachmentHyperlinkSupport { - - private static final String PREFIX = "Created an attachment (id="; //NOI18N - private static final String PREFIX2 = "Created attachment "; //NOI18N - private static final int EQUAL_SIGN_POSITION = PREFIX.lastIndexOf('='); - private static final int ATTACHMENT_HYPERLINK_START_FALLBACK = PREFIX.indexOf("attachment"); //NOI18N - private static final int ATTACHMENT_HYPERLINK_START_FALLBACK2 = PREFIX2.indexOf("attachment"); //NOI18N - //private static final Pattern pattern = Pattern.compile( - // "([0-9]++)\\)[^\\r\\n]*+(?:[\\r\\n]++(.*+))?+"); //NOI18N - - private static final char CR = '\r'; - private static final char LF = '\n'; - - static Attachement findAttachment(String text, Collection knownIds) { - int[] boundaries = findAttachment1(text, knownIds); - if(boundaries == null) { - return findAttachment2(text, knownIds); - } else { - Attachement b = new Attachement(); - b.idx1 = boundaries[0]; - b.idx2 = boundaries[1]; - b.id = getAttachmentId(text); - return b; - } - } - - private static int[] findAttachment1(String text, Collection knownIds) { - if ((knownIds != null) && knownIds.isEmpty()) { - return null; - } - - final int length = text.length(); - if ((length >= EQUAL_SIGN_POSITION + 3) - && (text.charAt(EQUAL_SIGN_POSITION) == '=') - && text.startsWith(PREFIX)) { - int idStartIndex = EQUAL_SIGN_POSITION + 1; - if (isValidIdChar(text.charAt(idStartIndex))) { - int index = idStartIndex + 1; - while ((index < length) && isValidIdChar(text.charAt(index))) { - index++; - } - if ((index < length) && (text.charAt(index) == ')')) { - int idEndIndex = index; - if (isKnownId(text.substring(idStartIndex, idEndIndex), - knownIds)) { - return findBoundaries(index, text, idEndIndex + 1, ATTACHMENT_HYPERLINK_START_FALLBACK); - } - } - } - } - return null; - } - - private static Attachement findAttachment2(String text, Collection knownIds) { - if (knownIds == null || knownIds.isEmpty()) { - return null; - } - - for (String id : knownIds) { - String prefixId = PREFIX2 + id; - if(!text.startsWith(prefixId)) { - continue; - } - - int[] boundaries = findBoundaries(prefixId.length() - 1, text, prefixId.length(), ATTACHMENT_HYPERLINK_START_FALLBACK2); - if(boundaries != null) { - Attachement b = new Attachement(); - b.idx1 = boundaries[0]; - b.idx2 = boundaries[1]; - b.id = id; - return b; - } - } - return null; - } - - private static int[] findBoundaries(int index, String text, int idEndIndex, int fallback) { - final int length = text.length(); - do { - index++; - } while ((index < length) && isNotNewline(text.charAt(index))); - if (index < length) { //at newline - - /* skip just one newline */ - if (text.charAt(index) == CR) { - index++; - } - if ((index < length) && (text.charAt(index) == LF)) { - index++; - } - while ((index < length) && isSpace(text.charAt(index))) { - index++; - } - if ((index < length) && isNotNewline(text.charAt(index))) { //at printable - int descriptionStart = index; - do { - index++; - } while ((index < length) && isNotNewline(text.charAt(index))); - return new int[] {descriptionStart, index}; - } - } - return new int[] {fallback, idEndIndex}; - } - - private static String getAttachmentId(String commentText) { - int closingBracketPos = commentText.indexOf(')', PREFIX.length() + 1); - assert closingBracketPos != -1; - return new String(commentText.substring(PREFIX.length(), closingBracketPos)); - } - - static class Attachement { - int idx1; - int idx2; - String id; - } - - private static boolean isKnownId(String id, - Collection knownIds) { - if (knownIds == null) { - return true; - } - - for (String validId : knownIds) { - if (id.equals(validId)) { - return true; - } - } - return false; - } - - private static boolean isValidIdChar(char c) { - return (c >= '0') && (c <= '9'); - } - - private static boolean isNotNewline(char c) { - return (c != '\r') && (c != '\n'); - } - - private static boolean isSpace(char c) { - return (c == ' ') || (c == '\t'); - } - -} diff --git a/ide/bugzilla/src/org/netbeans/modules/bugzilla/issue/BugzillaIssue.java b/ide/bugzilla/src/org/netbeans/modules/bugzilla/issue/BugzillaIssue.java deleted file mode 100644 index f09426c79b44..000000000000 --- a/ide/bugzilla/src/org/netbeans/modules/bugzilla/issue/BugzillaIssue.java +++ /dev/null @@ -1,1694 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.netbeans.modules.bugzilla.issue; - -import java.awt.EventQueue; -import java.io.File; -import java.io.OutputStream; -import java.lang.ref.WeakReference; -import java.net.URL; -import java.text.ParseException; -import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.Collections; -import java.util.Date; -import java.util.Enumeration; -import java.util.HashMap; -import java.util.LinkedList; -import java.util.List; -import java.util.Map; -import java.util.Properties; -import java.util.ResourceBundle; -import java.util.logging.Level; -import javax.swing.JTable; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.mylyn.internal.bugzilla.core.BugzillaAttribute; -import org.eclipse.mylyn.internal.bugzilla.core.BugzillaOperation; -import org.eclipse.mylyn.internal.bugzilla.core.BugzillaTaskDataHandler; -import org.eclipse.mylyn.internal.bugzilla.core.BugzillaVersion; -import org.eclipse.mylyn.internal.tasks.core.data.FileTaskAttachmentSource; -import org.eclipse.mylyn.tasks.core.RepositoryResponse; -import org.eclipse.mylyn.tasks.core.data.TaskAttribute; -import org.eclipse.mylyn.tasks.core.data.TaskAttributeMapper; -import org.eclipse.mylyn.tasks.core.data.TaskData; -import org.eclipse.mylyn.tasks.core.data.TaskOperation; -import org.netbeans.modules.bugzilla.Bugzilla; -import org.netbeans.modules.bugtracking.issuetable.IssueNode; -import org.netbeans.modules.bugtracking.spi.IssueController; -import org.netbeans.modules.bugtracking.issuetable.ColumnDescriptor; -import org.netbeans.modules.bugtracking.spi.IssueScheduleInfo; -import org.netbeans.modules.team.spi.OwnerInfo; -import org.netbeans.modules.bugtracking.commons.AttachmentsPanel; -import org.netbeans.modules.bugtracking.commons.NBBugzillaUtils; -import org.netbeans.modules.bugtracking.commons.UIUtils; -import org.netbeans.modules.bugzilla.BugzillaConfig; -import org.netbeans.modules.bugzilla.commands.AddAttachmentCommand; -import org.netbeans.modules.bugzilla.repository.BugzillaConfiguration; -import org.netbeans.modules.bugzilla.repository.BugzillaRepository; -import org.netbeans.modules.bugzilla.commands.GetAttachmentCommand; -import org.netbeans.modules.bugzilla.repository.IssueField; -import org.openide.filesystems.FileUtil; -import org.netbeans.modules.bugzilla.util.BugzillaUtil; -import org.netbeans.modules.bugzilla.util.NbBugzillaConstants; -import org.netbeans.modules.mylyn.util.AbstractNbTaskWrapper; -import org.netbeans.modules.mylyn.util.MylynSupport; -import org.netbeans.modules.mylyn.util.NbTask; -import org.netbeans.modules.mylyn.util.NbTask.SynchronizationState; -import org.netbeans.modules.mylyn.util.NbTaskDataModel; -import org.netbeans.modules.mylyn.util.NbTaskDataModel.NbTaskDataModelEvent; -import org.netbeans.modules.mylyn.util.NbTaskDataState; -import org.netbeans.modules.mylyn.util.commands.SubmitTaskCommand; -import org.netbeans.modules.mylyn.util.commands.SynchronizeTasksCommand; -import org.openide.awt.StatusDisplayer; -import org.openide.modules.Places; -import org.openide.util.NbBundle; -import static org.netbeans.modules.bugzilla.issue.Bundle.*; - -/** - * - * @author Tomas Stupka - * @author Jan Stola - */ -public class BugzillaIssue extends AbstractNbTaskWrapper { - - public static final String RESOLVE_FIXED = "FIXED"; // NOI18N - public static final String RESOLVE_DUPLICATE = "DUPLICATE"; // NOI18N - public static final String VCSHOOK_BUGZILLA_FIELD = "netbeans.vcshook.bugzilla."; // NOI18N - private static final SimpleDateFormat CC_DATE_FORMAT = new SimpleDateFormat("yyyy-MM-dd HH:mm"); // NOI18N - static final SimpleDateFormat DUE_DATE_FORMAT = new SimpleDateFormat("yyyy-MM-dd"); // NOI18N - - private final BugzillaRepository repository; - - private BugzillaIssueController controller; - private WeakReference nodeRef; - private OwnerInfo info; - - static final String LABEL_NAME_ID = "bugzilla.issue.id"; // NOI18N - static final String LABEL_NAME_SEVERITY = "bugzilla.issue.severity"; // NOI18N - static final String LABEL_NAME_ISSUE_TYPE = "bugzilla.issue.issue_type"; // NOI18N - static final String LABEL_NAME_PRIORITY = "bugzilla.issue.priority"; // NOI18N - static final String LABEL_NAME_STATUS = "bugzilla.issue.status"; // NOI18N - static final String LABEL_NAME_RESOLUTION = "bugzilla.issue.resolution"; // NOI18N - static final String LABEL_NAME_ASSIGNED_TO = "bugzilla.issue.assigned"; // NOI18N - static final String LABEL_NAME_PRODUCT = "bugzilla.issue.product"; // NOI18N - static final String LABEL_NAME_COMPONENT = "bugzilla.issue.component"; // NOI18N - static final String LABEL_NAME_VERSION = "bugzilla.issue.version"; // NOI18N - static final String LABEL_NAME_OS = "bugzilla.issue.os"; // NOI18N - static final String LABEL_NAME_PLATFORM = "bugzilla.issue.platform"; // NOI18N - static final String LABEL_NAME_MILESTONE = "bugzilla.issue.milestone"; // NOI18N - static final String LABEL_NAME_REPORTER = "bugzilla.issue.reporter"; // NOI18N - static final String LABEL_NAME_MODIFICATION = "bugzilla.issue.modified"; // NOI18N - static final String LABEL_NAME_QA_CONTACT = "bugzilla.issue.qa_contact"; // NOI18N - static final String LABEL_NAME_KEYWORDS = "bugzilla.issue.keywords"; // NOI18N - static final String LABEL_NAME_WHITEBOARD = "bugzilla.issue.whiteboard"; // NOI18N - - /** - * IssueProvider wasn't seen yet - */ - static final int FIELD_STATUS_IRELEVANT = -1; - - /** - * Field wasn't changed since the issue was seen the last time - */ - static final int FIELD_STATUS_UPTODATE = 1; - - /** - * Field was changed since the issue was seen the last time - */ - static final int FIELD_STATUS_MODIFIED = 2; - - /** - * Field was changed since the issue was seen the last time - */ - static final int FIELD_STATUS_OUTGOING = 4; - - /** - * Field was changed both locally and in repository - */ - static final int FIELD_STATUS_CONFLICT = FIELD_STATUS_MODIFIED | FIELD_STATUS_OUTGOING; - private String initialProduct = null; - - private Map availableOperations; - - private String recentChanges = ""; - private String tooltip = ""; - - private static final URL ICON_REMOTE_PATH = IssuePanel.class.getClassLoader().getResource("org/netbeans/modules/bugzilla/resources/remote.png"); //NOI18N - private static final URL ICON_CONFLICT_PATH = IssuePanel.class.getClassLoader().getResource("org/netbeans/modules/bugzilla/resources/conflict.png"); //NOI18N - private static final URL ICON_UNSUBMITTED_PATH = IssuePanel.class.getClassLoader().getResource("org/netbeans/modules/bugzilla/resources/unsubmitted.png"); //NOI18N - private boolean loading; - private boolean wasDuplicated; - - public BugzillaIssue (NbTask task, BugzillaRepository repo) { - super(task); - this.repository = repo; - updateRecentChanges(); - updateTooltip(); - } - - @Override - protected void taskDeleted (NbTask task) { - getRepository().taskDeleted(getID(task)); - } - - void markUserChange () { - if (isMarkedNewUnread()) { - markNewRead(); - } - } - - void delete () { - deleteTask(); - } - - public void opened() { - if(Bugzilla.LOG.isLoggable(Level.FINE)) { - Bugzilla.LOG.log(Level.FINE, "issue {0} open start", new Object[] {getID()}); - } - loading = true; - Bugzilla.getInstance().getRequestProcessor().post(new Runnable() { - @Override - public void run () { - if (editorOpened()) { - ensureConfigurationUptodate(); - loading = false; - refreshViewData(true); - } else { - // should close somehow - } - } - }); - String refresh = System.getProperty("org.netbeans.modules.bugzilla.noIssueRefresh"); // NOI18N - if(refresh != null && refresh.equals("true")) { // NOI18N - return; - } - if(Bugzilla.LOG.isLoggable(Level.FINE)) { - Bugzilla.LOG.log(Level.FINE, "issue {0} open finish", new Object[] {getID()}); - } - } - - public void closed () { - if(Bugzilla.LOG.isLoggable(Level.FINE)) { - Bugzilla.LOG.log(Level.FINE, "issue {0} close start", new Object[] {getID()}); - } - Bugzilla.getInstance().getRequestProcessor().post(new Runnable() { - @Override - public void run () { - editorClosed(); - } - }); - if(Bugzilla.LOG.isLoggable(Level.FINE)) { - Bugzilla.LOG.log(Level.FINE, "issue {0} close finish", new Object[] {getID()}); - } - } - - public String getDisplayName() { - return getDisplayName(getNbTask()); - } - - public static String getDisplayName (NbTask task) { - return task.getSynchronizationState() == SynchronizationState.OUTGOING_NEW ? - task.getSummary() : - NbBundle.getMessage(BugzillaIssue.class, "CTL_Issue", new Object[] {getID(task), task.getSummary()}); //NOI18N - } - - // XXX not the same as in Issue.getShortenedDisplayName() - -// public String getShortenedDisplayName() { -// if (data.isNew()) { -// return getDisplayName(); -// } -// -// String shortSummary = TextUtils.shortenText(getSummary(), -// 2, //try at least 2 words -// SHORTENED_SUMMARY_LENGTH); -// return NbBundle.getMessage(BugzillaIssue.class, -// "CTL_Issue", //NOI18N -// new Object[] {getID(), shortSummary}); -// } - - public String getTooltip() { - return tooltip; - } - - public static ColumnDescriptor[] getColumnDescriptors(BugzillaRepository repository) { - ResourceBundle loc = NbBundle.getBundle(BugzillaIssue.class); - JTable t = new JTable(); - List> ret = new LinkedList<>(); - - ret.add(new ColumnDescriptor<>(LABEL_NAME_ID, String.class, - loc.getString("CTL_Issue_ID_Title"), // NOI18N - loc.getString("CTL_Issue_ID_Desc"), // NOI18N - UIUtils.getColumnWidthInPixels(6, t))); - ret.add(new ColumnDescriptor<>(IssueNode.LABEL_NAME_SUMMARY, String.class, - loc.getString("CTL_Issue_Summary_Title"), // NOI18N - loc.getString("CTL_Issue_Summary_Desc"))); // NOI18N - ret.add(NBBugzillaUtils.isNbRepository(repository.getUrl()) - ? - new ColumnDescriptor<>(LABEL_NAME_ISSUE_TYPE, String.class, - loc.getString("CTL_Issue_Issue_Type_Title"), // NOI18N - loc.getString("CTL_Issue_Issue_Type_Desc"), // NOI18N - 0) - : - new ColumnDescriptor<>(LABEL_NAME_SEVERITY, String.class, - loc.getString("CTL_Issue_Severity_Title"), // NOI18N - loc.getString("CTL_Issue_Severity_Desc"), // NOI18N - 0)); - ret.add(new ColumnDescriptor<>(LABEL_NAME_PRIORITY, String.class, - loc.getString("CTL_Issue_Priority_Title"), // NOI18N - loc.getString("CTL_Issue_Priority_Desc"), // NOI18N - 0)); - ret.add(new ColumnDescriptor<>(LABEL_NAME_STATUS, String.class, - loc.getString("CTL_Issue_Status_Title"), // NOI18N - loc.getString("CTL_Issue_Status_Desc"), // NOI18N - 0)); - ret.add(new ColumnDescriptor<>(LABEL_NAME_RESOLUTION, String.class, - loc.getString("CTL_Issue_Resolution_Title"), // NOI18N - loc.getString("CTL_Issue_Resolution_Desc"), // NOI18N - 0)); - ret.add(new ColumnDescriptor<>(LABEL_NAME_ASSIGNED_TO, String.class, - loc.getString("CTL_Issue_Assigned_Title"), // NOI18N - loc.getString("CTL_Issue_Assigned_Desc"), // NOI18N - 0)); - ret.add(new ColumnDescriptor<>(LABEL_NAME_PRODUCT, String.class, - loc.getString("CTL_Issue_Product_Title"), // NOI18N - loc.getString("CTL_Issue_Product_Desc"), // NOI18N - 0, false)); - ret.add(new ColumnDescriptor<>(LABEL_NAME_COMPONENT, String.class, - loc.getString("CTL_Issue_Component_Title"), // NOI18N - loc.getString("CTL_Issue_Component_Desc"), // NOI18N - 0, false)); - ret.add(new ColumnDescriptor<>(LABEL_NAME_VERSION, String.class, - loc.getString("CTL_Issue_Version_Title"), // NOI18N - loc.getString("CTL_Issue_Version_Desc"), // NOI18N - 0, false)); - ret.add(new ColumnDescriptor<>(LABEL_NAME_OS, String.class, - loc.getString("CTL_Issue_OS_Title"), // NOI18N - loc.getString("CTL_Issue_OS_Desc"), // NOI18N - 0, false)); - ret.add(new ColumnDescriptor<>(LABEL_NAME_PLATFORM, String.class, - loc.getString("CTL_Issue_Platform_Title"), // NOI18N - loc.getString("CTL_Issue_Platform_Desc"), // NOI18N - 0, false)); - ret.add(new ColumnDescriptor<>(LABEL_NAME_MILESTONE, String.class, - loc.getString("CTL_Issue_Milestone_Title"), // NOI18N - loc.getString("CTL_Issue_Milestone_Desc"), // NOI18N - 0, false)); - ret.add(new ColumnDescriptor<>(LABEL_NAME_REPORTER, String.class, - loc.getString("CTL_Issue_Reporter_Title"), // NOI18N - loc.getString("CTL_Issue_Reporter_Desc"), // NOI18N - 0, false)); - ret.add(new ColumnDescriptor<>(LABEL_NAME_MODIFICATION, String.class, - loc.getString("CTL_Issue_Modification_Title"), // NOI18N - loc.getString("CTL_Issue_Modification_Desc"), // NOI18N - 0, false)); - if(BugzillaUtil.showQAContact(repository)) { - ret.add(new ColumnDescriptor<>(LABEL_NAME_QA_CONTACT, String.class, - loc.getString("CTL_Issue_QA_Contact_Title"), // NOI18N - loc.getString("CTL_Issue_QA_Contact_Desc"), // NOI18N - 0, false)); - } - ret.add(new ColumnDescriptor<>(LABEL_NAME_KEYWORDS, String.class, - loc.getString("CTL_Issue_Keywords_Title"), // NOI18N - loc.getString("CTL_Issue_Keywords_Desc"), // NOI18N - 0, false)); - if(BugzillaUtil.showStatusWhiteboard(repository)) { - ret.add(new ColumnDescriptor<>(LABEL_NAME_WHITEBOARD, String.class, - loc.getString("CTL_Issue_Whiteboard_Title"), // NOI18N - loc.getString("CTL_Issue_Whiteboard_Desc"), // NOI18N - 0, false)); - } - return ret.toArray(new ColumnDescriptor[0]); - } - - - public IssueController getController() { - if (controller == null) { - controller = new BugzillaIssueController(this); - } - return controller; - } - - @Override - public String toString() { - String str = getID() + " : " + getSummary(); // NOI18N - return str; - } - - public IssueNode getNode() { - BugzillaIssueNode n = nodeRef != null ? nodeRef.get() : null; - if(n == null) { - n = createNode(); - nodeRef = new WeakReference<>(n); - } - if (!EventQueue.isDispatchThread()) { - // loads repository task data from disk - getRepositoryTaskData(); - } - return n; - } - - public void setOwnerInfo(OwnerInfo info) { - this.info = info; - } - - public OwnerInfo getOwnerInfo() { - return info; - } - - public String getRecentChanges() { - return recentChanges; - } - - public BugzillaRepository getRepository() { - return repository; - } - - private void ensureConfigurationUptodate () { - BugzillaConfiguration conf = getRepository().getConfiguration(); - NbTaskDataState taskDataState = null; - try { - taskDataState = getNbTask().getTaskDataState(); - } catch (CoreException ex) { - Bugzilla.LOG.log(Level.INFO, null, ex); - } - boolean needsRefresh = false; - if (taskDataState != null && !isNew()) { - for (TaskData taskData : new TaskData[] { - taskDataState.getLastReadData(), - taskDataState.getLocalData(), - taskDataState.getRepositoryData() - }) { - String product = getFieldValue(taskData, IssueField.PRODUCT); - String resolution = getFieldValue(taskData, IssueField.RESOLUTION); - String severity = getFieldValue(taskData, IssueField.SEVERITY); - String milestone = getFieldValue(taskData, IssueField.MILESTONE); - String version = getFieldValue(taskData, IssueField.VERSION); - String priority = getFieldValue(taskData, IssueField.PRIORITY); - String platform = getFieldValue(taskData, IssueField.PLATFORM); - String status = getFieldValue(taskData, IssueField.STATUS); - String os = getFieldValue(taskData, IssueField.OS); - String component = getFieldValue(taskData, IssueField.COMPONENT); - - if(!component.isEmpty() && !conf.getComponents(product).contains(component) || - !os.isEmpty() && !conf.getOSs().contains(os) || - !status.isEmpty() && !conf.getStatusValues().contains(status) || - !platform.isEmpty() && !conf.getPlatforms().contains(platform) || - !priority.isEmpty() && !conf.getPriorities().contains(priority) || - !product.isEmpty() && !conf.getProducts().contains(product) || - !resolution.isEmpty() && !conf.getResolutions().contains(resolution) || - !severity.isEmpty() && !conf.getSeverities().contains(severity) || - !milestone.isEmpty() && !conf.getTargetMilestones(product).contains(milestone) || - !version.isEmpty() && !conf.getVersions(product).contains(version)) - { - needsRefresh = true; - break; - } - } - } - if (needsRefresh) { - getRepository().refreshConfiguration(); - - } - } - - @Override - protected void repositoryTaskDataLoaded (TaskData repositoryTaskData) { - EventQueue.invokeLater(new Runnable() { - @Override - public void run () { - if (updateTooltip()) { - fireDataChanged(); - } - } - }); - } - - public String getRepositoryFieldValue (IssueField f) { - NbTaskDataModel m = getModel(); - TaskData td; - if (m == null) { - td = getRepositoryTaskData(); - if (td == null) { - return "..."; //NOI18N - } - } else { - td = m.getRepositoryTaskData(); - } - return getFieldValue(td, f); - } - - public String getFieldValue(IssueField f) { - NbTaskDataModel m = getModel(); - return getFieldValue(m == null ? null : m.getLocalTaskData(), f); - } - - String getLastSeenFieldValue (IssueField f) { - NbTaskDataModel m = getModel(); - return getFieldValue(m == null ? null : m.getLastReadTaskData(), f); - } - - private static String getFieldValue (TaskData taskData, IssueField f) { - if (taskData == null) { - return ""; - } - if(f.isSingleAttribute()) { - TaskAttribute a = taskData.getRoot().getMappedAttribute(f.getKey()); - if(a != null && a.getValues().size() > 1) { - return listValues(a); - } - return a != null ? a.getValue() : ""; // NOI18N - } else { - List attrs = taskData.getAttributeMapper().getAttributesByType(taskData, f.getKey()); - // returning 0 would set status MODIFIED instead of NEW - return "" + ( attrs != null && attrs.size() > 0 ? attrs.size() : ""); // NOI18N - } - } - - /** - * Returns a comma separated list created - * from the values returned by TaskAttribute.getValues() - * - * @param a - * @return - */ - private static String listValues(TaskAttribute a) { - if(a == null) { - return ""; // NOI18N - } - StringBuilder sb = new StringBuilder(); - List l = a.getValues(); - for (int i = 0; i < l.size(); i++) { - String s = l.get(i); - sb.append(s); - if(i < l.size() -1) { - sb.append(","); // NOI18N - } - } - return sb.toString(); - } - - void setFieldValue(IssueField f, String value) { - if(f.isReadOnly()) { - assert false : "can't set value into IssueField " + f.getKey(); // NOI18N - return; - } - NbTaskDataModel m = getModel(); - // should not happen, setFieldValue either runs with model lock - // or it is called from issue editor in AWT - the editor could not be closed by user in the meantime - // (or it could. see issue #254373 -> reload attributes called setFV) - boolean isshowing = getController().getComponent().isShowing(); - assert m != null || !isshowing : "isShowing=" + isshowing + ", model=" + m; - if(m != null) { - TaskData taskData = m.getLocalTaskData(); - TaskAttribute a = taskData.getRoot().getMappedAttribute(f.getKey()); - if (a == null) { - if (f == IssueField.REASSIGN_TO_DEFAULT) { - setOperation(BugzillaOperation.reassignbycomponent); - return; - } - a = new TaskAttribute(taskData.getRoot(), f.getKey()); - } - if(f == IssueField.PRODUCT) { - handleProductChange(a); - } - Bugzilla.LOG.log(Level.FINER, "setting value [{0}] on field [{1}]", new Object[]{value, f.getKey()}) ; - if (!value.equals(a.getValue())) { - setValue(m, a, value); - } - } - } - - void setFieldValues(IssueField f, List ccs) { - NbTaskDataModel m = getModel(); - // should not happen, setFieldValue either runs with model lock - // or it is called from issue editor in AWT - the editor could not be closed by user in the meantime - // (or it could. see issue #254373 -> reload attributes called setFV) - assert m != null || !getController().getComponent().isShowing(); - if(m != null) { - TaskData taskData = m.getLocalTaskData(); - TaskAttribute a = taskData.getRoot().getMappedAttribute(f.getKey()); - if(a == null) { - a = new TaskAttribute(taskData.getRoot(), f.getKey()); - } - a.setValues(ccs); - m.attributeChanged(a); - } - } - - public List getRepositoryFieldValues (IssueField f) { - NbTaskDataModel m = getModel(); - return getFieldValues(m == null ? getRepositoryTaskData() : m.getRepositoryTaskData(), f); - } - - public List getFieldValues(IssueField f) { - NbTaskDataModel m = getModel(); - return getFieldValues(m == null ? null : m.getLocalTaskData(), f); - } - - List getLastSeenFieldValues (IssueField f) { - NbTaskDataModel m = getModel(); - return getFieldValues(m == null ? null : m.getLastReadTaskData(), f); - } - - private static List getFieldValues(TaskData taskData, IssueField f) { - if (taskData == null) { - return Collections.emptyList(); - } - if(f.isSingleAttribute()) { - TaskAttribute a = taskData.getRoot().getMappedAttribute(f.getKey()); - if(a != null) { - return a.getValues(); - } else { - return Collections.emptyList(); - } - } else { - List ret = new ArrayList<>(); - ret.add(getFieldValue(taskData, f)); - return ret; - } - } - - /** - * Returns a status value for the given field
- *
    - *
  • {@link #FIELD_STATUS_IRELEVANT} - issue wasn't seen yet - *
  • {@link #FIELD_STATUS_UPTODATE} - field value wasn't changed - *
  • {@link #FIELD_STATUS_MODIFIED} - field value was changed in repository - *
  • {@link #FIELD_STATUS_OUTGOING} - field value was changed locally - *
  • {@link #FIELD_STATUS_CONFLICT} - field value was changed both locally and remotely - *
- * @param f IssueField - * @return a status value - */ - public int getFieldStatus(IssueField f) { - NbTaskDataModel m = getModel(); - if (m == null) { - return FIELD_STATUS_UPTODATE; - } - TaskAttribute ta = m.getLocalTaskData().getRoot().getMappedAttribute(f.getKey()); - boolean incoming = ta != null && m.hasIncomingChanges(ta, true); - boolean outgoing = ta != null && m.hasOutgoingChanges(ta); - if (ta == null) { - return FIELD_STATUS_UPTODATE; - } else if (incoming & outgoing) { - return FIELD_STATUS_CONFLICT; - } else if (incoming) { - return FIELD_STATUS_MODIFIED; - } else if (outgoing) { - return FIELD_STATUS_OUTGOING; - } - return FIELD_STATUS_UPTODATE; - } - - private BugzillaIssueNode createNode() { - return new BugzillaIssueNode(this); - } - - private void handleProductChange(TaskAttribute a) { - if(!isNew() && initialProduct == null) { - initialProduct = a.getValue(); - } - } - - public void resolve (final String resolution) { - assert !isNew(); - - runWithModelLoaded(new Runnable() { - @Override - public void run () { - String value = getFieldValue(IssueField.STATUS); - if(!(value.equals("RESOLVED") && resolution.equals(getFieldValue(IssueField.RESOLUTION)))) { // NOI18N - setOperation(BugzillaOperation.resolve); - TaskAttribute rta = getModel().getLocalTaskData().getRoot(); - TaskAttribute ta = rta.getMappedAttribute(BugzillaOperation.resolve.getInputId()); - if(ta != null) { // ta can be null when changing status from CLOSED to RESOLVED - setValue(getModel(), ta, resolution); - } - } - } - }); - } - - void accept() { - setOperation(BugzillaOperation.accept); - } - - void duplicate(String id) { - NbTaskDataModel m = getModel(); - setOperation(BugzillaOperation.duplicate); - TaskAttribute rta = m.getLocalTaskData().getRoot(); - TaskAttribute ta = rta.getMappedAttribute(BugzillaOperation.duplicate.getInputId()); - setValue(m, ta, id); - wasDuplicated = true; - } - - boolean canReassign() { - NbTaskDataModel m = getModel(); - if (m == null) { - return false; - } - BugzillaConfiguration rc = getRepository().getConfiguration(); - final BugzillaVersion installedVersion = rc != null ? rc.getInstalledVersion() : null; - boolean oldRepository = installedVersion != null ? installedVersion.compareMajorMinorOnly(BugzillaVersion.BUGZILLA_3_2) < 0 : false; - if (oldRepository) { - TaskAttribute rta = m.getLocalTaskData().getRoot(); - TaskAttribute ta = rta.getMappedAttribute(BugzillaOperation.reassign.getInputId()); - return (ta != null); - } else { - return true; - } - } - - boolean canAssignToDefault() { - NbTaskDataModel m = getModel(); - if (m == null) { - return false; - } - BugzillaConfiguration rc = getRepository().getConfiguration(); - final BugzillaVersion installedVersion = rc != null ? rc.getInstalledVersion() : null; - boolean pre4 = installedVersion != null ? installedVersion.compareMajorMinorOnly(BugzillaVersion.BUGZILLA_3_0) <= 0 : false; - TaskData taskData = m.getLocalTaskData(); - if(pre4) { - return BugzillaOperation.reassignbycomponent.getInputId() != null ? - taskData.getRoot().getMappedAttribute(BugzillaOperation.reassignbycomponent.getInputId()) != null : - false; - } else { - TaskAttribute ta = taskData.getRoot().getAttribute(BugzillaAttribute.SET_DEFAULT_ASSIGNEE.getKey()); - return ta != null; - } - } - - boolean hasTimeTracking() { - NbTaskDataModel m = getModel(); - return m != null && m.getLocalTaskData().getRoot() - .getMappedAttribute(BugzillaAttribute.ACTUAL_TIME.getKey()) != null; // XXX dummy - } - - void reassign(String user) { - NbTaskDataModel m = getModel(); - setOperation(BugzillaOperation.reassign); - TaskAttribute rta = m.getLocalTaskData().getRoot(); - TaskAttribute ta = rta.getMappedAttribute(BugzillaOperation.reassign.getInputId()); - if(ta != null) { - setValue(m, ta, user); - } - ta = rta.getMappedAttribute(BugzillaAttribute.ASSIGNED_TO.getKey()); - if(ta != null) { - setValue(m, ta, user); - } - } - - void verify() { - setOperation(BugzillaOperation.verify); - } - - void close() { - setOperation(BugzillaOperation.close); - } - - void reopen() { - setOperation(BugzillaOperation.reopen); - } - - private void setOperation (BugzillaOperation operation) { - NbTaskDataModel m = getModel(); - TaskAttributeMapper mapper = m.getLocalTaskData().getAttributeMapper(); - for (TaskOperation op : mapper.getTaskOperations(m.getLocalTaskData().getRoot())) { - if (op.getOperationId().equals(operation.toString())) { - setOperation(op); - return; - } - } - // no operation found, leave to NO_OP ~ Leave as... - setOperation(BugzillaOperation.none); - } - - private void setOperation (TaskOperation operation) { - NbTaskDataModel m = getModel(); - TaskAttribute rta = m.getLocalTaskData().getRoot(); - TaskAttribute ta = rta.getMappedAttribute(TaskAttribute.OPERATION); - m.getLocalTaskData().getAttributeMapper().setTaskOperation(ta, operation); - m.attributeChanged(ta); - } - - List getAttachments() { - NbTaskDataModel m = getModel(); - List attrs = m == null ? null : m.getLocalTaskData() - .getAttributeMapper().getAttributesByType(m.getLocalTaskData(), TaskAttribute.TYPE_ATTACHMENT); - if (attrs == null) { - return Collections.emptyList(); - } - List attachments = new ArrayList(attrs.size()); - for (TaskAttribute taskAttribute : attrs) { - attachments.add(new Attachment(taskAttribute)); - } - return attachments; - } - - public void addAttachment(File file, final String comment, final String desc, String contentType, final boolean patch) { - assert !EventQueue.isDispatchThread() : "Accessing remote host. Do not call in awt"; // NOI18N - final FileTaskAttachmentSource attachmentSource = new FileTaskAttachmentSource(file); - if (contentType == null) { - file = FileUtil.normalizeFile(file); - String ct = FileUtil.getMIMEType(FileUtil.toFileObject(file)); - if ((ct != null) && (!"content/unknown".equals(ct))) { // NOI18N - contentType = ct; - } else { - contentType = FileTaskAttachmentSource.getContentTypeFromFilename(file.getName()); - } - } - attachmentSource.setContentType(contentType); - TaskData repositoryTaskData = getRepositoryTaskData(); - if (repositoryTaskData == null && (!synchronizeTask() - || (repositoryTaskData = getRepositoryTaskData()) == null)) { - // not fully initialized task, sync failed - return; - } - final TaskAttribute attAttribute = new TaskAttribute(repositoryTaskData.getRoot(), TaskAttribute.TYPE_ATTACHMENT); - TaskAttributeMapper mapper = attAttribute.getTaskData().getAttributeMapper(); - TaskAttribute a = attAttribute.createMappedAttribute(TaskAttribute.ATTACHMENT_DESCRIPTION); - a.setValue(desc); - a = attAttribute.createMappedAttribute(TaskAttribute.ATTACHMENT_IS_PATCH); - mapper.setBooleanValue(a, patch); - a = attAttribute.createMappedAttribute(TaskAttribute.ATTACHMENT_CONTENT_TYPE); - a.setValue(contentType); - - AddAttachmentCommand cmd = new AddAttachmentCommand(getID(), repository, comment, attachmentSource, file, attAttribute); - repository.getExecutor().execute(cmd); - if(!cmd.hasFailed()) { - refresh(true); // XXX to much refresh - is there no other way? - } - } - - Comment[] getComments() { - final List comments = new ArrayList<>(); - runWithModelLoaded(new Runnable() { - @Override - public void run() { - NbTaskDataModel m = getModel(); - List attrs = m == null ? null : m.getLocalTaskData() - .getAttributeMapper().getAttributesByType(m.getLocalTaskData(), TaskAttribute.TYPE_COMMENT); - if (attrs != null) { - for (TaskAttribute taskAttribute : attrs) { - comments.add(new Comment(taskAttribute)); - } - } - } - }); - return comments.toArray(new Comment[0]); - } - - // XXX carefull - implicit refresh - public void addComment (final String comment, final boolean close) { - assert !EventQueue.isDispatchThread() : "Accessing remote host. Do not call in awt"; // NOI18N - if(comment == null && !close) { - return; - } - refresh(); - - runWithModelLoaded(new Runnable() { - @Override - public void run () { - // resolved attrs - if (close) { - Bugzilla.LOG.log(Level.FINER, "resolving issue #{0} as fixed", new Object[]{getID()}); - resolve(RESOLVE_FIXED); // XXX constant? - - if(BugzillaUtil.isNbRepository(repository)) { - // check for other preselections - Properties p = System.getProperties(); - Enumeration keys = p.keys(); - List keyList = new LinkedList<>(); - while(keys.hasMoreElements()) { - Object key = keys.nextElement(); - if(key.toString().startsWith(VCSHOOK_BUGZILLA_FIELD)) { - keyList.add(key.toString()); - } - } - for (String key : keyList) { - String fieldName = key.substring(VCSHOOK_BUGZILLA_FIELD.length()); - String value = p.getProperty(key); - IssueField issueField = repository.getConfiguration().getField(fieldName); - if(issueField != null) { - if(issueField.isReadOnly()) { - Bugzilla.LOG.log(Level.WARNING, "field [{0}] is read-only.", new Object[]{repository.getUrl(), fieldName}); - } else { - setFieldValue(issueField, value); - } - } else { - Bugzilla.LOG.log(Level.WARNING, "Repsitory [{0}] has no field [{1}]", new Object[]{repository.getUrl(), fieldName}); - } - } - } - - } - if(comment != null) { - addComment(comment); - } - - submitAndRefresh(); - } - }); - } - - public void addComment (final String comment) { - if(comment != null && !comment.isEmpty()) { - runWithModelLoaded(new Runnable() { - @Override - public void run () { - Bugzilla.LOG.log(Level.FINER, "adding comment [{0}] to issue #{1}", new Object[]{comment, getID()}); - TaskAttribute ta = getModel().getLocalTaskData().getRoot().getMappedAttribute(IssueField.COMMENT.getKey()); - String value = ta.getValue(); - if (value == null || value.trim().isEmpty()) { - value = comment; - } else { - value += "\n\n" + comment; //NOI18N - } - setValue(getModel(), ta, value); - } - }); - } - } - - private void setDueDateAndSubmit (final Date date) { - refresh(); - runWithModelLoaded(new Runnable() { - @Override - public void run () { - if (date == null) { - setFieldValue(IssueField.DEADLINE, ""); - } else { - setFieldValue(IssueField.DEADLINE, DUE_DATE_FORMAT.format(date)); - } - submitAndRefresh(); - } - }); - } - - public void attachPatch(File file, String description, boolean isPatch) { - // HACK for attaching hg bundles - they are NOT patches - isPatch = !file.getName().endsWith(".hg"); // NOI18N - addAttachment(file, null, description, null, isPatch); - } - - private void prepareSubmit() { - if (initialProduct != null) { - // product change - TaskAttribute ta = getModel().getLocalTaskData().getRoot().getMappedAttribute(BugzillaAttribute.CONFIRM_PRODUCT_CHANGE.getKey()); - if (ta == null) { - ta = BugzillaTaskDataHandler.createAttribute(getModel().getLocalTaskData().getRoot(), BugzillaAttribute.CONFIRM_PRODUCT_CHANGE); - } - setValue(getModel(), ta, "1"); //NOI18N - } - } - - @NbBundle.Messages({ - "# {0} - task id and summary", - "MSG_BugzillaIssue.statusBar.submitted=Task {0} submitted.", - "MSG_LOG_FILE_DESC=IDE log", - "BugzillaIssue.attachment.noDescription=" - }) - public boolean submitAndRefresh() { - final boolean[] result = new boolean[1]; - runWithModelLoaded(new Runnable() { - - @Override - public void run () { - assert !EventQueue.isDispatchThread() : "Accessing remote host. Do not call in awt"; // NOI18N - - prepareSubmit(); - boolean addIDELog = fixAttachLog(); - List newAttachments = getNewAttachments(); - if (!newAttachments.isEmpty()) { - // clear before submit, we do not know how connectors deal with internal attributes - setNewAttachments(Collections.emptyList()); - } - final boolean wasNew = isNew(); - - SubmitTaskCommand submitCmd; - try { - if (saveChanges()) { - fireChanged(); - submitCmd = MylynSupport.getInstance().getCommandFactory().createSubmitTaskCommand(getModel()); - } else { - result[0] = false; - return; - } - } catch (CoreException ex) { - Bugzilla.LOG.log(Level.WARNING, null, ex); - result[0] = false; - return; - } - repository.getExecutor().execute(submitCmd); - if (!submitCmd.hasFailed()) { - taskSubmitted(submitCmd.getSubmittedTask()); - } - - if (!wasNew) { - refresh(); - if (wasDuplicated && !submitCmd.hasFailed()) { - try { - BugzillaIssue dupe = repository.getIssueCache().getIssue(getFieldValue(IssueField.DUPLICATE_ID)); - if(dupe != null) { - // if duplicate known on client then refresh to - // avoid potential mid-air ... - dupe.refresh(); - } - } finally { - wasDuplicated = false; - } - } - } else { - RepositoryResponse rr = submitCmd.getRepositoryResponse(); - if(!submitCmd.hasFailed()) { - updateRecentChanges(); - updateTooltip(); - fireDataChanged(); - String id = getID(); - repository.getIssueCache().setIssue(id, BugzillaIssue.this); - Bugzilla.LOG.log(Level.FINE, "created issue #{0}", id); - // a new issue was created -> refresh all queries - repository.refreshAllQueries(); - } else { - Bugzilla.LOG.log(Level.FINE, "submiting failed"); - if(rr != null) { - Bugzilla.LOG.log(Level.FINE, "repository response {0}", rr.getReposonseKind()); - } else { - Bugzilla.LOG.log(Level.FINE, "no repository response available"); - } - } - } - - if(submitCmd.hasFailed()) { - result[0] = false; - boolean needSave = false; - if (addIDELog) { - setFieldValue(IssueField.NB_ATTACH_IDE_LOG, "1"); //NOI18N - needSave = true; - } - if (!newAttachments.isEmpty()) { - setNewAttachments(newAttachments); - needSave = true; - } - if (needSave) { - saveChanges(); - } - return; - } else { - if (addIDELog) { - File f = new File(Places.getUserDirectory(), NbBugzillaConstants.NB_LOG_FILE_PATH); - if (f.isFile()) { - addAttachment(f, "", MSG_LOG_FILE_DESC(), NbBugzillaConstants.NB_LOG_FILE_ATT_CONT_TYPE, false); - } - } - if (!newAttachments.isEmpty()) { - for (AttachmentsPanel.AttachmentInfo attachment : newAttachments) { - if (attachment.getFile().isFile()) { - if (attachment.getDescription().trim().length() == 0) { - attachment.setDescription(Bundle.BugzillaIssue_attachment_noDescription()); - } - addAttachment(attachment.getFile(), null, attachment.getDescription(), attachment.getContentType(), attachment.isPatch()); // NOI18N - } else { - // PENDING notify user - } - } - } - } - StatusDisplayer.getDefault().setStatusText(Bundle.MSG_BugzillaIssue_statusBar_submitted( - getDisplayName())); - - setUpToDate(true, false); - result[0] = true; - } - - private boolean fixAttachLog () { - String val = getFieldValue(IssueField.NB_ATTACH_IDE_LOG); - getModel().getLocalTaskData().getRoot().removeAttribute(IssueField.NB_ATTACH_IDE_LOG.getKey()); - return "1".equals(val); - } - - }); - return result[0]; - } - - void updateModelAndRefresh () { - runWithModelLoaded(new Runnable() { - @Override - public void run() { - updateModel(); - refresh(); - } - }); - } - - public boolean refresh() { - assert !EventQueue.isDispatchThread() : "Accessing remote host. Do not call in awt"; // NOI18N - return refresh(false); - } - - private boolean refresh (boolean afterSubmitRefresh) { // XXX cacheThisIssue - we probalby don't need this, just always set the issue into the cache - assert !EventQueue.isDispatchThread() : "Accessing remote host. Do not call in awt"; // NOI18N - boolean synced = synchronizeTask(); - if (!loading) { - // refresh only when model is not currently being loaded - // otherwise it most likely ends up in editor not fully initialized - refreshViewData(afterSubmitRefresh); - } - return synced; - } - - private void refreshViewData(boolean force) { - if (controller != null) { - // view might not exist yet and we won't unnecessarily create it - controller.refreshViewData(force); - } - } - - /** - * Returns available operations for this issue - * @return - */ - Map getAvailableOperations () { - if (availableOperations == null) { - HashMap operations = new HashMap(5); - NbTaskDataModel model = getModel(); - List allOperations = model.getLocalTaskData().getAttributeMapper().getAttributesByType(model.getLocalTaskData(), TaskAttribute.TYPE_OPERATION); - for (TaskAttribute operation : allOperations) { - // the test must be here, 'operation' (applying writable action) is also among allOperations - if (operation.getId().startsWith(TaskAttribute.PREFIX_OPERATION)) { - operations.put(operation.getId().substring(TaskAttribute.PREFIX_OPERATION.length()), TaskOperation.createFrom(operation)); - } - } - availableOperations = operations; - } - - return availableOperations; - } - - boolean isResolveAvailable () { - Map operations = getAvailableOperations(); - return operations.containsKey(BugzillaOperation.resolve.toString()); - } - - private String getMappedValue(TaskAttribute a, String key) { - TaskAttribute ma = a.getMappedAttribute(key); - if(ma != null) { - return ma.getValue(); - } - return null; - } - - public void setUpToDate (boolean seen) { - setUpToDate(seen, true); - } - - private boolean updateTooltip () { - String displayName = getDisplayName(); - if (displayName.startsWith("#")) { //NOI18N - displayName = displayName.replaceFirst("#", ""); //NOI18N - } - String oldTooltip = tooltip; - - SynchronizationState state = getSynchronizationState(); - URL iconPath = getStateIcon(state); - String iconCode = ""; - if (iconPath != null) { - iconCode = " "; //NOI18N - } - String stateName = getStateDisplayName(state); - - String priorityLabel = NbBundle.getMessage(BugzillaIssue.class, "CTL_Issue_Priority_Title"); //NOI18N - String priority = getRepositoryFieldValue(IssueField.PRIORITY); - URL priorityIcon = BugzillaConfig.getInstance().getPriorityIconURL(priority); - - boolean showIssueType = BugzillaUtil.showIssueType(repository); - String typeLabel = NbBundle.getMessage(BugzillaIssue.class, showIssueType ? "LBL_Type" : "CTL_Issue_Severity_Title"); //NOI18N - String type = showIssueType ? getRepositoryFieldValue(IssueField.ISSUE_TYPE) : getRepositoryFieldValue(IssueField.SEVERITY); - - String productLabel = NbBundle.getMessage(BugzillaIssue.class, "CTL_Issue_Product_Title"); //NOI18N - String product = getRepositoryFieldValue(IssueField.PRODUCT); - - String componentLabel = NbBundle.getMessage(BugzillaIssue.class, "CTL_Issue_Component_Title"); //NOI18N - String component = getRepositoryFieldValue(IssueField.COMPONENT); - - String assigneeLabel = NbBundle.getMessage(BugzillaIssue.class, "LBL_Assigned"); //NOI18N - String assignee = getRepositoryFieldValue(IssueField.ASSIGNED_TO); - - String statusLabel = NbBundle.getMessage(BugzillaIssue.class, "CTL_Issue_Status_Title"); //NOI18N - String status = getRepositoryFieldValue(IssueField.STATUS); - String resolution = getRepositoryFieldValue(IssueField.RESOLUTION); - - if (resolution != null && !resolution.trim().isEmpty()) { - status += "/" + resolution; //NOI18N - } - String scheduledLabel = NbBundle.getMessage(BugzillaIssue.class, "CTL_Issue_Scheduled_Title"); //NOI18N - String scheduled = getScheduleDisplayString(); - - String dueLabel = NbBundle.getMessage(BugzillaIssue.class, "CTL_Issue_Due_Title"); //NOI18N - String due = getDueDisplayString(); - - - String estimateLabel = NbBundle.getMessage(BugzillaIssue.class, "CTL_Issue_Estimate_Title"); //NOI18N - String estimate = getEstimateDisplayString(); - - String fieldTable = "" //NOI18N - + "" //NOI18N - + "" //NOI18N - + "" - + ""; //NOI18N - - if (!scheduled.isEmpty()) { - fieldTable += ""; //NOI18N - } - boolean addNewLine = !due.isEmpty() || !estimate.isEmpty(); - if (addNewLine) { - fieldTable += ""; //NOI18N - } - if (!due.isEmpty()) { - fieldTable += ""; //NOI18N - } - if (!estimate.isEmpty()) { - fieldTable += ""; //NOI18N - } - if (addNewLine) { - fieldTable += ""; //NOI18N - } - fieldTable += "
" + priorityLabel + ": " + priority + "" + typeLabel + ":" + type + "
" + productLabel + ":" + product + "" + componentLabel + ":" + component + "
" + assigneeLabel + ":" + assignee + "
" + statusLabel + ":" + status + "
" + scheduledLabel + ":" + scheduled + "
" + dueLabel + ":" + due + "" + estimateLabel + ":" + estimate + "
"; //NOI18N - - StringBuilder sb = new StringBuilder(""); //NOI18N - sb.append("").append(displayName).append("
"); //NOI18N - if (stateName != null && !stateName.isEmpty()) { - sb.append("

").append(iconCode).append(stateName).append("

"); //NOI18N - } - sb.append("
"); //NOI18N - sb.append(fieldTable); - sb.append(""); //NOI18N - tooltip = sb.toString(); - return !oldTooltip.equals(tooltip); - } - - private URL getStateIcon(SynchronizationState state) { - URL iconPath = null; - if (state.equals(SynchronizationState.CONFLICT)) { - iconPath = ICON_CONFLICT_PATH; - } else if (state.equals(SynchronizationState.INCOMING) || state.equals(SynchronizationState.INCOMING_NEW)) { - iconPath = ICON_REMOTE_PATH; - } else if (state.equals(SynchronizationState.OUTGOING) || state.equals(SynchronizationState.OUTGOING_NEW)) { - iconPath = ICON_UNSUBMITTED_PATH; - } - return iconPath; - } - - private String getStateDisplayName(SynchronizationState state) { - String displayName = ""; - if (state.equals(SynchronizationState.CONFLICT)) { - displayName = NbBundle.getMessage(BugzillaIssue.class, "LBL_ConflictShort"); //NOI18N; - } else if (state.equals(SynchronizationState.INCOMING)) { - displayName = NbBundle.getMessage(BugzillaIssue.class, "LBL_RemoteShort"); //NOI18N; - } else if (state.equals(SynchronizationState.INCOMING_NEW)) { - displayName = NbBundle.getMessage(BugzillaIssue.class, "LBL_RemoteNewShort"); //NOI18N; - } else if (state.equals(SynchronizationState.OUTGOING)) { - displayName = NbBundle.getMessage(BugzillaIssue.class, "LBL_UnsubmittedShort"); //NOI18N; - } else if (state.equals(SynchronizationState.OUTGOING_NEW)) { - displayName = NbBundle.getMessage(BugzillaIssue.class, "LBL_UnsubmittedNewShort"); //NOI18N; - } - return displayName; - } - - private boolean updateRecentChanges () { - String oldChanges = recentChanges; - recentChanges = ""; - SynchronizationState syncState = getSynchronizationState(); - if (syncState == SynchronizationState.INCOMING_NEW) { - recentChanges = NbBundle.getMessage(BugzillaIssue.class, "LBL_NEW_STATUS"); //NOI18N - } else if (syncState == SynchronizationState.INCOMING - || syncState == SynchronizationState.CONFLICT) { - try { - NbTaskDataState taskDataState = getNbTask().getTaskDataState(); - if (taskDataState != null) { - TaskData repositoryData = taskDataState.getRepositoryData(); - TaskData lastReadData = taskDataState.getLastReadData(); - List changedFields = new ArrayList<>(); - for (IssueField f : getRepository().getConfiguration().getFields()) { - if (f==IssueField.MODIFICATION - || f==IssueField.REPORTER_NAME - || f==IssueField.QA_CONTACT_NAME - || f==IssueField.ASSIGNED_TO_NAME) { - continue; - } - String value = getFieldValue(repositoryData, f); - String seenValue = getFieldValue(lastReadData, f); - if(!value.trim().equals(seenValue.trim())) { - changedFields.add(f); - } - } - int changedCount = changedFields.size(); - if(changedCount == 1) { - String ret = null; - for (IssueField changedField : changedFields) { - if (changedField == IssueField.SUMMARY) { - ret = NbBundle.getMessage(BugzillaIssue.class, "LBL_SUMMARY_CHANGED_STATUS"); // NOI18N - } else if (changedField == IssueField.CC) { - ret = NbBundle.getMessage(BugzillaIssue.class, "LBL_CC_FIELD_CHANGED_STATUS"); // NOI18N - } else if (changedField == IssueField.KEYWORDS) { - ret = NbBundle.getMessage(BugzillaIssue.class, "LBL_KEYWORDS_CHANGED_STATUS"); // NOI18N - } else if (changedField == IssueField.DEPENDS_ON || changedField == IssueField.BLOCKS) { - ret = NbBundle.getMessage(BugzillaIssue.class, "LBL_DEPENDENCE_CHANGED_STATUS"); // NOI18N - } else if (changedField == IssueField.COMMENT_COUNT) { - String value = getFieldValue(repositoryData, changedField); - String seenValue = getFieldValue(lastReadData, changedField); - if(seenValue.equals("")) { // NOI18N - seenValue = "0"; // NOI18N - } - int count = 0; - try { - count = Integer.parseInt(value) - Integer.parseInt(seenValue); - } catch(NumberFormatException ex) { - Bugzilla.LOG.log(Level.WARNING, ret, ex); - } - ret = NbBundle.getMessage(BugzillaIssue.class, "LBL_COMMENTS_CHANGED", new Object[] {count}); // NOI18N - } else if (changedField == IssueField.ATTACHEMENT_COUNT) { - ret = NbBundle.getMessage(BugzillaIssue.class, "LBL_ATTACHMENTS_CHANGED"); // NOI18N - } else { - ret = NbBundle.getMessage(BugzillaIssue.class, "LBL_CHANGED_TO", new Object[] {changedField.getDisplayName(), getFieldValue(repositoryData, changedField)}); // NOI18N - } - } - recentChanges = ret; - } else { - for (IssueField changedField : changedFields) { - String key; - if (changedField == IssueField.SUMMARY) { - key = "LBL_CHANGES_INCL_SUMMARY"; // NOI18N - } else if (changedField == IssueField.PRIORITY) { - key = "LBL_CHANGES_INCL_PRIORITY"; // NOI18N - } else if (changedField == IssueField.SEVERITY) { - key = "LBL_CHANGES_INCL_SEVERITY"; // NOI18N - } else if (changedField == IssueField.ISSUE_TYPE) { - key = "LBL_CHANGES_INCL_ISSUE_TYPE"; // NOI18N - } else if (changedField == IssueField.PRODUCT) { - key = "LBL_CHANGES_INCL_PRODUCT"; // NOI18N - } else if (changedField == IssueField.COMPONENT) { - key = "LBL_CHANGES_INCL_COMPONENT"; // NOI18N - } else if (changedField == IssueField.PLATFORM) { - key = "LBL_CHANGES_INCL_PLATFORM"; // NOI18N - } else if (changedField == IssueField.VERSION) { - key = "LBL_CHANGES_INCL_VERSION"; // NOI18N - } else if (changedField == IssueField.MILESTONE) { - key = "LBL_CHANGES_INCL_MILESTONE"; // NOI18N - } else if (changedField == IssueField.KEYWORDS) { - key = "LBL_CHANGES_INCL_KEYWORDS"; // NOI18N - } else if (changedField == IssueField.URL) { - key = "LBL_CHANGES_INCL_URL"; // NOI18N - } else if (changedField == IssueField.ASSIGNED_TO) { - key = "LBL_CHANGES_INCL_ASSIGNEE"; // NOI18N - } else if (changedField == IssueField.QA_CONTACT) { - key = "LBL_CHANGES_INCL_QA_CONTACT"; // NOI18N - } else if (changedField == IssueField.DEPENDS_ON || changedField == IssueField.BLOCKS) { - key = "LBL_CHANGES_INCLUSIVE_DEPENDENCE"; // NOI18N - } else { - key = "LBL_CHANGES"; // NOI18N - } - recentChanges = NbBundle.getMessage(BugzillaIssue.class, key, new Object[] {changedCount}); - } - } - } - } catch (CoreException ex) { - Bugzilla.LOG.log(Level.WARNING, null, ex); - } - } - return !oldChanges.equals(recentChanges); - } - - @Override - protected void modelSaved (NbTaskDataModel model) { - if (controller != null) { - controller.modelStateChanged(model.isDirty(), model.hasOutgoingChanged()); - } - } - - @Override - protected String getSummary (TaskData taskData) { - return getFieldValue(taskData, IssueField.SUMMARY); - } - - @Override - protected void attributeChanged (NbTaskDataModelEvent event, NbTaskDataModel model) { - if (controller != null) { - // view might not exist yet and we won't unnecessarily create it - controller.modelStateChanged(model.isDirty(), model.isDirty() || !model.getChangedAttributes().isEmpty()); - } - } - - @Override - protected boolean synchronizeTask () { - try { - NbTask task = getNbTask(); - synchronized (task) { - Bugzilla.LOG.log(Level.FINE, "refreshing issue #{0}", task.getTaskId()); - SynchronizeTasksCommand cmd = MylynSupport.getInstance().getCommandFactory().createSynchronizeTasksCommand( - getRepository().getTaskRepository(), Collections.singleton(task)); - getRepository().getExecutor().execute(cmd); - return !cmd.hasFailed(); - } - } catch (CoreException ex) { - // should not happen - Bugzilla.LOG.log(Level.WARNING, null, ex); - return false; - } - } - - boolean save () { - return saveChanges(); - } - - private void setValue (NbTaskDataModel model, TaskAttribute ta, String value) { - TaskData repositoryTaskData = model.getRepositoryTaskData(); - if (value.isEmpty() && repositoryTaskData != null) { - // should be empty or set to ""??? - TaskAttribute a = repositoryTaskData.getRoot().getAttribute(ta.getId()); - if (a == null || a.getValues().isEmpty()) { - // repository value is also empty list, so let's set to the same - ta.clearValues(); - } else { - ta.setValue(value); - } - } else { - ta.setValue(value); - } - model.attributeChanged(ta); - } - - boolean setUnsubmittedAttachments (List newAttachments) { - return super.setNewAttachments(newAttachments); - } - - List getUnsubmittedAttachments () { - return getNewAttachments(); - } - - void setTaskPrivateNotes (String notes) { - super.setPrivateNotes(notes); - if (controller != null) { - controller.modelStateChanged(true, hasLocalEdits()); - } - } - - public void setTaskDueDate (final Date date, final boolean persistChange) { - runWithModelLoaded(new Runnable() { - - @Override - public void run () { - if (hasTimeTracking()) { - setDueDateAndSubmit(date); - } else { - setDueDate(date, persistChange); - if (controller != null) { - controller.modelStateChanged(hasUnsavedChanges(), hasLocalEdits()); - } - if (persistChange) { - dataChanged(); - } - } - } - }); - } - - public void setTaskScheduleDate (IssueScheduleInfo date, boolean persistChange) { - super.setScheduleDate(date, persistChange); - if (controller != null) { - controller.modelStateChanged(hasUnsavedChanges(), hasLocalEdits()); - } - if (persistChange) { - dataChanged(); - } - } - - public void setTaskEstimate (int estimate, boolean persistChange) { - super.setEstimate(estimate, persistChange); - if (controller != null) { - controller.modelStateChanged(hasUnsavedChanges(), hasLocalEdits()); - } - if (persistChange) { - dataChanged(); - } - } - - public boolean discardLocalEdits () { - final boolean retval[] = new boolean[1]; - runWithModelLoaded(new Runnable() { - @Override - public void run () { - clearUnsavedChanges(); - retval[0] = cancelChanges(); - if (controller != null) { - controller.modelStateChanged(hasUnsavedChanges(), hasLocalEdits()); - controller.refreshViewData(false); - } - } - }); - return retval[0]; - } - - public String getPriority() { - return getRepositoryFieldValue(IssueField.PRIORITY); - } - - class Comment { - private final Date when; - private final String author; - private final String authorName; - private final Long number; - private final String text; - private final Double worked; - - public Comment(TaskAttribute a) { - Date d = null; - String s = ""; - try { - s = getMappedValue(a, TaskAttribute.COMMENT_DATE); - if(s != null && !s.trim().equals("")) { // NOI18N - d = CC_DATE_FORMAT.parse(s); - } - } catch (ParseException ex) { - Bugzilla.LOG.log(Level.SEVERE, s, ex); - } - when = d; - TaskAttribute authorAttr = a.getMappedAttribute(TaskAttribute.COMMENT_AUTHOR); - if (authorAttr != null) { - author = authorAttr.getValue(); - TaskAttribute nameAttr = authorAttr.getMappedAttribute(TaskAttribute.PERSON_NAME); - authorName = nameAttr != null ? nameAttr.getValue() : null; - } else { - author = authorName = null; - } - String n = getMappedValue(a, TaskAttribute.COMMENT_NUMBER); - number = n != null ? Long.parseLong(n) : null; - text = getMappedValue(a, TaskAttribute.COMMENT_TEXT); - String workedString = getMappedValue(a, BugzillaAttribute.WORK_TIME.getKey()); - - double dbWorked = 0; - if(workedString == null || workedString.isEmpty()) { - dbWorked = 0.0; - } else { - try { - dbWorked = Double.parseDouble(workedString); - } catch (NumberFormatException e) { - Bugzilla.LOG.log(Level.WARNING, "WORK_TIME time for comment " + number + " is " + workedString , e); - dbWorked = 0; - } - } - worked = dbWorked; - } - - public Long getNumber() { - return number; - } - - public String getText() { - return text; - } - - public Date getWhen() { - return when; - } - - public String getAuthor() { - return author; - } - - public String getAuthorName() { - return authorName; - } - - public Double getWorked() { - return worked; - } - } - - class Attachment extends AttachmentsPanel.AbstractAttachment { - private final String desc; - private final String filename; - private final String author; - private final String authorName; - private final Date date; - private final String id; - private final String contentType; - private final String isDeprected; - private final String size; - private final String isPatch; - private final String url; - - public Attachment(TaskAttribute ta) { - id = ta.getValue(); - Date d = null; - String s = ""; - try { - s = getMappedValue(ta, TaskAttribute.ATTACHMENT_DATE); - if(s != null && !s.trim().equals("")) { // NOI18N - d = CC_DATE_FORMAT.parse(s); - } - } catch (ParseException ex) { - Bugzilla.LOG.log(Level.SEVERE, s, ex); - } - date = d; - filename = getMappedValue(ta, TaskAttribute.ATTACHMENT_FILENAME); - desc = getMappedValue(ta, TaskAttribute.ATTACHMENT_DESCRIPTION); - - TaskAttribute authorAttr = ta.getMappedAttribute(TaskAttribute.ATTACHMENT_AUTHOR); - if(authorAttr != null) { - author = authorAttr.getValue(); - TaskAttribute nameAttr = authorAttr.getMappedAttribute(TaskAttribute.PERSON_NAME); - authorName = nameAttr != null ? nameAttr.getValue() : null; - } else { - authorAttr = ta.getTaskData().getRoot().getMappedAttribute(IssueField.REPORTER.getKey()); - if(authorAttr != null) { - author = authorAttr.getValue(); - TaskAttribute nameAttr = authorAttr.getMappedAttribute(TaskAttribute.PERSON_NAME); - authorName = nameAttr != null ? nameAttr.getValue() : null; - } else { - author = authorName = null; - } - } - contentType = getMappedValue(ta, TaskAttribute.ATTACHMENT_CONTENT_TYPE); - isDeprected = getMappedValue(ta, TaskAttribute.ATTACHMENT_IS_DEPRECATED); - isPatch = getMappedValue(ta, TaskAttribute.ATTACHMENT_IS_PATCH); - size = getMappedValue(ta, TaskAttribute.ATTACHMENT_SIZE); - url = getMappedValue(ta, TaskAttribute.ATTACHMENT_URL); - } - - @Override - public boolean isPatch() { - return "1".equals(isPatch); - } - - @Override - public String getAuthorName() { - return authorName; - } - - @Override - public String getAuthor() { - return author; - } - - @Override - public Date getDate() { - return date; - } - - @Override - public String getDesc() { - return desc; - } - - @Override - public String getFilename() { - return filename; - } - - @Override - public String getContentType() { - return contentType; - } - - public String getId() { - return id; - } - - @Override - public boolean isDeprecated() { - return "1".equals(isDeprected); - } - - public String getSize() { - return size; - } - - public String getUrl() { - return url; - } - - @Override - public void getAttachementData(final OutputStream os) { - assert !EventQueue.isDispatchThread() : "Accessing remote host. Do not call in awt"; // NOI18N - repository.getExecutor().execute(new GetAttachmentCommand(repository, id, os)); - } - - @Override - public void open() { - super.open(); //To change body of generated methods, choose Tools | Templates. - } - - } - - @Override - protected void taskDataUpdated () { - availableOperations = null; - ensureConfigurationUptodate(); - Bugzilla.getInstance().getRequestProcessor().post(new Runnable() { - @Override - public void run() { - dataChanged(); - } - }); - } - - private void dataChanged () { - updateTooltip(); - fireDataChanged(); - refreshViewData(false); - } - - @Override - protected void taskModified (boolean syncStateChanged) { - if (updateRecentChanges() | updateTooltip()) { - fireDataChanged(); - } - if (syncStateChanged) { - fireStatusChanged(); - } - } - - void fireChangeEvent () { - fireChanged(); - } - -} diff --git a/ide/bugzilla/src/org/netbeans/modules/bugzilla/issue/BugzillaIssueController.java b/ide/bugzilla/src/org/netbeans/modules/bugzilla/issue/BugzillaIssueController.java deleted file mode 100644 index 221d5e4011e9..000000000000 --- a/ide/bugzilla/src/org/netbeans/modules/bugzilla/issue/BugzillaIssueController.java +++ /dev/null @@ -1,102 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.netbeans.modules.bugzilla.issue; - -import java.beans.PropertyChangeListener; -import javax.swing.JComponent; -import org.netbeans.modules.bugtracking.spi.IssueController; -import org.netbeans.modules.bugtracking.commons.UIUtils; -import org.openide.util.HelpCtx; - -/** - * - * @author Tomas Stupka, Jan Stola - */ -public class BugzillaIssueController implements IssueController { - private final IssuePanel issuePanel; - - public BugzillaIssueController(BugzillaIssue issue) { - IssuePanel panel = new IssuePanel(); - panel.setIssue(issue); - issuePanel = panel; - UIUtils.keepFocusedComponentVisible(issuePanel); - } - - @Override - public JComponent getComponent() { - return issuePanel; - } - - @Override - public void opened() { - BugzillaIssue issue = issuePanel.getIssue(); - if (issue != null) { - issuePanel.opened(); - } - } - - @Override - public void closed() { - BugzillaIssue issue = issuePanel.getIssue(); - if (issue != null) { - issuePanel.closed(); - } - } - - @Override - public HelpCtx getHelpCtx() { - return new HelpCtx("org.netbeans.modules.bugzilla.issue.BugzillaIssue"); // NOI18N - } - - void refreshViewData(boolean force) { - issuePanel.reloadFormInAWT(force); - } - - void modelStateChanged (boolean modelDirty, boolean modelHasLocalChanges) { - issuePanel.modelStateChanged(modelDirty, modelHasLocalChanges); - } - - @Override - public boolean saveChanges() { - return issuePanel.saveSynchronously(); - } - - @Override - public boolean discardUnsavedChanges() { - issuePanel.clearUnsavedChanges(); - return true; - } - - @Override - public void addPropertyChangeListener(PropertyChangeListener l) { - issuePanel.getIssue().addPropertyChangeListener(l); - } - - @Override - public void removePropertyChangeListener(PropertyChangeListener l) { - issuePanel.getIssue().removePropertyChangeListener(l); - } - - @Override - public boolean isChanged() { - return issuePanel.isChanged(); - } - -} diff --git a/ide/bugzilla/src/org/netbeans/modules/bugzilla/issue/BugzillaIssueNode.java b/ide/bugzilla/src/org/netbeans/modules/bugzilla/issue/BugzillaIssueNode.java deleted file mode 100644 index 3e2f995ed2d0..000000000000 --- a/ide/bugzilla/src/org/netbeans/modules/bugzilla/issue/BugzillaIssueNode.java +++ /dev/null @@ -1,277 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.netbeans.modules.bugzilla.issue; - -import java.util.List; -import org.netbeans.modules.bugtracking.issuetable.IssueNode; -import org.netbeans.modules.bugtracking.commons.NBBugzillaUtils; -import org.netbeans.modules.bugzilla.Bugzilla; -import org.netbeans.modules.bugzilla.BugzillaConnector; -import org.netbeans.modules.bugzilla.repository.BugzillaConfiguration; -import org.netbeans.modules.bugzilla.repository.IssueField; -import org.openide.nodes.Node.Property; -import org.openide.util.NbBundle; - -/** - * - * @author Tomas Stupka - */ -public class BugzillaIssueNode extends IssueNode { - public BugzillaIssueNode(BugzillaIssue issue) { - super(BugzillaConnector.ID, - issue.getRepository().getID(), - issue, - Bugzilla.getInstance().getIssueProvider(), - Bugzilla.getInstance().getStatusProvider(), - Bugzilla.getInstance().getChangesProvider()); - } - - BugzillaIssue getBugzillaIssue() { - return getIssueData(); - } - - @Override - protected Property[] getProperties() { - return new Property[] { - new IDProperty(), - NBBugzillaUtils.isNbRepository(getBugzillaIssue().getRepository().getUrl()) - ? new IssueTypeProperty() - : new SeverityProperty(), - new PriorityProperty(), - new BugzillaFieldProperty(BugzillaIssue.LABEL_NAME_STATUS, IssueField.STATUS, "CTL_Issue_Status_Title", "CTL_Issue_Status_Desc"), // NOI18N - new BugzillaFieldProperty(BugzillaIssue.LABEL_NAME_ASSIGNED_TO, IssueField.ASSIGNED_TO, "CTL_Issue_Assigned_Title", "CTL_Issue_Status_Desc"), // NOI18N - new ResolutionProperty(), - new SummaryProperty(), - new ModificationProperty(), - new BugzillaFieldProperty(BugzillaIssue.LABEL_NAME_PRODUCT, IssueField.PRODUCT, "CTL_Issue_Product_Title", "CTL_Issue_Product_Desc"), // NOI18N - new BugzillaFieldProperty(BugzillaIssue.LABEL_NAME_COMPONENT, IssueField.COMPONENT, "CTL_Issue_Component_Title", "CTL_Issue_Component_Desc"), // NOI18N - new BugzillaFieldProperty(BugzillaIssue.LABEL_NAME_VERSION, IssueField.VERSION, "CTL_Issue_Version_Title", "CTL_Issue_Version_Desc"), // NOI18N - new BugzillaFieldProperty(BugzillaIssue.LABEL_NAME_OS, IssueField.OS, "CTL_Issue_OS_Title", "CTL_Issue_OS_Desc"), // NOI18N - new BugzillaFieldProperty(BugzillaIssue.LABEL_NAME_PLATFORM, IssueField.PLATFORM, "CTL_Issue_Platform_Title", "CTL_Issue_Platform_Desc"), // NOI18N - new BugzillaFieldProperty(BugzillaIssue.LABEL_NAME_MILESTONE, IssueField.MILESTONE, "CTL_Issue_Milestone_Title", "CTL_Issue_Milestone_Desc"), // NOI18N - new BugzillaFieldProperty(BugzillaIssue.LABEL_NAME_REPORTER, IssueField.REPORTER_NAME, "CTL_Issue_Reporter_Title", "CTL_Issue_Reporter_Desc"), // NOI18N - new BugzillaFieldProperty(BugzillaIssue.LABEL_NAME_QA_CONTACT, IssueField.QA_CONTACT_NAME, "CTL_Issue_QA_Contact_Title", "CTL_Issue_QA_Contact_Desc"), // NOI18N - new BugzillaFieldProperty(BugzillaIssue.LABEL_NAME_KEYWORDS, IssueField.KEYWORDS, "CTL_Issue_Keywords_Title", "CTL_Issue_Keywords_Desc"), // NOI18N - new BugzillaFieldProperty(BugzillaIssue.LABEL_NAME_WHITEBOARD, IssueField.WHITEBOARD, "CTL_Issue_Whiteboard_Title", "CTL_Issue_Whiteboard_Desc"), // NOI18N - }; - }; - - @Override - public void fireDataChanged() { - super.fireDataChanged(); - } - - private Integer getIssueTypeSortKey(String issueType) { - BugzillaConfiguration bc = getBugzillaIssue().getRepository().getConfiguration(); - if(bc == null || !bc.isValid()) { - return null; - } - List s = bc.getIssueTypes(); - if(s == null) { - return null; - } - return s.indexOf(issueType); - } - - private Integer getSeveritySortKey(String severity) { - BugzillaConfiguration bc = getBugzillaIssue().getRepository().getConfiguration(); - if(bc == null || !bc.isValid()) { - return null; - } - List s = bc.getSeverities(); - if(s == null) { - return null; - } - return s.indexOf(severity); - } - - private Integer getPrioritySortKey(String priority) { - BugzillaConfiguration bc = getBugzillaIssue().getRepository().getConfiguration(); - if(bc == null || !bc.isValid()) { - return null; - } - List p = bc.getPriorities(); - if(p == null) { - return null; - } - return p.indexOf(priority); - } - - private Integer getResolutionSortKey(String resolution) { - BugzillaConfiguration bc = getBugzillaIssue().getRepository().getConfiguration(); - if(bc == null || !bc.isValid()) { - return null; - } - List r = bc.getResolutions(); - if(r == null) { - return null; - } - return r.indexOf(resolution); - } - - private class IDProperty extends IssueNode.IssueProperty { - public IDProperty() { - super(BugzillaIssue.LABEL_NAME_ID, - String.class, - NbBundle.getMessage(BugzillaIssue.class, "CTL_Issue_ID_Title"), // NOI18N - NbBundle.getMessage(BugzillaIssue.class, "CTL_Issue_ID_Desc")); // NOI18N - } - @Override - public String getValue() { - return getBugzillaIssue().getID(); - } - - @Override - public int compareTo(IssueNode.IssueProperty p) { - if(p == null) return 1; - Integer i1 = Integer.parseInt(getIssueData().getID()); - Integer i2 = Integer.parseInt(p.getIssueData().getID()); - return i1.compareTo(i2); - } - - } - - private class SeverityProperty extends IssueNode.IssueProperty { - public SeverityProperty() { - super(BugzillaIssue.LABEL_NAME_SEVERITY, - String.class, - NbBundle.getMessage(BugzillaIssue.class, "CTL_Issue_Severity_Title"), // NOI18N - NbBundle.getMessage(BugzillaIssue.class, "CTL_Issue_Severity_Desc")); // NOI18N - } - @Override - public String getValue() { - return getBugzillaIssue().getRepositoryFieldValue(IssueField.SEVERITY); - } - @Override - public Object getValue(String attributeName) { - if("sortkey".equals(attributeName)) { // NOI18N - return getSeveritySortKey(getBugzillaIssue().getRepositoryFieldValue(IssueField.SEVERITY)); - } else { - return super.getValue(attributeName); - } - } - } - - private class IssueTypeProperty extends IssueNode.IssueProperty { - public IssueTypeProperty() { - super(BugzillaIssue.LABEL_NAME_ISSUE_TYPE, - String.class, - NbBundle.getMessage(BugzillaIssue.class, "CTL_Issue_Issue_Type_Title"), // NOI18N - NbBundle.getMessage(BugzillaIssue.class, "CTL_Issue_Issue_Type_Desc")); // NOI18N - } - @Override - public String getValue() { - return getBugzillaIssue().getRepositoryFieldValue(IssueField.ISSUE_TYPE); - } - @Override - public Object getValue(String attributeName) { - if("sortkey".equals(attributeName)) { // NOI18N - return getIssueTypeSortKey(getBugzillaIssue().getRepositoryFieldValue(IssueField.ISSUE_TYPE)); - } else { - return super.getValue(attributeName); - } - } - } - - public class PriorityProperty extends IssueNode.IssueProperty { - public PriorityProperty() { - super(BugzillaIssue.LABEL_NAME_PRIORITY, - String.class, - NbBundle.getMessage(BugzillaIssue.class, "CTL_Issue_Priority_Title"), // NOI18N - NbBundle.getMessage(BugzillaIssue.class, "CTL_Issue_Priority_Desc")); // NOI18N - } - @Override - public String getValue() { - return getBugzillaIssue().getRepositoryFieldValue(IssueField.PRIORITY); - } - @Override - public Object getValue(String attributeName) { - if("sortkey".equals(attributeName)) { // NOI18N - return getPrioritySortKey(getBugzillaIssue().getRepositoryFieldValue(IssueField.PRIORITY)); - } else { - return super.getValue(attributeName); - } - } - } - - private class ResolutionProperty extends IssueNode.IssueProperty { - public ResolutionProperty() { - super(BugzillaIssue.LABEL_NAME_RESOLUTION, - String.class, - NbBundle.getMessage(BugzillaIssue.class, "CTL_Issue_Resolution_Title"), // NOI18N - NbBundle.getMessage(BugzillaIssue.class, "CTL_Issue_ID_Desc")); // NOI18N - } - @Override - public String getValue() { - return getBugzillaIssue().getRepositoryFieldValue(IssueField.RESOLUTION); - } - @Override - public Object getValue(String attributeName) { - if("sortkey".equals(attributeName)) { // NOI18N - return getResolutionSortKey(getBugzillaIssue().getRepositoryFieldValue(IssueField.RESOLUTION)); - } else { - return super.getValue(attributeName); - } - } - } - - private class ModificationProperty extends IssueNode.IssueProperty { - public ModificationProperty() { - super(BugzillaIssue.LABEL_NAME_MODIFICATION, - String.class, - NbBundle.getMessage(BugzillaIssue.class, "CTL_Issue_Modification_Title"), // NOI18N - NbBundle.getMessage(BugzillaIssue.class, "CTL_Issue_Modification_Desc")); // NOI18N - } - @Override - public String getValue() { - return getBugzillaIssue().getRepositoryFieldValue(IssueField.MODIFICATION); - } - @Override - public int compareTo(IssueNode.IssueProperty p) { - if(p == null) return 1; - // XXX sort as date - String s1 = getBugzillaIssue().getRepositoryFieldValue(IssueField.MODIFICATION); - String s2 = p.getIssueData().getRepositoryFieldValue(IssueField.MODIFICATION); - return s1.compareTo(s2); - } - } - - private class BugzillaFieldProperty extends IssueProperty { - private final IssueField field; - public BugzillaFieldProperty(String fieldLabel, IssueField f, String titleProp, String descProp) { - super(fieldLabel, - String.class, - NbBundle.getMessage(BugzillaIssue.class, titleProp), // NOI18N - NbBundle.getMessage(BugzillaIssue.class, descProp)); // NOI18N - this.field = f; - } - @Override - public String getValue() { - return getBugzillaIssue().getRepositoryFieldValue(field); - } - @Override - public int compareTo(IssueNode.IssueProperty p) { - if(p == null) return 1; - String s1 = getBugzillaIssue().getRepositoryFieldValue(field); - String s2 = p.getIssueData().getRepositoryFieldValue(field); - return s1.compareTo(s2); - } - } -} diff --git a/ide/bugzilla/src/org/netbeans/modules/bugzilla/issue/Bundle.properties b/ide/bugzilla/src/org/netbeans/modules/bugzilla/issue/Bundle.properties deleted file mode 100644 index 5b44b12c5872..000000000000 --- a/ide/bugzilla/src/org/netbeans/modules/bugzilla/issue/Bundle.properties +++ /dev/null @@ -1,267 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - -CTL_Issue=#{0} - {1} -CTL_NewIssue=New Task - -CTL_Issue_ID_Title=ID -CTL_Issue_ID_Desc=Task ID -CTL_Issue_Severity_Title=Severity -CTL_Issue_Severity_Desc=Task Severity -CTL_Issue_Issue_Type_Title=Task Type -CTL_Issue_Issue_Type_Desc=Task Type -CTL_Issue_Priority_Title=Priority -CTL_Issue_Priority_Desc=Task Priority -CTL_Issue_Status_Title=Status -CTL_Issue_Status_Desc=Task Status -CTL_Issue_Resolution_Title=Resolution -CTL_Issue_Resolution_Desc=Task Resolution -CTL_Issue_Summary_Title=Summary -CTL_Issue_Summary_Desc=Task Summary -CTL_Issue_Assigned_Title=Assigned To -CTL_Issue_Assigned_Desc=User to whom the task is assigned - -CTL_Issue_Scheduled_Title=Scheduled -CTL_Issue_Due_Title=Due -CTL_Issue_Estimate_Title=Estimate - -CTL_Issue_Product_Title=Product -CTL_Issue_Product_Desc=Task Product -CTL_Issue_Component_Title=Component -CTL_Issue_Component_Desc=Task Component -CTL_Issue_Version_Title=Version -CTL_Issue_Version_Desc=Task Version -CTL_Issue_OS_Title=OS -CTL_Issue_OS_Desc=Task OS -CTL_Issue_Platform_Title=Platform -CTL_Issue_Platform_Desc=Task Platform -CTL_Issue_Milestone_Title=Milestone -CTL_Issue_Milestone_Desc=Task Milestone -CTL_Issue_Reporter_Title=Reporter -CTL_Issue_Reporter_Desc=Task Reporter -CTL_Issue_Modification_Title=Modified -CTL_Issue_Modification_Desc=Last time the task was modified -CTL_Issue_QA_Contact_Title=QA Contact -CTL_Issue_QA_Contact_Desc=Task QA Contact -CTL_Issue_Keywords_Title=Keywords -CTL_Issue_Keywords_Desc=Task Keywords -CTL_Issue_Whiteboard_Title=Status Whiteboard -CTL_Issue_Whiteboard_Desc=Task Status Whiteboard - -# IssuePanel -IssuePanel.productLabel.text=Product: -IssuePanel.componentLabel.text=Component: -IssuePanel.versionLabel.text=Version: -IssuePanel.platformLabel.text=Platform: -IssuePanel.statusLabel.text=Status: -IssuePanel.resolutionLabel.text=Resolution: -IssuePanel.priorityLabel.text=Priority: -IssuePanel.targetMilestoneLabel.text=Target Milestone: -IssuePanel.urlLabel.text=URL: -IssuePanel.keywordsLabel.text=Keywords: -IssuePanel.reportedLabel.text=Reported: -# {0} creation, {1} reporter -IssuePanel.reportedLabel.format={0} by {1} -IssuePanel.modifiedLabel.text=Modified: -IssuePanel.assignedLabel.text=Assigned to: -IssuePanel.qaContactLabel.text=QA Contact: -IssuePanel.ccLabel.text=CC: -IssuePanel.dependsLabel.text=Depends on: -IssuePanel.blocksLabel.text=Blocks: -IssuePanel.submitButton.text.new=Submit Task -IssuePanel.attachmentsLabel.text=Attachments ({0}) -# {0} id, {1} summary -IssuePanel.headerLabel.format=Task #{0} - {1} -# {0} id -IssuePanel.submitMessage=Submitting changes to task {0} -IssuePanel.submitNewMessage=Submitting new task -IssuePanel.refreshButton.text=Refresh -IssuePanel.refreshMessage=Refreshing task {0} - -IssuePanel.duplicateLabel.text=of Task -IssuePanel.keywordsButton.text=... -IssuePanel.keywordsButton.message=Select or deselect task keywords. -IssuePanel.blocksButton.text=... -IssuePanel.blocksButton.message=&Select task that this task blocks. -IssuePanel.dependsOnButton.text=... -IssuePanel.dependsOnButton.message=&Select task that this task depends on. -IssuePanel.duplicateButton.text=... -IssuePanel.duplicateButton.message=&Select the duplicate task. -IssuePanel.summaryLabel.text=Summary: -IssuePanel.description=Description -IssuePanel.noSummary=Missing summary. -IssuePanel.noComponent=Missing component. -IssuePanel.noTargetMilestone=Missing target milestone. -IssuePanel.noVersion=Missing version. -IssuePanel.noReproducibility=Missing reproducibility. -IssuePanel.cyclicDependency=This task cannot block and depend on the same task. -IssuePanel.commentAddedWarning=Someone added a comment while you were editing this task. Read it below. -IssuePanel.invalidKeyword=Keywords field contains non-existing keyword(s). -IssuePanel.noDuplicateId=Duplicate of Task field contains no task id. -IssuePanel.reloadMessage=Reloading server attributes -IssuePanel.refreshButton.toolTipText=Load the latest task data from the server. -IssuePanel.tasklistButton.add=Add to Category -IssuePanel.statusWhiteboardLabel.text=Status Whiteboard: -IssuePanel.issueTypeLabel.text=Task Type: - -# IssuePanel - A11Y -IssuePanel.productCombo.AccessibleContext.accessibleDescription=N/A -IssuePanel.productField.AccessibleContext.accessibleDescription=N/A -IssuePanel.componentCombo.AccessibleContext.accessibleDescription=N/A -IssuePanel.versionCombo.AccessibleContext.accessibleDescription=N/A -IssuePanel.platformCombo.AccessibleContext.accessibleDescription=N/A -IssuePanel.osCombo.AccessibleContext.accessibleDescription=N/A -IssuePanel.statusCombo.AccessibleContext.accessibleDescription=N/A -IssuePanel.resolutionCombo.AccessibleContext.accessibleDescription=N/A -IssuePanel.resolutionField.AccessibleContext.accessibleDescription=N/A -IssuePanel.priorityCombo.AccessibleContext.accessibleDescription=N/A -IssuePanel.severityCombo.AccessibleContext.accessibleDescription=N/A -IssuePanel.targetMilestoneCombo.AccessibleContext.accessibleDescription=N/A -IssuePanel.urlField.AccessibleContext.accessibleDescription=N/A -IssuePanel.keywordsField.AccessibleContext.accessibleDescription=N/A -IssuePanel.keywordsButton.AccessibleContext.accessibleDescription=Opens keywords chooser -IssuePanel.reportedField.AccessibleContext.accessibleDescription=N/A -IssuePanel.modifiedField.AccessibleContext.accessibleDescription=N/A -IssuePanel.assignedField.AccessibleContext.accessibleDescription=N/A -IssuePanel.qaContactField.AccessibleContext.accessibleDescription=N/A -IssuePanel.ccField.AccessibleContext.accessibleDescription=N/A -IssuePanel.duplicateField.AccessibleContext.accessibleDescription=Number of duplicate task -IssuePanel.duplicateButton.AccessibleContext.accessibleDescription=Opens task chooser -IssuePanel.dependsField.AccessibleContext.accessibleDescription=N/A -IssuePanel.dependsOnButton.AccessibleContext.accessibleDescription=Opens task chooser -IssuePanel.blocksField.AccessibleContext.accessibleDescription=N/A -IssuePanel.blocksButton.AccessibleContext.accessibleDescription=Opens task chooser -IssuePanel.refreshButton.AccessibleContext.accessibleDescription=N/A -IssuePanel.summaryField.AccessibleContext.accessibleDescription=N/A -IssuePanel.addCommentArea.AccessibleContext.accessibleDescription= -IssuePanel.viewLogButton.text=(review IDE Log) -# {0} NB version {1} OS name {2} OS version {3} OS arch -# {4} Java version {5} java.vm.name {6} java.vm.version -IssuePanel.newIssue.netbeansInfo=Product Version = {0}\n\ -Operating System = {1} version {2} running on {3}\n\ -Java; VM; Vendor = {4}\n\ -Runtime = {5} {6} - -IssuePanel.newIssue.netbeansDescTemplate=STEPS:\n * Open dialog Foo\n * Click on button "Click me"\n\nACTUAL:\n nothing happens\n\nEXPECTED:\n message pops up - -# CommentsPanel -# {0} author -CommentsPanel.leftLabel.format={0} - Task Description -CommentsPanel.leftLabel.text=Comment -Comments.replyButton.text=Reply -CommentsPanel.textPane.AccessibleContext.accessibleName=Comment or description -CommentsPanel.textPane.AccessibleContext.accessibleDescription=Comment or description of the task -CommentsPanel.replyButton.AccessibleContext.accessibleDescription=Reply to the comment -CommentsPanel.mailtoButton.text=Mail to -CommentsPanel.mailtoButton.AccessibleContext.accessibleDescription=Email the author - -LBL_NEW_STATUS=New -LBL_SUMMARY_CHANGED_STATUS=Summary changed -## CC is a bugzilla attributes name, do not translate -LBL_CC_FIELD_CHANGED_STATUS=CC field changed -LBL_KEYWORDS_CHANGED_STATUS=Keywords changed -LBL_DEPENDENCE_CHANGED_STATUS=Dependence changed -LBL_CHANGED_TO={0} changed to {1} -LBL_CHANGES_INCL_SUMMARY= {0} changes, incl. summary -LBL_CHANGES_INCL_PRIORITY= {0} changes, incl. priority -LBL_CHANGES_INCL_SEVERITY= {0} changes, incl. severity -LBL_CHANGES_INCL_ISSUE_TYPE= {0} changes, incl. task type -LBL_CHANGES_INCL_PRODUCT= {0} changes, incl. product -LBL_CHANGES_INCL_COMPONENT= {0} changes, incl. component -LBL_CHANGES_INCL_PLATFORM= {0} changes, incl. platform -LBL_CHANGES_INCL_VERSION= {0} changes, incl. version -LBL_CHANGES_INCL_MILESTONE= {0} changes, incl. milestone -LBL_CHANGES_INCL_KEYWORDS= {0} changes, incl. keywords -LBL_CHANGES_INCL_URL= {0} changes, incl. url -LBL_CHANGES_INCL_ASSIGNEE= {0} changes, incl. Assignee -LBL_CHANGES_INCL_QA_CONTACT= {0} changes, incl. qa contact -LBL_CHANGES_INCLUSIVE_DEPENDENCE= {0} changes, inclusive dependence -LBL_CHANGES={0} changes -LBL_COMMENTS_CHANGED={0} new comment(s) -LBL_ATTACHMENTS_CHANGED=Attachment(s) added - -Attachment.open.progress=Opening attachment {0} -Attachment.saveToFile.progress=Saving attachment {0} -Attachment.applyPatch.progress=Applying patch {0} - -BugzillaIssueProvider.loadingIssue = Loading task... -BugzillaIssueProvider.resolveAction=Resolve... -BugzillaIssueProvider.resolveIssueButton.text=Resolve Task -BugzillaIssueProvider.resolveIssueMessage=Resolving task {0} -BugzillaIssueProvider.resolveAction.notPermitted=Resolve action is not permitted\nTask is already closed. -ResolveIssuePanel.resolutionLabel.text=&Resolution: -ResolveIssuePanel.commentLabel.text=Co&mment: -ResolveIssuePanel.duplicateButton.text=... -ResolveIssuePanel.resolveButton=&Resolve -ResolveIssuePanel.resolutionCombo.AccessibleContext.accessibleDescription=N/A -ResolveIssuePanel.duplicateField.AccessibleContext.accessibleDescription=Number of duplicate task -ResolveIssuePanel.duplicateButton.AccessibleContext.accessibleDescription=Opens task chooser -ResolveIssuePanel.textArea.AccessibleContext.accessibleDescription=N/A -ResolveIssuePanel.duplicateLabel.text=of &Task -IssuePanel.showInBrowserButton.text=Show in Browser -IssuePanel.assignToDefaultCheckBox.text=Reassign to Default - -LBL_CollapseAll=Collapse all -LBL_ExpandAll=Expand all -IssuePanel.jLabel7.text=+ -IssuePanel.estimatedField.text=0.0 -IssuePanel.estimatedLabel.text=Original Est. -IssuePanel.actualLabel.text=Current Est. -IssuePanel.actualField.text=0.0 -IssuePanel.workedLabel.text=Hours Worked -IssuePanel.workedField.text=0.0 -IssuePanel.remainingField.text=0.0 -IssuePanel.remainingLabel.text=Hours Left -IssuePanel.completeLabel.text=% Complete -IssuePanel.completeField.text=0 -IssuePanel.gainField.text=0 -IssuePanel.gainLabel.text=Gain -IssuePanel.deadlineLabel.text=Deadline -IssuePanel.workedSumField.text=0 -IssuePanel.timetrackingLabel.text=Timetracking: -IssuePanel.attachLogCheckBox.text=Attach IDE Log - -IssuePanel.btnDeleteTask.TTtext=Dismiss the new task, delete it and forget all changes made to its fields - -LBL_Type=Type -LBL_Assigned=Assignee -LBL_ConflictShort=Conflict - your unsubmitted changes conflict with remote changes -LBL_UnsubmittedShort=Unsubmitted - contains unsubmitted changes -LBL_UnsubmittedNewShort=Unsubmitted New - newly created task, not yet submitted -LBL_RemoteShort=Incoming - contains remote changes -LBL_RemoteNewShort=Incoming New - new task created in repository -IssuePanel.attributesSection.label=Attributes -IssuePanel.commentsLabel.text=Comments ({0}) -IssuePanel.newCommentSection.label=New Comment -IssuePanel.submitButton.AccessibleContext.accessibleDescription=N/A -IssuePanel.cancelButton.AccessibleContext.accessibleDescription=N/A -IssuePanel.cancelButton.text=Cancel -IssuePanel.submitButton.text=Submit -IssuePanel.btnDeleteTask.text=Dismiss -IssuePanel.notesLabel.text=Notes: -IssuePanel.estimateLabel.text=Estimate: -IssuePanel.scheduleDateLabel.text=Schedule Date: -IssuePanel.dueDateLabel.text=Due Date: -IssuePanel.estimateField.toolTipText= -IssuePanel.dueDateLabel.TTtext=Set task's due date -IssuePanel.scheduleDateLabel.TTtext=Set task's schedule date -IssuePanel.notesLabel.TTtext=Task's private notes -IssuePanel.estimateLabel.TTtext=Set task's estimate in hours -IssuePanel.privateAttributesSection.text=My Private Task Details -IssuePanel.privateAttributesSection.containsNotes=Contains notes -IssuePanel.reproducibilityLabel.text=Reproducibility: -IssuePanel.reproducibilityCommitText=Reproducibility: {0} diff --git a/ide/bugzilla/src/org/netbeans/modules/bugzilla/issue/CommentsPanel.java b/ide/bugzilla/src/org/netbeans/modules/bugzilla/issue/CommentsPanel.java deleted file mode 100644 index 07523f97f2a6..000000000000 --- a/ide/bugzilla/src/org/netbeans/modules/bugzilla/issue/CommentsPanel.java +++ /dev/null @@ -1,592 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.netbeans.modules.bugzilla.issue; - -import java.awt.Color; -import java.awt.Component; -import java.awt.Dimension; -import java.awt.Point; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.awt.event.MouseEvent; -import java.awt.event.MouseListener; -import java.text.DateFormat; -import java.text.MessageFormat; -import java.text.ParseException; -import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.Date; -import java.util.HashSet; -import java.util.List; -import java.util.ResourceBundle; -import java.util.Set; -import java.util.StringTokenizer; -import java.util.logging.Level; -import javax.swing.AbstractAction; -import javax.swing.Action; -import javax.swing.BorderFactory; -import javax.swing.GroupLayout; -import javax.swing.Icon; -import javax.swing.JComponent; -import javax.swing.JLabel; -import javax.swing.JMenuItem; -import javax.swing.JPanel; -import javax.swing.JPopupMenu; -import javax.swing.JScrollPane; -import javax.swing.JTextPane; -import javax.swing.LayoutStyle; -import javax.swing.JTree; -import javax.swing.SwingUtilities; -import javax.swing.UIManager; -import javax.swing.plaf.basic.BasicTextPaneUI; -import javax.swing.plaf.basic.BasicTreeUI; -import javax.swing.text.Caret; -import javax.swing.text.DefaultCaret; -import javax.swing.text.Element; -import javax.swing.text.StyledDocument; -import org.netbeans.modules.bugtracking.commons.IssueSettingsStorage; -import org.netbeans.modules.bugtracking.commons.HyperlinkSupport; -import org.netbeans.modules.bugtracking.commons.LinkButton; -import org.netbeans.modules.bugtracking.commons.UIUtils; -import org.netbeans.modules.bugzilla.Bugzilla; -import org.netbeans.modules.bugzilla.repository.IssueField; -import org.openide.util.NbBundle; -import org.openide.util.RequestProcessor; - -/** - * - * @author Jan Stola - */ -public class CommentsPanel extends JPanel { - static final RequestProcessor RP = new RequestProcessor("Bugzilla Comments Panel", 5, false); // NOI18N - private static final DateFormat dateTimeFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm"); // NOI18N - private static final String REPLY_TO_PROPERTY = "replyTo"; // NOI18N - private static final String QUOTE_PREFIX = "> "; // NOI18N - private static final int MAX_COMMENT_HEIGHT = 10000; - - private static Color blueBackground = null; - private static Color greyForeground = null; - - private final JPopupMenu commentsPopup = new PopupMenu(); - private BugzillaIssue issue; - private List attachments; - private List attachmentIds; - private NewCommentHandler newCommentHandler; - - private Set collapsedComments = Collections.synchronizedSet(new HashSet()); - - static { - blueBackground = UIManager.getColor( "nb.bugtracking.comment.background" ); //NOI18N - if( null == blueBackground ) - blueBackground = new Color(0xf3f6fd); - greyForeground = UIManager.getColor( "nb.bugtracking.comment.foreground" ); //NOI18N - if( null == greyForeground ) - greyForeground = new Color(0x999999); - } - private ArrayList sections; - - public CommentsPanel() { - setOpaque( false ); - } - - void setIssue(BugzillaIssue issue, - List attachments) { - removeAll(); - this.issue = issue; - initCollapsedComments(); - this.attachments = attachments; - this.attachmentIds = getAttachmentIds(attachments); - BugzillaIssue.Comment[] comments = issue.getComments(); - this.sections = new ArrayList<>(comments.length + 1); - GroupLayout layout = new GroupLayout(this); - GroupLayout.ParallelGroup horizontalGroup = layout.createParallelGroup(GroupLayout.Alignment.LEADING); - layout.setHorizontalGroup(layout.createSequentialGroup() - .addContainerGap() - .addGroup(horizontalGroup) - .addContainerGap()); - GroupLayout.SequentialGroup verticalGroup = layout.createSequentialGroup(); - verticalGroup.addContainerGap(); - layout.setVerticalGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING).addGroup(verticalGroup)); - DateFormat format = DateFormat.getDateTimeInstance(DateFormat.DEFAULT, DateFormat.SHORT); - String creationTxt = issue.getFieldValue(IssueField.CREATION); - try { - if (!creationTxt.isEmpty()) { - Date creation = dateTimeFormat.parse(creationTxt); - creationTxt = format.format(creation); - } - } catch (ParseException pex) { - Bugzilla.LOG.log(Level.INFO, null, pex); - } - sections.add(addSection(layout, Long.valueOf(0), - issue.getFieldValue(IssueField.DESCRIPTION), - issue.getFieldValue(IssueField.REPORTER), - issue.getFieldValue(IssueField.REPORTER_NAME), - creationTxt, horizontalGroup, verticalGroup, true)); - for (BugzillaIssue.Comment comment : comments) { - String when = format.format(comment.getWhen()); - sections.add(addSection(layout, comment.getNumber(), comment.getText(), comment.getAuthor(), comment.getAuthorName(), when, horizontalGroup, verticalGroup, false)); - } - verticalGroup.addContainerGap(); - setLayout(layout); - } - - private static List getAttachmentIds( - List attachments) { - if (attachments.isEmpty()) { - return Collections.emptyList(); - } - - List result = new ArrayList(attachments.size()); - for (BugzillaIssue.Attachment attachment : attachments) { - result.add(attachment.getId()); - } - return result; - } - - public void setNewCommentHandler(NewCommentHandler handler) { - newCommentHandler = handler; - } - - private ExpandLabel addSection(GroupLayout layout, final Long number, String text, final String author, String authorName, String dateTimeString, - GroupLayout.ParallelGroup horizontalGroup, GroupLayout.SequentialGroup verticalGroup, boolean description) { - - JTextPane textPane = new JTextPane(); - setupTextPane(textPane, text); - - JPanel headerPanel = new JPanel(); - headerPanel.setOpaque( false ); - JPanel placeholder = createTextPanelPlaceholder(); - JLabel commentLabel = new JLabel(); - JLabel rightLabel = new JLabel(); - ExpandLabel iconLabel = new ExpandLabel(placeholder, textPane, headerPanel, commentLabel, number); - JLabel leftLabel = new JLabel(); - - headerPanel.addMouseListener(iconLabel); - headerPanel.setComponentPopupMenu(expandPopup); - - // left label - ResourceBundle bundle = NbBundle.getBundle(CommentsPanel.class); - String leftTxt = ""; - String authorTxt = ((authorName != null) && (authorName.trim().length() > 0)) ? authorName : author; - if (description) { - String leftFormat = bundle.getString("CommentsPanel.leftLabel.format"); // NOI18N - leftTxt = MessageFormat.format(leftFormat, authorTxt); - } else { - leftTxt = authorTxt; - } - leftLabel.setText(leftTxt); - leftLabel.setLabelFor(textPane); - leftLabel.setForeground(greyForeground); - leftLabel.setOpaque(false); - leftLabel.addMouseListener(iconLabel); - leftLabel.setComponentPopupMenu(expandPopup); - - // comment label - commentLabel.setOpaque(false); - commentLabel.addMouseListener(iconLabel); - commentLabel.setComponentPopupMenu(expandPopup); - - // right label - rightLabel.setText(dateTimeString); - rightLabel.setForeground(greyForeground); - rightLabel.setOpaque(false); - rightLabel.addMouseListener(iconLabel); - rightLabel.setComponentPopupMenu(expandPopup); - - // state label - JLabel stateLabel = null; - - // replay button - LinkButton replyButton = new LinkButton(bundle.getString("Comments.replyButton.text")); // NOI18N - replyButton.addActionListener(getReplyListener()); - replyButton.putClientProperty(REPLY_TO_PROPERTY, textPane); - replyButton.getAccessibleContext().setAccessibleDescription(NbBundle.getMessage(CommentsPanel.class, "CommentsPanel.replyButton.AccessibleContext.accessibleDescription")); // NOI18N - replyButton.setOpaque(false); - - // mailto button - LinkButton.MailtoButton mailtoButton = null; - if(author.indexOf("@") > -1) { - mailtoButton = new LinkButton.MailtoButton( - NbBundle.getMessage(CommentsPanel.class, "CommentsPanel.mailtoButton.text"), // NOI18N - NbBundle.getMessage(CommentsPanel.class, "CommentsPanel.mailtoButton.AccessibleContext.accessibleDescription"), // NOI18N - author, - NbBundle.getMessage(CommentsPanel.class, "IssuePanel.headerLabel.format", new Object[] {issue.getID(), issue.getSummary()}), // subject NOI18N - getReplayText(text)); // body - replyButton.setOpaque(false); - } - // IssueProvider 172653 - JTextPane too big - JComponent pane = textPane; - if (textPane.getPreferredSize().height>Short.MAX_VALUE) { - pane = new JScrollPane(textPane); - Dimension dim = new Dimension(textPane.getPreferredSize()); - dim.height = MAX_COMMENT_HEIGHT; - pane.setPreferredSize(dim); - } - - // Layout - layoutHeaderPanel(headerPanel, iconLabel, leftLabel, commentLabel, rightLabel, replyButton, mailtoButton, stateLabel); - - iconLabel.setBorder(BorderFactory.createEmptyBorder(1,1,1,1)); - placeholder.setBorder(BorderFactory.createEmptyBorder(1,1,1,1)); - leftLabel.setBorder(BorderFactory.createEmptyBorder(1,1,1,1)); - commentLabel.setBorder(BorderFactory.createEmptyBorder(1,1,1,1)); - rightLabel.setBorder(BorderFactory.createEmptyBorder(1,1,1,1)); - - horizontalGroup - .addComponent(headerPanel) - .addGroup(layout.createSequentialGroup() - .addComponent(placeholder, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) - .addGap(0, 0, 0) - .addComponent(pane)); - - if (!description) { - verticalGroup.addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED); - } - verticalGroup - .addComponent(headerPanel) - .addGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING, false) - .addComponent(placeholder) - .addComponent(pane, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)); - return iconLabel; - } - - private void setupTextPane(final JTextPane textPane, String comment) { - if( UIUtils.isNimbus() ) { - textPane.setUI( new BasicTextPaneUI() ); - } - textPane.setText(comment); - - Caret caret = textPane.getCaret(); - if (caret instanceof DefaultCaret) { - ((DefaultCaret)caret).setUpdatePolicy(DefaultCaret.NEVER_UPDATE); - } - - // attachments - if (!attachmentIds.isEmpty()) { - AttachmentHyperlinkSupport.Attachement a = AttachmentHyperlinkSupport.findAttachment(comment, attachmentIds); - if (a != null) { - String attachmentId = a.id; - if (attachmentId != null) { - int index = attachmentIds.indexOf(attachmentId); - if (index != -1) { - BugzillaIssue.Attachment attachment = attachments.get(index); - AttachmentLink attachmentLink = new AttachmentLink(attachment); - HyperlinkSupport.getInstance().registerLink(textPane, new int[] {a.idx1, a.idx2}, attachmentLink); - } else { - Bugzilla.LOG.log(Level.WARNING, "couldn''t find attachment id in: {0}", comment); // NOI18N - } - } - } - } - - // pop-ups - textPane.setComponentPopupMenu(commentsPopup); - - textPane.setBackground(blueBackground); - - textPane.setBorder(BorderFactory.createEmptyBorder(3,3,3,3)); - textPane.setEditable(false); - textPane.getAccessibleContext().setAccessibleName(NbBundle.getMessage(CommentsPanel.class, "CommentsPanel.textPane.AccessibleContext.accessibleName")); // NOI18N - textPane.getAccessibleContext().setAccessibleDescription(NbBundle.getMessage(CommentsPanel.class, "CommentsPanel.textPane.AccessibleContext.accessibleDescription")); // NOI18N - } - - private void layoutHeaderPanel(JPanel headerPanel, JLabel iconLabel, JLabel leftLabel, JLabel commentLabel, JLabel rightLabel, LinkButton replyButton, LinkButton mailtoButton, JLabel stateLabel) { - GroupLayout layout = new GroupLayout(headerPanel); - headerPanel.setLayout(layout); - GroupLayout.SequentialGroup hGroup = layout.createSequentialGroup() - .addComponent(iconLabel) - .addComponent(leftLabel); - if (stateLabel != null) { - hGroup.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED) - .addComponent(stateLabel); - } - hGroup.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED) - .addComponent(commentLabel,0, 0, Short.MAX_VALUE) - .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED) - .addComponent(rightLabel) - .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED) - .addComponent(replyButton); - if (mailtoButton != null) { - hGroup.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED) - .addComponent(mailtoButton); - } - layout.setHorizontalGroup(hGroup); - - GroupLayout.ParallelGroup vGroup = layout.createParallelGroup(GroupLayout.Alignment.BASELINE) - .addComponent(iconLabel) - .addComponent(leftLabel); - if (stateLabel != null) { - vGroup.addComponent(stateLabel); - } - vGroup.addComponent(commentLabel) - .addComponent(rightLabel) - .addComponent(replyButton); - if (mailtoButton != null) { - vGroup.addComponent(mailtoButton); - } - layout.setVerticalGroup(vGroup); - } - - private ActionListener replyListener; - private ActionListener getReplyListener() { - if (replyListener == null) { - replyListener = new ActionListener() { - @Override - public void actionPerformed(ActionEvent e) { - Object source = e.getSource(); - if (source instanceof JComponent) { - JComponent comp = (JComponent)source; - Object value = comp.getClientProperty(REPLY_TO_PROPERTY); - if (value instanceof JTextPane) { - JTextPane pane = (JTextPane)value; - newCommentHandler.append(getReplayText(pane.getText())); - } - } - } - - }; - } - return replyListener; - } - - private String getReplayText(String text) { - StringBuilder sb = new StringBuilder(); - StringTokenizer tokenizer = new StringTokenizer(text, "\n"); // NOI18N - while (tokenizer.hasMoreElements()) { - String line = tokenizer.nextToken(); - sb.append(QUOTE_PREFIX).append(line).append('\n'); // NOI18N - } - return sb.toString(); - } - - private JPanel createTextPanelPlaceholder() { - JPanel placeholder = new JPanel(); - placeholder.setBackground(blueBackground); - GroupLayout layout = new GroupLayout(placeholder); - placeholder.setLayout(layout); - layout.setHorizontalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, ICON_WIDTH, Short.MAX_VALUE)); - layout.setVerticalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 0, Short.MAX_VALUE)); - return placeholder; - } - - void collapseAll () { - for (ExpandLabel lbl : sections) { - lbl.setState(true); - } - } - - void expandAll () { - for (ExpandLabel lbl : sections) { - lbl.setState(false); - } - } - - class PopupMenu extends JPopupMenu { - - /* - * Holds the location of where the user invoked the pop-up menu. - * It must be remembered before calling super.show(...) because - * the method show() may change the location of the pop-up menu, - * so the original location might not be available. - */ - private final Point clickPoint = new Point(); - - @Override - public void show(Component invoker, int x, int y) { - clickPoint.setLocation(x, y); - super.show(invoker, x, y); - } - - @Override - public void setVisible(boolean b) { - if (b) { - JTextPane pane = (JTextPane) getInvoker(); - StyledDocument doc = pane.getStyledDocument(); - Element elem = doc.getCharacterElement(pane.viewToModel(clickPoint)); - Object l = elem.getAttributes().getAttribute(HyperlinkSupport.LINK_ATTRIBUTE); - if (l instanceof AttachmentLink) { - BugzillaIssue.Attachment attachment = ((AttachmentLink) l).attachment; - if (attachment != null) { - add(new JMenuItem(attachment.getOpenAction())); - add(new JMenuItem(attachment.getSaveAction())); - Action openInStackAnalyzerAction = attachment.getOpenInStackAnalyzerAction(); - if(openInStackAnalyzerAction != null) { - add(new JMenuItem(openInStackAnalyzerAction)); - } - if (attachment.isPatch()) { - Action a = attachment.getApplyPatchAction(); - if(a != null) { - add(attachment.getApplyPatchAction()); - } - } - super.setVisible(true); - } - } - } else { - super.setVisible(false); - removeAll(); - } - } - - } - - public interface NewCommentHandler { - void append(String text); - } - - private final JPopupMenu expandPopup = new ExpandPopupMenu(); - private Set expandLabels = new HashSet(); - - private class ExpandPopupMenu extends JPopupMenu { - public ExpandPopupMenu() { - add(new JMenuItem(new AbstractAction(NbBundle.getMessage(CommentsPanel.class, "LBL_ExpandAll")) { // NOI18N - @Override - public void actionPerformed(ActionEvent e) { - for (ExpandLabel l : expandLabels) { - l.setState(false); - } - } - })); - add(new JMenuItem(new AbstractAction(NbBundle.getMessage(CommentsPanel.class, "LBL_CollapseAll")) { // NOI18N - @Override - public void actionPerformed(ActionEvent e) { - for (ExpandLabel l : expandLabels) { - l.setState(true); - } - } - })); - } - } - - private void commentCollapsed(Long number) { - collapsedComments.add(number); - } - - private Set touchedCommenst = Collections.synchronizedSet(new HashSet()); - private void commentExpanded(Long number) { - if(collapsedComments.remove(number)) { - touchedCommenst.add(number); - } - } - - private boolean isCollapsed(Long number) { - return collapsedComments.contains(number); - } - - private void initCollapsedComments() { - RP.post(new Runnable() { - @Override - public void run() { - Collection s = IssueSettingsStorage.getInstance().loadCollapsedCommenst(issue.getRepository().getUrl(), issue.getID()); - for (Long l : s) { - if(!touchedCommenst.contains(l)) { - collapsedComments.add(l); - } - } - } - }); - } - - void storeSettings() { - if(issue != null) { - IssueSettingsStorage.getInstance().storeCollapsedComments(collapsedComments, issue.getRepository().getUrl(), issue.getID()); - } - } - - private static final Icon ei; - private static final Icon ci; - private static final int ICON_WIDTH; - static { - JTree tv = new JTree(); - BasicTreeUI tvui = (BasicTreeUI) tv.getUI(); - ei = tvui.getExpandedIcon(); - ci = tvui.getCollapsedIcon(); - ICON_WIDTH = ei != null ? ei.getIconWidth() : 16; - } - private class ExpandLabel extends JLabel implements MouseListener { - private final JTextPane textPane; - private final JPanel headerPanel; - private final JPanel placeholderPanel; - private final JLabel commentLabel; - private final Long number; - - public ExpandLabel(JPanel placeholderPanel, JTextPane textPane, JPanel headerPanel, JLabel commentLabel, Long number) { - this.textPane = textPane; - this.headerPanel = headerPanel; - this.placeholderPanel = placeholderPanel; - this.commentLabel = commentLabel; - this.number = number; - - - addMouseListener(this); - setComponentPopupMenu(expandPopup); - setState(isCollapsed(number)); - expandLabels.add(this); - } - - @Override - public void mouseClicked(MouseEvent e) { - if (SwingUtilities.isLeftMouseButton(e)) { - setState(!isCollapsed(number)); - } - } - - @Override - public void mousePressed(MouseEvent e) {} - @Override - public void mouseReleased(MouseEvent e) {} - @Override - public void mouseEntered(MouseEvent e) {} - @Override - public void mouseExited(MouseEvent e) {} - - private void setState(boolean collapsed) { - if(collapsed) { - textPane.setVisible(false); - placeholderPanel.setVisible(false); - commentLabel.setText(textPane.getText().replace("\n", " ").replace("\t", " ")); // NOI18N - setIcon(ci); - headerPanel.setBackground(blueBackground); - headerPanel.setOpaque( true ); - commentCollapsed(number); - } else { - textPane.setVisible(true); - placeholderPanel.setVisible(true); - commentLabel.setText(""); - setIcon(ei); - headerPanel.setOpaque( false ); - commentExpanded(number); - } - } - } - - private class AttachmentLink implements HyperlinkSupport.Link { - private BugzillaIssue.Attachment attachment; - public AttachmentLink(BugzillaIssue.Attachment attachment) { - this.attachment = attachment; - } - @Override - public void onClick(String linkText) { - attachment.open(); - } - } -} diff --git a/ide/bugzilla/src/org/netbeans/modules/bugzilla/issue/IssuePanel.form b/ide/bugzilla/src/org/netbeans/modules/bugzilla/issue/IssuePanel.form deleted file mode 100644 index f7d54c1d9ad0..000000000000 --- a/ide/bugzilla/src/org/netbeans/modules/bugzilla/issue/IssuePanel.form +++ /dev/null @@ -1,1967 +0,0 @@ - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
diff --git a/ide/bugzilla/src/org/netbeans/modules/bugzilla/issue/IssuePanel.java b/ide/bugzilla/src/org/netbeans/modules/bugzilla/issue/IssuePanel.java deleted file mode 100644 index fbdf0e4c7324..000000000000 --- a/ide/bugzilla/src/org/netbeans/modules/bugzilla/issue/IssuePanel.java +++ /dev/null @@ -1,4542 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.netbeans.modules.bugzilla.issue; - -import java.awt.Color; -import java.awt.Component; -import java.awt.Container; -import java.awt.Dimension; -import java.awt.EventQueue; -import java.awt.Font; -import java.awt.Insets; -import java.awt.Point; -import java.awt.Rectangle; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.awt.event.KeyEvent; -import java.beans.PropertyChangeEvent; -import java.beans.PropertyChangeListener; -import java.net.MalformedURLException; -import java.net.URL; -import java.text.DateFormat; -import java.text.MessageFormat; -import java.text.ParseException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collection; -import java.util.Date; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Iterator; -import java.util.LinkedHashMap; -import java.util.LinkedHashSet; -import java.util.LinkedList; -import java.util.List; -import java.util.Map; -import java.util.MissingResourceException; -import java.util.Set; -import java.util.StringTokenizer; -import java.util.logging.Level; -import java.util.regex.Matcher; -import java.util.regex.Pattern; -import javax.swing.AbstractAction; -import javax.swing.AbstractButton; -import javax.swing.Action; -import javax.swing.ActionMap; -import javax.swing.ComboBoxModel; -import javax.swing.DefaultComboBoxModel; -import javax.swing.DefaultListCellRenderer; -import javax.swing.GroupLayout; -import javax.swing.ImageIcon; -import javax.swing.InputMap; -import javax.swing.JCheckBox; -import javax.swing.JComboBox; -import javax.swing.JComponent; -import javax.swing.JLabel; -import javax.swing.JList; -import javax.swing.JOptionPane; -import javax.swing.JScrollPane; -import javax.swing.JTextArea; -import javax.swing.JTextField; -import javax.swing.KeyStroke; -import javax.swing.LayoutStyle; -import javax.swing.ListModel; -import javax.swing.SwingConstants; -import javax.swing.SwingUtilities; -import javax.swing.UIManager; -import javax.swing.event.CaretEvent; -import javax.swing.event.CaretListener; -import javax.swing.event.ChangeEvent; -import javax.swing.event.ChangeListener; -import javax.swing.event.DocumentEvent; -import javax.swing.event.DocumentListener; -import javax.swing.event.ListSelectionEvent; -import javax.swing.event.ListSelectionListener; -import javax.swing.plaf.basic.BasicTextFieldUI; -import javax.swing.text.BadLocationException; -import javax.swing.text.Caret; -import javax.swing.text.DefaultCaret; -import javax.swing.text.JTextComponent; -import javax.swing.text.NumberFormatter; -import org.eclipse.mylyn.internal.bugzilla.core.BugzillaVersion; -import org.netbeans.api.progress.ProgressHandle; -import org.netbeans.api.progress.ProgressHandleFactory; -import org.netbeans.modules.bugtracking.api.Issue; -import org.netbeans.modules.bugtracking.api.IssueQuickSearch; -import org.netbeans.modules.team.spi.OwnerInfo; -import org.netbeans.modules.team.spi.RepositoryUser; -import org.netbeans.modules.team.spi.RepositoryUserRenderer; -import org.netbeans.modules.bugtracking.spi.IssueStatusProvider; -import org.netbeans.modules.bugtracking.commons.AttachmentsPanel; -import org.netbeans.modules.bugtracking.commons.LinkButton; -import org.netbeans.modules.bugtracking.commons.NBBugzillaUtils; -import org.netbeans.modules.bugtracking.commons.UIUtils; -import org.netbeans.modules.bugtracking.spi.SchedulePicker; -import org.netbeans.modules.bugzilla.Bugzilla; -import org.netbeans.modules.bugzilla.BugzillaConfig; -import org.netbeans.modules.bugzilla.issue.BugzillaIssue.Attachment; -import org.netbeans.modules.bugzilla.issue.BugzillaIssue.Comment; -import org.netbeans.modules.bugzilla.repository.BugzillaConfiguration; -import org.netbeans.modules.bugzilla.repository.BugzillaRepository; -import org.netbeans.modules.bugzilla.repository.CustomIssueField; -import org.netbeans.modules.bugzilla.repository.IssueField; -import org.netbeans.modules.bugzilla.util.BugzillaConstants; -import org.netbeans.modules.bugzilla.util.BugzillaUtil; -import org.netbeans.modules.bugzilla.util.NbBugzillaConstants; -import org.netbeans.modules.mylyn.util.NbDateRange; -import org.netbeans.modules.spellchecker.api.Spellchecker; -import org.netbeans.modules.team.ide.spi.IDEServices; -import org.openide.awt.HtmlBrowser; -import org.openide.filesystems.FileUtil; -import org.openide.nodes.Node; -import org.openide.util.HelpCtx; -import org.openide.util.ImageUtilities; -import org.openide.util.Mutex; -import org.openide.util.NbBundle; -import org.openide.util.Pair; -import org.openide.util.RequestProcessor; -import org.openide.windows.TopComponent; -import org.openide.windows.WindowManager; - -/** - * Panel showing (and allowing to edit) details of an issue. - * - * @author Jan Stola - */ -@NbBundle.Messages({ - "LBL_Duplicate.fieldName=Duplicate of" -}) -public class IssuePanel extends javax.swing.JPanel { - private static Color incomingChangesColor = null; - private static final RequestProcessor RP = new RequestProcessor("Bugzilla Issue Panel", 5, false); // NOI18N - private static final URL ICON_REMOTE_PATH = IssuePanel.class.getClassLoader().getResource("org/netbeans/modules/bugzilla/resources/remote.png"); //NOI18N - private static final ImageIcon ICON_REMOTE = ImageUtilities.loadImageIcon("org/netbeans/modules/bugzilla/resources/remote.png", true); //NOI18N - private static final URL ICON_CONFLICT_PATH = IssuePanel.class.getClassLoader().getResource("org/netbeans/modules/bugzilla/resources/conflict.png"); //NOI18N - private static final ImageIcon ICON_CONFLICT = ImageUtilities.loadImageIcon("org/netbeans/modules/bugzilla/resources/conflict.png", true); //NOI18N - private static final URL ICON_UNSUBMITTED_PATH = IssuePanel.class.getClassLoader().getResource("org/netbeans/modules/bugzilla/resources/unsubmitted.png"); //NOI18N - private static final ImageIcon ICON_UNSUBMITTED = ImageUtilities.loadImageIcon("org/netbeans/modules/bugzilla/resources/unsubmitted.png", true); //NOI18N - private static final String SECTION_ATTRIBUTES = ".attributes"; //NOI18N - private static final String SECTION_ATTACHMENTS = ".attachments"; //NOI18N - private static final String SECTION_COMMENTS = ".comments"; //NOI18N - private static final String SECTION_PRIVATE = ".private"; //NOI18N - private static final String ATTRIBUTE_PRIVATE_NOTES = "nb.private.notes"; //NOI18N - private static final String ATTRIBUTE_ESTIMATE = "nb.estimate"; //NOI18N - private static final String ATTRIBUTE_DUE_DATE = "nb.due.date"; //NOI18N - private static final String ATTRIBUTE_SCHEDULE_DATE = "nb.schedule.date"; //NOI18N - private BugzillaIssue issue; - private CommentsPanel commentsPanel; - private AttachmentsPanel attachmentsPanel; - private int resolvedIndex; - private List keywords = new LinkedList<>(); - private boolean reloading; - private boolean skipReload; - private boolean usingTargetMilestones; - private OwnerInfo ownerInfo; - private final Set unsavedFields = new HashSet<>(); - private boolean customFieldsLoaded; - - static { - incomingChangesColor = UIManager.getColor( "nb.bugtracking.label.highlight" ); //NOI18N - if( null == incomingChangesColor ) { - incomingChangesColor = new Color(217, 255, 217); - } - } - private boolean initializingNewTask; - private Action[] attributesSectionActions; - private Action[] attachmentsSectionActions; - private Action[] commentsSectionActions; - private Action[] privateSectionActions; - private final IDEServices.DatePickerComponent dueDatePicker; - private final IDEServices.DatePickerComponent deadlinePicker; - private final SchedulePicker scheduleDatePicker; - private static final NumberFormatter estimateFormatter = new NumberFormatter(new java.text.DecimalFormat("#0")) { - - @Override - public Object stringToValue (String text) throws ParseException { - Number value = (Number) super.stringToValue(text); - if (value == null) { - value = 0; - } - if (value.intValue() < 0) { - return 0; - } else { - return value.intValue(); - } - } - - }; - private boolean opened; - - public IssuePanel() { - initComponents(); - updateReadOnlyField(reportedField); - updateReadOnlyField(modifiedField); - updateReadOnlyField(resolutionField); - updateReadOnlyField(productField); - updateReadOnlyField(headerField); - messagePanel.setBackground(getBackground()); - customFieldsPanelLeft.setBackground(getBackground()); - customFieldsPanelRight.setBackground(getBackground()); - Font font = reportedLabel.getFont(); - headerField.setFont(font.deriveFont((float)(font.getSize()*1.7))); - duplicateLabel.setVisible(false); - duplicateWarning.setVisible(false); - duplicateField.setVisible(false); - duplicateButton.setVisible(false); - attachDocumentListeners(); - attachHideStatusListener(); - addCommentArea.addCaretListener(new CaretListener() { - @Override - public void caretUpdate(CaretEvent e) { - makeCaretVisible(addCommentArea); - } - }); - - // A11Y - Issues 163597 and 163598 - UIUtils.fixFocusTraversalKeys(addCommentArea); - - // Comments panel - commentsPanel = new CommentsPanel(); - commentsPanel.setNewCommentHandler(new CommentsPanel.NewCommentHandler() { - @Override - public void append(String text) { - addCommentArea.append(text); - addCommentArea.requestFocus(); - scrollRectToVisible(scrollPane1.getBounds()); - } - }); - attachmentsPanel = new AttachmentsPanel(this); - ((GroupLayout) commentsSectionPanel.getLayout()).replace(dummyCommentsPanel, commentsPanel); - ((GroupLayout) attributesSectionPanel.getLayout()).replace(dummyTimetrackingPanel, timetrackingPanel); - ((GroupLayout) attachmentsSectionPanel.getLayout()).replace(dummyAttachmentsPanel, attachmentsPanel); - deadlinePicker = UIUtils.createDatePickerComponent(); - ((GroupLayout) timetrackingPanel.getLayout()).replace(dummyDeadlineField, deadlinePicker.getComponent()); - GroupLayout layout = (GroupLayout) privatePanel.getLayout(); - dueDatePicker = UIUtils.createDatePickerComponent(); - scheduleDatePicker = new SchedulePicker(); - layout.replace(dummyDueDateField, dueDatePicker.getComponent()); - dueDateLabel.setLabelFor(dueDatePicker.getComponent()); - layout.replace(dummyScheduleDateField, scheduleDatePicker.getComponent()); - scheduleDateLabel.setLabelFor(scheduleDatePicker.getComponent()); - privateNotesField.addCaretListener(new CaretListener() { - @Override - public void caretUpdate (CaretEvent e) { - makeCaretVisible(privateNotesField); - } - }); - // A11Y - Issues 163597 and 163598 - UIUtils.fixFocusTraversalKeys(privateNotesField); - - initSpellChecker(); - initDefaultButton(); - - UIUtils.issue163946Hack(scrollPane1); - font = UIManager.getFont("Label.font"); // NOI18N - if (font != null) { - mainScrollPane.getVerticalScrollBar().setUnitIncrement((int) (font.getSize() * 1.5)); - mainScrollPane.getHorizontalScrollBar().setUnitIncrement((int) (font.getSize() * 1.5)); - } - } - - private void initDefaultButton() { - if(Boolean.getBoolean("bugtracking.suppressActionKeys")) { - return; - } - InputMap inputMap = getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT); - inputMap.put(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0), "submit"); // NOI18N - ActionMap actionMap = getActionMap(); - Action submitAction = new AbstractAction() { - @Override - public void actionPerformed(ActionEvent e) { - if (submitButton.isEnabled()) { - submitButtonActionPerformed(null); - } - } - }; - actionMap.put("submit", submitAction); // NOI18N - } - - private void updateReadOnlyField(JTextField field) { - if ("GTK".equals(UIManager.getLookAndFeel().getID())) { // NOI18N - field.setUI(new BasicTextFieldUI()); - } - Color bkColor = getBackground(); - if( null != bkColor ) - bkColor = new Color( bkColor.getRGB() ); - field.setBackground(bkColor); - Caret caret = field.getCaret(); - if (caret instanceof DefaultCaret) { - ((DefaultCaret)caret).setUpdatePolicy(DefaultCaret.NEVER_UPDATE); - } - } - - void reloadFormInAWT(final boolean force) { - if (EventQueue.isDispatchThread()) { - reloadForm(force); - } else { - EventQueue.invokeLater(new Runnable() { - @Override - public void run() { - reloadForm(force); - } - }); - } - } - - PropertyChangeListener cacheListener = new PropertyChangeListener() { - @Override - public void propertyChange(PropertyChangeEvent evt) { - if(evt.getSource() != IssuePanel.this.issue) { - return; - } - if (IssueStatusProvider.EVENT_STATUS_CHANGED.equals(evt.getPropertyName())) { - Mutex.EVENT.readAccess(new Runnable() { - @Override - public void run () { - updateFieldStatuses(); - } - }); - } - } - }; - - BugzillaIssue getIssue() { - return issue; - } - - void modelStateChanged (final boolean isDirty, final boolean isModified) { - Mutex.EVENT.readAccess(new Runnable() { - @Override - public void run () { - if (!reloading && isDirty) { - issue.markUserChange(); - } - if (!isDirty) { - clearUnsavedFields(); - } - if (enableMap.isEmpty()) { - cancelButton.setEnabled(isModified || isDirty); - } else { - enableMap.put(cancelButton, isModified || isDirty); - } - if (!initializingNewTask) { - issue.fireChangeEvent(); - } - } - }); - } - - boolean initializingNewTask() { - return initializingNewTask; - } - - public void setIssue(BugzillaIssue issue) { - assert SwingUtilities.isEventDispatchThread() : "Accessing Swing components. Do not call outside event-dispatch thread!"; // NOI18N - if (this.issue == null) { - issue.removePropertyChangeListener(cacheListener); - issue.addPropertyChangeListener(cacheListener); - - summaryField.getDocument().addDocumentListener(new DocumentListener() { - @Override - public void insertUpdate(DocumentEvent e) { - changedUpdate(e); - } - @Override - public void removeUpdate(DocumentEvent e) { - changedUpdate(e); - } - @Override - public void changedUpdate(DocumentEvent e) { - updateNoSummary(); - } - }); - keywordsField.getDocument().addDocumentListener(new DocumentListener() { - @Override - public void insertUpdate(DocumentEvent e) { - changedUpdate(e); - } - @Override - public void removeUpdate(DocumentEvent e) { - changedUpdate(e); - } - @Override - public void changedUpdate(DocumentEvent e) { - updateInvalidKeyword(); - } - }); - } - this.issue = issue; - initCombos(); - List kws = issue.getRepository().getConfiguration().getKeywords(); - keywords.clear(); - for (String keyword : kws) { - keywords.add(keyword.toUpperCase()); - } - attachmentsSection.setActions(getAttachmentsSectionActions()); - setupListeners(); - boolean showQAContact = BugzillaUtil.showQAContact(issue.getRepository()); - if (qaContactLabel.isVisible() != showQAContact) { - GroupLayout layout = (GroupLayout) attributesSectionPanel.getLayout(); - JLabel temp = new JLabel(); - swap(layout, ccLabel, qaContactLabel, temp); - swap(layout, ccField, qaContactField, temp); - qaContactLabel.setVisible(showQAContact); - qaContactField.setVisible(showQAContact); - } - boolean showStatusWhiteboard = BugzillaUtil.showStatusWhiteboard(issue.getRepository()); - statusWhiteboardLabel.setVisible(showStatusWhiteboard); - statusWhiteboardField.setVisible(showStatusWhiteboard); - statusWhiteboardWarning.setVisible(showStatusWhiteboard); - boolean showIssueType = BugzillaUtil.showIssueType(issue.getRepository()); - issueTypeLabel.setVisible(false); - issueTypeCombo.setVisible(showIssueType); - issueTypeWarning.setVisible(false); - severityCombo.setVisible(!showIssueType); - // Replace severity by issue-type - if (showIssueType) { - GroupLayout layout = (GroupLayout) attributesSectionPanel.getLayout(); - JLabel temp = new JLabel(); - swap(layout, severityCombo, issueTypeCombo, temp); - } - - if (issue.isNew()) { - if(NBBugzillaUtils.isNbRepository(issue.getRepository().getUrl())) { - ownerInfo = issue.getOwnerInfo(); - if(ownerInfo == null) { - // XXX not sure why we need this - i'm going to keep it for now, - // doesn't seem to harm - Node[] selection = WindowManager.getDefault().getRegistry().getActivatedNodes(); - ownerInfo = issue.getRepository().getOwnerInfo(selection); - } - } - } - - // Hack to "link" the width of both columns - Dimension dim = ccField.getPreferredSize(); - int width1 = Math.max(osCombo.getPreferredSize().width, platformCombo.getPreferredSize().width); - int width2 = Math.max(priorityCombo.getPreferredSize().width, showIssueType ? issueTypeCombo.getPreferredSize().width : severityCombo.getPreferredSize().width); - int gap = LayoutStyle.getInstance().getPreferredGap(osCombo, platformCombo, LayoutStyle.ComponentPlacement.RELATED, SwingConstants.EAST, this); - ccField.setPreferredSize(new Dimension(2*Math.max(width1,width2)+gap,dim.height)); - } - - private void selectProduct() { - if (ownerInfo != null) { - String owner = findInModel(productCombo, ownerInfo.getOwner()); - productCombo.setSelectedItem(owner); - List data = ownerInfo.getExtraData(); - if (data != null && data.size() > 0) { - String component = findInModel(componentCombo, data.get(0)); - selectInCombo(componentCombo, component, true); - } - } else { - BugzillaRepository repository = issue.getRepository(); - if (BugzillaUtil.isNbRepository(repository)) { - // IssueProvider 181224 - String defaultProduct = "ide"; // NOI18N - String defaultComponent = "Code"; // NOI18N - productCombo.setSelectedItem(defaultProduct); - componentCombo.setSelectedItem(defaultComponent); - } else { - productCombo.setSelectedIndex(0); - } - } - storeFieldValueForNewIssue(IssueField.COMPONENT, componentCombo); - } - - private String findInModel(JComboBox combo, String value) { - ComboBoxModel model = combo.getModel(); - for(int i = 0; i < model.getSize(); i++) { - String element = model.getElementAt(i).toString(); - if(value.equalsIgnoreCase(element)) { - return element; - } - } - return null; - } - - private static void swap(GroupLayout layout, JComponent comp1, JComponent comp2, JComponent temp) { - layout.replace(comp1, temp); - layout.replace(comp2, comp1); - layout.replace(temp, comp2); - } - - private int oldCommentCount; - void reloadForm(boolean force) { - if (skipReload || !opened) { - return; - } - enableComponents(true); - reloading = true; - clearHighlights(); - - boolean isNew = issue.isNew(); - boolean showProductCombo = true; - boolean hasTimeTracking = !isNew && issue.hasTimeTracking(); - GroupLayout layout = (GroupLayout) attributesSectionPanel.getLayout(); - if (showProductCombo) { - if (productCombo.getParent() == null) { - layout.replace(productField, productCombo); - } - } else { - if (productField.getParent() == null) { - layout.replace(productCombo, productField); - } - } - productLabel.setLabelFor(isNew ? productCombo : productField); - boolean isNetbeans = NBBugzillaUtils.isNbRepository(issue.getRepository().getUrl()); - if(isNew && isNetbeans) { - attachLogCheckBox.setVisible(true); - String attachLogValue = issue.getFieldValue(IssueField.NB_ATTACH_IDE_LOG); - if (attachLogValue.isEmpty()) { - attachLogCheckBox.setSelected(BugzillaConfig.getInstance().getAttachLogFile()); - } else { - reloadField(attachLogCheckBox, IssueField.NB_ATTACH_IDE_LOG); - } - reproducibilityCombo.setVisible(true); - reproducibilityLabel.setVisible(true); - } else { - reproducibilityCombo.setVisible(false); - reproducibilityLabel.setVisible(false); - attachLogCheckBox.setVisible(false); - } - switchViewLog(); - headerField.setVisible(!isNew); - statusCombo.setEnabled(!isNew); - newCommentSection.setLabel(NbBundle.getMessage(IssuePanel.class, isNew ? "IssuePanel.description" : "IssuePanel.newCommentSection.label")); // NOI18N - reportedLabel.setVisible(!isNew); - reportedField.setVisible(!isNew); - modifiedLabel.setVisible(!isNew); - modifiedField.setVisible(!isNew); - assignToDefaultCheckBox.setVisible(!isNew && issue.canAssignToDefault()); - assignToDefaultCheckBox.setSelected(false); - statusLabel.setVisible(!isNew); - statusCombo.setVisible(!isNew); - resolutionLabel.setVisible(!isNew); - timetrackingLabel.setVisible(hasTimeTracking); - timetrackingPanel.setVisible(hasTimeTracking); - dummyTimetrackingLabel.setVisible(hasTimeTracking); - commentsSection.setVisible(!isNew); - attachmentsSection.setVisible(!isNew); - dummyLabel3.setVisible(!isNew); - refreshButton.setVisible(!isNew); - cancelButton.setVisible(!isNew); - separatorLabel6.setVisible(!isNew); - btnDeleteTask.setVisible(isNew); - separatorDismissButton.setVisible(isNew); - separatorLabel3.setVisible(!isNew); - showInBrowserButton.setVisible(!isNew); - separatorLabel4.setVisible(!isNew); - privateSection.setVisible(!isNew); - assignedField.setEditable(issue.isNew() || issue.canReassign()); - assignedCombo.setEnabled(assignedField.isEditable()); - org.openide.awt.Mnemonics.setLocalizedText(submitButton, NbBundle.getMessage(IssuePanel.class, isNew ? "IssuePanel.submitButton.text.new" : "IssuePanel.submitButton.text")); // NOI18N - if (isNew && force && issue.isMarkedNewUnread()) { - // this should not be called when reopening task to submit - initializeNewTask(); - initStatusCombo("NEW"); // NOI18N - } else { - String format = NbBundle.getMessage(IssuePanel.class, "IssuePanel.headerLabel.format"); // NOI18N - String headerTxt = MessageFormat.format(format, issue.getID(), issue.getSummary()); - headerField.setText(headerTxt); - Dimension dim = headerField.getPreferredSize(); - headerField.setMinimumSize(new Dimension(0, dim.height)); - headerField.setPreferredSize(new Dimension(0, dim.height)); - reloadField(force, summaryField, IssueField.SUMMARY); - reloadField(force, productCombo, IssueField.PRODUCT); - productChanged(false); - reloadField(productField, IssueField.PRODUCT); - reloadField(force, componentCombo, IssueField.COMPONENT); - reloadField(force, versionCombo, IssueField.VERSION); - reloadField(force, platformCombo, IssueField.PLATFORM); - reloadField(force, osCombo, IssueField.OS); - reloadField(resolutionField, IssueField.RESOLUTION); // Must be before statusCombo - initStatusCombo(issue.getRepositoryFieldValue(IssueField.STATUS)); - reloadField(force, statusCombo, IssueField.STATUS); - reloadField(force, resolutionCombo, IssueField.RESOLUTION); - - reloadField(force, duplicateField, IssueField.DUPLICATE_ID); - JTextField field = new JTextField(); - duplicateField.setBorder(field.getBorder()); - duplicateField.setBackground(field.getBackground()); - - reloadField(force, priorityCombo, IssueField.PRIORITY); - if (BugzillaUtil.isNbRepository(issue.getRepository())) { - reloadField(force, issueTypeCombo, IssueField.ISSUE_TYPE); - } - reloadField(force, severityCombo, IssueField.SEVERITY); - if (usingTargetMilestones) { - reloadField(force, targetMilestoneCombo, IssueField.MILESTONE); - } - reloadField(assignToDefaultCheckBox, IssueField.REASSIGN_TO_DEFAULT); - reloadField(urlField, IssueField.URL); - reloadField(force, statusWhiteboardField, IssueField.WHITEBOARD); - reloadField(force, keywordsField, IssueField.KEYWORDS); - if (isNew) { - if (addCommentArea.getText().isEmpty()) { - reloadField(addCommentArea, IssueField.DESCRIPTION); - } - } else { - reloadField(addCommentArea, IssueField.COMMENT); - } - - if (!isNew) { - // reported field - format = NbBundle.getMessage(IssuePanel.class, "IssuePanel.reportedLabel.format"); // NOI18N - Date creation = issue.getCreatedDate(); - String creationTxt = creation != null ? DateFormat.getDateInstance(DateFormat.DEFAULT).format(creation) : ""; // NOI18N - String reporterName = issue.getFieldValue(IssueField.REPORTER_NAME); - String reporter = issue.getFieldValue(IssueField.REPORTER); - String reporterTxt = ((reporterName == null) || (reporterName.trim().length() == 0)) ? reporter : reporterName; - String reportedTxt = MessageFormat.format(format, creationTxt, reporterTxt); - reportedField.setText(reportedTxt); - fixPrefSize(reportedField); - - // modified field - Date modification = issue.getLastModifyDate(); - String modifiedTxt = modification != null ? DateFormat.getDateTimeInstance().format(modification) : ""; // NOI18N - modifiedField.setText(modifiedTxt); - fixPrefSize(modifiedField); - - String privateNotes = issue.getPrivateNotes(); - privateNotesField.setText(privateNotes); - setPrivateSectionLabel(privateNotes); - - dueDatePicker.setDate(issue.getDueDate()); - NbDateRange scheduleDate = issue.getScheduleDate(); - scheduleDatePicker.setScheduleDate(scheduleDate == null ? null : scheduleDate.toSchedulingInfo()); - estimateField.setValue(issue.getEstimate()); - dueDatePicker.getComponent().setEnabled(!hasTimeTracking); - - // time tracking - if(hasTimeTracking) { - reloadField(force, estimatedField, IssueField.ESTIMATED_TIME); - reloadField(force, workedField, IssueField.WORK_TIME); - reloadField(force, remainingField, IssueField.REMAINING_TIME); - reloadField(force, deadlinePicker, IssueField.DEADLINE); - - String actualString = issue.getFieldValue(IssueField.ACTUAL_TIME); - if(actualString.trim().equals("")) { // NOI18N - actualString = "0"; // NOI18N - } - actualField.setText(String.valueOf(Double.parseDouble(actualString) + getDoubleValue(remainingField))); - double worked = 0; - Comment[] comments = issue.getComments(); - for (Comment comment : comments) { - worked += comment.getWorked(); - } - workedSumField.setText(String.valueOf(worked)); - gainField.setText(String.valueOf(getDoubleValue(estimatedField) - getDoubleValue(remainingField))); - completeField.setText(String.valueOf((int)Math.floor(getDoubleValue(workedSumField) / getDoubleValue(actualField) * 100))); - } - } - - String assignee = issue.getFieldValue(IssueField.ASSIGNED_TO); - String selectedAssignee = (assignedField.getParent() == null) ? assignedCombo.getSelectedItem().toString() : assignedField.getText(); - if (force) { - assignedToStatusLabel.setVisible(assignee.trim().length() > 0); - } - if (assignedField.getParent() == null) { - reloadField(force, assignedCombo, IssueField.ASSIGNED_TO); - } else { - reloadField(force, assignedField, IssueField.ASSIGNED_TO); - } - reloadField(force, qaContactField, IssueField.QA_CONTACT); - reloadField(force, ccField, IssueField.CC); - reloadField(force, dependsField, IssueField.DEPENDS_ON); - reloadField(force, blocksField, IssueField.BLOCKS); - if (!customFieldsLoaded) { - customFieldsLoaded = true; - initCustomFields(); - } - reloadCustomFields(force); - } - int newCommentCount = issue.getComments().length; - if (!force) { - if (oldCommentCount != newCommentCount) { - String message = NbBundle.getMessage(IssuePanel.class, "IssuePanel.commentAddedWarning"); // NOI18N - fieldsIncoming.put(IssueField.COMMENT_COUNT, message); - } else { - fieldsIncoming.remove(IssueField.COMMENT_COUNT); - } - } - oldCommentCount = newCommentCount; - List attachments = issue.getAttachments(); - List unsubmitted = issue.getUnsubmittedAttachments(); - if (!isNew) { - commentsPanel.setIssue(issue, attachments); - commentsSection.setLabel(NbBundle.getMessage(IssuePanel.class, "IssuePanel.commentsLabel.text", issue.getComments().length + 1)); //NOI18N - } - if(isNetbeans) { - AttachmentsPanel.NBBugzillaCallback callback = - new AttachmentsPanel.NBBugzillaCallback() { - @Override - public String getLogFilePath() { - return NbBugzillaConstants.NB_LOG_FILE_PATH; - } - @Override - public String getLogFileContentType() { - return NbBugzillaConstants.NB_LOG_FILE_ATT_CONT_TYPE; - } - @Override - public String getLogFileDescription() { - return Bundle.MSG_LOG_FILE_DESC(); - } - @Override - public void showLogFile() { - IssuePanel.showLogFile(null); - } - }; - attachmentsPanel.setAttachments(attachments, unsubmitted, callback); - } else { - attachmentsPanel.setAttachments(attachments, unsubmitted, null); - } - attachmentsSection.setLabel(NbBundle.getMessage(IssuePanel.class, "IssuePanel.attachmentsLabel.text", attachments.size())); //NOI18N - UIUtils.keepFocusedComponentVisible(commentsPanel, this); - UIUtils.keepFocusedComponentVisible(attachmentsPanel, this); - updateFieldStatuses(); - updateNoSummary(); - updateMessagePanel(); - cancelButton.setEnabled(issue.hasLocalEdits() || !unsavedFields.isEmpty()); - reloading = false; - repaint(); - } - - protected void setPrivateSectionLabel(String privateNotes) throws MissingResourceException { - if(privateNotes != null && !privateNotes.isEmpty() ) { - privateSection.setLabel("" + // NOI18N - org.openide.util.NbBundle.getMessage(IssuePanel.class, "IssuePanel.privateAttributesSection.text") + // NOI18N - " (" + // NOI18N - org.openide.util.NbBundle.getMessage(IssuePanel.class, "IssuePanel.privateAttributesSection.containsNotes") + // NOI18N - ")"); // NOI18N - } else { - privateSection.setLabel(org.openide.util.NbBundle.getMessage(IssuePanel.class, "IssuePanel.privateAttributesSection.text")); // NOI18N - } - } - - private void reloadCustomFields(boolean force) { - // Reload custom fields - for (CustomFieldInfo field : customFields) { - reloadField(force, field.comp, field.field); - } - } - - private static void fixPrefSize(JTextField textField) { - // The preferred size of JTextField on (Classic) Windows look and feel - // is one pixel shorter. The following code is a workaround. - textField.setPreferredSize(null); - Dimension dim = textField.getPreferredSize(); - Dimension fixedDim = new Dimension(dim.width+1, dim.height); - textField.setPreferredSize(fixedDim); - } - - private void reloadField (boolean force, Object component, IssueField field) { - reloadField(component, field); - } - - private void reloadField (Object component, IssueField field) { - String newValue; - if (component instanceof JList) { - newValue = mergeValues(issue.getFieldValues(field)); - } else { - newValue = issue.getFieldValue(field); - } - boolean fieldDirty = unsavedFields.contains(field.getKey()); - if (!fieldDirty) { - if (component instanceof JComboBox) { - JComboBox combo = (JComboBox)component; - selectInCombo(combo, newValue, true); - } else if (component instanceof JTextComponent) { - ((JTextComponent)component).setText(newValue); - } else if (component instanceof JList) { - JList list = (JList)component; - list.clearSelection(); - ListModel model = list.getModel(); - for (String value : issue.getFieldValues(field)) { - for (int i=0; i... fields) { - updateFieldDecorations(warningLabel, fieldLabel, fieldName(fieldLabel), fields); - } - - @NbBundle.Messages({ - "# {0} - field name", "# {1} - old value", "# {2} - new value", - "IssuePanel.fieldModifiedRemotely={0} field was changed in repository from \"{1}\" to \"{2}\"", - "# {0} - field name", "# {1} - old value", "# {2} - new value", "# {3} - icon path", - "IssuePanel.fieldModifiedRemotelyTT=

 Remote change - {0}

" - + "" - + "" - + "" - + "
remote value:{2}
base value:{1}
" - + "

Field {0} was changed in repository from \"{1}\" to \"{2}\".

" - + "

", - "# {0} - field name", "# {1} - old value", "# {2} - new value", - "IssuePanel.fieldModifiedConflict={0} field was changed in repository from \"{1}\" to \"{2}\" " - + "before you submitted your local changes. " - + "Local value will be submitted.", - "# {0} - field name", "# {1} - old value", "# {2} - incoming value", "# {3} - local value", "# {4} - icon path", - "IssuePanel.fieldModifiedConflictTT=

 Conflict - {0}

" - + "" - + "" - + "" - + "" - + "
incoming value:{2}
local value:{3}
base value:{1}
" - + "

Field {0} was changed in repository from \"{1}\" to \"{2}\" " - + "before you submitted your local changes." - + "Local value will be submitted.

" - + "

", - "# {0} - field name", "# {1} - old value", "# {2} - new value", - "IssuePanel.fieldModifiedLocally={0} field was changed locally from \"{1}\" to \"{2}\" but not yet submitted.", - "# {0} - field name", "# {1} - old value", "# {2} - new value", "# {3} - icon path", - "IssuePanel.fieldModifiedLocallyTT=

 Unsubmitted change - {0}

" - + "" - + "" - + "" - + "
local value:{2}
base value:{1}
" - + "

Field {0} was changed locally from \"{1}\" to \"{2}\" but not yet submitted.

" - + "

", - "IssuePanel.commentAddedLocally=Comment was added but not yet submitted.", - "# {0} - icon path", - "IssuePanel.commentAddedLocallyTT=

 Unsubmitted change - New Comment

" - + "

A new comment was added but not yet submitted.

" - }) - private void updateFieldDecorations (JLabel warningLabel, JComponent fieldLabel, String fieldName, - Pair... fields) { - boolean isNew = issue.isNew(); - String newValue = "", lastSeenValue = "", repositoryValue = ""; //NOI18N - boolean fieldDirty = false; - boolean valueModifiedByUser = false; - boolean valueModifiedByServer = false; - for (Pair p : fields) { - Object component = p.second(); - IssueField field = p.first(); - if (component instanceof JList) { - newValue += " " + mergeValues(issue.getFieldValues(field)); - lastSeenValue += " " + mergeValues(issue.getLastSeenFieldValues(field)); - repositoryValue += " " + mergeValues(issue.getRepositoryFieldValues(field)); - } else { - newValue += " " + issue.getFieldValue(field); - lastSeenValue += " " + issue.getLastSeenFieldValue(field); - repositoryValue += " " + issue.getRepositoryFieldValue(field); - } - fieldDirty |= unsavedFields.contains(field.getKey()); - valueModifiedByUser |= (issue.getFieldStatus(field) & BugzillaIssue.FIELD_STATUS_OUTGOING) != 0; - valueModifiedByServer |= (issue.getFieldStatus(field) & BugzillaIssue.FIELD_STATUS_MODIFIED) != 0; - } - newValue = newValue.substring(1); - lastSeenValue = lastSeenValue.substring(1); - repositoryValue = repositoryValue.substring(1); - if (warningLabel != null) { - boolean change = false; - if (!isNew) { - boolean visible = warningLabel.isVisible(); - IssueField field = fields[0].first(); - removeTooltips(warningLabel, field); - if (fieldLabel != null && fieldLabel.getFont().isBold()) { - fieldLabel.setFont(fieldLabel.getFont().deriveFont(fieldLabel.getFont().getStyle() & ~Font.BOLD)); - } - if (visible && valueModifiedByServer && (valueModifiedByUser || fieldDirty) && !newValue.equals(repositoryValue)) { - String message = Bundle.IssuePanel_fieldModifiedConflict(fieldName, lastSeenValue, repositoryValue); - // do not use || - change = fieldsLocal.remove(field) != null | fieldsIncoming.remove(field) != null - | !message.equals(fieldsConflict.put(field, message)); - tooltipsConflict.addTooltip(warningLabel, field, Bundle.IssuePanel_fieldModifiedConflictTT( - fieldName, lastSeenValue, repositoryValue, newValue, ICON_CONFLICT_PATH)); - } else if (visible && valueModifiedByServer) { - String message = Bundle.IssuePanel_fieldModifiedRemotely(fieldName, lastSeenValue, repositoryValue); - // do not use || - change = fieldsLocal.remove(field) != null | fieldsConflict.remove(field) != null - | !message.equals(fieldsIncoming.put(field, message)); - tooltipsIncoming.addTooltip(warningLabel, field, Bundle.IssuePanel_fieldModifiedRemotelyTT( - fieldName, lastSeenValue, repositoryValue, ICON_REMOTE_PATH)); - } else if (visible && (valueModifiedByUser || fieldDirty) && !newValue.equals(lastSeenValue)) { - String message; - if (field == IssueField.COMMENT) { - message = Bundle.IssuePanel_commentAddedLocally(); - tooltipsLocal.addTooltip(warningLabel, field, Bundle.IssuePanel_commentAddedLocallyTT(ICON_UNSUBMITTED_PATH)); - } else { - message = Bundle.IssuePanel_fieldModifiedLocally(fieldName, lastSeenValue, newValue); - tooltipsLocal.addTooltip(warningLabel, field, Bundle.IssuePanel_fieldModifiedLocallyTT( - fieldName, lastSeenValue, newValue, ICON_UNSUBMITTED_PATH)); - } - // do not use || - change = fieldsConflict.remove(field) != null | fieldsIncoming.remove(field) != null - | !message.equals(fieldsLocal.put(field, message)); - } else { - // do not use || - change = fieldsLocal.remove(field) != null - | fieldsConflict.remove(field) != null - | fieldsIncoming.remove(field) != null; - } - updateIcon(warningLabel); - if (fieldDirty && fieldLabel != null) { - fieldLabel.setFont(fieldLabel.getFont().deriveFont(fieldLabel.getFont().getStyle() | Font.BOLD)); - } - } - if (change && !reloading) { - updateMessagePanel(); - } - } - } - - @NbBundle.Messages({ - "# {0} - icon path", - "IssuePanel.attachmentsToSubmit=

 Unsubmitted Attachments

" - + "

New attachments were added but not yet submitted

", - "IssuePanel.attachmentsAddedLocally=Attachments were added but not yet submitted" - }) - private void updateAttachmentsStatus () { - boolean change = false; - if (!issue.isNew()) { - boolean valueModifiedByUser = !issue.getUnsubmittedAttachments().isEmpty(); - removeTooltips(attachmentsWarning, IssueField.NB_NEW_ATTACHMENTS); - AbstractButton attachmentsLabel = attachmentsSection.getLabelComponent(); - if (attachmentsLabel.getFont().isBold()) { - attachmentsLabel.setFont(attachmentsLabel.getFont().deriveFont(attachmentsLabel.getFont().getStyle() & ~Font.BOLD)); - } - if (valueModifiedByUser) { - String message = Bundle.IssuePanel_attachmentsAddedLocally(); - tooltipsLocal.addTooltip(attachmentsWarning, IssueField.NB_NEW_ATTACHMENTS, - Bundle.IssuePanel_attachmentsToSubmit(ICON_UNSUBMITTED_PATH)); - change = !message.equals(fieldsLocal.put(IssueField.NB_NEW_ATTACHMENTS, message)); - } else { - change = fieldsLocal.remove(IssueField.NB_NEW_ATTACHMENTS) != null; - } - updateIcon(attachmentsWarning); - if (unsavedFields.contains(IssueField.NB_NEW_ATTACHMENTS.getKey())) { - attachmentsLabel.setFont(attachmentsLabel.getFont().deriveFont(attachmentsLabel.getFont().getStyle() | Font.BOLD)); - } - } - if (change && !reloading) { - updateMessagePanel(); - } - } - - private void updateFieldDecorations (String key, JComponent fieldLabel) { - boolean fieldDirty = unsavedFields.contains(key); - if (fieldLabel != null) { - if (fieldDirty) { - fieldLabel.setFont(fieldLabel.getFont().deriveFont(fieldLabel.getFont().getStyle() | Font.BOLD)); - } else { - fieldLabel.setFont(fieldLabel.getFont().deriveFont(fieldLabel.getFont().getStyle() & ~Font.BOLD)); - } - } - } - - private boolean selectInCombo(JComboBox combo, Object value, boolean forceInModel) { - if (value == null) { - return false; - } - if (!value.equals(combo.getSelectedItem())) { - combo.setSelectedItem(value); - } - if (forceInModel && !value.equals("") && !value.equals(combo.getSelectedItem())) { // NOI18N - // Reload of server attributes is needed - workarounding it - ComboBoxModel model = combo.getModel(); - if (model instanceof DefaultComboBoxModel) { - ((DefaultComboBoxModel)model).insertElementAt(value, 0); - combo.setSelectedIndex(0); - } - } - return value.equals(combo.getSelectedItem()); - } - - private String fieldName(JComponent fieldLabel) { - assert fieldLabel instanceof JLabel || fieldLabel instanceof AbstractButton; - String txt; - if(fieldLabel instanceof JLabel) { - txt = ((JLabel) fieldLabel).getText().trim(); - - } else if(fieldLabel instanceof AbstractButton) { - txt = ((AbstractButton) fieldLabel).getText().trim(); - } else { - return null; - } - if (txt.endsWith(":")) { // NOI18N - txt = txt.substring(0, txt.length()-1); - } - return txt; - } - - @NbBundle.Messages({ - "LBL_HappensAlways=Happens every time", - "LBL_HappensSometimes=Happens sometimes, but not always", - "LBL_HaventTried=Haven't tried to reproduce it", - "LBL_Tried=Tried, but couldn't reproduce it" - }) - private void initCombos() { - BugzillaRepository repository = issue.getRepository(); - BugzillaConfiguration bc = repository.getConfiguration(); - if(bc == null || !bc.isValid()) { - // XXX nice error msg? - return; - } - productCombo.setModel(toComboModel(bc.getProducts())); - // componentCombo, versionCombo, targetMilestoneCombo are filled - // automatically when productCombo is set/changed - platformCombo.setModel(toComboModel(bc.getPlatforms())); - osCombo.setModel(toComboModel(bc.getOSs())); - // Do not support MOVED resolution (yet?) - List resolutions = new LinkedList<>(bc.getResolutions()); - resolutions.remove("MOVED"); // NOI18N - resolutionCombo.setModel(toComboModel(resolutions)); - priorityCombo.setModel(toComboModel(bc.getPriorities())); - priorityCombo.setRenderer(new PriorityRenderer()); - severityCombo.setModel(toComboModel(bc.getSeverities())); - - initAssignedCombo(); - - if (BugzillaUtil.isNbRepository(repository)) { - issueTypeCombo.setModel(toComboModel(bc.getIssueTypes())); - reproducibilityCombo.setModel(toComboModel(Arrays.asList(Bundle.LBL_HappensAlways(), Bundle.LBL_HappensSometimes(), Bundle.LBL_HaventTried(), Bundle.LBL_Tried()))); - reproducibilityCombo.setSelectedItem(null); - } - // stausCombo and resolution fields are filled in reloadForm - } - - private void initAssignedCombo() { - assignedCombo.setRenderer(new RepositoryUserRenderer()); - RP.post(new Runnable() { - @Override - public void run() { - BugzillaRepository repository = issue.getRepository(); - final Collection users = repository.getUsers(); - final DefaultComboBoxModel assignedModel = new DefaultComboBoxModel(); - for (RepositoryUser user: users) { - assignedModel.addElement(user); - } - EventQueue.invokeLater(new Runnable() { - @Override - public void run() { - reloading = true; - try { - Object assignee = (assignedField.getParent() == null) ? assignedCombo.getSelectedItem() : assignedField.getText(); - if (assignee == null) { - assignee = ""; //NOI18N - } - assignedCombo.setModel(assignedModel); - GroupLayout layout = (GroupLayout) attributesSectionPanel.getLayout(); - if ((assignedCombo.getParent()==null) != users.isEmpty()) { - layout.replace(users.isEmpty() ? assignedCombo : assignedField, users.isEmpty() ? assignedField : assignedCombo); - assignedLabel.setLabelFor(users.isEmpty() ? assignedField : assignedCombo); - } - if (assignedField.getParent() == null) { - assignedCombo.setSelectedItem(assignee); - } else { - assignedField.setText(assignee.toString()); - } - } finally { - reloading = false; - } - } - }); - } - }); - } - - private void initStatusCombo(String currentStatus) { - // Init statusCombo - allowed transitions (heuristics): - // Open -> Open-Unconfirmed-Reopened+Resolved - // Resolved -> Reopened+Close - // Close-Resolved -> Reopened+Resolved+(Close with higher index) - BugzillaRepository repository = issue.getRepository(); - BugzillaConfiguration bc = repository.getConfiguration(); - if(bc == null || !bc.isValid()) { - // XXX nice error msg? - return; - } - List allStatuses = bc.getStatusValues(); - List openStatuses = bc.getOpenStatusValues(); - List statuses = new LinkedList<>(); - boolean oldRepository = (issue.getRepository().getConfiguration().getInstalledVersion().compareMajorMinorOnly(BugzillaVersion.BUGZILLA_3_2) < 0); - String nev = "NEW"; // NOI18N - String unconfirmed = "UNCONFIRMED"; // NOI18N - String reopened = "REOPENED"; // NOI18N - String resolved = "RESOLVED"; // NOI18N - if (currentStatus != null) { - currentStatus = currentStatus.trim(); - } - String status = issue.getLastSeenFieldValue(IssueField.STATUS); - if (status.isEmpty()) { - status = currentStatus; - } - if (openStatuses.contains(status)) { - statuses.addAll(openStatuses); - if (!unconfirmed.equals(status)) { - statuses.remove(unconfirmed); - } - if (!reopened.equals(status)) { - statuses.remove(reopened); - } - if (oldRepository && !nev.equals(status)) { - statuses.remove(nev); - } - statuses.add(resolved); - } else { - if (allStatuses.contains(reopened)) { - statuses.add(reopened); - } else { - // Pure guess - statuses.addAll(openStatuses); - statuses.remove(unconfirmed); - if (oldRepository) { - statuses.remove(nev); - } - } - if (resolved.equals(status)) { - List closedStatuses = new LinkedList<>(allStatuses); - closedStatuses.removeAll(openStatuses); - statuses.addAll(closedStatuses); - } else { - if (!oldRepository) { - statuses.add(resolved); - } - if (allStatuses.contains(status)) { - if (!"".equals(status)) { - for (int i = allStatuses.indexOf(status); i < allStatuses.size(); i++) { - String s = allStatuses.get(i); - if (!openStatuses.contains(s)) { - statuses.add(s); - } - } - } - } else { - Bugzilla.LOG.log(Level.WARNING, "status value {0} not between all statuses: {1}", new Object[]{status, allStatuses}); // NOI18N - } - } - } - resolvedIndex = statuses.indexOf(resolved); - statusCombo.setModel(toComboModel(statuses)); - statusCombo.setSelectedItem(currentStatus); - } - - private ComboBoxModel toComboModel(List items) { - return new DefaultComboBoxModel(items.toArray()); - } - - private void updateFieldStatuses() { - updateFieldStatus(summaryLabel, IssueField.SUMMARY); - updateFieldDecorations(summaryField, IssueField.SUMMARY, summaryWarning, summaryLabel); - updateFieldStatus(productLabel, IssueField.PRODUCT); - updateFieldDecorations(productCombo.getParent() == null ? productField : productCombo, - IssueField.PRODUCT, productWarning, productLabel); - updateFieldStatus(componentLabel, IssueField.COMPONENT); - updateFieldDecorations(componentCombo, IssueField.COMPONENT, componentWarning, componentLabel); - updateFieldStatus(versionLabel, IssueField.VERSION); - updateFieldDecorations(versionCombo, IssueField.VERSION, versionWarning, versionLabel); - updateFieldStatus(platformLabel, IssueField.PLATFORM, IssueField.OS); - updateFieldDecorations(platformWarning, platformLabel, new Pair[] { - Pair.of(IssueField.PLATFORM, platformCombo), - Pair.of(IssueField.OS, osCombo) - }); - updateFieldStatus(statusLabel, IssueField.STATUS); - updateFieldDecorations(statusCombo, IssueField.STATUS, statusWarning, statusLabel); - updateFieldStatus(resolutionLabel, IssueField.RESOLUTION); - updateFieldDecorations(resolutionCombo, IssueField.RESOLUTION, resolutionWarning, resolutionLabel); - updateFieldStatus(duplicateLabel, IssueField.DUPLICATE_ID); - updateFieldDecorations(duplicateWarning, duplicateLabel, Bundle.LBL_Duplicate_fieldName(), Pair.of(IssueField.DUPLICATE_ID, duplicateField)); - if (BugzillaUtil.showIssueType(issue.getRepository())) { - updateFieldStatus(priorityLabel, IssueField.PRIORITY, IssueField.ISSUE_TYPE); - updateFieldDecorations(priorityWarning, priorityLabel, new Pair[] { - Pair.of(IssueField.PRIORITY, priorityCombo), - Pair.of(IssueField.ISSUE_TYPE, issueTypeCombo) - }); - } else { - updateFieldStatus(priorityLabel, IssueField.PRIORITY, IssueField.SEVERITY); - updateFieldDecorations(priorityWarning, priorityLabel, new Pair[] { - Pair.of(IssueField.PRIORITY, priorityCombo), - Pair.of(IssueField.SEVERITY, severityCombo) - }); - } - updateFieldStatus(targetMilestoneLabel, IssueField.MILESTONE); - updateFieldDecorations(targetMilestoneCombo, IssueField.MILESTONE, milestoneWarning, targetMilestoneLabel); - updateFieldStatus(urlLabel, IssueField.URL); - updateFieldDecorations(urlField, IssueField.URL, urlWarning, urlLabel); - updateFieldStatus(statusWhiteboardLabel, IssueField.WHITEBOARD); - updateFieldDecorations(statusWhiteboardField, IssueField.WHITEBOARD, statusWhiteboardWarning, statusWhiteboardLabel); - updateFieldStatus(keywordsLabel, IssueField.KEYWORDS); - updateFieldDecorations(keywordsField, IssueField.KEYWORDS, keywordsWarning, keywordsLabel); - updateFieldStatus(assignedLabel, IssueField.ASSIGNED_TO); - if (assignedField.getParent() == null) { - updateFieldDecorations(assignedCombo, IssueField.ASSIGNED_TO, assignedToWarning, assignedLabel); - } else { - updateFieldDecorations(assignedField, IssueField.ASSIGNED_TO, assignedToWarning, assignedLabel); - } - updateFieldStatus(qaContactLabel, IssueField.QA_CONTACT); - updateFieldDecorations(qaContactField, IssueField.QA_CONTACT, qaContactWarning, qaContactLabel); - updateFieldStatus(ccLabel, IssueField.CC); - updateFieldDecorations(ccField, IssueField.CC, ccWarning, ccLabel); - updateFieldStatus(dependsLabel, IssueField.DEPENDS_ON); - updateFieldDecorations(dependsField, IssueField.DEPENDS_ON, dependsOnWarning, dependsLabel); - updateFieldStatus(blocksLabel, IssueField.BLOCKS); - updateFieldDecorations(blocksField, IssueField.BLOCKS, blocksWarning, blocksLabel); - updateFieldStatus(timetrackingWarning, IssueField.ESTIMATED_TIME, - IssueField.REMAINING_TIME, - IssueField.WORK_TIME, - IssueField.DEADLINE, - IssueField.COMMENT); - updateFieldDecorations(estimatedField, IssueField.ESTIMATED_TIME, timetrackingWarning, estimatedLabel); - updateFieldDecorations(remainingField, IssueField.REMAINING_TIME, timetrackingWarning, remainingLabel); - updateFieldDecorations(workedField, IssueField.WORK_TIME, timetrackingWarning, workedLabel); - updateFieldDecorations(deadlinePicker, IssueField.DEADLINE, timetrackingWarning, deadlineLabel); - updateFieldStatus(newCommentSection.getLabelComponent()); - updateFieldDecorations(addCommentArea, IssueField.COMMENT, commentWarning, newCommentSection.getLabelComponent()); - updateCustomFieldStatuses(); - updateAttachmentsStatus(); - - updateFieldDecorations(ATTRIBUTE_PRIVATE_NOTES, notesLabel); - updateFieldDecorations(ATTRIBUTE_DUE_DATE, dueDateLabel); - updateFieldDecorations(ATTRIBUTE_SCHEDULE_DATE, scheduleDateLabel); - updateFieldDecorations(ATTRIBUTE_ESTIMATE, estimateLabel); - - repaint(); - } - - private void updateCustomFieldStatuses () { - for (CustomFieldInfo field : customFields) { - updateFieldStatus(field.label, field.field); - updateFieldDecorations(field.comp, field.field, field.warning, field.label); - } - } - - private void updateFieldStatus(JComponent label, IssueField... fields) { - label.setOpaque(false); - for (IssueField field : fields) { - boolean highlight = !issue.isNew() && (issue.getFieldStatus(field) & BugzillaIssue.FIELD_STATUS_MODIFIED) != 0; - if (highlight) { - label.setOpaque(true); - label.setBackground(incomingChangesColor); - break; - } - } - } - - private void cancelHighlight(JComponent label) { - if (!reloading) { - label.setOpaque(false); - label.getParent().repaint(); - } - } - - private void storeFieldValue(IssueField field, JComboBox combo) { - Object value = combo.getSelectedItem(); - // It (normally) should not happen that value is null, but issue 159804 shows that - // some strange configurations (or other bugs) can lead into this situation - if (value != null) { - storeFieldValue(field, value.toString()); - } - } - - private void storeFieldValue(IssueField field, JTextComponent textComponent) { - storeFieldValue(field, textComponent.getText()); - } - - private void storeFieldValue(IssueField field, JList list) { - List values = new ArrayList<>(); - for (Object value : list.getSelectedValues()) { - values.add(value.toString()); - } - if (!issue.getFieldValues(field).equals(values)) { - addUnsavedField(field.getKey()); - issue.setFieldValues(field, values); - } - } - - private void storeFieldValue(IssueField field, String value) { - boolean changed = false; - if (field == IssueField.STATUS) { - changed = true; - if (value.equals("CLOSED")) { // NOI18N - issue.close(); - issue.setFieldValue(IssueField.RESOLUTION, resolutionField.getText()); - } else if (value.equals("VERIFIED")) { // NOI18N - issue.verify(); - issue.setFieldValue(IssueField.RESOLUTION, resolutionField.getText()); - } else if (value.equals("REOPENED")) { // NOI18N - issue.reopen(); - issue.setFieldValue(IssueField.RESOLUTION, ""); //NOI18N - } else if (value.equals("RESOLVED")) { // NOI18N - issue.resolve(resolutionCombo.getSelectedItem().toString()); - addUnsavedField(IssueField.RESOLUTION.getKey()); - issue.setFieldValue(IssueField.RESOLUTION, resolutionCombo.getSelectedItem().toString()); - } else if (value.equals("ASSIGNED")) { // NOI18N - issue.accept(); - issue.setFieldValue(IssueField.RESOLUTION, ""); //NOI18N - } else { - issue.setFieldValue(IssueField.RESOLUTION, ""); //NOI18N - changed = false; - } - } else if (field == IssueField.RESOLUTION && "RESOLVED".equals(statusCombo.getSelectedItem())) { - changed = true; - if (value.equals("DUPLICATE")) { - issue.duplicate(duplicateField.getText().trim()); - if (!duplicateField.getText().trim().equals(issue.getFieldValue(IssueField.DUPLICATE_ID))) { - addUnsavedField(IssueField.DUPLICATE_ID.getKey()); - issue.setFieldValue(IssueField.DUPLICATE_ID, duplicateField.getText().trim()); - } - } else { - issue.resolve(value); - } - } else if (field == IssueField.DUPLICATE_ID && "RESOLVED".equals(statusCombo.getSelectedItem()) - && "DUPLICATE".equals(resolutionCombo.getSelectedItem())) { - issue.duplicate(value); - addUnsavedField(field.getKey()); - } else if ((field == IssueField.ASSIGNED_TO) && !issue.isNew()) { - issue.reassign(value); - addUnsavedField(field.getKey()); - } - if (changed || !issue.getFieldValue(field).equals(value)) { - addUnsavedField(field.getKey()); - issue.setFieldValue(field, value); - } - } - - private void attachDocumentListeners() { - urlField.getDocument().addDocumentListener(new CancelHighlightDocumentListener(urlLabel)); - statusWhiteboardField.getDocument().addDocumentListener(new CancelHighlightDocumentListener(statusWhiteboardLabel)); - keywordsField.getDocument().addDocumentListener(new CancelHighlightDocumentListener(keywordsLabel)); - assignedField.getDocument().addDocumentListener(new CancelHighlightDocumentListener(assignedLabel)); - qaContactField.getDocument().addDocumentListener(new CancelHighlightDocumentListener(qaContactLabel)); - ccField.getDocument().addDocumentListener(new CancelHighlightDocumentListener(ccLabel)); - blocksField.getDocument().addDocumentListener(new CancelHighlightDocumentListener(blocksLabel)); - dependsField.getDocument().addDocumentListener(new CancelHighlightDocumentListener(dependsLabel)); - CyclicDependencyDocumentListener cyclicDependencyListener = new CyclicDependencyDocumentListener(); - blocksField.getDocument().addDocumentListener(cyclicDependencyListener); - dependsField.getDocument().addDocumentListener(cyclicDependencyListener); - addCommentArea.getDocument().addDocumentListener(new RevalidatingListener()); - duplicateField.getDocument().addDocumentListener(new DuplicateListener()); - } - - private void attachHideStatusListener() { - assignedField.getDocument().addDocumentListener(new DocumentListener() { - @Override - public void insertUpdate(DocumentEvent e) { - changedUpdate(e); - } - - @Override - public void removeUpdate(DocumentEvent e) { - changedUpdate(e); - } - - @Override - public void changedUpdate(DocumentEvent e) { - if (!reloading) { - assignedToStatusLabel.setVisible(false); - } - } - }); - } - - private void updateNoSummary() { - if (summaryField.getText().trim().length() == 0) { - if (!noSummary) { - noSummary = true; - updateMessagePanel(); - } - } else { - if (noSummary) { - noSummary = false; - updateMessagePanel(); - } - } - } - - private void updateInvalidKeyword() { - boolean invalidFound = false; - StringTokenizer st = new StringTokenizer(keywordsField.getText(), ", \t\n\r\f"); // NOI18N - while (st.hasMoreTokens()) { - String token = st.nextToken(); - if (!keywords.contains(token.toUpperCase())) { - invalidFound = true; - break; - } - } - if (invalidFound != invalidKeyword) { - invalidKeyword = invalidFound; - updateMessagePanel(); - } - } - - private void updateNoComponent() { - boolean newNoComponent = (componentCombo.getSelectedItem() == null); - if (noComponent != newNoComponent) { - noComponent = newNoComponent; - updateMessagePanel(); - } - } - - private void updateNoReproducibility() { - boolean newNoReproducibility = (reproducibilityCombo.getSelectedItem() == null); - if (noReproducibility != newNoReproducibility) { - noReproducibility = newNoReproducibility; - updateMessagePanel(); - } - } - - private void updateNoVersion() { - boolean newNoVersion = (versionCombo.getSelectedItem() == null); - if (noVersion != newNoVersion) { - noVersion = newNoVersion; - updateMessagePanel(); - } - } - - private void updateNoTargetMilestone() { - boolean newNoTargetMilestone = (targetMilestoneCombo.getSelectedItem() == null); - if (noTargetMilestione != newNoTargetMilestone) { - noTargetMilestione = newNoTargetMilestone; - updateMessagePanel(); - } - } - - private boolean noSummary = false; - private boolean invalidKeyword = false; - private boolean cyclicDependency = false; - private boolean noComponent = false; - private boolean noReproducibility = false; - private boolean noVersion = false; - private boolean noTargetMilestione = false; - private boolean noDuplicateId = false; - private final Map fieldsConflict = new LinkedHashMap<>(); - private final Map fieldsIncoming = new LinkedHashMap<>(); - private final Map fieldsLocal = new LinkedHashMap<>(); - private final TooltipsMap tooltipsConflict = new TooltipsMap(); - private final TooltipsMap tooltipsIncoming = new TooltipsMap(); - private final TooltipsMap tooltipsLocal = new TooltipsMap(); - private void updateMessagePanel() { - messagePanel.removeAll(); - if (noComponent) { - addMessage("IssuePanel.noComponent"); // NOI18N - } - if (noVersion) { - addMessage("IssuePanel.noVersion"); // NOI18N - } - if (noTargetMilestione) { - addMessage("IssuePanel.noTargetMilestone"); // NOI18N - } - if (noReproducibility && issue.isNew()) { - addMessage("IssuePanel.noReproducibility"); // NOI18N - } - if (noSummary) { - JLabel noSummaryLabel = new JLabel(); - noSummaryLabel.setText(NbBundle.getMessage(IssuePanel.class, "IssuePanel.noSummary")); // NOI18N - String icon = issue.isNew() ? "org/netbeans/modules/bugzilla/resources/info.png" : "org/netbeans/modules/bugzilla/resources/error.gif"; // NOI18N - noSummaryLabel.setIcon(ImageUtilities.loadImageIcon(icon, false)); - messagePanel.add(noSummaryLabel); - } - if (cyclicDependency) { - JLabel cyclicDependencyLabel = new JLabel(); - cyclicDependencyLabel.setText(NbBundle.getMessage(IssuePanel.class, "IssuePanel.cyclicDependency")); // NOI18N - cyclicDependencyLabel.setIcon(ImageUtilities.loadImageIcon("org/netbeans/modules/bugzilla/resources/error.gif", false)); // NOI18N - messagePanel.add(cyclicDependencyLabel); - } - if (invalidKeyword) { - JLabel invalidKeywordLabel = new JLabel(); - invalidKeywordLabel.setText(NbBundle.getMessage(IssuePanel.class, "IssuePanel.invalidKeyword")); // NOI18N - invalidKeywordLabel.setIcon(ImageUtilities.loadImageIcon("org/netbeans/modules/bugzilla/resources/error.gif", false)); // NOI18N - messagePanel.add(invalidKeywordLabel); - } - if (noDuplicateId) { - JLabel noDuplicateLabel = new JLabel(); - noDuplicateLabel.setText(NbBundle.getMessage(IssuePanel.class, "IssuePanel.noDuplicateId")); // NOI18N - noDuplicateLabel.setIcon(ImageUtilities.loadImageIcon("org/netbeans/modules/bugzilla/resources/error.gif", false)); // NOI18N - messagePanel.add(noDuplicateLabel); - } - if (noSummary || cyclicDependency || invalidKeyword || noComponent || noVersion || noTargetMilestione || noDuplicateId || (noReproducibility && issue.isNew())) { - submitButton.setEnabled(false); - } else { - submitButton.setEnabled(true); - } - for (Pair, ImageIcon> p : new Pair[] { - Pair.of(fieldsConflict, ICON_CONFLICT), - Pair.of(fieldsIncoming, ICON_REMOTE), - Pair.of(fieldsLocal, ICON_UNSUBMITTED) - }) { - for (Map.Entry e : p.first().entrySet()) { - JLabel lbl = new JLabel(e.getValue()); - lbl.setIcon(p.second()); - messagePanel.add(lbl); - } - } - if (noSummary || cyclicDependency || invalidKeyword || noComponent || noVersion || noTargetMilestione || noDuplicateId || (noReproducibility && issue.isNew()) - || (fieldsConflict.size() + fieldsIncoming.size() + fieldsLocal.size() > 0)) { - messagePanel.setVisible(true); - messagePanel.revalidate(); - } else { - messagePanel.setVisible(false); - } - } - - void addMessage(String messageKey) { - JLabel messageLabel = new JLabel(); - messageLabel.setText(NbBundle.getMessage(IssuePanel.class, messageKey)); - String icon = issue.isNew() ? "org/netbeans/modules/bugzilla/resources/info.png" : "org/netbeans/modules/bugzilla/resources/error.gif"; // NOI18N - messageLabel.setIcon(ImageUtilities.loadImageIcon(icon, false)); - messagePanel.add(messageLabel); - } - - private Map enableMap = new HashMap<>(); - private void enableComponents(boolean enable) { - enableComponents(this, enable); - if (enable) { - enableMap.clear(); - } - } - - private void enableComponents(Component comp, boolean enable) { - if (comp instanceof Container) { - for (Component subComp : ((Container)comp).getComponents()) { - enableComponents(subComp, enable); - } - } - if ((comp instanceof JComboBox) - || ((comp instanceof JTextComponent) && ((JTextComponent)comp).isEditable()) - || (comp instanceof AbstractButton) || (comp instanceof JList)) { - if (enable) { - Boolean b = enableMap.get(comp); - if (b != null) { - comp.setEnabled(b); - } else { - comp.setEnabled(true); - } - } else { - enableMap.put(comp, comp.isEnabled()); - comp.setEnabled(false); - } - } - } - - private void initSpellChecker () { - Spellchecker.register(summaryField); - Spellchecker.register(addCommentArea); - Spellchecker.register(privateNotesField); - } - - private List customFields = new LinkedList<>(); - private void initCustomFields() { - customFields.clear(); - customFieldsPanelLeft.removeAll(); - customFieldsPanelRight.removeAll(); - GroupLayout labelLayout = new GroupLayout(customFieldsPanelLeft); - customFieldsPanelLeft.setLayout(labelLayout); - GroupLayout fieldLayout = new GroupLayout(customFieldsPanelRight); - customFieldsPanelRight.setLayout(fieldLayout); - GroupLayout.ParallelGroup labelHorizontalGroup = labelLayout.createParallelGroup(GroupLayout.Alignment.LEADING); - GroupLayout.SequentialGroup labelVerticalGroup = labelLayout.createSequentialGroup(); - GroupLayout.ParallelGroup fieldHorizontalGroup = fieldLayout.createParallelGroup(GroupLayout.Alignment.LEADING); - GroupLayout.SequentialGroup fieldVerticalGroup = fieldLayout.createSequentialGroup(); - boolean nbRepository = BugzillaUtil.isNbRepository(issue.getRepository()); - boolean newIssue = issue.isNew(); - boolean anyField = false; - for (IssueField field : issue.getRepository().getConfiguration().getFields()) { - if (field instanceof CustomIssueField) { - CustomIssueField cField = (CustomIssueField)field; - if ((nbRepository && cField.getKey().equals(IssueField.ISSUE_TYPE.getKey())) - || (newIssue && !cField.getShowOnBugCreation()) // NB IssueProvider type is already among non-custom fields - || (isNbExceptionReport(field) && (newIssue || "".equals(issue.getFieldValue(field).trim())))) // NOI18N do not show exception reporter field - issue #212182 - { - continue; - } - JLabel label = new JLabel(cField.getDisplayName()+":"); // NOI18N - JComponent comp; - JComponent editor; - boolean rigid = false; - switch (cField.getType()) { - case LargeText: - JScrollPane scrollPane = new JScrollPane(); - JTextArea textArea = new JTextArea(); - textArea.setRows(5); - scrollPane.setViewportView(textArea); - comp = scrollPane; - editor = textArea; - label.setVerticalAlignment(SwingConstants.TOP); - UIUtils.fixFocusTraversalKeys(textArea); - UIUtils.issue163946Hack(scrollPane); - break; - case FreeText: - if(isNbExceptionReport(field)) { - final String val = issue.getFieldValue(field); - LinkButton lb = new LinkButton(val); - lb.addActionListener(new ActionListener() { - @Override - public void actionPerformed(ActionEvent e) { - try { - URL url = new URL("http://statistics.netbeans.org/exceptions/detail.do?id=" + val); // NOI18N - HtmlBrowser.URLDisplayer.getDefault().showURL(url); - } catch (MalformedURLException muex) { - Bugzilla.LOG.log(Level.INFO, "Unable to show the exception report in the browser.", muex); // NOI18N - } - } - }); - comp = editor = lb; - } else { - comp = editor = new JTextField(); - } - break; - case MultipleSelection: - JList list = new JList(); - DefaultComboBoxModel model = new DefaultComboBoxModel(cField.getOptions().toArray()); - list.setModel(model); - if (model.getSize()//GEN-BEGIN:initComponents - private void initComponents() { - - productField = new javax.swing.JTextField(); - resolutionCombo = new javax.swing.JComboBox(); - assignedCombo = new javax.swing.JComboBox(); - timetrackingPanel = new javax.swing.JPanel(); - estimatedLabel = new javax.swing.JLabel(); - estimatedField = new javax.swing.JTextField(); - estimatedWarning = new javax.swing.JLabel(); - actualLabel = new javax.swing.JLabel(); - workedLabel = new javax.swing.JLabel(); - workedField = new javax.swing.JTextField(); - workedWarning = new javax.swing.JLabel(); - remainingField = new javax.swing.JTextField(); - remainingLabel = new javax.swing.JLabel(); - remainingWarning = new javax.swing.JLabel(); - completeLabel = new javax.swing.JLabel(); - workedSumField = new javax.swing.JLabel(); - jLabel7 = new javax.swing.JLabel(); - actualField = new javax.swing.JTextField(); - completeField = new javax.swing.JTextField(); - gainLabel = new javax.swing.JLabel(); - gainField = new javax.swing.JTextField(); - deadlineLabel = new javax.swing.JLabel(); - dummyDeadlineField = new javax.swing.JTextField(); - actualWarning = new javax.swing.JLabel(); - deadlineWarning = new javax.swing.JLabel(); - completeWarning = new javax.swing.JLabel(); - gainWarning = new javax.swing.JLabel(); - attributesSectionPanel = new javax.swing.JPanel(); - duplicateWarning = new javax.swing.JLabel(); - reportedLabel = new javax.swing.JLabel(); - osCombo = new javax.swing.JComboBox(); - blocksWarning = new javax.swing.JLabel(); - dependsOnButton = new javax.swing.JButton(); - componentCombo = new javax.swing.JComboBox(); - qaContactField = new javax.swing.JTextField(); - blocksLabel = new javax.swing.JLabel(); - customFieldsPanelLeft = new javax.swing.JPanel(); - versionLabel = new javax.swing.JLabel(); - statusWhiteboardLabel = new javax.swing.JLabel(); - platformWarning = new javax.swing.JLabel(); - statusWarning = new javax.swing.JLabel(); - urlLabel = new org.netbeans.modules.bugtracking.commons.LinkButton(); - priorityLabel = new javax.swing.JLabel(); - modifiedField = new javax.swing.JTextField(); - targetMilestoneLabel = new javax.swing.JLabel(); - summaryWarning = new javax.swing.JLabel(); - productLabel = new javax.swing.JLabel(); - assignedToWarning = new javax.swing.JLabel(); - issueTypeWarning = new javax.swing.JLabel(); - issueTypeLabel = new javax.swing.JLabel(); - statusLabel = new javax.swing.JLabel(); - dependsLabel = new javax.swing.JLabel(); - ccWarning = new javax.swing.JLabel(); - platformLabel = new javax.swing.JLabel(); - keywordsLabel = new javax.swing.JLabel(); - componentLabel = new javax.swing.JLabel(); - assignedLabel = new javax.swing.JLabel(); - duplicateField = new javax.swing.JTextField(); - priorityCombo = new javax.swing.JComboBox(); - resolutionWarning = new javax.swing.JLabel(); - issueTypeCombo = new javax.swing.JComboBox(); - productWarning = new javax.swing.JLabel(); - summaryField = new javax.swing.JTextField(); - assignedField = new javax.swing.JTextField(); - dummyTimetrackingPanel = new javax.swing.JPanel(); - summaryLabel = new javax.swing.JLabel(); - assignedToStatusLabel = new javax.swing.JLabel(); - blocksButton = new javax.swing.JButton(); - duplicateButton = new javax.swing.JButton(); - milestoneWarning = new javax.swing.JLabel(); - dummyLabel2 = new javax.swing.JLabel(); - assignToDefaultCheckBox = new javax.swing.JCheckBox(); - modifiedLabel = new javax.swing.JLabel(); - urlField = new javax.swing.JTextField(); - customFieldsPanelRight = new javax.swing.JPanel(); - ccLabel = new javax.swing.JLabel(); - ccField = new javax.swing.JTextField(); - blocksField = new javax.swing.JTextField(); - dependsField = new javax.swing.JTextField(); - productCombo = new javax.swing.JComboBox(); - componentWarning = new javax.swing.JLabel(); - versionCombo = new javax.swing.JComboBox(); - dummyLabel1 = new javax.swing.JLabel(); - dummyLabel3 = new javax.swing.JLabel(); - timetrackingLabel = new javax.swing.JLabel(); - dependsOnWarning = new javax.swing.JLabel(); - platformCombo = new javax.swing.JComboBox(); - severityCombo = new javax.swing.JComboBox(); - resolutionLabel = new javax.swing.JLabel(); - resolutionField = new javax.swing.JTextField(); - targetMilestoneCombo = new javax.swing.JComboBox(); - reproducibilityLabel = new javax.swing.JLabel(); - reproducibilityCombo = new javax.swing.JComboBox(); - statusWhiteboardField = new javax.swing.JTextField(); - priorityWarning = new javax.swing.JLabel(); - statusWhiteboardWarning = new javax.swing.JLabel(); - reportedField = new javax.swing.JTextField(); - urlWarning = new javax.swing.JLabel(); - timetrackingWarning = new javax.swing.JLabel(); - statusCombo = new javax.swing.JComboBox(); - keywordsField = new javax.swing.JTextField(); - reportedStatusLabel = new javax.swing.JLabel(); - dummyTimetrackingLabel = new javax.swing.JLabel(); - qaContactLabel = new javax.swing.JLabel(); - versionWarning = new javax.swing.JLabel(); - duplicateLabel = new javax.swing.JLabel(); - keywordsButton = new javax.swing.JButton(); - keywordsWarning = new javax.swing.JLabel(); - qaContactWarning = new javax.swing.JLabel(); - attachmentsSectionPanel = new javax.swing.JPanel(); - attachmentsWarning = new javax.swing.JLabel(); - dummyAttachmentsPanel = new javax.swing.JPanel(); - commentsSectionPanel = new javax.swing.JPanel(); - dummyCommentsPanel = new javax.swing.JPanel(); - newCommentSectionPanel = new javax.swing.JPanel(); - scrollPane1 = new javax.swing.JScrollPane(); - addCommentArea = new javax.swing.JTextArea() { - @Override - public Dimension getPreferredScrollableViewportSize() { - Dimension dim = super.getPreferredScrollableViewportSize(); - JScrollPane scrollPane = (JScrollPane)SwingUtilities.getAncestorOfClass(JScrollPane.class, this); - int delta = 0; - if (scrollPane != null) { - Component comp = scrollPane.getHorizontalScrollBar(); - delta = comp.isVisible() ? comp.getHeight() : 0; - } - Insets insets = getInsets(); - int prefHeight = 5 * getRowHeight() + insets.top + insets.bottom; - dim = new Dimension(0, delta + ((dim.height < prefHeight) ? prefHeight : dim.height)); - return dim; - } - }; - attachLogCheckBox = new javax.swing.JCheckBox(); - viewLogButton = new org.netbeans.modules.bugtracking.commons.LinkButton(); - commentWarning = new javax.swing.JLabel(); - messagePanel = new javax.swing.JPanel(); - privatePanel = new javax.swing.JPanel(); - dueDateLabel = new javax.swing.JLabel(); - dummyDueDateField = new javax.swing.JTextField(); - scheduleDateLabel = new javax.swing.JLabel(); - dummyScheduleDateField = new javax.swing.JTextField(); - estimateLabel = new javax.swing.JLabel(); - estimateField = new javax.swing.JFormattedTextField(); - notesLabel = new javax.swing.JLabel(); - privateNotesScrollPane = new javax.swing.JScrollPane(); - privateNotesField = new javax.swing.JTextArea() { - @Override - public Dimension getPreferredScrollableViewportSize() { - Dimension dim = super.getPreferredScrollableViewportSize(); - JScrollPane scrollPane = (JScrollPane)SwingUtilities.getAncestorOfClass(JScrollPane.class, this); - int delta = 0; - if (scrollPane != null) { - Component comp = scrollPane.getHorizontalScrollBar(); - delta = comp.isVisible() ? comp.getHeight() : 0; - } - Insets insets = getInsets(); - int prefHeight = 5 * getRowHeight() + insets.top + insets.bottom; - dim = new Dimension(0, delta + ((dim.height < prefHeight) ? prefHeight : dim.height)); - return dim; - } - }; - jComboBox1 = new javax.swing.JComboBox(); - headerPanel = new javax.swing.JPanel(); - headerField = new javax.swing.JTextField(); - buttonsPanel = new javax.swing.JPanel(); - separatorLabel4 = new javax.swing.JLabel(); - separatorLabel6 = new javax.swing.JLabel(); - separatorLabel3 = new javax.swing.JLabel(); - separatorDismissButton = new javax.swing.JLabel(); - refreshButton = new org.netbeans.modules.bugtracking.commons.LinkButton(); - cancelButton = new org.netbeans.modules.bugtracking.commons.LinkButton(); - showInBrowserButton = new org.netbeans.modules.bugtracking.commons.LinkButton(); - submitButton = new org.netbeans.modules.bugtracking.commons.LinkButton(); - btnDeleteTask = new org.netbeans.modules.bugtracking.commons.LinkButton(); - mainScrollPane = new javax.swing.JScrollPane(); - mainPanel = new javax.swing.JPanel(); - attributesSection = new org.netbeans.modules.bugtracking.commons.CollapsibleSectionPanel(); - attachmentsSection = new org.netbeans.modules.bugtracking.commons.CollapsibleSectionPanel(); - newCommentSection = new org.netbeans.modules.bugtracking.commons.SectionPanel(); - jPanel1 = new javax.swing.JPanel() { - - @Override - public Dimension getPreferredSize () { - return getMinimumSize(); - } - } - ; - commentsSection = new org.netbeans.modules.bugtracking.commons.CollapsibleSectionPanel(); - privateSection = new org.netbeans.modules.bugtracking.commons.CollapsibleSectionPanel(); - - FormListener formListener = new FormListener(); - - productField.setEditable(false); - productField.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0)); - productField.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(IssuePanel.class, "IssuePanel.productField.AccessibleContext.accessibleDescription")); // NOI18N - - resolutionCombo.addActionListener(formListener); - resolutionCombo.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(IssuePanel.class, "IssuePanel.resolutionCombo.AccessibleContext.accessibleDescription")); // NOI18N - - assignedCombo.setEditable(true); - assignedCombo.addActionListener(formListener); - - timetrackingPanel.setBackground(javax.swing.UIManager.getDefaults().getColor("TextArea.background")); - - org.openide.awt.Mnemonics.setLocalizedText(estimatedLabel, org.openide.util.NbBundle.getMessage(IssuePanel.class, "IssuePanel.estimatedLabel.text")); // NOI18N - - estimatedField.setText(org.openide.util.NbBundle.getMessage(IssuePanel.class, "IssuePanel.estimatedField.text")); // NOI18N - - org.openide.awt.Mnemonics.setLocalizedText(actualLabel, org.openide.util.NbBundle.getMessage(IssuePanel.class, "IssuePanel.actualLabel.text")); // NOI18N - - org.openide.awt.Mnemonics.setLocalizedText(workedLabel, org.openide.util.NbBundle.getMessage(IssuePanel.class, "IssuePanel.workedLabel.text")); // NOI18N - - workedField.setText(org.openide.util.NbBundle.getMessage(IssuePanel.class, "IssuePanel.workedField.text")); // NOI18N - workedField.addFocusListener(formListener); - - remainingField.setText(org.openide.util.NbBundle.getMessage(IssuePanel.class, "IssuePanel.remainingField.text")); // NOI18N - - org.openide.awt.Mnemonics.setLocalizedText(remainingLabel, org.openide.util.NbBundle.getMessage(IssuePanel.class, "IssuePanel.remainingLabel.text")); // NOI18N - - org.openide.awt.Mnemonics.setLocalizedText(completeLabel, org.openide.util.NbBundle.getMessage(IssuePanel.class, "IssuePanel.completeLabel.text")); // NOI18N - - org.openide.awt.Mnemonics.setLocalizedText(workedSumField, org.openide.util.NbBundle.getMessage(IssuePanel.class, "IssuePanel.workedSumField.text")); // NOI18N - - org.openide.awt.Mnemonics.setLocalizedText(jLabel7, org.openide.util.NbBundle.getMessage(IssuePanel.class, "IssuePanel.jLabel7.text")); // NOI18N - - actualField.setEditable(false); - actualField.setText(org.openide.util.NbBundle.getMessage(IssuePanel.class, "IssuePanel.actualField.text")); // NOI18N - - completeField.setEditable(false); - completeField.setText(org.openide.util.NbBundle.getMessage(IssuePanel.class, "IssuePanel.completeField.text")); // NOI18N - - org.openide.awt.Mnemonics.setLocalizedText(gainLabel, org.openide.util.NbBundle.getMessage(IssuePanel.class, "IssuePanel.gainLabel.text")); // NOI18N - - gainField.setEditable(false); - gainField.setText(org.openide.util.NbBundle.getMessage(IssuePanel.class, "IssuePanel.gainField.text")); // NOI18N - - org.openide.awt.Mnemonics.setLocalizedText(deadlineLabel, org.openide.util.NbBundle.getMessage(IssuePanel.class, "IssuePanel.deadlineLabel.text")); // NOI18N - - javax.swing.GroupLayout timetrackingPanelLayout = new javax.swing.GroupLayout(timetrackingPanel); - timetrackingPanel.setLayout(timetrackingPanelLayout); - timetrackingPanelLayout.setHorizontalGroup( - timetrackingPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(timetrackingPanelLayout.createSequentialGroup() - .addGroup(timetrackingPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(estimatedLabel) - .addComponent(estimatedField, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(estimatedWarning, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addGroup(timetrackingPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(actualLabel) - .addComponent(actualField, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(actualWarning, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addGroup(timetrackingPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(timetrackingPanelLayout.createSequentialGroup() - .addComponent(workedSumField) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(jLabel7) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(workedField, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addComponent(workedLabel)) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(workedWarning, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addGroup(timetrackingPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(remainingLabel) - .addGroup(timetrackingPanelLayout.createSequentialGroup() - .addComponent(remainingField, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE) - .addGap(6, 6, 6) - .addComponent(remainingWarning, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE))) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addGroup(timetrackingPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(completeLabel) - .addComponent(completeField, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(completeWarning, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addGroup(timetrackingPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(timetrackingPanelLayout.createSequentialGroup() - .addComponent(gainField, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(gainWarning, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE) - .addGap(9, 9, 9) - .addGroup(timetrackingPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(dummyDeadlineField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(deadlineLabel)) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(deadlineWarning, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addComponent(gainLabel))) - ); - timetrackingPanelLayout.setVerticalGroup( - timetrackingPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(timetrackingPanelLayout.createSequentialGroup() - .addGroup(timetrackingPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(completeLabel) - .addGroup(timetrackingPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(actualLabel, javax.swing.GroupLayout.Alignment.TRAILING) - .addComponent(estimatedLabel) - .addComponent(remainingLabel)) - .addComponent(workedLabel)) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addGroup(timetrackingPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER) - .addComponent(actualWarning, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(remainingField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(workedField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(estimatedField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(deadlineWarning, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(completeField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(jLabel7) - .addComponent(actualField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(estimatedWarning, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(remainingWarning, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(workedWarning, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(workedSumField) - .addComponent(completeWarning, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE))) - .addGroup(timetrackingPanelLayout.createSequentialGroup() - .addComponent(gainLabel) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addGroup(timetrackingPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER) - .addComponent(gainField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(gainWarning, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE))) - .addGroup(timetrackingPanelLayout.createSequentialGroup() - .addComponent(deadlineLabel) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(dummyDeadlineField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) - ); - - attributesSectionPanel.setBackground(javax.swing.UIManager.getDefaults().getColor("TextArea.background")); - - reportedLabel.setLabelFor(reportedField); - org.openide.awt.Mnemonics.setLocalizedText(reportedLabel, org.openide.util.NbBundle.getMessage(IssuePanel.class, "IssuePanel.reportedLabel.text")); // NOI18N - - osCombo.addActionListener(formListener); - - org.openide.awt.Mnemonics.setLocalizedText(dependsOnButton, org.openide.util.NbBundle.getMessage(IssuePanel.class, "IssuePanel.dependsOnButton.text")); // NOI18N - dependsOnButton.setFocusPainted(false); - dependsOnButton.setMargin(new java.awt.Insets(0, 0, 0, 0)); - dependsOnButton.addActionListener(formListener); - - componentCombo.addActionListener(formListener); - - blocksLabel.setLabelFor(blocksField); - org.openide.awt.Mnemonics.setLocalizedText(blocksLabel, org.openide.util.NbBundle.getMessage(IssuePanel.class, "IssuePanel.blocksLabel.text")); // NOI18N - - versionLabel.setLabelFor(versionCombo); - org.openide.awt.Mnemonics.setLocalizedText(versionLabel, org.openide.util.NbBundle.getMessage(IssuePanel.class, "IssuePanel.versionLabel.text")); // NOI18N - - org.openide.awt.Mnemonics.setLocalizedText(statusWhiteboardLabel, org.openide.util.NbBundle.getMessage(IssuePanel.class, "IssuePanel.statusWhiteboardLabel.text")); // NOI18N - - org.openide.awt.Mnemonics.setLocalizedText(urlLabel, org.openide.util.NbBundle.getMessage(IssuePanel.class, "IssuePanel.urlLabel.text")); // NOI18N - urlLabel.addActionListener(formListener); - - priorityLabel.setLabelFor(priorityCombo); - org.openide.awt.Mnemonics.setLocalizedText(priorityLabel, org.openide.util.NbBundle.getMessage(IssuePanel.class, "IssuePanel.priorityLabel.text")); // NOI18N - - modifiedField.setEditable(false); - modifiedField.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0)); - - targetMilestoneLabel.setLabelFor(targetMilestoneCombo); - org.openide.awt.Mnemonics.setLocalizedText(targetMilestoneLabel, org.openide.util.NbBundle.getMessage(IssuePanel.class, "IssuePanel.targetMilestoneLabel.text")); // NOI18N - - productLabel.setLabelFor(productCombo); - org.openide.awt.Mnemonics.setLocalizedText(productLabel, org.openide.util.NbBundle.getMessage(IssuePanel.class, "IssuePanel.productLabel.text")); // NOI18N - - issueTypeLabel.setLabelFor(issueTypeCombo); - org.openide.awt.Mnemonics.setLocalizedText(issueTypeLabel, org.openide.util.NbBundle.getMessage(IssuePanel.class, "IssuePanel.issueTypeLabel.text")); // NOI18N - - statusLabel.setLabelFor(statusCombo); - org.openide.awt.Mnemonics.setLocalizedText(statusLabel, org.openide.util.NbBundle.getMessage(IssuePanel.class, "IssuePanel.statusLabel.text")); // NOI18N - - dependsLabel.setLabelFor(dependsField); - org.openide.awt.Mnemonics.setLocalizedText(dependsLabel, org.openide.util.NbBundle.getMessage(IssuePanel.class, "IssuePanel.dependsLabel.text")); // NOI18N - - platformLabel.setLabelFor(platformCombo); - org.openide.awt.Mnemonics.setLocalizedText(platformLabel, org.openide.util.NbBundle.getMessage(IssuePanel.class, "IssuePanel.platformLabel.text")); // NOI18N - - keywordsLabel.setLabelFor(keywordsField); - org.openide.awt.Mnemonics.setLocalizedText(keywordsLabel, org.openide.util.NbBundle.getMessage(IssuePanel.class, "IssuePanel.keywordsLabel.text")); // NOI18N - - componentLabel.setLabelFor(componentCombo); - org.openide.awt.Mnemonics.setLocalizedText(componentLabel, org.openide.util.NbBundle.getMessage(IssuePanel.class, "IssuePanel.componentLabel.text")); // NOI18N - - assignedLabel.setLabelFor(assignedField); - org.openide.awt.Mnemonics.setLocalizedText(assignedLabel, org.openide.util.NbBundle.getMessage(IssuePanel.class, "IssuePanel.assignedLabel.text")); // NOI18N - - duplicateField.setColumns(15); - - priorityCombo.addActionListener(formListener); - - issueTypeCombo.addActionListener(formListener); - - summaryLabel.setLabelFor(summaryField); - org.openide.awt.Mnemonics.setLocalizedText(summaryLabel, org.openide.util.NbBundle.getMessage(IssuePanel.class, "IssuePanel.summaryLabel.text")); // NOI18N - - org.openide.awt.Mnemonics.setLocalizedText(blocksButton, org.openide.util.NbBundle.getMessage(IssuePanel.class, "IssuePanel.blocksButton.text")); // NOI18N - blocksButton.setFocusPainted(false); - blocksButton.setMargin(new java.awt.Insets(0, 0, 0, 0)); - blocksButton.addActionListener(formListener); - - org.openide.awt.Mnemonics.setLocalizedText(duplicateButton, org.openide.util.NbBundle.getMessage(IssuePanel.class, "IssuePanel.duplicateButton.text")); // NOI18N - duplicateButton.setFocusPainted(false); - duplicateButton.setMargin(new java.awt.Insets(0, 0, 0, 0)); - duplicateButton.addActionListener(formListener); - - assignToDefaultCheckBox.setBackground(javax.swing.UIManager.getDefaults().getColor("TextArea.background")); - org.openide.awt.Mnemonics.setLocalizedText(assignToDefaultCheckBox, org.openide.util.NbBundle.getMessage(IssuePanel.class, "IssuePanel.assignToDefaultCheckBox.text")); // NOI18N - - modifiedLabel.setLabelFor(modifiedField); - org.openide.awt.Mnemonics.setLocalizedText(modifiedLabel, org.openide.util.NbBundle.getMessage(IssuePanel.class, "IssuePanel.modifiedLabel.text")); // NOI18N - - urlField.setColumns(15); - - ccLabel.setLabelFor(ccField); - org.openide.awt.Mnemonics.setLocalizedText(ccLabel, org.openide.util.NbBundle.getMessage(IssuePanel.class, "IssuePanel.ccLabel.text")); // NOI18N - - blocksField.setColumns(15); - - dependsField.setColumns(15); - - productCombo.addActionListener(formListener); - - versionCombo.addActionListener(formListener); - - org.openide.awt.Mnemonics.setLocalizedText(timetrackingLabel, org.openide.util.NbBundle.getMessage(IssuePanel.class, "IssuePanel.timetrackingLabel.text")); // NOI18N - - platformCombo.addActionListener(formListener); - - severityCombo.addActionListener(formListener); - - org.openide.awt.Mnemonics.setLocalizedText(resolutionLabel, org.openide.util.NbBundle.getMessage(IssuePanel.class, "IssuePanel.resolutionLabel.text")); // NOI18N - - resolutionField.setEditable(false); - resolutionField.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0)); - - targetMilestoneCombo.addActionListener(formListener); - - org.openide.awt.Mnemonics.setLocalizedText(reproducibilityLabel, org.openide.util.NbBundle.getMessage(IssuePanel.class, "IssuePanel.reproducibilityLabel.text")); // NOI18N - - reproducibilityCombo.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" })); - reproducibilityCombo.addActionListener(formListener); - - statusWhiteboardField.setColumns(15); - - reportedField.setEditable(false); - reportedField.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0)); - - statusCombo.addActionListener(formListener); - - keywordsField.setColumns(15); - - qaContactLabel.setLabelFor(qaContactField); - org.openide.awt.Mnemonics.setLocalizedText(qaContactLabel, org.openide.util.NbBundle.getMessage(IssuePanel.class, "IssuePanel.qaContactLabel.text")); // NOI18N - - duplicateLabel.setLabelFor(duplicateField); - org.openide.awt.Mnemonics.setLocalizedText(duplicateLabel, org.openide.util.NbBundle.getMessage(IssuePanel.class, "IssuePanel.duplicateLabel.text")); // NOI18N - - org.openide.awt.Mnemonics.setLocalizedText(keywordsButton, org.openide.util.NbBundle.getMessage(IssuePanel.class, "IssuePanel.keywordsButton.text")); // NOI18N - keywordsButton.setFocusPainted(false); - keywordsButton.setMargin(new java.awt.Insets(0, 0, 0, 0)); - keywordsButton.addActionListener(formListener); - - javax.swing.GroupLayout attributesSectionPanelLayout = new javax.swing.GroupLayout(attributesSectionPanel); - attributesSectionPanel.setLayout(attributesSectionPanelLayout); - attributesSectionPanelLayout.setHorizontalGroup( - attributesSectionPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(attributesSectionPanelLayout.createSequentialGroup() - .addGroup(attributesSectionPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(attributesSectionPanelLayout.createSequentialGroup() - .addGroup(attributesSectionPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(statusWhiteboardWarning, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(keywordsWarning, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(urlWarning, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(milestoneWarning, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(issueTypeWarning, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(versionWarning, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(componentWarning, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(productWarning, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(summaryWarning, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(timetrackingWarning, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addGap(5, 5, 5) - .addGroup(attributesSectionPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) - .addComponent(keywordsLabel) - .addComponent(statusWhiteboardLabel) - .addComponent(timetrackingLabel) - .addComponent(summaryLabel) - .addComponent(urlLabel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(issueTypeLabel) - .addComponent(versionLabel) - .addComponent(componentLabel) - .addComponent(productLabel) - .addComponent(targetMilestoneLabel) - .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, attributesSectionPanelLayout.createSequentialGroup() - .addComponent(reproducibilityLabel) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addComponent(dummyLabel2)))) - .addComponent(customFieldsPanelLeft, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addGroup(attributesSectionPanelLayout.createSequentialGroup() - .addComponent(platformWarning, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE) - .addGap(5, 5, 5) - .addComponent(platformLabel)) - .addGroup(attributesSectionPanelLayout.createSequentialGroup() - .addComponent(priorityWarning, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(priorityLabel))) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addGroup(attributesSectionPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(dummyTimetrackingPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addComponent(customFieldsPanelRight, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addGroup(attributesSectionPanelLayout.createSequentialGroup() - .addGroup(attributesSectionPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) - .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, attributesSectionPanelLayout.createSequentialGroup() - .addComponent(keywordsField, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(keywordsButton)) - .addComponent(urlField) - .addComponent(targetMilestoneCombo, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addComponent(issueTypeCombo, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addComponent(versionCombo, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addComponent(componentCombo, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addComponent(productCombo, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addGroup(attributesSectionPanelLayout.createSequentialGroup() - .addComponent(platformCombo, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(osCombo, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) - .addGroup(attributesSectionPanelLayout.createSequentialGroup() - .addComponent(priorityCombo, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(severityCombo, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) - .addComponent(reproducibilityCombo, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) - .addGroup(attributesSectionPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(assignedToWarning, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(qaContactWarning, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(ccWarning, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(statusWarning, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(resolutionWarning, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(duplicateWarning, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(dependsOnWarning, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(blocksWarning, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addGap(5, 5, 5) - .addGroup(attributesSectionPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(attributesSectionPanelLayout.createSequentialGroup() - .addComponent(reportedLabel) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(reportedField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(reportedStatusLabel) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) - .addComponent(modifiedLabel) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(modifiedField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addGroup(attributesSectionPanelLayout.createSequentialGroup() - .addGroup(attributesSectionPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(blocksLabel) - .addComponent(dependsLabel) - .addComponent(duplicateLabel) - .addComponent(resolutionLabel) - .addComponent(statusLabel) - .addComponent(ccLabel) - .addComponent(qaContactLabel) - .addComponent(assignedLabel)) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addGroup(attributesSectionPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) - .addComponent(ccField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(assignedField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(statusCombo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(assignToDefaultCheckBox) - .addComponent(qaContactField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(resolutionField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, attributesSectionPanelLayout.createSequentialGroup() - .addGroup(attributesSectionPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) - .addComponent(blocksField, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE) - .addComponent(dependsField, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE) - .addComponent(duplicateField, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addGroup(attributesSectionPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(duplicateButton, javax.swing.GroupLayout.Alignment.TRAILING) - .addComponent(dependsOnButton, javax.swing.GroupLayout.Alignment.TRAILING) - .addComponent(blocksButton, javax.swing.GroupLayout.Alignment.TRAILING)))) - .addGap(18, 18, Short.MAX_VALUE) - .addComponent(assignedToStatusLabel)))) - .addComponent(summaryField) - .addComponent(statusWhiteboardField))) - .addGroup(attributesSectionPanelLayout.createSequentialGroup() - .addGroup(attributesSectionPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) - .addComponent(dummyLabel1) - .addGroup(attributesSectionPanelLayout.createSequentialGroup() - .addComponent(dummyLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 176, javax.swing.GroupLayout.PREFERRED_SIZE) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addComponent(dummyTimetrackingLabel))) - .addGap(300, 300, 300)) - ); - - attributesSectionPanelLayout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {osCombo, platformCombo, priorityCombo, severityCombo}); - - attributesSectionPanelLayout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {assignedField, ccField, componentCombo, issueTypeCombo, productCombo, qaContactField, resolutionField, statusCombo, targetMilestoneCombo, urlField, versionCombo}); - - attributesSectionPanelLayout.setVerticalGroup( - attributesSectionPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(attributesSectionPanelLayout.createSequentialGroup() - .addGap(0, 0, 0) - .addGroup(attributesSectionPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(attributesSectionPanelLayout.createSequentialGroup() - .addGroup(attributesSectionPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER) - .addComponent(reportedField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(reportedStatusLabel) - .addComponent(modifiedField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(modifiedLabel) - .addComponent(productWarning, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(productLabel) - .addComponent(productCombo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(reportedLabel)) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addGroup(attributesSectionPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER) - .addComponent(componentWarning, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(componentLabel) - .addComponent(componentCombo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(assignedToWarning, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(assignedLabel) - .addComponent(assignedField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addGroup(attributesSectionPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER) - .addComponent(versionWarning, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(versionLabel) - .addComponent(versionCombo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(assignToDefaultCheckBox)) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addGroup(attributesSectionPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER) - .addComponent(platformWarning, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(platformLabel) - .addComponent(platformCombo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(osCombo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(qaContactWarning, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(qaContactLabel) - .addComponent(qaContactField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addGroup(attributesSectionPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER) - .addComponent(issueTypeWarning, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(issueTypeLabel) - .addComponent(issueTypeCombo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(ccWarning, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(ccLabel) - .addComponent(ccField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(dummyLabel1) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addGroup(attributesSectionPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER) - .addComponent(priorityLabel) - .addComponent(priorityWarning, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(priorityCombo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(severityCombo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(statusLabel) - .addComponent(statusWarning, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(statusCombo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addGroup(attributesSectionPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER) - .addComponent(milestoneWarning, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(targetMilestoneLabel) - .addComponent(targetMilestoneCombo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(resolutionWarning, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(resolutionLabel) - .addComponent(resolutionField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addGroup(attributesSectionPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER) - .addComponent(duplicateWarning, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(duplicateLabel) - .addComponent(duplicateField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(duplicateButton) - .addComponent(dummyLabel2) - .addComponent(reproducibilityLabel) - .addComponent(reproducibilityCombo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addGroup(attributesSectionPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER) - .addComponent(urlWarning, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(urlLabel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(urlField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(dependsOnWarning, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(dependsLabel) - .addComponent(dependsField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(dependsOnButton)) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addGroup(attributesSectionPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER) - .addComponent(keywordsWarning, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(keywordsLabel) - .addComponent(keywordsField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(keywordsButton) - .addComponent(blocksLabel) - .addComponent(blocksWarning, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(blocksField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(blocksButton)) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addGroup(attributesSectionPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER) - .addComponent(statusWhiteboardWarning, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(statusWhiteboardLabel) - .addComponent(statusWhiteboardField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))) - .addGroup(attributesSectionPanelLayout.createSequentialGroup() - .addGap(25, 25, 25) - .addComponent(assignedToStatusLabel))) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) - .addGroup(attributesSectionPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(attributesSectionPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER) - .addComponent(timetrackingWarning, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(timetrackingLabel)) - .addComponent(dummyTimetrackingPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addGroup(attributesSectionPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(dummyTimetrackingLabel) - .addComponent(dummyLabel3)) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addGroup(attributesSectionPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) - .addComponent(customFieldsPanelRight, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(customFieldsPanelLeft, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addGap(18, 18, 18) - .addGroup(attributesSectionPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER) - .addComponent(summaryWarning, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(summaryLabel) - .addComponent(summaryField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addGap(0, 0, Short.MAX_VALUE)) - ); - - attributesSectionPanelLayout.linkSize(javax.swing.SwingConstants.VERTICAL, new java.awt.Component[] {dummyLabel1, dummyLabel2, dummyLabel3, dummyTimetrackingLabel, priorityCombo}); - - osCombo.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(IssuePanel.class, "IssuePanel.osCombo.AccessibleContext.accessibleDescription")); // NOI18N - dependsOnButton.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(IssuePanel.class, "IssuePanel.dependsOnButton.AccessibleContext.accessibleDescription")); // NOI18N - componentCombo.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(IssuePanel.class, "IssuePanel.componentCombo.AccessibleContext.accessibleDescription")); // NOI18N - qaContactField.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(IssuePanel.class, "IssuePanel.qaContactField.AccessibleContext.accessibleDescription")); // NOI18N - modifiedField.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(IssuePanel.class, "IssuePanel.modifiedField.AccessibleContext.accessibleDescription")); // NOI18N - duplicateField.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(IssuePanel.class, "IssuePanel.duplicateField.AccessibleContext.accessibleDescription")); // NOI18N - priorityCombo.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(IssuePanel.class, "IssuePanel.priorityCombo.AccessibleContext.accessibleDescription")); // NOI18N - assignedField.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(IssuePanel.class, "IssuePanel.assignedField.AccessibleContext.accessibleDescription")); // NOI18N - blocksButton.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(IssuePanel.class, "IssuePanel.blocksButton.AccessibleContext.accessibleDescription")); // NOI18N - duplicateButton.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(IssuePanel.class, "IssuePanel.duplicateButton.AccessibleContext.accessibleDescription")); // NOI18N - urlField.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(IssuePanel.class, "IssuePanel.urlField.AccessibleContext.accessibleDescription")); // NOI18N - ccField.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(IssuePanel.class, "IssuePanel.ccField.AccessibleContext.accessibleDescription")); // NOI18N - blocksField.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(IssuePanel.class, "IssuePanel.blocksField.AccessibleContext.accessibleDescription")); // NOI18N - dependsField.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(IssuePanel.class, "IssuePanel.dependsField.AccessibleContext.accessibleDescription")); // NOI18N - productCombo.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(IssuePanel.class, "IssuePanel.productCombo.AccessibleContext.accessibleDescription")); // NOI18N - versionCombo.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(IssuePanel.class, "IssuePanel.versionCombo.AccessibleContext.accessibleDescription")); // NOI18N - platformCombo.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(IssuePanel.class, "IssuePanel.platformCombo.AccessibleContext.accessibleDescription")); // NOI18N - severityCombo.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(IssuePanel.class, "IssuePanel.severityCombo.AccessibleContext.accessibleDescription")); // NOI18N - resolutionField.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(IssuePanel.class, "IssuePanel.resolutionField.AccessibleContext.accessibleDescription")); // NOI18N - targetMilestoneCombo.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(IssuePanel.class, "IssuePanel.targetMilestoneCombo.AccessibleContext.accessibleDescription")); // NOI18N - reportedField.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(IssuePanel.class, "IssuePanel.reportedField.AccessibleContext.accessibleDescription")); // NOI18N - statusCombo.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(IssuePanel.class, "IssuePanel.statusCombo.AccessibleContext.accessibleDescription")); // NOI18N - keywordsField.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(IssuePanel.class, "IssuePanel.keywordsField.AccessibleContext.accessibleDescription")); // NOI18N - keywordsButton.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(IssuePanel.class, "IssuePanel.keywordsButton.AccessibleContext.accessibleDescription")); // NOI18N - - attachmentsSectionPanel.setBackground(javax.swing.UIManager.getDefaults().getColor("TextArea.background")); - - attachmentsWarning.setBackground(javax.swing.UIManager.getDefaults().getColor("TextArea.background")); - - javax.swing.GroupLayout attachmentsSectionPanelLayout = new javax.swing.GroupLayout(attachmentsSectionPanel); - attachmentsSectionPanel.setLayout(attachmentsSectionPanelLayout); - attachmentsSectionPanelLayout.setHorizontalGroup( - attachmentsSectionPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(attachmentsSectionPanelLayout.createSequentialGroup() - .addGap(0, 0, 0) - .addComponent(attachmentsWarning, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE) - .addGap(5, 5, 5) - .addComponent(dummyAttachmentsPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addGap(0, 0, 0)) - ); - attachmentsSectionPanelLayout.setVerticalGroup( - attachmentsSectionPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(attachmentsSectionPanelLayout.createSequentialGroup() - .addGap(0, 0, 0) - .addGroup(attachmentsSectionPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(dummyAttachmentsPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(attachmentsWarning, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addGap(0, 0, 0)) - ); - - commentsSectionPanel.setBackground(javax.swing.UIManager.getDefaults().getColor("TextArea.background")); - - javax.swing.GroupLayout commentsSectionPanelLayout = new javax.swing.GroupLayout(commentsSectionPanel); - commentsSectionPanel.setLayout(commentsSectionPanelLayout); - commentsSectionPanelLayout.setHorizontalGroup( - commentsSectionPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(commentsSectionPanelLayout.createSequentialGroup() - .addGap(0, 0, 0) - .addComponent(dummyCommentsPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addGap(0, 0, 0)) - ); - commentsSectionPanelLayout.setVerticalGroup( - commentsSectionPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(commentsSectionPanelLayout.createSequentialGroup() - .addGap(0, 0, 0) - .addComponent(dummyCommentsPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addGap(0, 0, 0)) - ); - - newCommentSectionPanel.setBackground(javax.swing.UIManager.getDefaults().getColor("TextArea.background")); - - scrollPane1.setVerticalScrollBarPolicy(javax.swing.ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER); - - addCommentArea.setLineWrap(true); - addCommentArea.setWrapStyleWord(true); - scrollPane1.setViewportView(addCommentArea); - addCommentArea.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(IssuePanel.class, "IssuePanel.addCommentArea.AccessibleContext.accessibleDescription")); // NOI18N - - attachLogCheckBox.setBackground(javax.swing.UIManager.getDefaults().getColor("TextArea.background")); - org.openide.awt.Mnemonics.setLocalizedText(attachLogCheckBox, org.openide.util.NbBundle.getMessage(IssuePanel.class, "IssuePanel.attachLogCheckBox.text")); // NOI18N - attachLogCheckBox.addActionListener(formListener); - - org.openide.awt.Mnemonics.setLocalizedText(viewLogButton, org.openide.util.NbBundle.getMessage(IssuePanel.class, "IssuePanel.viewLogButton.text")); // NOI18N - viewLogButton.addActionListener(formListener); - - messagePanel.setLayout(new javax.swing.BoxLayout(messagePanel, javax.swing.BoxLayout.PAGE_AXIS)); - - javax.swing.GroupLayout newCommentSectionPanelLayout = new javax.swing.GroupLayout(newCommentSectionPanel); - newCommentSectionPanel.setLayout(newCommentSectionPanelLayout); - newCommentSectionPanelLayout.setHorizontalGroup( - newCommentSectionPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(newCommentSectionPanelLayout.createSequentialGroup() - .addGap(0, 0, 0) - .addComponent(commentWarning, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE) - .addGap(5, 5, 5) - .addGroup(newCommentSectionPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(messagePanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addGroup(newCommentSectionPanelLayout.createSequentialGroup() - .addComponent(attachLogCheckBox) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(viewLogButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addComponent(scrollPane1)) - .addGap(0, 0, 0)) - ); - newCommentSectionPanelLayout.setVerticalGroup( - newCommentSectionPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(newCommentSectionPanelLayout.createSequentialGroup() - .addGap(0, 0, 0) - .addGroup(newCommentSectionPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(commentWarning, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(scrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) - .addGroup(newCommentSectionPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) - .addComponent(viewLogButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(attachLogCheckBox)) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(messagePanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addGap(0, 0, 0)) - ); - - privatePanel.setBackground(javax.swing.UIManager.getDefaults().getColor("TextArea.background")); - - dueDateLabel.setLabelFor(dummyDueDateField); - org.openide.awt.Mnemonics.setLocalizedText(dueDateLabel, org.openide.util.NbBundle.getMessage(IssuePanel.class, "IssuePanel.dueDateLabel.text")); // NOI18N - dueDateLabel.setToolTipText(org.openide.util.NbBundle.getMessage(IssuePanel.class, "IssuePanel.dueDateLabel.TTtext")); // NOI18N - - scheduleDateLabel.setLabelFor(dummyScheduleDateField); - org.openide.awt.Mnemonics.setLocalizedText(scheduleDateLabel, org.openide.util.NbBundle.getMessage(IssuePanel.class, "IssuePanel.scheduleDateLabel.text")); // NOI18N - scheduleDateLabel.setToolTipText(org.openide.util.NbBundle.getMessage(IssuePanel.class, "IssuePanel.scheduleDateLabel.TTtext")); // NOI18N - - estimateLabel.setLabelFor(estimatedField); - org.openide.awt.Mnemonics.setLocalizedText(estimateLabel, org.openide.util.NbBundle.getMessage(IssuePanel.class, "IssuePanel.estimateLabel.text")); // NOI18N - estimateLabel.setToolTipText(org.openide.util.NbBundle.getMessage(IssuePanel.class, "IssuePanel.estimateLabel.TTtext")); // NOI18N - - estimateField.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(estimateFormatter)); - estimateField.setText("0"); - estimateField.setToolTipText(org.openide.util.NbBundle.getMessage(IssuePanel.class, "IssuePanel.estimateField.toolTipText")); // NOI18N - - notesLabel.setLabelFor(privateNotesField); - org.openide.awt.Mnemonics.setLocalizedText(notesLabel, org.openide.util.NbBundle.getMessage(IssuePanel.class, "IssuePanel.notesLabel.text")); // NOI18N - notesLabel.setToolTipText(org.openide.util.NbBundle.getMessage(IssuePanel.class, "IssuePanel.notesLabel.TTtext")); // NOI18N - - privateNotesField.setColumns(20); - privateNotesField.setLineWrap(true); - privateNotesField.setWrapStyleWord(true); - privateNotesScrollPane.setViewportView(privateNotesField); - - javax.swing.GroupLayout privatePanelLayout = new javax.swing.GroupLayout(privatePanel); - privatePanel.setLayout(privatePanelLayout); - privatePanelLayout.setHorizontalGroup( - privatePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(privatePanelLayout.createSequentialGroup() - .addGroup(privatePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) - .addComponent(notesLabel) - .addComponent(dueDateLabel)) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addGroup(privatePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(privatePanelLayout.createSequentialGroup() - .addComponent(dummyDueDateField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) - .addComponent(scheduleDateLabel) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(dummyScheduleDateField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) - .addComponent(estimateLabel) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(estimateField, javax.swing.GroupLayout.PREFERRED_SIZE, 65, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addComponent(privateNotesScrollPane))) - ); - privatePanelLayout.setVerticalGroup( - privatePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(privatePanelLayout.createSequentialGroup() - .addGroup(privatePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) - .addComponent(dueDateLabel) - .addComponent(dummyDueDateField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(scheduleDateLabel) - .addComponent(dummyScheduleDateField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(estimateLabel) - .addComponent(estimateField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) - .addGroup(privatePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(notesLabel) - .addComponent(privateNotesScrollPane, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))) - ); - - jComboBox1.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" })); - - setBackground(javax.swing.UIManager.getDefaults().getColor("TextArea.background")); - - headerPanel.setBackground(javax.swing.UIManager.getDefaults().getColor("TextArea.background")); - - headerField.setEditable(false); - headerField.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0)); - - buttonsPanel.setBackground(javax.swing.UIManager.getDefaults().getColor("TextArea.background")); - - separatorLabel4.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0))); - - separatorLabel6.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0))); - - separatorLabel3.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0))); - - separatorDismissButton.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0))); - - org.openide.awt.Mnemonics.setLocalizedText(refreshButton, org.openide.util.NbBundle.getMessage(IssuePanel.class, "IssuePanel.refreshButton.text")); // NOI18N - refreshButton.setToolTipText(org.openide.util.NbBundle.getMessage(IssuePanel.class, "IssuePanel.refreshButton.toolTipText")); // NOI18N - refreshButton.addActionListener(formListener); - - org.openide.awt.Mnemonics.setLocalizedText(cancelButton, org.openide.util.NbBundle.getMessage(IssuePanel.class, "IssuePanel.cancelButton.text")); // NOI18N - cancelButton.addActionListener(formListener); - - org.openide.awt.Mnemonics.setLocalizedText(showInBrowserButton, org.openide.util.NbBundle.getMessage(IssuePanel.class, "IssuePanel.showInBrowserButton.text")); // NOI18N - showInBrowserButton.addActionListener(formListener); - - org.openide.awt.Mnemonics.setLocalizedText(submitButton, org.openide.util.NbBundle.getMessage(IssuePanel.class, "IssuePanel.submitButton.text")); // NOI18N - submitButton.addActionListener(formListener); - - org.openide.awt.Mnemonics.setLocalizedText(btnDeleteTask, org.openide.util.NbBundle.getMessage(IssuePanel.class, "IssuePanel.btnDeleteTask.text")); // NOI18N - btnDeleteTask.setToolTipText(org.openide.util.NbBundle.getMessage(IssuePanel.class, "IssuePanel.btnDeleteTask.TTtext")); // NOI18N - btnDeleteTask.addActionListener(formListener); - - javax.swing.GroupLayout buttonsPanelLayout = new javax.swing.GroupLayout(buttonsPanel); - buttonsPanel.setLayout(buttonsPanelLayout); - buttonsPanelLayout.setHorizontalGroup( - buttonsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(buttonsPanelLayout.createSequentialGroup() - .addContainerGap() - .addComponent(refreshButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(separatorLabel3) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(showInBrowserButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(separatorLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, 2, javax.swing.GroupLayout.PREFERRED_SIZE) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(submitButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(separatorLabel6, javax.swing.GroupLayout.PREFERRED_SIZE, 2, javax.swing.GroupLayout.PREFERRED_SIZE) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(cancelButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(separatorDismissButton, javax.swing.GroupLayout.PREFERRED_SIZE, 2, javax.swing.GroupLayout.PREFERRED_SIZE) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(btnDeleteTask, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addGap(0, 0, 0)) - ); - buttonsPanelLayout.setVerticalGroup( - buttonsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(buttonsPanelLayout.createSequentialGroup() - .addGap(0, 0, 0) - .addGroup(buttonsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER) - .addComponent(refreshButton, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addComponent(separatorLabel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addComponent(showInBrowserButton, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addComponent(separatorLabel4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addComponent(submitButton, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addComponent(cancelButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(separatorLabel6, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addComponent(btnDeleteTask, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(separatorDismissButton, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))) - ); - - buttonsPanelLayout.linkSize(javax.swing.SwingConstants.VERTICAL, new java.awt.Component[] {refreshButton, separatorLabel3, showInBrowserButton}); - - refreshButton.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(IssuePanel.class, "IssuePanel.refreshButton.AccessibleContext.accessibleDescription")); // NOI18N - cancelButton.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(IssuePanel.class, "IssuePanel.cancelButton.AccessibleContext.accessibleDescription")); // NOI18N - submitButton.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(IssuePanel.class, "IssuePanel.submitButton.AccessibleContext.accessibleDescription")); // NOI18N - - javax.swing.GroupLayout headerPanelLayout = new javax.swing.GroupLayout(headerPanel); - headerPanel.setLayout(headerPanelLayout); - headerPanelLayout.setHorizontalGroup( - headerPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(headerPanelLayout.createSequentialGroup() - .addContainerGap() - .addComponent(headerField) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(buttonsPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addContainerGap()) - ); - headerPanelLayout.setVerticalGroup( - headerPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(headerPanelLayout.createSequentialGroup() - .addContainerGap() - .addGroup(headerPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER) - .addComponent(headerField) - .addComponent(buttonsPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addContainerGap()) - ); - - mainScrollPane.setBorder(null); - - mainPanel.setBackground(javax.swing.UIManager.getDefaults().getColor("TextArea.background")); - - attributesSection.setBackground(javax.swing.UIManager.getDefaults().getColor("TextArea.background")); - attributesSection.setActions(getAttributesSectionActions()); - attributesSection.setContent(attributesSectionPanel); - attributesSection.setLabel(org.openide.util.NbBundle.getMessage(IssuePanel.class, "IssuePanel.attributesSection.label")); // NOI18N - - attachmentsSection.setBackground(javax.swing.UIManager.getDefaults().getColor("TextArea.background")); - attachmentsSection.setContent(attachmentsSectionPanel); - attachmentsSection.setExpanded(false); - attachmentsSection.setLabel(org.openide.util.NbBundle.getMessage(IssuePanel.class, "IssuePanel.attachmentsLabel.text", 0)); // NOI18N - - newCommentSection.setBackground(javax.swing.UIManager.getDefaults().getColor("TextArea.background")); - newCommentSection.setContent(newCommentSectionPanel); - newCommentSection.setLabel(org.openide.util.NbBundle.getMessage(IssuePanel.class, "IssuePanel.newCommentSection.label")); // NOI18N - - jPanel1.setBackground(javax.swing.UIManager.getDefaults().getColor("TextArea.background")); - - commentsSection.setBackground(javax.swing.UIManager.getDefaults().getColor("TextArea.background")); - commentsSection.setActions(getCommentsSectionActions()); - commentsSection.setContent(commentsSectionPanel); - commentsSection.setLabel(org.openide.util.NbBundle.getMessage(IssuePanel.class, "IssuePanel.commentsLabel.text", 0)); // NOI18N - - javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); - jPanel1.setLayout(jPanel1Layout); - jPanel1Layout.setHorizontalGroup( - jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(jPanel1Layout.createSequentialGroup() - .addGap(0, 0, 0) - .addComponent(commentsSection, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addGap(0, 0, 0)) - ); - jPanel1Layout.setVerticalGroup( - jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(jPanel1Layout.createSequentialGroup() - .addGap(0, 0, 0) - .addComponent(commentsSection, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addGap(0, 0, 0)) - ); - - privateSection.setBackground(javax.swing.UIManager.getDefaults().getColor("TextArea.background")); - privateSection.setActions(getPrivateSectionActions()); - privateSection.setContent(privatePanel); - privateSection.setLabel(org.openide.util.NbBundle.getMessage(IssuePanel.class, "IssuePanel.privateAttributesSection.text")); // NOI18N - - javax.swing.GroupLayout mainPanelLayout = new javax.swing.GroupLayout(mainPanel); - mainPanel.setLayout(mainPanelLayout); - mainPanelLayout.setHorizontalGroup( - mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(mainPanelLayout.createSequentialGroup() - .addContainerGap() - .addGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(attributesSection, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addComponent(attachmentsSection, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addComponent(privateSection, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addComponent(newCommentSection, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) - .addContainerGap()) - ); - mainPanelLayout.setVerticalGroup( - mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(mainPanelLayout.createSequentialGroup() - .addContainerGap() - .addComponent(attributesSection, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) - .addComponent(attachmentsSection, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) - .addComponent(privateSection, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) - .addComponent(newCommentSection, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) - .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addContainerGap()) - ); - - mainScrollPane.setViewportView(mainPanel); - - javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); - this.setLayout(layout); - layout.setHorizontalGroup( - layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(headerPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addComponent(mainScrollPane) - ); - layout.setVerticalGroup( - layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(layout.createSequentialGroup() - .addGap(0, 0, 0) - .addComponent(headerPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addGap(0, 0, 0) - .addComponent(mainScrollPane)) - ); - } - - // Code for dispatching events from components to event handlers. - - private class FormListener implements java.awt.event.ActionListener, java.awt.event.FocusListener { - FormListener() {} - public void actionPerformed(java.awt.event.ActionEvent evt) { - if (evt.getSource() == refreshButton) { - IssuePanel.this.refreshButtonActionPerformed(evt); - } - else if (evt.getSource() == cancelButton) { - IssuePanel.this.cancelButtonActionPerformed(evt); - } - else if (evt.getSource() == showInBrowserButton) { - IssuePanel.this.showInBrowserButtonActionPerformed(evt); - } - else if (evt.getSource() == submitButton) { - IssuePanel.this.submitButtonActionPerformed(evt); - } - else if (evt.getSource() == btnDeleteTask) { - IssuePanel.this.btnDeleteTaskActionPerformed(evt); - } - else if (evt.getSource() == resolutionCombo) { - IssuePanel.this.resolutionComboActionPerformed(evt); - } - else if (evt.getSource() == assignedCombo) { - IssuePanel.this.assignedComboActionPerformed(evt); - } - else if (evt.getSource() == osCombo) { - IssuePanel.this.osComboActionPerformed(evt); - } - else if (evt.getSource() == dependsOnButton) { - IssuePanel.this.dependsOnButtonActionPerformed(evt); - } - else if (evt.getSource() == componentCombo) { - IssuePanel.this.componentComboActionPerformed(evt); - } - else if (evt.getSource() == urlLabel) { - IssuePanel.this.urlButtonActionPerformed(evt); - } - else if (evt.getSource() == priorityCombo) { - IssuePanel.this.priorityComboActionPerformed(evt); - } - else if (evt.getSource() == issueTypeCombo) { - IssuePanel.this.issueTypeComboActionPerformed(evt); - } - else if (evt.getSource() == blocksButton) { - IssuePanel.this.blocksButtonActionPerformed(evt); - } - else if (evt.getSource() == duplicateButton) { - IssuePanel.this.duplicateButtonActionPerformed(evt); - } - else if (evt.getSource() == productCombo) { - IssuePanel.this.productComboActionPerformed(evt); - } - else if (evt.getSource() == versionCombo) { - IssuePanel.this.versionComboActionPerformed(evt); - } - else if (evt.getSource() == platformCombo) { - IssuePanel.this.platformComboActionPerformed(evt); - } - else if (evt.getSource() == severityCombo) { - IssuePanel.this.severityComboActionPerformed(evt); - } - else if (evt.getSource() == targetMilestoneCombo) { - IssuePanel.this.targetMilestoneComboActionPerformed(evt); - } - else if (evt.getSource() == statusCombo) { - IssuePanel.this.statusComboActionPerformed(evt); - } - else if (evt.getSource() == keywordsButton) { - IssuePanel.this.keywordsButtonActionPerformed(evt); - } - else if (evt.getSource() == attachLogCheckBox) { - IssuePanel.this.attachLogCheckBoxActionPerformed(evt); - } - else if (evt.getSource() == viewLogButton) { - IssuePanel.this.viewLogButtonActionPerformed(evt); - } - else if (evt.getSource() == reproducibilityCombo) { - IssuePanel.this.reproducibilityComboActionPerformed(evt); - } - } - - public void focusGained(java.awt.event.FocusEvent evt) { - } - - public void focusLost(java.awt.event.FocusEvent evt) { - if (evt.getSource() == workedField) { - IssuePanel.this.workedFieldFocusLost(evt); - } - } - }// //GEN-END:initComponents - - private void productComboActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_productComboActionPerformed - productChanged(true); - }//GEN-LAST:event_productComboActionPerformed - - private boolean productChanged(boolean reload) { - cancelHighlight(productLabel); - // Reload componentCombo, versionCombo and targetMilestoneCombo - BugzillaRepository repository = issue.getRepository(); - BugzillaConfiguration bc = repository.getConfiguration(); - if (bc == null || !bc.isValid()) { - // XXX nice error msg? - return true; - } - String product = productCombo.getSelectedItem().toString(); - Object component = componentCombo.getSelectedItem(); - Object version = versionCombo.getSelectedItem(); - Object targetMilestone = targetMilestoneCombo.getSelectedItem(); - componentCombo.setModel(toComboModel(bc.getComponents(product))); - versionCombo.setModel(toComboModel(bc.getVersions(product))); - List targetMilestones = bc.getTargetMilestones(product); - usingTargetMilestones = !targetMilestones.isEmpty(); - targetMilestoneCombo.setModel(toComboModel(targetMilestones)); - // Attempt to keep selection - if (!selectInCombo(componentCombo, component, false)) { - if (issue.isNew() && componentCombo.getModel().getSize() > 0 - || componentCombo.getModel().getSize() == 1) { - componentCombo.setSelectedIndex(0); - } else { - componentCombo.setSelectedItem(null); - } - storeFieldValueForNewIssue(IssueField.COMPONENT, componentCombo); - } - if (!selectInCombo(versionCombo, version, false)) { - if (issue.isNew() && versionCombo.getModel().getSize() > 0 - || versionCombo.getModel().getSize() == 1) { - versionCombo.setSelectedIndex(0); - } else { - versionCombo.setSelectedItem(null); - } - storeFieldValueForNewIssue(IssueField.VERSION, versionCombo); - } - if (usingTargetMilestones) { - if (!selectInCombo(targetMilestoneCombo, targetMilestone, false)) { - if (issue.isNew() && targetMilestoneCombo.getModel().getSize() > 0 - || targetMilestoneCombo.getModel().getSize() == 1) { - targetMilestoneCombo.setSelectedIndex(0); - } else { - targetMilestoneCombo.setSelectedItem(null); - } - storeFieldValueForNewIssue(IssueField.MILESTONE, targetMilestoneCombo); - } - } - targetMilestoneLabel.setVisible(usingTargetMilestones); - targetMilestoneCombo.setVisible(usingTargetMilestones); - milestoneWarning.setVisible(usingTargetMilestones); - if (issue.isNew()) { - issue.setFieldValue(IssueField.PRODUCT, product); - if (BugzillaUtil.isNbRepository(repository)) { // IssueProvider 180467, 184412 - // Default target milestone - List milestones = repository.getConfiguration().getTargetMilestones(product); - String defaultMilestone = "TBD"; // NOI18N - if (milestones.contains(defaultMilestone)) { - issue.setFieldValue(IssueField.MILESTONE, defaultMilestone); - } - // Default version - List versions = repository.getConfiguration().getVersions(product); - String defaultVersion = getCurrentNetBeansVersion(); - for (String v : versions) { - if (v.trim().equalsIgnoreCase(defaultVersion)) { - issue.setFieldValue(IssueField.VERSION, v); - } - } - } - if(reload) { // But the reloaders, the vile, the murderers ... and all liars—they will be consigned to the fiery lake of burning sulfur. This is the second death. - if (reloading) { - // reload when current refresh of components finishes - EventQueue.invokeLater(new Runnable () { - @Override - public void run () { - reloadForm(false); - } - }); - } else { - reloadForm(false); - } - } - } - return false; - } - - private void statusComboActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_statusComboActionPerformed - cancelHighlight(statusLabel); - cancelHighlight(resolutionLabel); - // Hide/show resolution combo - if ("RESOLVED".equals(statusCombo.getSelectedItem())) { // NOI18N - if (resolutionCombo.getParent() == null) { - ((GroupLayout) attributesSectionPanel.getLayout()).replace(resolutionField, resolutionCombo); - } - boolean setResolution = !resolutionCombo.isVisible(); - resolutionCombo.setVisible(true); - resolutionWarning.setVisible(true); - resolutionLabel.setVisible(true); - String resolution = issue.getRepositoryFieldValue(IssueField.RESOLUTION); - if (resolution.isEmpty()) { - resolution = "FIXED"; //NOI18N - } - if (setResolution) { - resolutionCombo.setSelectedItem(resolution); - } - } else { - resolutionCombo.setVisible(false); - resolutionLabel.setVisible(false); - resolutionWarning.setVisible(false); - updateFieldDecorations(resolutionCombo, IssueField.RESOLUTION, resolutionWarning, resolutionLabel); - duplicateLabel.setVisible(false); - duplicateWarning.setVisible(false); - duplicateField.setVisible(false); - duplicateButton.setVisible(false); - updateFieldDecorations(duplicateField, IssueField.DUPLICATE_ID, duplicateWarning, duplicateLabel); - updateNoDuplicateId(); - } - if (!resolutionField.getText().trim().equals("")) { // NOI18N - if (statusCombo.getSelectedIndex() > resolvedIndex) { - if (resolutionField.getParent() == null) { - ((GroupLayout) attributesSectionPanel.getLayout()).replace(resolutionCombo, resolutionField); - } - resolutionField.setVisible(true); - } else { - resolutionField.setVisible(false); - } - duplicateLabel.setVisible(false); - duplicateWarning.setVisible(false); - duplicateField.setVisible(false); - duplicateButton.setVisible(false); - updateFieldDecorations(duplicateField, IssueField.DUPLICATE_ID, duplicateWarning, duplicateLabel); - updateNoDuplicateId(); - } - resolutionLabel.setLabelFor(resolutionCombo.isVisible() ? resolutionCombo : resolutionField); - }//GEN-LAST:event_statusComboActionPerformed - - private void storeCCValue() { - Set oldCCs = ccs(issue.getRepositoryFieldValue(IssueField.CC)); - Set newCCs = ccs(ccField.getText()); - - String removedCCs = getMissingCCs(oldCCs, newCCs); - String addedCCs = getMissingCCs(newCCs, oldCCs); - - addUnsavedField(IssueField.CC.getKey()); - issue.setFieldValues(IssueField.CC, new ArrayList<>(ccs(ccField.getText()))); - storeFieldValue(IssueField.REMOVECC, removedCCs); - storeFieldValue(IssueField.NEWCC, addedCCs); - } - - private Set ccs(String values) { - Set ccs = new LinkedHashSet<>(); - StringTokenizer st = new StringTokenizer(values, ", \t\n\r\f"); // NOI18N - while (st.hasMoreTokens()) { - ccs.add(st.nextToken()); - } - return ccs; - } - - private String getMissingCCs(Set ccs, Set missingIn) { - StringBuilder ret = new StringBuilder(); - Iterator it = ccs.iterator(); - while(it.hasNext()) { - String cc = it.next(); - if(cc.trim().equals("")) continue; - if(!missingIn.contains(cc)) { - ret.append(cc); - if(it.hasNext()) { - ret.append(','); - } - } - } - return ret.toString(); - } - - private void refreshButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_refreshButtonActionPerformed - String refreshMessageFormat = NbBundle.getMessage(IssuePanel.class, "IssuePanel.refreshMessage"); // NOI18N - String refreshMessage = MessageFormat.format(refreshMessageFormat, issue.getID()); - final ProgressHandle handle = ProgressHandleFactory.createHandle(refreshMessage); - handle.start(); - handle.switchToIndeterminate(); - skipReload = true; - enableComponents(false); - RP.post(new Runnable() { - @Override - public void run() { - try { - issue.updateModelAndRefresh(); - } finally { - EventQueue.invokeLater(new Runnable() { - @Override - public void run() { - enableComponents(true); - skipReload = false; - } - }); - handle.finish(); - reloadFormInAWT(true); - } - } - }); - }//GEN-LAST:event_refreshButtonActionPerformed - - private void resolutionComboActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_resolutionComboActionPerformed - cancelHighlight(resolutionLabel); - if (resolutionCombo.getParent() == null) { - return; - } - boolean shown = "DUPLICATE".equals(resolutionCombo.getSelectedItem()); // NOI18N - duplicateLabel.setVisible(shown); - duplicateWarning.setVisible(shown); - duplicateField.setVisible(shown); - duplicateButton.setVisible(shown && duplicateField.isEditable()); - updateFieldDecorations(duplicateField, IssueField.DUPLICATE_ID, duplicateWarning, duplicateLabel); - updateNoDuplicateId(); - }//GEN-LAST:event_resolutionComboActionPerformed - - private void keywordsButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_keywordsButtonActionPerformed - String message = NbBundle.getMessage(IssuePanel.class, "IssuePanel.keywordsButton.message"); // NOI18N - String kws = BugzillaUtil.getKeywords(message, keywordsField.getText(), issue.getRepository()); - keywordsField.setText(kws); - }//GEN-LAST:event_keywordsButtonActionPerformed - - private void blocksButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_blocksButtonActionPerformed - Issue i = IssueQuickSearch.selectIssue( - NbBundle.getMessage(IssuePanel.class, "IssuePanel.blocksButton.message"), // NOI18N - BugzillaUtil.getRepository(issue.getRepository()), - this, - new HelpCtx("org.netbeans.modules.bugzilla.blocksChooser")); // NOI18N - if (i != null) { - String newIssueID = i.getID(); - StringBuilder sb = new StringBuilder(); - if (!blocksField.getText().trim().equals("")) { // NOI18N - sb.append(blocksField.getText()).append(',').append(' '); - } - sb.append(newIssueID); - blocksField.setText(sb.toString()); - } - }//GEN-LAST:event_blocksButtonActionPerformed - - private void dependsOnButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_dependsOnButtonActionPerformed - Issue i = IssueQuickSearch.selectIssue( - NbBundle.getMessage(IssuePanel.class, "IssuePanel.dependsOnButton.message"), // NOI18N - BugzillaUtil.getRepository(issue.getRepository()), - this, - new HelpCtx("org.netbeans.modules.bugzilla.dependsOnChooser")); // NOI18N - if (i != null) { - String newIssueID = i.getID(); - StringBuilder sb = new StringBuilder(); - if (!dependsField.getText().trim().equals("")) { // NOI18N - sb.append(dependsField.getText()).append(',').append(' '); - } - sb.append(newIssueID); - dependsField.setText(sb.toString()); - } - }//GEN-LAST:event_dependsOnButtonActionPerformed - - private void componentComboActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_componentComboActionPerformed - cancelHighlight(componentLabel); - updateNoComponent(); - }//GEN-LAST:event_componentComboActionPerformed - - private void versionComboActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_versionComboActionPerformed - cancelHighlight(versionLabel); - updateNoVersion(); - }//GEN-LAST:event_versionComboActionPerformed - - private void platformComboActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_platformComboActionPerformed - cancelHighlight(platformLabel); - }//GEN-LAST:event_platformComboActionPerformed - - private void priorityComboActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_priorityComboActionPerformed - cancelHighlight(priorityLabel); - }//GEN-LAST:event_priorityComboActionPerformed - - private void severityComboActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_severityComboActionPerformed - cancelHighlight(priorityLabel); - }//GEN-LAST:event_severityComboActionPerformed - - private void targetMilestoneComboActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_targetMilestoneComboActionPerformed - cancelHighlight(targetMilestoneLabel); - updateNoTargetMilestone(); - }//GEN-LAST:event_targetMilestoneComboActionPerformed - - private void osComboActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_osComboActionPerformed - cancelHighlight(platformLabel); - }//GEN-LAST:event_osComboActionPerformed - - private void reloadButtonActionPerformed(java.awt.event.ActionEvent evt) { - String reloadMessage = NbBundle.getMessage(IssuePanel.class, "IssuePanel.reloadMessage"); // NOI18N - final ProgressHandle handle = ProgressHandleFactory.createHandle(reloadMessage); - handle.start(); - handle.switchToIndeterminate(); - skipReload = true; - enableComponents(false); - RP.post(new Runnable() { - @Override - public void run() { - issue.getRepository().refreshConfiguration(); - EventQueue.invokeLater(new Runnable() { - @Override - public void run() { - try { - reloading = true; - Object product = productCombo.getSelectedItem(); - Object platform = platformCombo.getSelectedItem(); - Object os = osCombo.getSelectedItem(); - Object priority = priorityCombo.getSelectedItem(); - Object severity = severityCombo.getSelectedItem(); - Object resolution = resolutionCombo.getSelectedItem(); - Object issueType = issueTypeCombo.getSelectedItem(); - initCombos(); - initCustomFields(); - selectInCombo(productCombo, product, false); - productChanged(false); - selectInCombo(platformCombo, platform, false); - selectInCombo(osCombo, os, false); - selectInCombo(priorityCombo, priority, false); - selectInCombo(severityCombo, severity, false); - initStatusCombo(statusCombo.getSelectedItem().toString()); - selectInCombo(resolutionCombo, resolution, false); - if (BugzillaUtil.isNbRepository(issue.getRepository())) { - issueTypeCombo.setSelectedItem(issueType); - } - reloadCustomFields(true); - updateCustomFieldStatuses(); - } finally { - reloading = false; - enableComponents(true); - skipReload = false; - } - } - }); - handle.finish(); - } - }); - } - - private void duplicateButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_duplicateButtonActionPerformed - Issue i = IssueQuickSearch.selectIssue( - NbBundle.getMessage(IssuePanel.class, "IssuePanel.duplicateButton.message"), //NOI18N - BugzillaUtil.getRepository(issue.getRepository()), - this, - new HelpCtx("org.netbeans.modules.bugzilla.duplicateChooser")); // NOI18N - if (i != null) { - String newIssueID = i.getID(); - duplicateField.setText(newIssueID); - } - }//GEN-LAST:event_duplicateButtonActionPerformed - - private void assignedComboActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_assignedComboActionPerformed - cancelHighlight(assignedLabel); - if (!reloading) { - assignedToStatusLabel.setVisible(false); - } - Object value = assignedCombo.getSelectedItem(); - if (value instanceof RepositoryUser) { - String assignee = ((RepositoryUser)value).getUserName(); - BugzillaRepository repository = issue.getRepository(); - assignedCombo.setSelectedItem(assignee); - } - }//GEN-LAST:event_assignedComboActionPerformed - - private void issueTypeComboActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_issueTypeComboActionPerformed - cancelHighlight(issueTypeLabel); - }//GEN-LAST:event_issueTypeComboActionPerformed - - private void showInBrowserButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_showInBrowserButtonActionPerformed - try { - URL url = new URL(issue.getRepository().getUrl() + BugzillaConstants.URL_SHOW_BUG + issue.getID()); - HtmlBrowser.URLDisplayer.getDefault().showURL(url); - } catch (MalformedURLException muex) { - Bugzilla.LOG.log(Level.INFO, "Unable to show the issue in the browser.", muex); // NOI18N - } - }//GEN-LAST:event_showInBrowserButtonActionPerformed - -private void urlButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_urlButtonActionPerformed - String urlString = urlField.getText(); - if(urlString.isEmpty()) { - return; - } - URL url = null; - try { - url = new URL(urlString); - } catch (MalformedURLException muex) { - if(issue != null) { - String repoUrlString = issue.getRepository().getUrl(); - urlString = repoUrlString + (repoUrlString.endsWith("/") ? "" : "/") + urlString; // NOI18N - try { - url = new URL(urlString); - } catch (MalformedURLException ex) { - Bugzilla.LOG.log(Level.INFO, "Unable to open " + urlString, muex); // NOI18N - } - } - } - if(url != null) { - HtmlBrowser.URLDisplayer.getDefault().showURL(url); - } -}//GEN-LAST:event_urlButtonActionPerformed -private void workedFieldFocusLost(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_workedFieldFocusLost - if(!"".equals(workedField.getText().trim())) { - String workedString = workedField.getText().trim(); - if(!workedString.trim().equals("")) { - try { - Double.parseDouble(workedString); - } catch (NumberFormatException e) { - return; - } - } - double actual = getDoubleValue(actualField); - double worked = getDoubleValue(workedField); - double workedSum = getDoubleValue(workedSumField); - - double remaining = actual - worked - workedSum; - if(remaining > 0) { - remainingField.setText(String.valueOf(remaining)); - } else { - remainingField.setText("0"); // NOI18N - } - } -}//GEN-LAST:event_workedFieldFocusLost - - private void attachLogCheckBoxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_attachLogCheckBoxActionPerformed - switchViewLog(); - }//GEN-LAST:event_attachLogCheckBoxActionPerformed - - private void viewLogButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_viewLogButtonActionPerformed - showLogFile(evt); - }//GEN-LAST:event_viewLogButtonActionPerformed - - private void submitButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_submitButtonActionPerformed - final boolean isNew = issue.isNew(); - if(isNew && reproducibilityCombo.isVisible()) { - String repro = NbBundle.getMessage(IssuePanel.class, "IssuePanel.reproducibilityCommitText", (String) reproducibilityCombo.getSelectedItem()); // NOI18N - String comment = addCommentArea.getText(); - String nbInfo = getNetbeansInfo(); - int idx = nbInfo.lastIndexOf("\n"); // NOI18N - if(idx > 0) { - String s = nbInfo.substring(idx, nbInfo.length() - 1); - idx = comment.indexOf(s); - if(idx > 0) { - idx += s.length() + 1; - comment = comment.substring(0, idx) + "\n\n" + repro + comment.substring(idx); // NOI18N - } else { - comment = repro + "\n\n" + comment; // NOI18N - } - } else { - comment = repro + "\n\n" + comment; // NOI18N - } - issue.setFieldValue(IssueField.DESCRIPTION, comment); - } - - String submitMessage; - if (isNew) { - submitMessage = NbBundle.getMessage(IssuePanel.class, "IssuePanel.submitNewMessage"); // NOI18N - } else { - String submitMessageFormat = NbBundle.getMessage(IssuePanel.class, "IssuePanel.submitMessage"); // NOI18N - submitMessage = MessageFormat.format(submitMessageFormat, issue.getID()); - } - final ProgressHandle handle = ProgressHandleFactory.createHandle(submitMessage); - handle.start(); - handle.switchToIndeterminate(); - skipReload = true; - enableComponents(false); - RP.post(new Runnable() { - @Override - public void run() { - boolean submitOK = false; - try { - submitOK = issue.submitAndRefresh(); - } finally { - EventQueue.invokeLater(new Runnable() { - @Override - public void run() { - enableComponents(true); - skipReload = false; - } - }); - handle.finish(); - if(submitOK) { - if (isNew) { - // Show all custom fields, not only the ones shown on bug creation - EventQueue.invokeLater(new Runnable() { - @Override - public void run() { - initCustomFields(); - } - }); - } - reloadFormInAWT(true); - } - } - } - }); - }//GEN-LAST:event_submitButtonActionPerformed - - boolean saveSynchronously() { - boolean saved = false; - try { - saved = issue.save(); - } finally { - EventQueue.invokeLater(new Runnable() { - @Override - public void run() { - clearUnsavedFields(); - enableComponents(true); - updateFieldStatuses(); - cancelButton.setEnabled(issue.hasLocalEdits()); - skipReload = false; - } - }); - } - return saved; - } - - @NbBundle.Messages({ - "LBL_IssuePanel.cancelChanges.title=Cancel Local Edits?", - "MSG_IssuePanel.cancelChanges.message=Do you want to cancel all your local changes to this task?" - }) - private void cancelButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cancelButtonActionPerformed - if (JOptionPane.YES_OPTION != JOptionPane.showConfirmDialog(WindowManager.getDefault().getMainWindow(), - Bundle.MSG_IssuePanel_cancelChanges_message(), - Bundle.LBL_IssuePanel_cancelChanges_title(), JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE)) { - return; - } - discard(); - } - - void discard() { - skipReload = true; - enableComponents(false); - RP.post(new Runnable() { - @Override - public void run() { - boolean cleared = false; - try { - cleared = issue.discardLocalEdits(); - } finally { - final boolean fCleared = cleared; - EventQueue.invokeLater(new Runnable() { - @Override - public void run() { - clearUnsavedFields(); - enableComponents(true); - cancelButton.setEnabled(!fCleared); - skipReload = false; - reloadForm(true); - } - }); - } - } - }); - }//GEN-LAST:event_cancelButtonActionPerformed - - void clearUnsavedChanges() { - issue.clearUnsavedChanges(); - clearUnsavedFields(); - } - - private void clearUnsavedFields() { - boolean fire = !unsavedFields.isEmpty(); - unsavedFields.clear(); - if(fire) { - issue.fireChangeEvent(); - } - } - - private void addUnsavedField(String fieldName) { - boolean fire = unsavedFields.isEmpty(); - unsavedFields.add(fieldName); - if(fire) { - issue.fireChangeEvent(); - } - } - - boolean isChanged() { - return !initializingNewTask() && getIssue().hasUnsavedChanges(); - } - - @NbBundle.Messages({ - "LBL_IssuePanel.deleteTask.title=Delete New Task?", - "MSG_IssuePanel.deleteTask.message=Do you want to delete the new task permanently?" - }) - private void btnDeleteTaskActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnDeleteTaskActionPerformed - if (JOptionPane.YES_OPTION != JOptionPane.showConfirmDialog(WindowManager.getDefault().getMainWindow(), - Bundle.MSG_IssuePanel_deleteTask_message(), - Bundle.LBL_IssuePanel_deleteTask_title(), JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE)) { - return; - } - clearUnsavedChanges(); - Container tc = SwingUtilities.getAncestorOfClass(TopComponent.class, this); - if (tc instanceof TopComponent) { - ((TopComponent) tc).close(); - } - RP.post(new Runnable() { - @Override - public void run() { - issue.delete(); - } - }); - }//GEN-LAST:event_btnDeleteTaskActionPerformed - - private void reproducibilityComboActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_reproducibilityComboActionPerformed - updateNoReproducibility(); - }//GEN-LAST:event_reproducibilityComboActionPerformed - - // Variables declaration - do not modify//GEN-BEGIN:variables - private javax.swing.JTextField actualField; - private javax.swing.JLabel actualLabel; - private javax.swing.JLabel actualWarning; - private javax.swing.JTextArea addCommentArea; - private javax.swing.JCheckBox assignToDefaultCheckBox; - private javax.swing.JComboBox assignedCombo; - private javax.swing.JTextField assignedField; - private javax.swing.JLabel assignedLabel; - private javax.swing.JLabel assignedToStatusLabel; - private javax.swing.JLabel assignedToWarning; - private javax.swing.JCheckBox attachLogCheckBox; - private org.netbeans.modules.bugtracking.commons.CollapsibleSectionPanel attachmentsSection; - private javax.swing.JPanel attachmentsSectionPanel; - private javax.swing.JLabel attachmentsWarning; - private org.netbeans.modules.bugtracking.commons.CollapsibleSectionPanel attributesSection; - private javax.swing.JPanel attributesSectionPanel; - private javax.swing.JButton blocksButton; - private javax.swing.JTextField blocksField; - private javax.swing.JLabel blocksLabel; - private javax.swing.JLabel blocksWarning; - private org.netbeans.modules.bugtracking.commons.LinkButton btnDeleteTask; - private javax.swing.JPanel buttonsPanel; - private org.netbeans.modules.bugtracking.commons.LinkButton cancelButton; - private javax.swing.JTextField ccField; - private javax.swing.JLabel ccLabel; - private javax.swing.JLabel ccWarning; - private javax.swing.JLabel commentWarning; - private org.netbeans.modules.bugtracking.commons.CollapsibleSectionPanel commentsSection; - private javax.swing.JPanel commentsSectionPanel; - private javax.swing.JTextField completeField; - private javax.swing.JLabel completeLabel; - private javax.swing.JLabel completeWarning; - private javax.swing.JComboBox componentCombo; - private javax.swing.JLabel componentLabel; - private javax.swing.JLabel componentWarning; - private javax.swing.JPanel customFieldsPanelLeft; - private javax.swing.JPanel customFieldsPanelRight; - private javax.swing.JLabel deadlineLabel; - private javax.swing.JLabel deadlineWarning; - private javax.swing.JTextField dependsField; - private javax.swing.JLabel dependsLabel; - private javax.swing.JButton dependsOnButton; - private javax.swing.JLabel dependsOnWarning; - private javax.swing.JLabel dueDateLabel; - private javax.swing.JPanel dummyAttachmentsPanel; - private javax.swing.JPanel dummyCommentsPanel; - private javax.swing.JTextField dummyDeadlineField; - private javax.swing.JTextField dummyDueDateField; - private javax.swing.JLabel dummyLabel1; - private javax.swing.JLabel dummyLabel2; - private javax.swing.JLabel dummyLabel3; - private javax.swing.JTextField dummyScheduleDateField; - private javax.swing.JLabel dummyTimetrackingLabel; - private javax.swing.JPanel dummyTimetrackingPanel; - private javax.swing.JButton duplicateButton; - private javax.swing.JTextField duplicateField; - private javax.swing.JLabel duplicateLabel; - private javax.swing.JLabel duplicateWarning; - private javax.swing.JFormattedTextField estimateField; - private javax.swing.JLabel estimateLabel; - private javax.swing.JTextField estimatedField; - private javax.swing.JLabel estimatedLabel; - private javax.swing.JLabel estimatedWarning; - private javax.swing.JTextField gainField; - private javax.swing.JLabel gainLabel; - private javax.swing.JLabel gainWarning; - private javax.swing.JTextField headerField; - private javax.swing.JPanel headerPanel; - private javax.swing.JComboBox issueTypeCombo; - private javax.swing.JLabel issueTypeLabel; - private javax.swing.JLabel issueTypeWarning; - private javax.swing.JComboBox jComboBox1; - private javax.swing.JLabel jLabel7; - private javax.swing.JPanel jPanel1; - private javax.swing.JButton keywordsButton; - private javax.swing.JTextField keywordsField; - private javax.swing.JLabel keywordsLabel; - private javax.swing.JLabel keywordsWarning; - private javax.swing.JPanel mainPanel; - private javax.swing.JScrollPane mainScrollPane; - private javax.swing.JPanel messagePanel; - private javax.swing.JLabel milestoneWarning; - private javax.swing.JTextField modifiedField; - private javax.swing.JLabel modifiedLabel; - private org.netbeans.modules.bugtracking.commons.SectionPanel newCommentSection; - private javax.swing.JPanel newCommentSectionPanel; - private javax.swing.JLabel notesLabel; - private javax.swing.JComboBox osCombo; - private javax.swing.JComboBox platformCombo; - private javax.swing.JLabel platformLabel; - private javax.swing.JLabel platformWarning; - private javax.swing.JComboBox priorityCombo; - private javax.swing.JLabel priorityLabel; - private javax.swing.JLabel priorityWarning; - private javax.swing.JTextArea privateNotesField; - private javax.swing.JScrollPane privateNotesScrollPane; - private javax.swing.JPanel privatePanel; - private org.netbeans.modules.bugtracking.commons.CollapsibleSectionPanel privateSection; - private javax.swing.JComboBox productCombo; - private javax.swing.JTextField productField; - private javax.swing.JLabel productLabel; - private javax.swing.JLabel productWarning; - private javax.swing.JTextField qaContactField; - private javax.swing.JLabel qaContactLabel; - private javax.swing.JLabel qaContactWarning; - private org.netbeans.modules.bugtracking.commons.LinkButton refreshButton; - private javax.swing.JTextField remainingField; - private javax.swing.JLabel remainingLabel; - private javax.swing.JLabel remainingWarning; - private javax.swing.JTextField reportedField; - private javax.swing.JLabel reportedLabel; - private javax.swing.JLabel reportedStatusLabel; - private javax.swing.JComboBox reproducibilityCombo; - private javax.swing.JLabel reproducibilityLabel; - private javax.swing.JComboBox resolutionCombo; - private javax.swing.JTextField resolutionField; - private javax.swing.JLabel resolutionLabel; - private javax.swing.JLabel resolutionWarning; - private javax.swing.JLabel scheduleDateLabel; - private javax.swing.JScrollPane scrollPane1; - private javax.swing.JLabel separatorDismissButton; - private javax.swing.JLabel separatorLabel3; - private javax.swing.JLabel separatorLabel4; - private javax.swing.JLabel separatorLabel6; - private javax.swing.JComboBox severityCombo; - private org.netbeans.modules.bugtracking.commons.LinkButton showInBrowserButton; - private javax.swing.JComboBox statusCombo; - private javax.swing.JLabel statusLabel; - private javax.swing.JLabel statusWarning; - private javax.swing.JTextField statusWhiteboardField; - private javax.swing.JLabel statusWhiteboardLabel; - private javax.swing.JLabel statusWhiteboardWarning; - private org.netbeans.modules.bugtracking.commons.LinkButton submitButton; - private javax.swing.JTextField summaryField; - private javax.swing.JLabel summaryLabel; - private javax.swing.JLabel summaryWarning; - private javax.swing.JComboBox targetMilestoneCombo; - private javax.swing.JLabel targetMilestoneLabel; - private javax.swing.JLabel timetrackingLabel; - private javax.swing.JPanel timetrackingPanel; - private javax.swing.JLabel timetrackingWarning; - private javax.swing.JTextField urlField; - private org.netbeans.modules.bugtracking.commons.LinkButton urlLabel; - private javax.swing.JLabel urlWarning; - private javax.swing.JComboBox versionCombo; - private javax.swing.JLabel versionLabel; - private javax.swing.JLabel versionWarning; - private org.netbeans.modules.bugtracking.commons.LinkButton viewLogButton; - private javax.swing.JTextField workedField; - private javax.swing.JLabel workedLabel; - private javax.swing.JLabel workedSumField; - private javax.swing.JLabel workedWarning; - // End of variables declaration//GEN-END:variables - - void makeCaretVisible(JTextArea textArea) { - int pos = textArea.getCaretPosition(); - try { - Rectangle rec = textArea.getUI().modelToView(textArea, pos); - if (rec != null) { - Point p = SwingUtilities.convertPoint(textArea, rec.x, rec.y, this); - scrollRectToVisible(new Rectangle(p.x, p.y, rec.width, rec.height)); - } - } catch (BadLocationException blex) { - Bugzilla.LOG.log(Level.INFO, blex.getMessage(), blex); - } - } - - private static final String CURRENT_NB_VERSION = "8.1"; // NOI18N - private String getCurrentNetBeansVersion() { - String version = parseProductVersion(getProductVersionValue()); - if(version != null) { - if(version.equalsIgnoreCase("dev")) { // NOI18N - return CURRENT_NB_VERSION; - } else { - return version; - } - } - return CURRENT_NB_VERSION; - } - - static String parseProductVersion(String productVersionValue) { - Pattern p = Pattern.compile("NetBeans IDE\\s([a-zA-Z0-9\\.?]*)\\s?.*"); // NOI18N - Matcher m = p.matcher(productVersionValue); - if(m.matches()) { - String version = m.group(1); - if(version != null && !version.trim().isEmpty()) { - return version; - } - } - return null; - } - - private void addNetbeansInfo() { - assert issue.isNew(); - String infoTxt = getNetbeansInfo(); - addCommentArea.setText(infoTxt + "\n\n" + NbBundle.getMessage(IssuePanel.class, "IssuePanel.newIssue.netbeansDescTemplate")); // NOI18N - storeFieldValueForNewIssue(IssueField.DESCRIPTION, addCommentArea); - } - - private String getNetbeansInfo() throws MissingResourceException { - String format = NbBundle.getMessage(IssuePanel.class, "IssuePanel.newIssue.netbeansInfo"); // NOI18N - Object[] info = new Object[] { - getProductVersionValue(), - System.getProperty("os.name", "unknown"), // NOI18N - System.getProperty("os.version", "unknown"), // NOI18N - System.getProperty("os.arch", "unknown"), // NOI18N - System.getProperty("java.version", "unknown"), // NOI18N - System.getProperty("java.vm.name", "unknown"), // NOI18N - System.getProperty("java.vm.version", "") // NOI18N - }; - return MessageFormat.format(format, info); - } - - public static String getProductVersionValue () { - return MessageFormat.format( - NbBundle.getBundle("org.netbeans.core.startup.Bundle").getString("currentVersion"), // NOI18N - new Object[] {System.getProperty("netbeans.buildnumber")}); // NOI18N - } - - void opened() { - restoreSections(); - enableComponents(false); - issue.opened(); - opened = true; - } - - void closed() { - if(issue != null) { - persistSections(); - commentsPanel.storeSettings(); - opened = false; - issue.closed(); - } - } - - private void persistSections () { - if (!issue.isNew()) { - BugzillaConfig config = BugzillaConfig.getInstance(); - String repositoryId = issue.getRepository().getID(); - String taskId = issue.getID(); - config.setEditorSectionCollapsed(repositoryId, taskId, SECTION_ATTRIBUTES, !attributesSection.isExpanded()); - config.setEditorSectionCollapsed(repositoryId, taskId, SECTION_ATTACHMENTS, !attachmentsSection.isExpanded()); - config.setEditorSectionCollapsed(repositoryId, taskId, SECTION_COMMENTS, !commentsSection.isExpanded()); - config.setEditorSectionCollapsed(repositoryId, taskId, SECTION_PRIVATE, !privateSection.isExpanded()); - } - } - - private void restoreSections () { - BugzillaConfig config = BugzillaConfig.getInstance(); - String repositoryId = issue.getRepository().getID(); - String taskId = issue.getID(); - attributesSection.setExpanded(!config.isEditorSectionCollapsed(repositoryId, taskId, SECTION_ATTRIBUTES, false)); - attachmentsSection.setExpanded(!config.isEditorSectionCollapsed(repositoryId, taskId, SECTION_ATTACHMENTS, true)); - commentsSection.setExpanded(!config.isEditorSectionCollapsed(repositoryId, taskId, SECTION_COMMENTS, false)); - privateSection.setExpanded(!config.isEditorSectionCollapsed(repositoryId, taskId, SECTION_PRIVATE, true)); - } - - private double getDoubleValue(JComponent field) { - assert field instanceof JTextField || field instanceof JLabel; - - String txt; - if(field instanceof JTextField) { - txt = ((JTextField)field).getText(); - } else { - txt = ((JLabel)field).getText(); - } - if(txt.isEmpty()) return 0; - try { - return Double.parseDouble(txt); - } catch (NumberFormatException e) { - Bugzilla.LOG.log(Level.WARNING, txt, e); - return 0; - } - } - - static void showLogFile(ActionEvent evt) { - Action a = getShowLogAction(); - if(a != null) { - a.actionPerformed(null); - } - } - - static Action getShowLogAction() { - return FileUtil.getConfigObject("Actions/View/org-netbeans-core-actions-LogAction.instance", Action.class); // NOI18N - } - - private void switchViewLog() { - viewLogButton.setVisible(attachLogCheckBox.isSelected()); - } - - private String mergeValues (List values) { - String newValue; - StringBuilder sb = new StringBuilder(); - for (String value : values) { - if (sb.length()!=0) { - sb.append(','); - } - sb.append(value); - } - newValue = sb.toString(); - return newValue; - } - - private void setupListeners () { - if (issue.isNew()) { - addCommentArea.getDocument().addDocumentListener(new FieldChangeListener(addCommentArea, IssueField.DESCRIPTION) { - @Override - void fieldModified () { - // still new? - if (issue.isNew()) { - super.fieldModified(); - } - } - }); - } - addCommentArea.getDocument().addDocumentListener(new FieldChangeListener(addCommentArea, IssueField.COMMENT, - commentWarning, newCommentSection.getLabelComponent()) { - @Override - void fieldModified () { - if (!(reloading || issue.isNew())) { - issue.setFieldValue(IssueField.COMMENT, addCommentArea.getText().trim()); - addUnsavedField(IssueField.COMMENT.getKey()); - updateDecorations(); - } - } - }); - summaryField.getDocument().addDocumentListener(new FieldChangeListener(summaryField, IssueField.SUMMARY, summaryWarning, summaryLabel)); - productCombo.addActionListener(new FieldChangeListener(productCombo, IssueField.PRODUCT, productWarning, productLabel)); - componentCombo.addActionListener(new FieldChangeListener(componentCombo, IssueField.COMPONENT, componentWarning, componentLabel)); - versionCombo.addActionListener(new FieldChangeListener(versionCombo, IssueField.VERSION, versionWarning, versionLabel)); - platformCombo.addActionListener(new FieldChangeListener(platformCombo, IssueField.PLATFORM, platformWarning, platformLabel, new Pair[] { - Pair.of(IssueField.PLATFORM, platformCombo), - Pair.of(IssueField.OS, osCombo) - })); - osCombo.addActionListener(new FieldChangeListener(osCombo, IssueField.OS, platformWarning, platformLabel, new Pair[] { - Pair.of(IssueField.PLATFORM, platformCombo), - Pair.of(IssueField.OS, osCombo) - })); - statusCombo.addActionListener(new FieldChangeListener(statusCombo, IssueField.STATUS, statusWarning, statusLabel)); - - resolutionCombo.addActionListener(new FieldChangeListener(resolutionCombo, IssueField.RESOLUTION, resolutionWarning, resolutionLabel)); - duplicateField.getDocument().addDocumentListener(new FieldChangeListener(duplicateField, IssueField.DUPLICATE_ID, - duplicateWarning, duplicateLabel, Bundle.LBL_Duplicate_fieldName()) { - @Override - public void fieldModified () { - if (!reloading && duplicateField.isVisible() && duplicateField.isEditable()) { - storeFieldValue(IssueField.DUPLICATE_ID, duplicateField); //NOI18N - updateDecorations(); - } - } - }); - - boolean showIssueType = BugzillaUtil.showIssueType(issue.getRepository()); - priorityCombo.addActionListener(new FieldChangeListener(priorityCombo, IssueField.PRIORITY, priorityWarning, priorityLabel, new Pair[] { - Pair.of(IssueField.PRIORITY, priorityCombo), - showIssueType ? Pair.of(IssueField.ISSUE_TYPE, issueTypeCombo) : Pair.of(IssueField.SEVERITY, severityCombo) - })); - issueTypeCombo.addActionListener(new FieldChangeListener(issueTypeCombo, IssueField.ISSUE_TYPE, priorityWarning, priorityLabel, new Pair[] { - Pair.of(IssueField.PRIORITY, priorityCombo), - Pair.of(IssueField.ISSUE_TYPE, issueTypeCombo) - })); - severityCombo.addActionListener(new FieldChangeListener(severityCombo, IssueField.SEVERITY, priorityWarning, priorityLabel, new Pair[] { - Pair.of(IssueField.PRIORITY, priorityCombo), - Pair.of(IssueField.SEVERITY, severityCombo) - })); - targetMilestoneCombo.addActionListener(new FieldChangeListener(targetMilestoneCombo, IssueField.MILESTONE, milestoneWarning, targetMilestoneLabel)); - assignToDefaultCheckBox.addActionListener(new FieldChangeListener(assignToDefaultCheckBox, IssueField.REASSIGN_TO_DEFAULT)); - urlField.getDocument().addDocumentListener(new FieldChangeListener(urlField, IssueField.URL, urlWarning, urlLabel)); - statusWhiteboardField.getDocument().addDocumentListener(new FieldChangeListener(statusWhiteboardField, IssueField.WHITEBOARD, statusWhiteboardWarning, statusWhiteboardLabel)); - keywordsField.getDocument().addDocumentListener(new FieldChangeListener(keywordsField, IssueField.KEYWORDS, keywordsWarning, keywordsLabel)); - qaContactField.getDocument().addDocumentListener(new FieldChangeListener(qaContactField, IssueField.QA_CONTACT, qaContactWarning, qaContactLabel)); - ccField.getDocument().addDocumentListener(new FieldChangeListener(ccField, IssueField.CC, ccWarning, ccLabel) { - @Override - public void fieldModified () { - if (!reloading) { - storeCCValue(); - updateDecorations(); - } - } - }); - dependsField.getDocument().addDocumentListener(new FieldChangeListener(dependsField, IssueField.DEPENDS_ON, dependsOnWarning, dependsLabel)); - blocksField.getDocument().addDocumentListener(new FieldChangeListener(blocksField, IssueField.BLOCKS, blocksWarning, blocksLabel)); - assignedField.getDocument().addDocumentListener(new FieldChangeListener(assignedField, IssueField.ASSIGNED_TO, assignedToWarning, assignedLabel)); - assignedCombo.addActionListener(new FieldChangeListener(assignedCombo, IssueField.ASSIGNED_TO, assignedToWarning, assignedLabel)); - - estimatedField.getDocument().addDocumentListener(new FieldChangeListener(estimatedField, IssueField.ESTIMATED_TIME, timetrackingWarning, estimatedLabel)); - workedField.getDocument().addDocumentListener(new FieldChangeListener(workedField, IssueField.WORK_TIME, timetrackingWarning, workedLabel)); - remainingField.getDocument().addDocumentListener(new FieldChangeListener(remainingField, IssueField.REMAINING_TIME, timetrackingWarning, remainingLabel)); - deadlinePicker.addChangeListener(new FieldChangeListener(deadlinePicker.getComponent(), - IssueField.DEADLINE, timetrackingWarning, deadlineLabel, Pair.of(IssueField.DEADLINE, deadlinePicker)) { - - @Override - void fieldModified () { - if (!reloading && isEnabled()) { - Date date = deadlinePicker.getDate(); - String value = date == null ? "" : BugzillaIssue.DUE_DATE_FORMAT.format(date); - if (!issue.getFieldValue(IssueField.DEADLINE).equals(value)) { - addUnsavedField(IssueField.DEADLINE.getKey()); - issue.setFieldValue(IssueField.DEADLINE, value); - updateDecorations(); - } - } - } - - }); - attachLogCheckBox.addActionListener(new FieldChangeListener(attachLogCheckBox, IssueField.NB_ATTACH_IDE_LOG) { - @Override - void fieldModified () { - if (!reloading && isEnabled() && issue.isNew()) { - boolean selected = ((JCheckBox) attachLogCheckBox).isSelected(); - storeFieldValue(IssueField.NB_ATTACH_IDE_LOG, selected ? "1" : ""); - BugzillaConfig.getInstance().putAttachLogFile(selected); - } - } - }); - attachmentsPanel.addChangeListener(new ChangeListener() { - @Override - public void stateChanged (ChangeEvent e) { - if (!reloading && attachmentsPanel.isVisible()) { - if (issue.setUnsubmittedAttachments(attachmentsPanel.getNewAttachments())) { - addUnsavedField(IssueField.NB_NEW_ATTACHMENTS.getKey()); - updateAttachmentsStatus(); - } - } - } - }); - privateNotesField.getDocument().addDocumentListener(new TaskAttributeListener(privateNotesField, ATTRIBUTE_PRIVATE_NOTES, notesLabel) { - - @Override - protected boolean storeValue () { - String txt = privateNotesField.getText(); - issue.setTaskPrivateNotes(txt); - setPrivateSectionLabel(txt); - return true; - } - }); - dueDatePicker.addChangeListener(new DatePickerListener(dueDatePicker.getComponent(), - ATTRIBUTE_DUE_DATE, dueDateLabel) { - - @Override - protected boolean storeValue () { - issue.setTaskDueDate(dueDatePicker.getDate(), false); - return true; - } - }); - scheduleDatePicker.addChangeListener(new DatePickerListener(scheduleDatePicker.getComponent(), - ATTRIBUTE_SCHEDULE_DATE, scheduleDateLabel) { - - @Override - protected boolean storeValue () { - issue.setTaskScheduleDate(scheduleDatePicker.getScheduleDate(), false); - return true; - } - }); - estimateField.getDocument().addDocumentListener(new TaskAttributeListener(estimateField, - ATTRIBUTE_ESTIMATE, estimateLabel) { - - @Override - protected boolean storeValue () { - int value = ((Number) estimateField.getValue()).intValue(); - if (value != issue.getEstimate()) { - issue.setTaskEstimate(value, false); - return true; - } else { - return false; - } - } - - }); - } - - private void setupCustomFieldsListeners () { - // custom fields - for (CustomFieldInfo field : customFields) { - if (field.comp instanceof JTextComponent) { - ((JTextComponent) field.comp).getDocument().addDocumentListener( - new FieldChangeListener(field.comp, field.field, field.warning, field.label)); - } else if (field.comp instanceof JComboBox) { - ((JComboBox) field.comp).addActionListener( - new FieldChangeListener(field.comp, field.field, field.warning, field.label)); - } else if (field.comp instanceof JList) { - ((JList) field.comp).addListSelectionListener( - new FieldChangeListener(field.comp, field.field, field.warning, field.label)); - } else { - Bugzilla.LOG.log(Level.INFO, "Custom field component {0} is not supported!", field.comp); // NOI18N - } - } - } - - @NbBundle.Messages("IssuePanel.reloadButton.text=Reload Attributes") - private Action[] getAttributesSectionActions () { - if (attributesSectionActions == null) { - attributesSectionActions = new Action[] { - new AbstractAction(Bundle.IssuePanel_reloadButton_text()) { - - @Override - public void actionPerformed (ActionEvent e) { - reloadButtonActionPerformed(e); - } - } - }; - } - return attributesSectionActions; - } - - @NbBundle.Messages({ - "IssuePanel.commentsSectionAction.collapse.text=Collapse All", - "IssuePanel.commentsSectionAction.expand.text=Expand All" - }) - private Action[] getCommentsSectionActions () { - if (commentsSectionActions == null) { - commentsSectionActions = new Action[] { - new AbstractAction(Bundle.IssuePanel_commentsSectionAction_collapse_text()) { - - @Override - public void actionPerformed (ActionEvent e) { - commentsPanel.collapseAll(); - commentsSection.setExpanded(false); - } - }, - new AbstractAction(Bundle.IssuePanel_commentsSectionAction_expand_text()) { - - @Override - public void actionPerformed (ActionEvent e) { - commentsPanel.expandAll(); - commentsSection.setExpanded(true); - } - } - }; - } - return commentsSectionActions; - } - - @NbBundle.Messages({ - "CTL_Attachment.action.create=Add Attachment", - "CTL_Attachment.action.attachLog=Attach Log" - }) - private Action[] getAttachmentsSectionActions () { - if (attachmentsSectionActions == null) { - List actions = new ArrayList<>(); - actions.add(new AbstractAction(Bundle.CTL_Attachment_action_create()) { - - @Override - public void actionPerformed (ActionEvent e) { - attachmentsSection.setExpanded(true); - EventQueue.invokeLater(new Runnable() { - - @Override - public void run () { - attachmentsPanel.createAttachment(); - } - }); - } - }); - if (NBBugzillaUtils.isNbRepository(issue.getRepository().getUrl())) { - actions.add(new AbstractAction(Bundle.CTL_Attachment_action_attachLog()) { - - @Override - public void actionPerformed (ActionEvent e) { - attachmentsSection.setExpanded(true); - EventQueue.invokeLater(new Runnable() { - - @Override - public void run () { - attachmentsPanel.createNbLogAttachment(); - } - }); - } - }); - } - attachmentsSectionActions = actions.toArray(new Action[0]); - } - return attachmentsSectionActions; - } - - @NbBundle.Messages("IssuePanel.addToCategory.text=Add to Category") - private Action[] getPrivateSectionActions () { - if (privateSectionActions == null) { - privateSectionActions = new Action[] { - new AbstractAction(Bundle.IssuePanel_addToCategory_text()) { - @Override - public void actionPerformed (ActionEvent e) { - Bugzilla.getInstance().getBugtrackingFactory().addToCategory(issue.getRepository(), issue); - } - } - }; - } - return privateSectionActions; - } - - private void storeFieldValueForNewIssue (IssueField f, JComponent component) { - if (reloading && initializingNewTask) { - if (component instanceof JTextComponent) { - issue.setFieldValue(f, ((JTextComponent) component).getText()); - } else if (component instanceof JComboBox) { - Object value = ((JComboBox) component).getSelectedItem(); - issue.setFieldValue(f, value == null ? "" : value.toString()); - } - } - } - - private void clearHighlights () { - fieldsConflict.clear(); - fieldsIncoming.clear(); - fieldsLocal.clear(); - } - - private void updateIcon (JLabel label) { - label.setToolTipText(null); - label.setIcon(null); - Map conflicts = tooltipsConflict.get(label); - Map local = tooltipsLocal.get(label); - Map remote = tooltipsIncoming.get(label); - if (conflicts != null || local != null || remote != null) { - if (conflicts != null) { - label.setIcon(ICON_CONFLICT); - } else if (local != null) { - label.setIcon(ICON_UNSUBMITTED); - } else { - label.setIcon(ICON_REMOTE); - } - StringBuilder sb = new StringBuilder(""); //NOI18N - appendTooltips(sb, conflicts); - appendTooltips(sb, local); - appendTooltips(sb, remote); - sb.append(""); //NOI18N - label.setToolTipText(sb.toString()); - } - } - - private void appendTooltips (StringBuilder sb, Map tooltips) { - if (tooltips != null) { - for (Map.Entry e : tooltips.entrySet()) { - sb.append(e.getValue()); - } - } - } - - private void removeTooltips (JLabel label, IssueField field) { - tooltipsConflict.removeTooltip(label, field); - tooltipsIncoming.removeTooltip(label, field); - tooltipsLocal.removeTooltip(label, field); - } - - private void initializeNewTask () { - initializingNewTask = true; - if(BugzillaUtil.isNbRepository(issue.getRepository())) { - addNetbeansInfo(); - issue.setFieldValue(IssueField.NB_ATTACH_IDE_LOG, attachLogCheckBox.isSelected() ? "1" : "0"); - } - // Preselect the first product - selectProduct(); - initializingNewTask = false; - } - - private static class TooltipsMap extends HashMap> { - - private void removeTooltip (JLabel label, IssueField field) { - Map fields = get(label); - if (fields != null) { - fields.remove(field); - if (fields.isEmpty()) { - remove(label); - } - } - } - - private void addTooltip (JLabel label, IssueField field, String tooltip) { - Map fields = get(label); - if (fields == null) { - fields = new LinkedHashMap<>(2); - put(label, fields); - } - fields.put(field, tooltip); - } - - } - - private class FieldChangeListener implements DocumentListener, ActionListener, - ListSelectionListener, ChangeListener { - private final IssueField field; - private final JComponent component; - private final JLabel warningLabel; - private final JComponent fieldLabel; - private final String fieldName; - private Pair[] decoratedFields; - - public FieldChangeListener (JComponent component, IssueField field) { - this(component, field, null, null); - } - - public FieldChangeListener (JComponent component, IssueField field, JLabel warningLabel, - JComponent fieldLabel) { - this(component, field, warningLabel, fieldLabel, Pair.of(field, component)); - } - - public FieldChangeListener (JComponent component, IssueField field, JLabel warningLabel, - JComponent fieldLabel, String fieldName) { - this(component, field, warningLabel, fieldLabel, fieldName, Pair.of(field, component)); - } - - public FieldChangeListener (JComponent component, IssueField field, JLabel warningLabel, - JComponent fieldLabel, Pair... multiField) { - this(component, field, warningLabel, fieldLabel, - fieldLabel == null ? null : fieldName(fieldLabel), multiField); - } - - public FieldChangeListener (JComponent component, IssueField field, JLabel warningLabel, - JComponent fieldLabel, String fieldName, Pair... multiField) { - this.component = component; - this.field = field; - this.warningLabel = warningLabel; - this.fieldLabel = fieldLabel; - this.fieldName = fieldName; - this.decoratedFields = multiField; - } - - @Override - public final void insertUpdate (DocumentEvent e) { - fieldModified(); - } - - @Override - public final void removeUpdate (DocumentEvent e) { - fieldModified(); - } - - @Override - public final void changedUpdate (DocumentEvent e) { - fieldModified(); - } - - @Override - public void actionPerformed (ActionEvent e) { - if (e.getSource() == component) { - fieldModified(); - } - } - - @Override - public void valueChanged (ListSelectionEvent e) { - if (!e.getValueIsAdjusting() && e.getSource() == component) { - fieldModified(); - } - } - - @Override - public void stateChanged (ChangeEvent e) { - fieldModified(); - } - - void fieldModified () { - if (!reloading && isEnabled()) { - if (component instanceof JTextComponent) { - storeFieldValue(field, (JTextComponent) component); - updateDecorations(); - } else if (component instanceof JList) { - storeFieldValue(field, (JList) component); - updateDecorations(); - } else if (component instanceof JComboBox) { - Object value = ((JComboBox) component).getSelectedItem(); - if (value != null && assignToDefaultCheckBox.isVisible() && !assignToDefaultCheckBox.isSelected()) { - // when changing component or product, assign to default should be automatically selected - // as it is in browser - if (component == productCombo && !value.equals(issue.getFieldValue(IssueField.PRODUCT))) { - assignToDefaultCheckBox.doClick(); - } else if (component == componentCombo && !value.equals(issue.getFieldValue(IssueField.COMPONENT))) { - assignToDefaultCheckBox.doClick(); - } - } - storeFieldValue(field, (JComboBox) component); - updateDecorations(); - } else if (component instanceof JCheckBox) { - storeFieldValue(field, ((JCheckBox) component).isSelected() ? "1" : "0"); - updateDecorations(); - } - } - } - - public boolean isEnabled () { - return component.isVisible() && component.isEnabled(); - } - - protected final void updateDecorations () { - updateFieldDecorations(warningLabel, fieldLabel, fieldName, decoratedFields); - } - } - - private abstract class TaskAttributeListener implements DocumentListener { - - private final String attributeName; - private final JComponent component; - private final JComponent fieldLabel; - - public TaskAttributeListener (JComponent component, String attributeName, JComponent fieldLabel) { - this.component = component; - this.attributeName = attributeName; - this.fieldLabel = fieldLabel; - } - - @Override - public final void insertUpdate (DocumentEvent e) { - fieldModified(); - } - - @Override - public final void removeUpdate (DocumentEvent e) { - fieldModified(); - } - - @Override - public final void changedUpdate (DocumentEvent e) { - fieldModified(); - } - - void fieldModified () { - if (!reloading && isEnabled() && storeValue()) { - addUnsavedField(attributeName); - updateDecorations(); - } - } - - public boolean isEnabled () { - return component.isVisible() && component.isEnabled(); - } - - protected final void updateDecorations () { - updateFieldDecorations(attributeName, fieldLabel); - } - - protected abstract boolean storeValue (); - } - - private abstract class DatePickerListener implements ChangeListener { - - private final String attributeName; - private final JComponent component; - private final JComponent fieldLabel; - - public DatePickerListener (JComponent component, - String attributeName, JComponent fieldLabel) { - this.component = component; - this.attributeName = attributeName; - this.fieldLabel = fieldLabel; - } - - void fieldModified () { - if (!reloading && isEnabled() && storeValue()) { - addUnsavedField(attributeName); - updateDecorations(); - } - } - - @Override - public void stateChanged (ChangeEvent e) { - fieldModified(); - } - - public boolean isEnabled () { - return component.isVisible() && component.isEnabled(); - } - - protected final void updateDecorations () { - updateFieldDecorations(attributeName, fieldLabel); - } - - protected abstract boolean storeValue (); - } - - class CancelHighlightDocumentListener implements DocumentListener { - private final JComponent label; - - CancelHighlightDocumentListener(JComponent label) { - this.label = label; - } - - @Override - public void insertUpdate(DocumentEvent e) { - cancelHighlight(label); - } - - @Override - public void removeUpdate(DocumentEvent e) { - cancelHighlight(label); - } - - @Override - public void changedUpdate(DocumentEvent e) { - cancelHighlight(label); - } - } - - class CyclicDependencyDocumentListener implements DocumentListener { - - @Override - public void insertUpdate(DocumentEvent e) { - changedUpdate(e); - } - - @Override - public void removeUpdate(DocumentEvent e) { - changedUpdate(e); - } - - @Override - public void changedUpdate(DocumentEvent e) { - Set bugs1 = bugs(blocksField.getText()); - Set bugs2 = bugs(dependsField.getText()); - bugs1.retainAll(bugs2); - if (bugs1.isEmpty()) { - if (cyclicDependency) { - cyclicDependency = false; - updateMessagePanel(); - } - } else { - if (!cyclicDependency) { - cyclicDependency = true; - updateMessagePanel(); - } - } - } - - private Set bugs(String values) { - Set bugs = new HashSet<>(); - StringTokenizer st = new StringTokenizer(values, ", \t\n\r\f"); // NOI18N - while (st.hasMoreTokens()) { - String token = st.nextToken(); - try { - bugs.add(Integer.parseInt(token)); - } catch (NumberFormatException nfex) {} - } - return bugs; - } - } - - class RevalidatingListener implements DocumentListener, Runnable { - private boolean ignoreUpdate; - - @Override - public void insertUpdate(DocumentEvent e) { - changedUpdate(e); - } - - @Override - public void removeUpdate(DocumentEvent e) { - changedUpdate(e); - } - - @Override - public void changedUpdate(DocumentEvent e) { - if (ignoreUpdate) return; - ignoreUpdate = true; - EventQueue.invokeLater(this); - } - - @Override - public void run() { - revalidate(); - repaint(); - ignoreUpdate = false; - } - - } - - private class DuplicateListener implements DocumentListener { - @Override - public void insertUpdate(DocumentEvent e) { - changedUpdate(e); - } - - @Override - public void removeUpdate(DocumentEvent e) { - changedUpdate(e); - } - - @Override - public void changedUpdate(DocumentEvent e) { - updateNoDuplicateId(); - } - } - - private void updateNoDuplicateId() { - boolean newNoDuplicateId = "DUPLICATE".equals(resolutionCombo.getSelectedItem()) - && duplicateField.isVisible() - && "".equals(duplicateField.getText().trim()); - if(newNoDuplicateId != noDuplicateId) { - noDuplicateId = newNoDuplicateId; - updateMessagePanel(); - } - } - - private static class CustomFieldInfo { - CustomIssueField field; - JLabel label; - JComponent comp; - JLabel warning; - - CustomFieldInfo(CustomIssueField field, JLabel label, JComponent comp, JLabel warning) { - this.field = field; - this.label = label; - this.comp = comp; - this.warning = warning; - } - } - - private static class PriorityRenderer extends DefaultListCellRenderer { - - @Override - public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) { - JLabel renderer = (JLabel) super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus); - renderer.setIcon(BugzillaConfig.getInstance().getPriorityIcon((String)value)); - return renderer; - } - - } -} \ No newline at end of file diff --git a/ide/bugzilla/src/org/netbeans/modules/bugzilla/issue/ResolveIssuePanel.form b/ide/bugzilla/src/org/netbeans/modules/bugzilla/issue/ResolveIssuePanel.form deleted file mode 100644 index 37006f63cd59..000000000000 --- a/ide/bugzilla/src/org/netbeans/modules/bugzilla/issue/ResolveIssuePanel.form +++ /dev/null @@ -1,195 +0,0 @@ - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
diff --git a/ide/bugzilla/src/org/netbeans/modules/bugzilla/issue/ResolveIssuePanel.java b/ide/bugzilla/src/org/netbeans/modules/bugzilla/issue/ResolveIssuePanel.java deleted file mode 100644 index 4311b3c82988..000000000000 --- a/ide/bugzilla/src/org/netbeans/modules/bugzilla/issue/ResolveIssuePanel.java +++ /dev/null @@ -1,247 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.netbeans.modules.bugzilla.issue; - -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.util.LinkedList; -import java.util.List; -import javax.swing.DefaultComboBoxModel; -import javax.swing.JButton; -import javax.swing.event.DocumentEvent; -import javax.swing.event.DocumentListener; -import org.netbeans.modules.bugtracking.api.Issue; -import org.netbeans.modules.bugtracking.api.IssueQuickSearch; -import org.netbeans.modules.bugzilla.repository.BugzillaConfiguration; -import org.netbeans.modules.bugzilla.repository.BugzillaRepository; -import org.netbeans.modules.bugzilla.util.BugzillaUtil; -import org.openide.DialogDescriptor; -import org.openide.DialogDisplayer; -import org.openide.util.HelpCtx; -import org.openide.util.NbBundle; - -/** - * - * @author Jan Stola - */ -public class ResolveIssuePanel extends javax.swing.JPanel { - private final BugzillaIssue issue; - private JButton ok = new JButton(); - - public ResolveIssuePanel(BugzillaIssue issue) { - this.issue = issue; - initComponents(); - // workaround for 0 size container gap caused by invisible duplicatePanel - ((javax.swing.GroupLayout)getLayout()).setHonorsVisibility(false); - - BugzillaRepository repository = issue.getRepository(); - BugzillaConfiguration bc = repository.getConfiguration(); - if(bc == null || !bc.isValid()) { - // XXX nice error msg? - return; - } - List resolutions = new LinkedList(bc.getResolutions()); - resolutions.remove("MOVED"); // NOI18N - duplicatePanel.setVisible(false); - resolutionCombo.setModel(new DefaultComboBoxModel(resolutions.toArray())); - org.openide.awt.Mnemonics.setLocalizedText(ok, NbBundle.getMessage(ResolveIssuePanel.class, "ResolveIssuePanel.resolveButton")); // NOI18N - } - - public String getSelectedResolution() { - return (String) resolutionCombo.getSelectedItem(); - } - - public String getComment() { - return textArea.getText(); - } - - /** This method is called from within the constructor to - * initialize the form. - * WARNING: Do NOT modify this code. The content of this method is - * always regenerated by the Form Editor. - */ - @SuppressWarnings("unchecked") - // //GEN-BEGIN:initComponents - private void initComponents() { - - resolutionLabel = new javax.swing.JLabel(); - resolutionCombo = new javax.swing.JComboBox(); - commentLabel = new javax.swing.JLabel(); - scrollPane = new javax.swing.JScrollPane(); - textArea = new javax.swing.JTextArea(); - duplicatePanel = new javax.swing.JPanel(); - duplicateLabel = new javax.swing.JLabel(); - duplicateField = new javax.swing.JTextField(); - duplicateButton = new javax.swing.JButton(); - - resolutionLabel.setLabelFor(resolutionCombo); - org.openide.awt.Mnemonics.setLocalizedText(resolutionLabel, org.openide.util.NbBundle.getMessage(ResolveIssuePanel.class, "ResolveIssuePanel.resolutionLabel.text")); // NOI18N - - commentLabel.setLabelFor(textArea); - org.openide.awt.Mnemonics.setLocalizedText(commentLabel, org.openide.util.NbBundle.getMessage(ResolveIssuePanel.class, "ResolveIssuePanel.commentLabel.text")); // NOI18N - - textArea.setColumns(80); - textArea.setRows(5); - scrollPane.setViewportView(textArea); - textArea.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(ResolveIssuePanel.class, "ResolveIssuePanel.textArea.AccessibleContext.accessibleDescription")); // NOI18N - - duplicateLabel.setLabelFor(duplicateField); - org.openide.awt.Mnemonics.setLocalizedText(duplicateLabel, org.openide.util.NbBundle.getMessage(ResolveIssuePanel.class, "ResolveIssuePanel.duplicateLabel.text")); // NOI18N - - duplicateField.setColumns(15); - - org.openide.awt.Mnemonics.setLocalizedText(duplicateButton, org.openide.util.NbBundle.getMessage(ResolveIssuePanel.class, "ResolveIssuePanel.duplicateButton.text")); // NOI18N - duplicateButton.setFocusPainted(false); - duplicateButton.setMargin(new java.awt.Insets(0, 0, 0, 0)); - duplicateButton.addActionListener(new java.awt.event.ActionListener() { - public void actionPerformed(java.awt.event.ActionEvent evt) { - duplicateButtonActionPerformed(evt); - } - }); - - javax.swing.GroupLayout duplicatePanelLayout = new javax.swing.GroupLayout(duplicatePanel); - duplicatePanel.setLayout(duplicatePanelLayout); - duplicatePanelLayout.setHorizontalGroup( - duplicatePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(duplicatePanelLayout.createSequentialGroup() - .addComponent(duplicateLabel) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(duplicateField, javax.swing.GroupLayout.PREFERRED_SIZE, 151, javax.swing.GroupLayout.PREFERRED_SIZE) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(duplicateButton)) - ); - duplicatePanelLayout.setVerticalGroup( - duplicatePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(duplicatePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) - .addComponent(duplicateLabel) - .addComponent(duplicateButton) - .addComponent(duplicateField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) - ); - - duplicateField.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(ResolveIssuePanel.class, "ResolveIssuePanel.duplicateField.AccessibleContext.accessibleDescription")); // NOI18N - duplicateButton.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(ResolveIssuePanel.class, "ResolveIssuePanel.duplicateButton.AccessibleContext.accessibleDescription")); // NOI18N - - javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); - this.setLayout(layout); - layout.setHorizontalGroup( - layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(layout.createSequentialGroup() - .addContainerGap() - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(resolutionLabel) - .addComponent(commentLabel)) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(layout.createSequentialGroup() - .addComponent(resolutionCombo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) - .addComponent(duplicatePanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addComponent(scrollPane)) - .addContainerGap()) - ); - layout.setVerticalGroup( - layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(layout.createSequentialGroup() - .addContainerGap() - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) - .addComponent(resolutionLabel) - .addComponent(resolutionCombo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addComponent(duplicatePanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(commentLabel) - .addComponent(scrollPane)) - .addContainerGap()) - ); - - resolutionCombo.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(ResolveIssuePanel.class, "ResolveIssuePanel.resolutionCombo.AccessibleContext.accessibleDescription")); // NOI18N - }// //GEN-END:initComponents - - private void duplicateButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_duplicateButtonActionPerformed - Issue i = IssueQuickSearch.selectIssue( - NbBundle.getMessage(IssuePanel.class, "IssuePanel.duplicateButton.message"), //NOI18N - BugzillaUtil.getRepository(issue.getRepository()), - this, - new HelpCtx("org.netbeans.modules.bugzilla.duplicateChooser")); // NOI18N - if (i != null) { - duplicateField.setText(i.getID()); - } -}//GEN-LAST:event_duplicateButtonActionPerformed - - - // Variables declaration - do not modify//GEN-BEGIN:variables - private javax.swing.JLabel commentLabel; - private javax.swing.JButton duplicateButton; - private javax.swing.JTextField duplicateField; - private javax.swing.JLabel duplicateLabel; - private javax.swing.JPanel duplicatePanel; - private javax.swing.JComboBox resolutionCombo; - private javax.swing.JLabel resolutionLabel; - private javax.swing.JScrollPane scrollPane; - private javax.swing.JTextArea textArea; - // End of variables declaration//GEN-END:variables - - private void checkDuplicateId () { - ok.setEnabled(!BugzillaIssue.RESOLVE_DUPLICATE.equals(resolutionCombo.getSelectedItem()) //NOI18N - || duplicateField.getText().trim().length() > 0); - } - - private void resolutionComboSelectionChanged () { - boolean shown = BugzillaIssue.RESOLVE_DUPLICATE.equals(resolutionCombo.getSelectedItem()); // NOI18N - duplicatePanel.setVisible(shown); - checkDuplicateId(); - } - - boolean showDialog() { - ok.getAccessibleContext().setAccessibleDescription(ok.getText()); - final DialogDescriptor dd = new DialogDescriptor(this, NbBundle.getMessage(ResolveIssuePanel.class, "BugzillaIssueProvider.resolveIssueButton.text"), //NOI18N - true, new Object[]{ok, DialogDescriptor.CANCEL_OPTION}, ok, - DialogDescriptor.DEFAULT_ALIGN, new HelpCtx(ResolveIssuePanel.class), null); - duplicateField.getDocument().addDocumentListener(new DocumentListener() { - @Override - public void insertUpdate(DocumentEvent e) { - checkDuplicateId(); - } - - @Override - public void removeUpdate(DocumentEvent e) { - checkDuplicateId(); - } - - @Override - public void changedUpdate(DocumentEvent e) { - checkDuplicateId(); - } - }); - resolutionCombo.addActionListener(new ActionListener() { - @Override - public void actionPerformed(ActionEvent e) { - resolutionComboSelectionChanged(); - } - }); - resolutionComboSelectionChanged(); - return DialogDisplayer.getDefault().notify(dd) == ok; - } - - String getDuplicateId() { - return duplicateField.getText().trim(); - } - -} diff --git a/ide/bugzilla/src/org/netbeans/modules/bugzilla/query/BugzillaQuery.java b/ide/bugzilla/src/org/netbeans/modules/bugzilla/query/BugzillaQuery.java deleted file mode 100644 index dcf918338699..000000000000 --- a/ide/bugzilla/src/org/netbeans/modules/bugzilla/query/BugzillaQuery.java +++ /dev/null @@ -1,426 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.netbeans.modules.bugzilla.query; - -import org.netbeans.modules.bugzilla.repository.BugzillaRepository; -import java.util.*; -import org.netbeans.modules.bugzilla.*; -import java.util.logging.Level; -import javax.swing.SwingUtilities; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.mylyn.tasks.core.IRepositoryQuery; -import org.netbeans.modules.bugzilla.issue.BugzillaIssue; -import org.netbeans.modules.bugtracking.issuetable.ColumnDescriptor; -import org.netbeans.modules.bugtracking.spi.IssueStatusProvider.Status; -import org.netbeans.modules.team.spi.OwnerInfo; -import org.netbeans.modules.team.commons.LogUtils; -import org.netbeans.modules.bugzilla.util.BugzillaConstants; -import org.netbeans.modules.mylyn.util.MylynSupport; -import org.netbeans.modules.mylyn.util.NbTask; -import org.netbeans.modules.mylyn.util.commands.SynchronizeQueryCommand; - -/** - * - * @author Tomas Stupka - */ -public class BugzillaQuery { - - public static final String BUGZILLA_ADHOC_QUERY_PREFIX = "bugzilla ad-hoc query nr. "; - - private String name; - private final BugzillaRepository repository; - protected QueryController controller; - private final Set issues = new HashSet<>(); - - // XXX its not clear how the urlParam is used between query and controller - protected String urlParameters; - private boolean initialUrlDef; - - private boolean firstRun = true; - private ColumnDescriptor[] columnDescriptors; - private OwnerInfo info; - private boolean saved; - protected long lastRefresh; - private IRepositoryQuery iquery; - - public BugzillaQuery(BugzillaRepository repository) { - this(null, null, repository, null, false, false, true); - } - - public BugzillaQuery (String name, BugzillaRepository repository, String urlParameters, boolean saved, boolean urlDef, boolean initControler) { - this(name, null, repository, urlParameters, saved, urlDef, initControler); - } - - public BugzillaQuery (String name, IRepositoryQuery query, BugzillaRepository repository, String urlParameters, boolean saved, boolean urlDef, boolean initControler) { - this.repository = repository; - this.saved = saved; - this.name = name; - this.iquery = query; - this.urlParameters = urlParameters; - this.initialUrlDef = urlDef; - this.lastRefresh = BugzillaConfig.getInstance().getLastQueryRefresh(repository, getStoredQueryName()); - - if(initControler) { - controller = createControler(repository, this, urlParameters); - } - } - - public String getDisplayName() { - return name; - } - - public String getTooltip() { - return name + " - " + repository.getDisplayName(); // NOI18N - } - - public synchronized QueryController getController() { - if (controller == null) { - controller = createControler(repository, this, urlParameters); - } - return controller; - } - - public BugzillaRepository getRepository() { - return repository; - } - - protected QueryController createControler(BugzillaRepository r, BugzillaQuery q, String parameters) { - return new QueryController(r, q, parameters, initialUrlDef); - } - - public ColumnDescriptor[] getColumnDescriptors() { - if(columnDescriptors == null) { - columnDescriptors = BugzillaIssue.getColumnDescriptors(repository); - } - return columnDescriptors; - } - - boolean refreshIntern(final boolean autoRefresh) { // XXX what if already running! - cancel task - - assert urlParameters != null; - assert !SwingUtilities.isEventDispatchThread() : "Accessing remote host. Do not call in awt"; // NOI18N - - final boolean ret[] = new boolean[1]; - executeQuery(new Runnable() { - @Override - public void run() { - Bugzilla.LOG.log(Level.FINE, "refresh start - {0} [{1}]", new String[] {name, urlParameters}); // NOI18N - try { - - // keeps all issues we will retrieve from the server - // - those matching the query criteria - // - and the obsolete ones - issues.clear(); - if(isSaved()) { - if(!wasRun() && !issues.isEmpty()) { - Bugzilla.LOG.log(Level.WARNING, "query {0} supposed to be run for the first time yet already contains issues.", getDisplayName()); // NOI18N - assert false; - } - } - firstRun = false; - - // run query to know what matches the criteria - StringBuilder url = new StringBuilder(); - url.append(BugzillaConstants.URL_ADVANCED_BUG_LIST); - url.append(urlParameters); // XXX encode url? - // IssuesIdCollector will populate the issues set - try { - if (iquery == null) { - String qName = getStoredQueryName(); - if (qName == null || name == null) { - qName = BUGZILLA_ADHOC_QUERY_PREFIX + System.currentTimeMillis(); //NOI18N - } - iquery = MylynSupport.getInstance().getRepositoryQuery(repository.getTaskRepository(), qName); - if (iquery == null) { - iquery = MylynSupport.getInstance().createNewQuery(repository.getTaskRepository(), qName); - MylynSupport.getInstance().addQuery(repository.getTaskRepository(), iquery); - } - } - String queryUrl = url.toString(); - iquery.setUrl(queryUrl); - SynchronizeQueryCommand queryCmd = MylynSupport.getInstance().getCommandFactory() - .createSynchronizeQueriesCommand(repository.getTaskRepository(), iquery); - QueryProgressListener list = new QueryProgressListener(); - queryCmd.addCommandProgressListener(list); - repository.getExecutor().execute(queryCmd, !autoRefresh); - ret[0] = queryCmd.hasFailed(); - if (ret[0]) { - if (isSaved()) { - for (NbTask t : MylynSupport.getInstance().getTasks(iquery)) { - // as a side effect creates a BugzillaIssue instance - BugzillaIssue bzIssue = getRepository().getIssueForTask(t); - if (bzIssue != null) { - issues.add(bzIssue.getID()); - } - } - } - list.notifyIssues(issues); - return; - } - - list.notifyIssues(issues); - - // but what about the archived issues? - // they should be refreshed as well, but do we really care about them ? - } catch (CoreException ex) { - Bugzilla.LOG.log(Level.INFO, null, ex); - ret[0] = true; - } - } finally { - BugzillaConfig.getInstance().putLastQueryRefresh(repository, getStoredQueryName(), System.currentTimeMillis()); - logQueryEvent(issues.size(), autoRefresh); - Bugzilla.LOG.log(Level.FINE, "refresh finish - {0} [{1}]", new String[] {name, urlParameters}); // NOI18N - } - } - }); - - return ret[0]; - } - - public String getStoredQueryName() { - return getDisplayName(); - } - - protected void logQueryEvent(int count, boolean autoRefresh) { - LogUtils.logQueryEvent( - BugzillaConnector.getConnectorName(), - name, - count, - false, - autoRefresh); - } - - void refresh(String urlParameters, boolean autoReresh) { - assert urlParameters != null; - this.urlParameters = urlParameters; - refreshIntern(autoReresh); - } - - public void remove() { - repository.removeQuery(this); - } - - public void setOwnerInfo(OwnerInfo info) { - this.info = info; - } - - public OwnerInfo getOwnerInfo() { - return info; - } - - public Status getIssueStatus(String id) { - return repository.getIssueCache().getIssue(id).getStatus(); - } - - int getSize() { - return issues.size(); - } - - public String getUrlParameters() { - return getController().getUrlParameters(false); - } - - public boolean isUrlDefined() { - return getController().isUrlDefined(); - } - - public void setName(String name) { - this.name = name; - if (iquery != null) { - iquery.setSummary(name); - } - } - - public void setSaved(boolean saved) { - if(saved) { - info = null; - } - this.saved = saved; - } - - public boolean isSaved() { - return saved; - } - - public Collection getIssues() { - if (issues == null) { - return Collections.emptyList(); - } - List ids = new ArrayList<>(); - synchronized (issues) { - ids.addAll(issues); - } - - List ret = new ArrayList<>(); - for (String id : ids) { - BugzillaIssue issue = repository.getIssueCache().getIssue(id); - if (issue != null) { - ret.add(issue); - } - } - return ret; - } - - boolean wasRun() { - return !firstRun; - } - - public long getLastRefresh() { - return lastRefresh; - } - - public boolean canRemove() { - return true; - } - - void delete() { - if(iquery != null) { - MylynSupport.getInstance().deleteQuery(iquery); - } - } - - private class QueryProgressListener implements SynchronizeQueryCommand.CommandProgressListener { - - private final Set addedIds = new HashSet(); - - @Override - public void queryRefreshStarted (Collection tasks) { - for (NbTask task : tasks) { - taskAdded(task); - } - } - - @Override - public void tasksRefreshStarted (Collection tasks) { - getController().switchToDeterminateProgress(tasks.size()); - } - - @Override - public void taskAdded (NbTask task) { - issues.add(task.getTaskId()); - // when issue table or task dashboard is able to handle deltas - // fire an event from here - } - - @Override - public void taskRemoved (NbTask task) { - issues.remove(task.getTaskId()); - BugzillaIssue issue = repository.getIssueForTask(task); - if (issue != null) { - fireNotifyDataRemoved(issue); - } - } - - @Override - public void taskSynchronized (NbTask task) { - getController().addProgressUnit(BugzillaIssue.getDisplayName(task)); - } - - private void notifyIssues (Set issues) { - // this is due to the archived issues - MylynSupport supp = MylynSupport.getInstance(); - try { - for (String taskId : issues) { - NbTask task = supp.getTask(repository.getUrl(), taskId); - if (task != null) { - BugzillaIssue issue = repository.getIssueForTask(task); - if (issue != null) { - if (addedIds.add(task.getTaskId())) { - fireNotifyDataAdded(issue); // XXX - !!! triggers getIssues() - } - } - } - } - } catch (CoreException ex) { - Bugzilla.LOG.log(Level.INFO, null, ex); - } - } - }; - - public void addNotifyListener(QueryNotifyListener l) { - List list = getNotifyListeners(); - synchronized(list) { - list.add(l); - } - } - - public void removeNotifyListener(QueryNotifyListener l) { - List list = getNotifyListeners(); - synchronized(list) { - list.remove(l); - } - } - - protected void fireNotifyDataAdded (BugzillaIssue issue) { - QueryNotifyListener[] listeners = getListeners(); - for (QueryNotifyListener l : listeners) { - l.notifyDataAdded(issue); - } - } - - protected void fireNotifyDataRemoved (BugzillaIssue issue) { - QueryNotifyListener[] listeners = getListeners(); - for (QueryNotifyListener l : listeners) { - l.notifyDataRemoved(issue); - } - } - - protected void fireStarted() { - QueryNotifyListener[] listeners = getListeners(); - for (QueryNotifyListener l : listeners) { - l.started(); - } - } - - protected void fireFinished() { - QueryNotifyListener[] listeners = getListeners(); - for (QueryNotifyListener l : listeners) { - l.finished(); - } - } - - // XXX move to API - protected void executeQuery (Runnable r) { - fireStarted(); - try { - r.run(); - } finally { - fireFinished(); - lastRefresh = System.currentTimeMillis(); - } - } - - private QueryNotifyListener[] getListeners() { - List list = getNotifyListeners(); - QueryNotifyListener[] listeners; - synchronized (list) { - listeners = list.toArray(new QueryNotifyListener[0]); - } - return listeners; - } - - private List notifyListeners; - private List getNotifyListeners() { - if(notifyListeners == null) { - notifyListeners = new ArrayList(); - } - return notifyListeners; - } -} diff --git a/ide/bugzilla/src/org/netbeans/modules/bugzilla/query/BugzillaQueryCellRenderer.java b/ide/bugzilla/src/org/netbeans/modules/bugzilla/query/BugzillaQueryCellRenderer.java deleted file mode 100644 index 1891b6393da7..000000000000 --- a/ide/bugzilla/src/org/netbeans/modules/bugzilla/query/BugzillaQueryCellRenderer.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.netbeans.modules.bugzilla.query; - -import java.awt.Component; -import javax.swing.JLabel; -import javax.swing.JTable; -import javax.swing.table.TableCellRenderer; -import org.netbeans.modules.bugtracking.issuetable.QueryTableCellRenderer; -import org.netbeans.modules.bugzilla.BugzillaConfig; -import org.netbeans.modules.bugzilla.issue.BugzillaIssueNode.PriorityProperty; - -/** - * - * @author Tomas Stupka - * - */ -public class BugzillaQueryCellRenderer implements TableCellRenderer { - - private final QueryTableCellRenderer defaultIssueRenderer; - - public BugzillaQueryCellRenderer(QueryTableCellRenderer defaultIssueRenderer) { - this.defaultIssueRenderer = defaultIssueRenderer; - } - - @Override - public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { - JLabel renderer = (JLabel) defaultIssueRenderer.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column); - if(!(value instanceof PriorityProperty)) { - return renderer; - } - PriorityProperty p = (PriorityProperty) value; - String priority = p.getValue(); - renderer.setIcon(BugzillaConfig.getInstance().getPriorityIcon(priority)); - return renderer; - } - -} diff --git a/ide/bugzilla/src/org/netbeans/modules/bugzilla/query/Bundle.properties b/ide/bugzilla/src/org/netbeans/modules/bugzilla/query/Bundle.properties deleted file mode 100644 index 8f00a03d21f5..000000000000 --- a/ide/bugzilla/src/org/netbeans/modules/bugzilla/query/Bundle.properties +++ /dev/null @@ -1,149 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - -## libs/jsch/manifest.mf -OpenIDE-Module-Name=Bugzilla -QueryPanel.jLabel4.text=Product: -QueryPanel.jLabel1.text=Name: -QueryPanel.nameField.text= -QueryPanel.jLabel2.text=... -QueryPanel.jLabel1.text_1=Task ID: -QueryPanel.byTextLabel.text_1=Find tasks by text -QueryPanel.byDetailsLabel.text=Find by product details -QueryPanel.byPeopleLabel.text=Find by people -QueryPanel.byLastChangeLabel.text=Find by last change -QueryPanel.bugAssigneeCheckBox.text=Assigned to -QueryPanel.reporterCheckBox.text=Reporter -QueryPanel.ccCheckBox.text=CC -QueryPanel.commenterCheckBox.text=Commenter -QueryPanel.gotoIssueButton.text=Go To Task -QueryPanel.searchButton.text=Search -QueryPanel.tableSummaryLabel.text_1=jLabel2 -QueryPanel.peopleLabel.text=Any one of: -QueryPanel.versionLabel.text=Version -QueryPanel.statusLabel.text=Status -QueryPanel.resolutionLabel.text=Resolution -QueryPanel.priorityLabel.text=Priority -QueryPanel.summaryLabel.text_1=Summary: -QueryPanel.commentLabel.text=Comment: -QueryPanel.keywordsLabel.text=Keywords: -QueryPanel.productLabel.text=Product -QueryPanel.componentLabel.text=Component - -MSG_NoResults=No Tasks found -MSG_Searching=Searching... -MSG_SearchingQuery=Searching {0}... -MSG_Opening=Opening Task {0} ... -MSG_Populating=Reading server data from Task Repository ''{0}''... - -LBL_RetrievingIssue=Retrieved task {0} - -MSG_RemoveQuery=Do you want to remove the query ''{0}''? -CTL_RemoveQuery=Remove - -QueryPanel.jLabel2.text_1=Query URL: -QueryPanel.urlToggleButton.textForm=Create Query in Form -QueryPanel.urlToggleButton.textUrl=Create Query as URL - -QueryPanel.nameLabel.text_1=jLabel4 -QueryPanel.filterLabel.text_1=Filter: -QueryPanel.lastRefreshDateLabel.text_1=jLabel4 -QueryPanel.lastRefreshLabel.text_1=Last run: - -LBL_Never=Never -QueryPanel.changedFromTextField.text= -QueryPanel.changedToTextField.text= -QueryPanel.changedLabel.text_1=Only bugs changed between: -QueryPanel.changedAndLabel.text=and -QueryPanel.changedWhereLabel.text=where -# {$an_attribute_given_by_name_and_picked_from_a_list} has changed, and the new value was {$value} -QueryPanel.changedBlaBlaLabel.text=has changed, and the new value was -# YYYY-MM-DD is a date format -QueryPanel.changedHintLabel.text=YYYY-MM-DD or relative dates -QueryPanel.refreshButton.text=Refresh -QueryPanel.modifyButton.text=Modify Query -QueryPanel.seenButton.text=Mark All Tasks As Seen -QueryPanel.removeButton.text=Remove Query -QueryPanel.webButton.text=Open web Query -LBL_MatchingIssues=There are {0} tasks matching this query. -LBL_MatchingIssue=There is 1 task matching this query. -QueryPanel.saveChangesButton.text=Save Changes -QueryPanel.saveQueryButton.text=Save Query -QueryPanel.cancelChangesButton.text=Cancel Changes -QueryPanel.jLabel4.text_1= -QueryPanel.jLabel5.text= -QueryPanel.jLabel6.text= -QueryPanel.keywordsButton.text=... - -LBL_SelectKeywords=Select or deselect keywords. -QueryPanel.severityLabel.text=Severity -QueryPanel.noContentLabel.text=jLabel9 -QueryPanel.savePanel.AccessibleContext.accessibleDescription=Save Query -QueryPanel.queryNameTextField.AccessibleContext.accessibleDescription=Query Name -QueryPanel.refreshConfigurationButton.text=Reload Attributes -QueryPanel.summaryTextField.AccessibleContext.accessibleName=Summary -QueryPanel.commentTextField.AccessibleContext.accessibleName=Comment -QueryPanel.keywordsTextField.AccessibleContext.accessibleName=Keywords -QueryPanel.peopleTextField.AccessibleContext.accessibleName=Username -QueryPanel.peopleComboBox.AccessibleContext.accessibleName=Substring type -QueryPanel.changedFromTextField.AccessibleContext.accessibleDescription=Start of the time range -QueryPanel.changedToTextField.AccessibleContext.accessibleDescription=End of the time range -QueryPanel.changedList.AccessibleContext.accessibleDescription=Changed field -QueryPanel.newValueTextField.AccessibleContext.accessibleDescription=New value of the field -QueryPanel.bugAssigneeCheckBox.AccessibleContext.accessibleDescription=N/A -QueryPanel.reporterCheckBox.AccessibleContext.accessibleDescription=N/A -QueryPanel.ccCheckBox.AccessibleContext.accessibleDescription=N/A -QueryPanel.commenterCheckBox.AccessibleContext.accessibleDescription=N/A -QueryPanel.peopleComboBox.AccessibleContext.accessibleDescription=N/A -QueryPanel.peopleTextField.AccessibleContext.accessibleDescription=N/A -QueryPanel.productList.AccessibleContext.accessibleDescription=N/A -QueryPanel.componentList.AccessibleContext.accessibleDescription=N/A -QueryPanel.versionList.AccessibleContext.accessibleDescription=N/A -QueryPanel.statusList.AccessibleContext.accessibleDescription=N/A -QueryPanel.resolutionList.AccessibleContext.accessibleDescription=N/A -QueryPanel.priorityList.AccessibleContext.accessibleDescription=N/A -QueryPanel.severityList.AccessibleContext.accessibleDescription=N/A -QueryPanel.summaryComboBox.AccessibleContext.accessibleDescription=N/A -QueryPanel.commentComboBox.AccessibleContext.accessibleDescription=N/A -QueryPanel.keywordsComboBox.AccessibleContext.accessibleDescription=N/A -QueryPanel.summaryTextField.AccessibleContext.accessibleDescription=N/A -QueryPanel.commentTextField.AccessibleContext.accessibleDescription=N/A -QueryPanel.keywordsTextField.AccessibleContext.accessibleDescription=N/A -QueryPanel.keywordsButton.AccessibleContext.accessibleDescription=N/A -QueryPanel.refreshButton.AccessibleContext.accessibleDescription=N/A -QueryPanel.modifyButton.AccessibleContext.accessibleDescription=N/A -QueryPanel.seenButton.AccessibleContext.accessibleDescription=N/A -QueryPanel.removeButton.AccessibleContext.accessibleDescription=N/A -QueryPanel.idTextField.AccessibleContext.accessibleDescription=N/A -QueryPanel.gotoIssueButton.AccessibleContext.accessibleDescription=N/A -QueryPanel.urlTextField.AccessibleContext.accessibleDescription=N/A -QueryPanel.searchButton.AccessibleContext.accessibleDescription=N/A -QueryPanel.saveChangesButton.AccessibleContext.accessibleDescription=N/A -QueryPanel.cancelChangesButton.AccessibleContext.accessibleDescription=N/A -QueryPanel.filterComboBox.AccessibleContext.accessibleDescription=N/A -QueryPanel.refreshConfigurationButton.AccessibleContext.accessibleDescription=N/A -QueryPanel.urlToggleButton.AccessibleContext.accessibleDescription=N/A -QueryPanel.webButton.AccessibleContext.accessibleDescription=N/A -QueryPanel.saveButton.AccessibleContext.accessibleDescription=N/A -QueryPanel.separatorLabel2.text= -QueryPanel.separatorLabel3.text= -QueryPanel.jLabel7.text= -QueryPanel.whiteboardLabel.text=Whiteboard: -QueryPanel.issueTypeLabel.text=Task Type -QueryPanel.tmLabel.text=Target Milestone -QueryPanel.cloneQueryButton.text=Clone Query -MSG_SAME_NAME=Query with the same name already exists. \ No newline at end of file diff --git a/ide/bugzilla/src/org/netbeans/modules/bugzilla/query/QueryController.java b/ide/bugzilla/src/org/netbeans/modules/bugzilla/query/QueryController.java deleted file mode 100644 index 396c39290bbf..000000000000 --- a/ide/bugzilla/src/org/netbeans/modules/bugzilla/query/QueryController.java +++ /dev/null @@ -1,1307 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.netbeans.modules.bugzilla.query; - -import org.netbeans.modules.bugtracking.commons.SaveQueryPanel; -import java.awt.Component; -import java.awt.EventQueue; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.awt.event.FocusEvent; -import java.awt.event.FocusListener; -import java.awt.event.ItemEvent; -import java.awt.event.ItemListener; -import java.awt.event.KeyEvent; -import java.awt.event.KeyListener; -import java.beans.PropertyChangeListener; -import java.beans.PropertyChangeSupport; -import java.lang.reflect.Constructor; -import java.lang.reflect.InvocationTargetException; -import java.net.MalformedURLException; -import java.net.URL; -import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.Date; -import java.util.HashMap; -import java.util.LinkedHashMap; -import java.util.LinkedList; -import java.util.List; -import java.util.Map; -import java.util.MissingResourceException; -import java.util.concurrent.Semaphore; -import java.util.logging.Level; -import javax.swing.DefaultComboBoxModel; -import javax.swing.JComponent; -import javax.swing.event.ChangeEvent; -import javax.swing.event.ChangeListener; -import javax.swing.event.ListSelectionEvent; -import javax.swing.event.ListSelectionListener; -import org.netbeans.api.progress.ProgressHandle; -import org.netbeans.api.progress.ProgressHandleFactory; -import org.netbeans.modules.bugtracking.issuetable.Filter; -import org.netbeans.modules.bugtracking.issuetable.IssueTable; -import org.netbeans.modules.bugtracking.issuetable.QueryTableCellRenderer; -import org.netbeans.modules.bugtracking.commons.SaveQueryPanel.QueryNameValidator; -import org.netbeans.modules.bugtracking.commons.UIUtils; -import org.netbeans.modules.bugtracking.spi.QueryProvider; -import org.netbeans.modules.bugzilla.Bugzilla; -import org.netbeans.modules.bugzilla.BugzillaConfig; -import org.netbeans.modules.bugzilla.repository.BugzillaRepository; -import org.netbeans.modules.bugzilla.issue.BugzillaIssue; -import org.netbeans.modules.bugzilla.query.QueryParameter.AllWordsTextFieldParameter; -import org.netbeans.modules.bugzilla.util.BugzillaUtil; -import org.netbeans.modules.bugzilla.query.QueryParameter.CheckBoxParameter; -import org.netbeans.modules.bugzilla.query.QueryParameter.ComboParameter; -import org.netbeans.modules.bugzilla.query.QueryParameter.EmptyValuesListParameter; -import org.netbeans.modules.bugzilla.query.QueryParameter.ListParameter; -import org.netbeans.modules.bugzilla.query.QueryParameter.ParameterValue; -import org.netbeans.modules.bugzilla.query.QueryParameter.TextFieldParameter; -import org.netbeans.modules.bugzilla.repository.BugzillaConfiguration; -import org.netbeans.modules.bugzilla.util.BugzillaConstants; -import org.openide.DialogDisplayer; -import org.openide.NotifyDescriptor; -import org.openide.awt.HtmlBrowser; -import org.openide.util.Cancellable; -import org.openide.util.HelpCtx; -import org.openide.util.NbBundle; -import org.openide.util.RequestProcessor; -import org.openide.util.RequestProcessor.Task; - -/** - * - * @author Tomas Stupka - */ -public class QueryController implements org.netbeans.modules.bugtracking.spi.QueryController, ItemListener, ListSelectionListener, ActionListener, FocusListener, KeyListener, ChangeListener { - - protected QueryPanel panel; - - private static final String CHANGED_NOW = "Now"; // NOI18N - - private final ComboParameter summaryParameter; - private final ComboParameter commentsParameter; - private final ComboParameter whiteboardParameter; - private final ComboParameter keywordsParameter; - private final ComboParameter peopleParameter; - private final ListParameter productParameter; - private final ListParameter componentParameter; - private final ListParameter versionParameter; - private final ListParameter statusParameter; - private final ListParameter resolutionParameter; - private final ListParameter priorityParameter; - private final ListParameter changedFieldsParameter; - private final ListParameter severityParameter; - private final ListParameter issueTypeParameter; - private ListParameter tmParameter; - - private final Map parameters; - - private final RequestProcessor rp = new RequestProcessor("Bugzilla query", 1, true); // NOI18N - - private final BugzillaRepository repository; - protected BugzillaQuery query; - - private final SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); // NOI18N - private QueryTask refreshTask; - private final IssueTable issueTable; - private final boolean isNetbeans; - - private final Object REFRESH_LOCK = new Object(); - private final Semaphore querySemaphore = new Semaphore(1); - private boolean populated = false; - private boolean wasOpened; - private boolean wasModeShow; - private QueryProvider.IssueContainer delegatingIssueContainer; - - public QueryController(BugzillaRepository repository, BugzillaQuery query, String urlParameters, boolean urlDef) { - this(repository, query, urlParameters, urlDef, true); - } - - public QueryController(BugzillaRepository repository, BugzillaQuery query, String urlParameters, boolean urlDef, boolean populate) { - this.repository = repository; - this.query = query; - - issueTable = new IssueTable(repository.getID(), query.getDisplayName(), this, query.getColumnDescriptors(), query.isSaved()); - setupRenderer(issueTable); - panel = new QueryPanel(issueTable.getComponent()); - - isNetbeans = BugzillaUtil.isNbRepository(repository); - panel.setNBFieldsVisible(isNetbeans); - - panel.productList.addListSelectionListener(this); - panel.filterComboBox.addItemListener(this); - panel.searchButton.addActionListener(this); - panel.keywordsButton.addActionListener(this); - panel.cancelChangesButton.addActionListener(this); - panel.saveChangesButton.addActionListener(this); - panel.gotoIssueButton.addActionListener(this); - panel.webButton.addActionListener(this); - panel.urlToggleButton.addActionListener(this); - panel.refreshButton.addActionListener(this); - panel.modifyButton.addActionListener(this); - panel.seenButton.addActionListener(this); - panel.removeButton.addActionListener(this); - panel.refreshConfigurationButton.addActionListener(this); - panel.cloneQueryButton.addActionListener(this); - panel.changedFromTextField.addFocusListener(this); - - panel.idTextField.addActionListener(this); - panel.productList.addKeyListener(this); - panel.componentList.addKeyListener(this); - panel.versionList.addKeyListener(this); - panel.statusList.addKeyListener(this); - panel.resolutionList.addKeyListener(this); - panel.severityList.addKeyListener(this); - panel.priorityList.addKeyListener(this); - panel.changedList.addKeyListener(this); - panel.tmList.addKeyListener(this); - - panel.summaryTextField.addActionListener(this); - panel.commentTextField.addActionListener(this); - panel.whiteboardTextField.addActionListener(this); - panel.keywordsTextField.addActionListener(this); - panel.peopleTextField.addActionListener(this); - panel.changedFromTextField.addActionListener(this); - panel.changedToTextField.addActionListener(this); - panel.changedToTextField.addActionListener(this); - - // setup parameters - parameters = new LinkedHashMap<>(); - summaryParameter = createQueryParameter(ComboParameter.class, panel.summaryComboBox, "short_desc_type"); // NOI18N - commentsParameter = createQueryParameter(ComboParameter.class, panel.commentComboBox, "long_desc_type"); // NOI18N - whiteboardParameter = createQueryParameter(ComboParameter.class, panel.whiteboardComboBox, "status_whiteboard_type"); // NOI18N - keywordsParameter = createQueryParameter(ComboParameter.class, panel.keywordsComboBox, "keywords_type"); // NOI18N - peopleParameter = createQueryParameter(ComboParameter.class, panel.peopleComboBox, "emailtype1"); // NOI18N - productParameter = createQueryParameter(ListParameter.class, panel.productList, "product"); // NOI18N - componentParameter = createQueryParameter(ListParameter.class, panel.componentList, "component"); // NOI18N - versionParameter = createQueryParameter(ListParameter.class, panel.versionList, "version"); // NOI18N - statusParameter = createQueryParameter(ListParameter.class, panel.statusList, "bug_status"); // NOI18N - resolutionParameter = createQueryParameter(ListParameter.class, panel.resolutionList, "resolution"); // NOI18N - priorityParameter = createQueryParameter(ListParameter.class, panel.priorityList, "priority"); // NOI18N - changedFieldsParameter = createQueryParameter(EmptyValuesListParameter.class, panel.changedList, "chfield"); // NOI18N - tmParameter = createQueryParameter(ListParameter.class, panel.tmList, "target_milestone"); // NOI18N - if(isNetbeans) { - issueTypeParameter = createQueryParameter(ListParameter.class, panel.issueTypeList, "cf_bug_type"); // NOI18N - severityParameter = null; - } else { - severityParameter = createQueryParameter(ListParameter.class, panel.severityList, "bug_severity"); // NOI18N - issueTypeParameter = null; - } - - createQueryParameter(AllWordsTextFieldParameter.class, panel.summaryTextField, "short_desc"); // NOI18N - createQueryParameter(AllWordsTextFieldParameter.class, panel.commentTextField, "long_desc"); // NOI18N - createQueryParameter(AllWordsTextFieldParameter.class, panel.whiteboardTextField, "status_whiteboard"); // NOI18N - createQueryParameter(TextFieldParameter.class, panel.keywordsTextField, "keywords"); // NOI18N - createQueryParameter(TextFieldParameter.class, panel.peopleTextField, "email1"); // NOI18N - createQueryParameter(CheckBoxParameter.class, panel.bugAssigneeCheckBox, "emailassigned_to1"); // NOI18N - createQueryParameter(CheckBoxParameter.class, panel.reporterCheckBox, "emailreporter1"); // NOI18N - createQueryParameter(CheckBoxParameter.class, panel.ccCheckBox, "emailcc1"); // NOI18N - createQueryParameter(CheckBoxParameter.class, panel.commenterCheckBox, "emaillongdesc1"); // NOI18N - createQueryParameter(TextFieldParameter.class, panel.changedFromTextField, "chfieldfrom"); // NOI18N - createQueryParameter(TextFieldParameter.class, panel.changedToTextField, "chfieldto"); // NOI18N - createQueryParameter(TextFieldParameter.class, panel.newValueTextField, "chfieldvalue"); // NOI18N - - for(QueryParameter p : parameters.values()) { - p.addChangeListener(this); - } - - panel.filterComboBox.setModel(new DefaultComboBoxModel(issueTable.getDefinedFilters())); - - if(query.isSaved()) { - setAsSaved(); - } else { - wasModeShow = true; // if not saved, means by default are issues shown - } - - if(urlDef) { - panel.switchQueryFields(false); - panel.urlTextField.setText(urlParameters); - populated = true; - setChanged(); - } else { - querySemaphore.acquireUninterruptibly(); - Bugzilla.LOG.log(Level.FINE, "lock aquired because populating {0}", query.getDisplayName()); // NOI18N - postPopulate(urlParameters, false); - } - } - - private void setupRenderer(IssueTable issueTable) { - BugzillaQueryCellRenderer renderer = new BugzillaQueryCellRenderer((QueryTableCellRenderer)issueTable.getRenderer()); - issueTable.setRenderer(renderer); - } - - @Override - public boolean providesMode(QueryMode mode) { - return true; - } - - @Override - public void opened() { - wasOpened = true; - if(query.isSaved()) { - setIssueCount(query.getSize()); - if(!query.wasRun()) { - onRefresh(); - } - if(refreshTask != null) { - refreshTask.fillTableIfNeccessary(); - } - } - } - - @Override - public void closed() { - onCancelChanges(); - synchronized(REFRESH_LOCK) { - if(refreshTask != null) { - refreshTask.cancel(); - } - } - if(!query.isSaved()) { - query.delete(); - } - } - - private T createQueryParameter(Class clazz, Component c, String parameter) { - try { - Constructor constructor = clazz.getConstructor(c.getClass(), String.class, String.class); - T t = constructor.newInstance(c, parameter, getRepository().getTaskRepository().getCharacterEncoding()); - parameters.put(parameter, t); - return t; - } catch (NoSuchMethodException | SecurityException | InstantiationException | IllegalAccessException | IllegalArgumentException | InvocationTargetException ex) { - Bugzilla.LOG.log(Level.SEVERE, parameter, ex); - } - return null; - } - - @Override - public JComponent getComponent(QueryMode mode) { - setMode(mode); - return panel; - } - - @Override - public HelpCtx getHelpCtx() { - return new HelpCtx("org.netbeans.modules.bugzilla.query.BugzillaQuery"); // NOI18N - } - - private void setMode(QueryMode mode) { - switch(mode) { - case EDIT: - if(query.isSaved()) { - onModify(); - } - break; - case VIEW: - wasModeShow = true; - onCancelChanges(); - selectFilter(issueTable.getAllFilter()); - break; - default: - throw new IllegalStateException("Unsupported mode " + mode); - } - } - - public String getUrlParameters(boolean encode) { - if(panel.urlPanel.isVisible()) { - return panel.urlTextField.getText(); - } else { - StringBuilder sb = new StringBuilder(); - for (QueryParameter qp : parameters.values()) { - sb.append(qp.get(encode)); - } - return sb.toString(); - } - } - - protected BugzillaRepository getRepository() { - return repository; - } - - protected void postPopulate(final String urlParameters, final boolean forceRefresh) { - - final Task[] t = new Task[1]; - Cancellable c = new Cancellable() { - @Override - public boolean cancel() { - if(t[0] != null) { - return t[0].cancel(); - } - return true; - } - }; - - final String msgPopulating = NbBundle.getMessage(QueryController.class, "MSG_Populating", new Object[]{repository.getDisplayName()}); // NOI18N - final ProgressHandle handle = ProgressHandleFactory.createHandle(msgPopulating, c); - - EventQueue.invokeLater(new Runnable() { - @Override - public void run() { - enableFields(false); - panel.showRetrievingProgress(true, msgPopulating, !query.isSaved()); - handle.start(); - } - }); - - t[0] = rp.post(new Runnable() { - @Override - public void run() { - try { - if(forceRefresh) { - repository.refreshConfiguration(); - } - populate(urlParameters); - } finally { - EventQueue.invokeLater(new Runnable() { - @Override - public void run() { - enableFields(true); - setChanged(); - handle.finish(); - panel.showRetrievingProgress(false, null, !query.isSaved()); - } - }); - } - } - }); - } - - private boolean ignoreChanges = false; - protected void populate(final String urlParameters) { - if(Bugzilla.LOG.isLoggable(Level.FINE)) { - Bugzilla.LOG.log(Level.FINE, "Starting populate query controller{0}", (query.isSaved() ? " - " + query.getDisplayName() : "")); // NOI18N - } - final BugzillaConfiguration bc = repository.getConfiguration(); - if(bc == null || !bc.isValid()) { - // XXX nice errro msg? - querySemaphore.release(); - return; - } - EventQueue.invokeLater(new Runnable() { - @Override - public void run() { - ignoreChanges = true; - try { - productParameter.setParameterValues(toParameterValues(bc.getProducts())); - populateProductDetails(); - if(isNetbeans) { - issueTypeParameter.setParameterValues(toParameterValues(bc.getIssueTypes())); - } else { - severityParameter.setParameterValues(toParameterValues(bc.getSeverities())); - } - statusParameter.setParameterValues(toParameterValues(bc.getStatusValues())); - resolutionParameter.setParameterValues(toParameterValues(getQueryResolutions(bc))); - priorityParameter.setParameterValues(toParameterValues(bc.getPriorities())); - changedFieldsParameter.setParameterValues(QueryParameter.PV_LAST_CHANGE); - summaryParameter.setParameterValues(QueryParameter.PV_TEXT_SEARCH_VALUES); - commentsParameter.setParameterValues(QueryParameter.PV_TEXT_SEARCH_VALUES); - whiteboardParameter.setParameterValues(QueryParameter.PV_TEXT_SEARCH_VALUES); - keywordsParameter.setParameterValues(QueryParameter.PV_KEYWORDS_VALUES); - peopleParameter.setParameterValues(QueryParameter.PV_PEOPLE_VALUES); - panel.changedToTextField.setText(CHANGED_NOW); - - setParameters(urlParameters != null ? urlParameters : getDefaultParameters()); - - populated = true; - Bugzilla.LOG.log(Level.FINE, "populated query {0}", query.getDisplayName()); // NOI18N - - } finally { - resetParameters(); - ignoreChanges = false; - querySemaphore.release(); - Bugzilla.LOG.log(Level.FINE, "released lock on query {0}", query.getDisplayName()); // NOI18N - - if(Bugzilla.LOG.isLoggable(Level.FINE)) { - Bugzilla.LOG.log(Level.FINE, "Finnished populate query controller {0}", (query.isSaved() ? " - " + query.getDisplayName() : "")); // NOI18N - } - } - } - }); - } - - private String getDefaultParameters() { - return BugzillaUtil.isNbRepository(repository) ? BugzillaConstants.DEFAULT_NB_STATUS_PARAMETERS : BugzillaConstants.DEFAULT_STATUS_PARAMETERS; - } - - protected void enableFields(boolean bl) { - // set all non parameter fields - panel.enableFields(bl); - // set the parameter fields - for (Map.Entry e : parameters.entrySet()) { - QueryParameter qp = parameters.get(e.getKey()); - qp.setEnabled(bl); - } - } - - protected void disableProduct() { // XXX whatever field - productParameter.setAlwaysDisabled(true); - } - - protected void selectFirstProduct() { - EventQueue.invokeLater(new Runnable() { - @Override - public void run() { - if(panel.productList.getModel().getSize() > 0) { - panel.productList.setSelectedIndex(0); - } - } - }); - } - - @Override - public void itemStateChanged(ItemEvent e) { - if(e.getSource() == panel.filterComboBox) { - onFilterChange((Filter)e.getItem()); - } - } - - @Override - public void valueChanged(ListSelectionEvent e) { - if(e.getSource() == panel.productList) { - onProductChanged(e); - } - } - - @Override - public void focusGained(FocusEvent e) { - if(panel.changedFromTextField.getText().equals("")) { // NOI18N - String lastChangeFrom = BugzillaConfig.getInstance().getLastChangeFrom(); - panel.changedFromTextField.setText(lastChangeFrom); - panel.changedFromTextField.setSelectionStart(0); - panel.changedFromTextField.setSelectionEnd(lastChangeFrom.length()); - } - } - - @Override - public void focusLost(FocusEvent e) { - // do nothing - } - - @Override - public void actionPerformed(ActionEvent e) { - if(e.getSource() == panel.searchButton) { - onRefresh(); - } else if (e.getSource() == panel.gotoIssueButton) { - onGotoIssue(); - } else if (e.getSource() == panel.keywordsButton) { - onKeywords(); - } else if (e.getSource() == panel.saveChangesButton) { - onSave(); // refresh - } else if (e.getSource() == panel.cancelChangesButton) { - onCancelChanges(); - } else if (e.getSource() == panel.webButton) { - onWeb(); - } else if (e.getSource() == panel.urlToggleButton) { - onDefineAs(); - } else if (e.getSource() == panel.refreshButton) { - onRefresh(); - } else if (e.getSource() == panel.modifyButton) { - onModify(); - } else if (e.getSource() == panel.seenButton) { - onMarkSeen(); - } else if (e.getSource() == panel.removeButton) { - onRemove(); - } else if (e.getSource() == panel.refreshConfigurationButton) { - onRefreshConfiguration(); - } else if (e.getSource() == panel.cloneQueryButton) { - onCloneQuery(); - } else if (e.getSource() == panel.idTextField) { - if(!panel.idTextField.getText().trim().equals("")) { // NOI18N - onGotoIssue(); - } - } else if (e.getSource() == panel.summaryTextField || - e.getSource() == panel.commentTextField || - e.getSource() == panel.keywordsTextField || - e.getSource() == panel.peopleTextField || - e.getSource() == panel.changedFromTextField || - e.getSource() == panel.newValueTextField || - e.getSource() == panel.changedToTextField) - { - onRefresh(); - } - } - - @Override - public void keyTyped(KeyEvent e) { - // do nothing - } - - @Override - public void keyPressed(KeyEvent e) { - // do nothing - } - - @Override - public void keyReleased(KeyEvent e) { - if(e.getKeyCode() != KeyEvent.VK_ENTER) { - return; - } - if(e.getSource() == panel.productList || - e.getSource() == panel.componentList || - e.getSource() == panel.versionList || - e.getSource() == panel.statusList || - e.getSource() == panel.resolutionList || - e.getSource() == panel.priorityList || - e.getSource() == panel.changedList) - { - onRefresh(); - } - } - - private void onFilterChange(Filter filter) { - selectFilter(filter); - } - - private void onSave() { - Bugzilla.getInstance().getRequestProcessor().post(new Runnable() { - @Override - public void run() { - saveSynchronously(null); - } - }); - } - - boolean saveSynchronously(String name) { - Bugzilla.LOG.fine("on save start"); - boolean firstTime = !query.isSaved(); - if (firstTime) { - name = name == null ? getSaveName() : name; - if (name == null) { - return false; - } - } - name = name == null ? query.getDisplayName() : name; - assert name != null; - Bugzilla.LOG.log(Level.FINE, "saving query ''{0}''", new Object[]{name}); - save(name); - - if (!firstTime) { - Bugzilla.LOG.log(Level.FINE, "refreshing query ''{0}'' after save", new Object[]{name}); - onRefresh(); - } - - Bugzilla.LOG.log(Level.FINE, "query ''{0}'' saved", new Object[]{name}); - Bugzilla.LOG.fine("on save finnish"); - - return true; - } - - void save(String name) { - query.setName(name); - saveQuery(); - query.setSaved(true); - setAsSaved(); - fireChanged(); - } - - private String getSaveName() { - QueryNameValidator v = new QueryNameValidator() { - @Override - public String isValid(String name) { - Collection queries = repository.getQueries (); - for (BugzillaQuery q : queries) { - if(q.getDisplayName().equals(name)) { - return NbBundle.getMessage(QueryController.class, "MSG_SAME_NAME"); - } - } - return null; - } - }; - return SaveQueryPanel.show(v, new HelpCtx("org.netbeans.modules.bugzilla.query.savePanel")); - } - - private void onCancelChanges() { - if(query.getDisplayName() != null) { // XXX need a better semantic - isSaved? - String urlParameters = BugzillaConfig.getInstance().getUrlParams(repository, query.getDisplayName()); - if(urlParameters != null) { - setParameters(urlParameters); - } - } - setAsSaved(); - } - - public void selectFilter(final Filter filter) { - if(filter != null) { - // XXX this part should be handled in the issues table - move the filtercombo and the label over - Collection issues = query.getIssues(); - int c = 0; - if(issues != null) { - for (BugzillaIssue issue : issues) { - if(filter.accept(issue.getNode())) c++; - } - } - final int issueCount = c; - - Runnable r = new Runnable() { - @Override - public void run() { - panel.filterComboBox.setSelectedItem(filter); - setIssueCount(issueCount); - } - }; - if(EventQueue.isDispatchThread()) { - r.run(); - } else { - EventQueue.invokeLater(r); - } - } - issueTable.setFilter(filter); - } - - private void setAsSaved() { - panel.setSaved(query.getDisplayName(), getLastRefresh()); - panel.setModifyVisible(false); - wasModeShow = true; - } - - private String getLastRefresh() throws MissingResourceException { - long l = query.getLastRefresh(); - return l > 0 ? - dateFormat.format(new Date(l)) : - NbBundle.getMessage(QueryController.class, "LBL_Never"); // NOI18N - } - - private void onGotoIssue() { - String idText = panel.idTextField.getText().trim(); - if(idText == null || idText.trim().equals("") ) { // NOI18N - return; - } - - final String id = idText.replaceAll("\\s", ""); // NOI18N - - final Task[] t = new Task[1]; - Cancellable c = new Cancellable() { - @Override - public boolean cancel() { - if(t[0] != null) { - return t[0].cancel(); - } - return true; - } - }; - final ProgressHandle handle = ProgressHandleFactory.createHandle(NbBundle.getMessage(QueryController.class, "MSG_Opening", new Object[] {id}), c); // NOI18N - t[0] = Bugzilla.getInstance().getRequestProcessor().create(new Runnable() { - @Override - public void run() { - handle.start(); - try { - openIssue(repository.getIssue(id)); - } finally { - handle.finish(); - } - } - }); - t[0].schedule(0); - } - - protected void openIssue(BugzillaIssue issue) { - if (issue != null) { - BugzillaUtil.openIssue(issue); - } else { - // XXX nice message? - } - } - - private void onWeb() { - String params = getUrlParameters(true); - String repoURL = repository.getTaskRepository().getRepositoryUrl() + "/query.cgi?format=advanced"; // NOI18N //XXX need constants - - final String urlString = repoURL + (params != null && !params.equals("") ? params : ""); // NOI18N - Bugzilla.getInstance().getRequestProcessor().post(new Runnable() { - @Override - public void run() { - URL url; - try { - url = new URL(urlString); - } catch (MalformedURLException ex) { - Bugzilla.LOG.log(Level.SEVERE, null, ex); - return; - } - HtmlBrowser.URLDisplayer displayer = HtmlBrowser.URLDisplayer.getDefault (); - if (displayer != null) { - displayer.showURL (url); - } else { - // XXX nice error message? - Bugzilla.LOG.warning("No URLDisplayer found."); // NOI18N - } - } - }); - } - - private void onProductChanged(ListSelectionEvent e) { - Object[] values = panel.productList.getSelectedValues(); - String[] products = null; - if(values != null) { - products = new String[values.length]; - for (int i = 0; i < values.length; i++) { - products[i] = ((ParameterValue) values[i]).getValue(); - } - } - populateProductDetails(products); - } - - private void onDefineAs() { - panel.switchQueryFields(panel.urlPanel.isVisible()); - } - - private void onKeywords() { - String keywords = BugzillaUtil.getKeywords(NbBundle.getMessage(QueryController.class, "LBL_SelectKeywords"), panel.keywordsTextField.getText(), repository); // NOI18N - if(keywords != null) { - panel.keywordsTextField.setText(keywords); - } - } - - public void autoRefresh() { - refresh(true, false); - } - - public void refresh(boolean synchronously) { - refresh(false, synchronously); - } - - @NbBundle.Messages({"MSG_Changed=The query was changed and has to be saved before refresh.", - "LBL_Save=Save", - "LBL_Discard=Discard"}) - public void onRefresh() { - if(query.isSaved() && isChanged()) { - NotifyDescriptor desc = new NotifyDescriptor.Confirmation( - Bundle.MSG_Changed(), NotifyDescriptor.YES_NO_CANCEL_OPTION - ); - Object[] choose = { Bundle.LBL_Save(), Bundle.LBL_Discard(), NotifyDescriptor.CANCEL_OPTION }; - desc.setOptions(choose); - Object ret = DialogDisplayer.getDefault().notify(desc); - if(ret == choose[0]) { - saveQuery(); // persist the parameters - } else if (ret == choose[1]) { - onCancelChanges(); - return; - } else { - return; - } - } - refresh(false, false); - } - - private void refresh(final boolean auto, boolean synchronously) { - Task t; - synchronized(REFRESH_LOCK) { - if(refreshTask == null) { - refreshTask = new QueryTask(); - } else { - refreshTask.cancel(); - } - t = refreshTask.post(auto); - } - if(synchronously) { - t.waitFinished(); - } - } - - private void onModify() { - panel.setModifyVisible(true); - } - - private void onMarkSeen() { - Bugzilla.getInstance().getRequestProcessor().post(new Runnable() { - @Override - public void run() { - Collection issues = query.getIssues(); - for (BugzillaIssue issue : issues) { - issue.setUpToDate(true); - } - } - }); - } - - private void onRemove() { - NotifyDescriptor nd = new NotifyDescriptor.Confirmation( - NbBundle.getMessage(QueryController.class, "MSG_RemoveQuery", new Object[] { query.getDisplayName() }), // NOI18N - NbBundle.getMessage(QueryController.class, "CTL_RemoveQuery"), // NOI18N - NotifyDescriptor.OK_CANCEL_OPTION); - - if(DialogDisplayer.getDefault().notify(nd) == NotifyDescriptor.OK_OPTION) { - Bugzilla.getInstance().getRequestProcessor().post(new Runnable() { - @Override - public void run() { - remove(); - } - }); - } - } - - protected void onCloneQuery() { - String p = getUrlParameters(false); - BugzillaQuery q = new BugzillaQuery(null, getRepository(), p, false, isUrlDefined(), true); - BugzillaUtil.openQuery(q); - } - - private void onRefreshConfiguration() { - postPopulate(getUrlParameters(false), true); - } - - private void remove() { - synchronized(REFRESH_LOCK) { - if (refreshTask != null) { - refreshTask.cancel(); - } - } - query.remove(); - } - - private void populateProductDetails(String... products) { - BugzillaConfiguration bc = repository.getConfiguration(); - if(bc == null || !bc.isValid()) { - // XXX nice errro msg? - return; - } - - // have to assure bc was loaded asyn, so do this here - List targetMilestones = bc.getTargetMilestones(null); - final boolean usingTargetMilestones = !targetMilestones.isEmpty(); - - UIUtils.runInAWT(new Runnable() { - public void run() { - panel.tmLabel.setVisible(usingTargetMilestones); - panel.tmList.setVisible(usingTargetMilestones); - panel.tmScrollPane.setVisible(usingTargetMilestones); - } - }); - - if(products == null || products.length == 0) { - products = new String[] {null}; - } - - List newComponents = new ArrayList<>(); - List newVersions = new ArrayList<>(); - List newTargetMilestone = new ArrayList<>(); - for (String p : products) { - List productComponents = bc.getComponents(p); - for (String c : productComponents) { - if(!newComponents.contains(c)) { - newComponents.add(c); - } - } - List productVersions = bc.getVersions(p); - for (String c : productVersions) { - if(!newVersions.contains(c)) { - newVersions.add(c); - } - } - if(usingTargetMilestones) { - List targetMilestone = bc.getTargetMilestones(p); - for (String c : targetMilestone) { - if(!newTargetMilestone.contains(c)) { - newTargetMilestone.add(c); - } - } - } - } - - Collections.sort(newComponents); - Collections.sort(newVersions); - - componentParameter.setParameterValues(toParameterValues(newComponents)); - versionParameter.setParameterValues(toParameterValues(newVersions)); - if(usingTargetMilestones) { - tmParameter.setParameterValues(toParameterValues(newTargetMilestone)); - } - } - - private List toParameterValues(List values) { - List ret = new ArrayList<>(values.size()); - for (String v : values) { - ret.add(new ParameterValue(v, v)); - } - return ret; - } - - private void setParameters(String urlParameters) { - if(urlParameters == null) { - return; - } - String[] params = urlParameters.split("&"); // NOI18N - if(params == null || params.length == 0) return; - Map> normalizedParams = new HashMap<>(); - for (String p : params) { - int idx = p.indexOf("="); // NOI18N - if(idx > -1) { - String parameter = p.substring(0, idx); - String value = p.substring(idx + 1); - - ParameterValue pv = new ParameterValue(value, value); - List values = normalizedParams.get(parameter); - if(values == null) { - values = new ArrayList<>(); - normalizedParams.put(parameter, values); - } - values.add(pv); - } else { - // XXX warning!! - } - } - - List componentPV = null; - List versionPV = null; - for (Map.Entry> e : normalizedParams.entrySet()) { - QueryParameter qp = parameters.get(e.getKey()); - if(qp != null) { - if(qp == componentParameter) { - componentPV = e.getValue(); - } else if(qp == versionParameter) { - versionPV = e.getValue(); - } else { - List pvs = e.getValue(); - qp.setValues(pvs.toArray(new ParameterValue[0])); - } - } - } - setDependentParameter(componentParameter, componentPV); - setDependentParameter(versionParameter, versionPV); - } - - private void setDependentParameter(QueryParameter qp, List values) { - if(values != null) { - qp.setValues(values.toArray(new ParameterValue[0])); - } - } - - private void setIssueCount(final int count) { - EventQueue.invokeLater(new Runnable() { - @Override - public void run() { - String msg = - count == 1 ? - NbBundle.getMessage(QueryController.class, "LBL_MatchingIssue", new Object[] {count}) : // NOI18N - NbBundle.getMessage(QueryController.class, "LBL_MatchingIssues", new Object[] {count}); // NOI18N - panel.tableSummaryLabel.setText(msg); - } - }); - } - - boolean isUrlDefined() { - return panel.urlPanel.isVisible(); - } - - void switchToDeterminateProgress(long issuesCount) { - synchronized(REFRESH_LOCK) { - if(refreshTask != null) { - refreshTask.switchToDeterminateProgress(issuesCount); - } - } - } - - void addProgressUnit(String issueDesc) { - synchronized(REFRESH_LOCK) { - if(refreshTask != null) { - refreshTask.addProgressUnit(issueDesc); - } - } - } - - @Override - public void stateChanged(ChangeEvent e) { - setChanged(); - } - - public void setChanged() { - UIUtils.runInAWT(new Runnable() { - @Override - public void run() { - panel.saveChangesButton.setEnabled((!ignoreChanges && isChanged()) || !query.isSaved()); - fireChanged(); - } - }); - } - - @Override - public boolean isChanged() { - for(QueryParameter p : parameters.values()) { - if(p.isChanged()) { - return true; - } - } - return false; - } - - private List getQueryResolutions(BugzillaConfiguration bc) { - List l = new ArrayList<>(bc.getResolutions()); - l.add(0, "---"); - return l; - } - - private void resetParameters() { - for(QueryParameter p : parameters.values()) { - p.reset(); - } - } - - private void saveQuery() { - String name = query.getDisplayName(); - Bugzilla.LOG.log(Level.FINE, "saving query ''{0}''", new Object[]{name}); // NOI18N - repository.saveQuery(query); - resetParameters(); - Bugzilla.LOG.log(Level.FINE, "query ''{0}'' saved", new Object[]{name}); // NOI18N - } - - @Override - public boolean saveChanges(String name) { - return saveSynchronously(name); - } - - @Override - public boolean discardUnsavedChanges() { - onCancelChanges(); - return true; - } - - private final PropertyChangeSupport support = new PropertyChangeSupport(this); - @Override - public void addPropertyChangeListener(PropertyChangeListener l) { - support.addPropertyChangeListener(l); - } - - @Override - public void removePropertyChangeListener(PropertyChangeListener l) { - support.removePropertyChangeListener(l); - } - - private void fireChanged() { - support.firePropertyChange(QueryController.PROP_CHANGED, null, null); - } - - /** - * package private for testing purposes - */ - IssueTable getIssueTable() { - return issueTable; - } - - public void setContainer(QueryProvider.IssueContainer c) { - delegatingIssueContainer = c; - } - - private class QueryTask implements Runnable, Cancellable, QueryNotifyListener { - private ProgressHandle handle; - private Task task; - private int counter; - private boolean autoRefresh; - private long progressMaxWorkunits; - private int progressWorkunits; - private final LinkedList notifiedIssues = new LinkedList<>(); - - public QueryTask() { - query.addNotifyListener(this); - } - - private void startQuery() { - // NOI18N - String displayName = query.getDisplayName() != null ? query.getDisplayName() + " (" + repository.getDisplayName() + ")" // NOI18N - : repository.getDisplayName(); - handle = ProgressHandleFactory.createHandle( - NbBundle.getMessage( - QueryController.class, - "MSG_SearchingQuery", // NOI18N - new Object[]{ - displayName}), - this); - EventQueue.invokeLater(new Runnable() { - @Override - public void run() { - enableFields(false); - panel.showSearchingProgress(true, NbBundle.getMessage(QueryController.class, "MSG_Searching")); // NOI18N - } - }); - if(delegatingIssueContainer != null) { - delegatingIssueContainer.refreshingStarted(); - } - handle.start(); - } - - private void finnishQuery() { - task = null; - if(delegatingIssueContainer != null) { - delegatingIssueContainer.refreshingFinished(); - } - if(handle != null) { - handle.finish(); - handle = null; - } - EventQueue.invokeLater(new Runnable() { - @Override - public void run() { - panel.setQueryRunning(false); - panel.setLastRefresh(getLastRefresh()); - panel.showNoContentPanel(false); - enableFields(true); - } - }); - } - - void switchToDeterminateProgress(long progressMaxWorkunits) { - if(handle != null) { - handle.switchToDeterminate((int) progressMaxWorkunits); - this.progressMaxWorkunits = progressMaxWorkunits; - this.progressWorkunits = 0; - } - } - - void addProgressUnit(String issueDesc) { - if(handle != null && progressWorkunits < progressMaxWorkunits) { - handle.progress( - NbBundle.getMessage( - QueryController.class, "LBL_RetrievingIssue", new Object[] {issueDesc}), - ++progressWorkunits); - } - } - - private void executeQuery() { - setQueryRunning(true); - // XXX isn't persistent and should be merged with refresh - String lastChageFrom = panel.changedFromTextField.getText().trim(); - if(lastChageFrom != null && !lastChageFrom.equals("")) { // NOI18N - BugzillaConfig.getInstance().setLastChangeFrom(lastChageFrom); - } - try { - if (panel.urlPanel.isVisible()) { - // XXX check url format etc... - // XXX what if there is a different host in queries repository as in the url? - query.refresh(panel.urlTextField.getText(), autoRefresh); - } else { - query.refresh(getUrlParameters(true), autoRefresh); - } - } finally { - setQueryRunning(false); // XXX do we need this? its called in finishQuery anyway - task = null; - } - - } - - private void setQueryRunning(final boolean running) { - EventQueue.invokeLater(new Runnable() { - @Override - public void run() { - panel.setQueryRunning(running); - } - }); - } - - @Override - public void run() { - startQuery(); - try { - Bugzilla.LOG.log(Level.FINE, "waiting until lock releases in query {0}", query.getDisplayName()); // NOI18N - long t = System.currentTimeMillis(); - try { - querySemaphore.acquire(); - } catch (InterruptedException ex) { - Bugzilla.LOG.log(Level.INFO, "interuped while trying to lock query", ex); // NOI18N - return; - } - querySemaphore.release(); - Bugzilla.LOG.log(Level.FINE, "lock aquired for query {0} after {1}", new Object[]{query.getDisplayName(), System.currentTimeMillis() - t}); // NOI18N - if(!populated) { - Bugzilla.LOG.log(Level.WARNING, "Skipping refresh of query {0} because isn''t populated.", query.getDisplayName()); // NOI18N - // something went wrong during populate - skip execute - return; - } - executeQuery(); - } finally { - finnishQuery(); - } - } - - Task post(boolean autoRefresh) { - Task t = task; - if (t != null) { - t.cancel(); - } - task = t = rp.create(this); - this.autoRefresh = autoRefresh; - t.schedule(0); - return t; - } - - @Override - public boolean cancel() { - Task t = task; - if (t != null) { - t.cancel(); - finnishQuery(); - } - return true; - } - - @Override - public void notifyDataAdded (final BugzillaIssue issue) { - if(delegatingIssueContainer != null) { - delegatingIssueContainer.add(issue); - } - if(wasOpened && wasModeShow) { - issueTable.addNode(issue.getNode()); - } else { - synchronized(notifiedIssues) { - notifiedIssues.add(issue); - } - } - setIssueCount(++counter); - if(counter == 1) { - EventQueue.invokeLater(new Runnable() { - @Override - public void run() { - panel.showNoContentPanel(false); - } - }); - } - } - - @Override - public void notifyDataRemoved (final BugzillaIssue issue) { - if(delegatingIssueContainer != null) { - delegatingIssueContainer.remove(issue); - } - // issue table cannot remove data - } - - @Override - public void started() { - issueTable.started(); - counter = 0; - synchronized(notifiedIssues) { - notifiedIssues.clear(); - } - setIssueCount(counter); - } - - @Override - public void finished() { } - - void fillTableIfNeccessary() { - synchronized(notifiedIssues) { - for (BugzillaIssue issue : notifiedIssues) { - issueTable.addNode(issue.getNode()); - } - notifiedIssues.clear(); - } - } - - } - -} diff --git a/ide/bugzilla/src/org/netbeans/modules/bugzilla/query/QueryNotifyListener.java b/ide/bugzilla/src/org/netbeans/modules/bugzilla/query/QueryNotifyListener.java deleted file mode 100644 index 1b90d1d34a70..000000000000 --- a/ide/bugzilla/src/org/netbeans/modules/bugzilla/query/QueryNotifyListener.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.netbeans.modules.bugzilla.query; - -import org.netbeans.modules.bugzilla.issue.BugzillaIssue; - -/** - * Notifies changes on a query - * @author Tomas Stupka - */ -public interface QueryNotifyListener { - - /** - * Query execution was started - */ - public void started(); - - /** - * - * @param issue - */ - public void notifyDataAdded (BugzillaIssue issue); - - /** - * - * @param issue - */ - public void notifyDataRemoved (BugzillaIssue issue); - - /** - * Query execution was finished - */ - public void finished(); - -} diff --git a/ide/bugzilla/src/org/netbeans/modules/bugzilla/query/QueryPanel.form b/ide/bugzilla/src/org/netbeans/modules/bugzilla/query/QueryPanel.form deleted file mode 100644 index 6fbe51ab5178..000000000000 --- a/ide/bugzilla/src/org/netbeans/modules/bugzilla/query/QueryPanel.form +++ /dev/null @@ -1,2109 +0,0 @@ - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/ide/bugzilla/src/org/netbeans/modules/bugzilla/query/QueryPanel.java b/ide/bugzilla/src/org/netbeans/modules/bugzilla/query/QueryPanel.java deleted file mode 100644 index f1120a108c0c..000000000000 --- a/ide/bugzilla/src/org/netbeans/modules/bugzilla/query/QueryPanel.java +++ /dev/null @@ -1,1479 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.netbeans.modules.bugzilla.query; - -import java.awt.Color; -import java.awt.Component; -import java.awt.Dimension; -import java.awt.Font; -import java.awt.event.FocusEvent; -import java.awt.event.MouseAdapter; -import java.awt.event.MouseEvent; -import javax.swing.DefaultComboBoxModel; -import javax.swing.DefaultListCellRenderer; -import javax.swing.Icon; -import javax.swing.JComponent; -import javax.swing.JLabel; -import javax.swing.JList; -import javax.swing.JPanel; -import javax.swing.JScrollPane; -import javax.swing.JTree; -import javax.swing.plaf.basic.BasicTreeUI; -import org.netbeans.modules.bugtracking.issuetable.Filter; -import org.netbeans.modules.bugtracking.commons.UIUtils; -import org.netbeans.modules.bugzilla.query.QueryParameter.ParameterValueCellRenderer; -import org.netbeans.modules.bugzilla.util.BugzillaUtil; - -/** - * - * @author Tomas Stupka, Jan Stola - */ -public class QueryPanel extends javax.swing.JPanel { - - final ExpandablePanel byText; - final ExpandablePanel byDetails; - final ExpandablePanel byPeople; - final ExpandablePanel byLastChange; - private final Color defaultTextColor; - - /** Creates new form QueryPanel */ - public QueryPanel(JComponent tableComponent) { - initComponents(); - - Color bkColor = UIUtils.getSectionPanelBackground(); - gotoPanel.setBackground( bkColor ); - tablePanel.setBackground( bkColor ); - urlPanel.setBackground( bkColor ); - criteriaPanel.setBackground( bkColor ); - - Font f = new JLabel().getFont(); - int s = f.getSize(); - nameLabel.setFont(jLabel1.getFont().deriveFont(s * 1.7f)); - defaultTextColor = noContentLabel.getForeground(); - - tablePanel.add(tableComponent); - - JTree tv = new JTree(); - BasicTreeUI tvui = (BasicTreeUI) tv.getUI(); - Icon ei = tvui.getExpandedIcon(); - Icon ci = tvui.getCollapsedIcon(); - - byTextContainer.add(byTextPanel); - byDetailsContainer.add(byDetailsPanel); - byPeopleContainer.add(byPeoplePanel); - byLastChangeContainer.add(byLastChangePanel); - - byText = new ExpandablePanel(byTextLabel, byTextContainer, ei, ci); - byDetails = new ExpandablePanel(byDetailsLabel, byDetailsContainer, ei, ci); - byPeople = new ExpandablePanel(byPeopleLabel, byPeopleContainer, ei, ci); - byLastChange = new ExpandablePanel(byLastChangeLabel, byLastChangeContainer, ei, ci); - - byText.expand(); - byDetails.expand(); - byPeople.colapse(); - byLastChange.colapse(); - - urlPanel.setVisible(false); - queryHeaderPanel.setVisible(false); - tableFieldsPanel.setVisible(false); - cancelChangesButton.setVisible(false); - filterComboBox.setVisible(false); - filterLabel.setVisible(false); - noContentPanel.setVisible(false); - - saveChangesButton.setEnabled(false); - - bugAssigneeCheckBox.setOpaque(false); - reporterCheckBox.setOpaque(false); - ccCheckBox.setOpaque(false); - commenterCheckBox.setOpaque(false); - - summaryComboBox.setModel(new DefaultComboBoxModel()); - commentComboBox.setModel(new DefaultComboBoxModel()); - keywordsComboBox.setModel(new DefaultComboBoxModel()); - peopleComboBox.setModel(new DefaultComboBoxModel()); - - summaryComboBox.setRenderer(new ParameterValueCellRenderer()); - commentComboBox.setRenderer(new ParameterValueCellRenderer()); - whiteboardComboBox.setRenderer(new ParameterValueCellRenderer()); - keywordsComboBox.setRenderer(new ParameterValueCellRenderer()); - peopleComboBox.setRenderer(new ParameterValueCellRenderer()); - severityList.setCellRenderer(new ParameterValueCellRenderer()); - issueTypeList.setCellRenderer(new ParameterValueCellRenderer()); - productList.setCellRenderer(new ParameterValueCellRenderer()); - componentList.setCellRenderer(new ParameterValueCellRenderer()); - versionList.setCellRenderer(new ParameterValueCellRenderer()); - statusList.setCellRenderer(new ParameterValueCellRenderer()); - resolutionList.setCellRenderer(new ParameterValueCellRenderer()); - priorityList.setCellRenderer(new QueryParameter.PriorityRenderer()); - changedList.setCellRenderer(new ParameterValueCellRenderer()); - tmList.setCellRenderer(new ParameterValueCellRenderer()); - - filterComboBox.setRenderer(new FilterCellRenderer()); - - UIUtils.keepFocusedComponentVisible(this); - UIUtils.keepComponentsWidthByVisibleArea(this, new UIUtils.SizeController() { - @Override - public void setWidth(int width) { - setContainerSize(byTextContainer, width, byTextPanel.getPreferredSize().height); - setContainerSize(byPeopleContainer, width, byPeoplePanel.getPreferredSize().height); - setContainerSize(byLastChangeContainer, width, byLastChangePanel.getPreferredSize().height); - } - private void setContainerSize(JComponent cmp, int width, int height) { - cmp.setPreferredSize(new Dimension(width, height)); - cmp.revalidate(); - } - }); - - validate(); - repaint(); - } - - void setQueryRunning(final boolean running) { - UIUtils.runInAWT(new Runnable() { - @Override - public void run() { - modifyButton.setEnabled(!running); - seenButton.setEnabled(!running); - removeButton.setEnabled(!running); - refreshButton.setEnabled(!running); - filterLabel.setEnabled(!running); - filterComboBox.setEnabled(!running); - } - }); - } - - /** This method is called from within the constructor to - * initialize the form. - * WARNING: Do NOT modify this code. The content of this method is - * always regenerated by the Form Editor. - */ - @SuppressWarnings("unchecked") - // //GEN-BEGIN:initComponents - private void initComponents() { - - byLastChangePanel = new javax.swing.JPanel(); - changedLabel = new javax.swing.JLabel(); - changedAndLabel = new javax.swing.JLabel(); - changedHintLabel = new javax.swing.JLabel(); - changedWhereLabel = new javax.swing.JLabel(); - jScrollPane1 = new javax.swing.JScrollPane(); - changedBlaBlaLabel = new javax.swing.JLabel(); - byPeoplePanel = new javax.swing.JPanel(); - byTextPanel = new javax.swing.JPanel(); - tableFieldsPanel = new javax.swing.JPanel(); - tableHeaderPanel = new javax.swing.JPanel(); - filterLabel = new javax.swing.JLabel(); - criteriaPanel = new javax.swing.JPanel(); - jLabel2 = new javax.swing.JLabel(); - jLabel1 = new javax.swing.JLabel(); - separatorLabel2 = new javax.swing.JLabel(); - separatorLabel3 = new javax.swing.JLabel(); - queryHeaderPanel = new javax.swing.JPanel(); - lastRefreshLabel = new javax.swing.JLabel(); - jLabel4 = new javax.swing.JLabel(); - jLabel5 = new javax.swing.JLabel(); - jLabel6 = new javax.swing.JLabel(); - jLabel7 = new javax.swing.JLabel(); - noContentPanel = new javax.swing.JPanel(); - noContentLabel = new javax.swing.JLabel(); - - byLastChangePanel.setBackground(javax.swing.UIManager.getDefaults().getColor("TextArea.background")); - - changedLabel.setLabelFor(changedFromTextField); - org.openide.awt.Mnemonics.setLocalizedText(changedLabel, org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.changedLabel.text_1")); // NOI18N - - changedFromTextField.setColumns(8); - changedFromTextField.setText(org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.changedFromTextField.text")); // NOI18N - - changedAndLabel.setLabelFor(changedToTextField); - org.openide.awt.Mnemonics.setLocalizedText(changedAndLabel, org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.changedAndLabel.text")); // NOI18N - - changedToTextField.setColumns(8); - changedToTextField.setText(org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.changedToTextField.text")); // NOI18N - - changedHintLabel.setForeground(javax.swing.UIManager.getDefaults().getColor("Label.disabledForeground")); - org.openide.awt.Mnemonics.setLocalizedText(changedHintLabel, org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.changedHintLabel.text")); // NOI18N - - changedWhereLabel.setLabelFor(changedList); - org.openide.awt.Mnemonics.setLocalizedText(changedWhereLabel, org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.changedWhereLabel.text")); // NOI18N - - jScrollPane1.setViewportView(changedList); - changedList.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.changedList.AccessibleContext.accessibleDescription")); // NOI18N - - changedBlaBlaLabel.setLabelFor(newValueTextField); - org.openide.awt.Mnemonics.setLocalizedText(changedBlaBlaLabel, org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.changedBlaBlaLabel.text")); // NOI18N - - newValueTextField.setColumns(20); - - javax.swing.GroupLayout byLastChangePanelLayout = new javax.swing.GroupLayout(byLastChangePanel); - byLastChangePanel.setLayout(byLastChangePanelLayout); - byLastChangePanelLayout.setHorizontalGroup( - byLastChangePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(byLastChangePanelLayout.createSequentialGroup() - .addContainerGap() - .addGroup(byLastChangePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(byLastChangePanelLayout.createSequentialGroup() - .addComponent(changedLabel) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addGroup(byLastChangePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(changedHintLabel) - .addGroup(byLastChangePanelLayout.createSequentialGroup() - .addComponent(changedFromTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(changedAndLabel) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(changedToTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))) - .addGap(0, 253, Short.MAX_VALUE)) - .addGroup(byLastChangePanelLayout.createSequentialGroup() - .addComponent(changedWhereLabel) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 216, javax.swing.GroupLayout.PREFERRED_SIZE) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(changedBlaBlaLabel) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(newValueTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 1, Short.MAX_VALUE))) - .addContainerGap()) - ); - byLastChangePanelLayout.setVerticalGroup( - byLastChangePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(byLastChangePanelLayout.createSequentialGroup() - .addContainerGap() - .addGroup(byLastChangePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) - .addComponent(changedLabel) - .addComponent(changedAndLabel) - .addComponent(changedToTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(changedFromTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addGap(4, 4, 4) - .addComponent(changedHintLabel) - .addGap(18, 18, 18) - .addGroup(byLastChangePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(changedWhereLabel) - .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 71, javax.swing.GroupLayout.PREFERRED_SIZE) - .addGroup(byLastChangePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) - .addComponent(changedBlaBlaLabel) - .addComponent(newValueTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))) - .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) - ); - - changedFromTextField.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.changedFromTextField.AccessibleContext.accessibleDescription")); // NOI18N - changedToTextField.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.changedToTextField.AccessibleContext.accessibleDescription")); // NOI18N - newValueTextField.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.newValueTextField.AccessibleContext.accessibleDescription")); // NOI18N - - byPeoplePanel.setBackground(javax.swing.UIManager.getDefaults().getColor("TextArea.background")); - - org.openide.awt.Mnemonics.setLocalizedText(peopleLabel, org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.peopleLabel.text")); // NOI18N - - org.openide.awt.Mnemonics.setLocalizedText(bugAssigneeCheckBox, org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.bugAssigneeCheckBox.text")); // NOI18N - - org.openide.awt.Mnemonics.setLocalizedText(reporterCheckBox, org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.reporterCheckBox.text")); // NOI18N - reporterCheckBox.addActionListener(new java.awt.event.ActionListener() { - public void actionPerformed(java.awt.event.ActionEvent evt) { - reporterCheckBoxActionPerformed(evt); - } - }); - - org.openide.awt.Mnemonics.setLocalizedText(ccCheckBox, org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.ccCheckBox.text")); // NOI18N - - org.openide.awt.Mnemonics.setLocalizedText(commenterCheckBox, org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.commenterCheckBox.text")); // NOI18N - - peopleComboBox.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" })); - - peopleTextField.setColumns(17); - - javax.swing.GroupLayout byPeoplePanelLayout = new javax.swing.GroupLayout(byPeoplePanel); - byPeoplePanel.setLayout(byPeoplePanelLayout); - byPeoplePanelLayout.setHorizontalGroup( - byPeoplePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(byPeoplePanelLayout.createSequentialGroup() - .addContainerGap() - .addComponent(peopleLabel) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addGroup(byPeoplePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(commenterCheckBox) - .addComponent(ccCheckBox) - .addGroup(byPeoplePanelLayout.createSequentialGroup() - .addComponent(bugAssigneeCheckBox) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(peopleComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addGap(7, 7, 7) - .addComponent(peopleTextField)) - .addComponent(reporterCheckBox)) - .addContainerGap()) - ); - byPeoplePanelLayout.setVerticalGroup( - byPeoplePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(byPeoplePanelLayout.createSequentialGroup() - .addContainerGap() - .addGroup(byPeoplePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) - .addGroup(byPeoplePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) - .addComponent(peopleComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(peopleTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addGroup(byPeoplePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) - .addComponent(bugAssigneeCheckBox) - .addComponent(peopleLabel))) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(reporterCheckBox) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(ccCheckBox) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(commenterCheckBox) - .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) - ); - - bugAssigneeCheckBox.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.bugAssigneeCheckBox.AccessibleContext.accessibleDescription")); // NOI18N - reporterCheckBox.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.reporterCheckBox.AccessibleContext.accessibleDescription")); // NOI18N - ccCheckBox.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.ccCheckBox.AccessibleContext.accessibleDescription")); // NOI18N - commenterCheckBox.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.commenterCheckBox.AccessibleContext.accessibleDescription")); // NOI18N - peopleComboBox.getAccessibleContext().setAccessibleName(org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.peopleComboBox.AccessibleContext.accessibleName")); // NOI18N - peopleComboBox.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.peopleComboBox.AccessibleContext.accessibleDescription")); // NOI18N - peopleTextField.getAccessibleContext().setAccessibleName(org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.peopleTextField.AccessibleContext.accessibleName")); // NOI18N - peopleTextField.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.peopleTextField.AccessibleContext.accessibleDescription")); // NOI18N - - byDetailsPanel.setBackground(javax.swing.UIManager.getDefaults().getColor("TextArea.background")); - - productLabel.setFont(productLabel.getFont().deriveFont(productLabel.getFont().getStyle() | java.awt.Font.BOLD)); - productLabel.setLabelFor(productList); - org.openide.awt.Mnemonics.setLocalizedText(productLabel, org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.productLabel.text")); // NOI18N - - versionLabel.setFont(versionLabel.getFont().deriveFont(versionLabel.getFont().getStyle() | java.awt.Font.BOLD)); - versionLabel.setLabelFor(versionList); - org.openide.awt.Mnemonics.setLocalizedText(versionLabel, org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.versionLabel.text")); // NOI18N - - versionScrollPane.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); - - versionList.setModel(new javax.swing.AbstractListModel() { - String[] strings = { "" }; - public int getSize() { return strings.length; } - public Object getElementAt(int i) { return strings[i]; } - }); - versionList.setVisibleRowCount(6); - versionScrollPane.setViewportView(versionList); - versionList.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.versionList.AccessibleContext.accessibleDescription")); // NOI18N - - statusLabel.setFont(statusLabel.getFont().deriveFont(statusLabel.getFont().getStyle() | java.awt.Font.BOLD)); - statusLabel.setLabelFor(statusList); - org.openide.awt.Mnemonics.setLocalizedText(statusLabel, org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.statusLabel.text")); // NOI18N - - statusScrollPane.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); - - statusList.setModel(new javax.swing.AbstractListModel() { - String[] strings = { "" }; - public int getSize() { return strings.length; } - public Object getElementAt(int i) { return strings[i]; } - }); - statusList.setVisibleRowCount(6); - statusScrollPane.setViewportView(statusList); - statusList.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.statusList.AccessibleContext.accessibleDescription")); // NOI18N - - resolutionLabel.setFont(resolutionLabel.getFont().deriveFont(resolutionLabel.getFont().getStyle() | java.awt.Font.BOLD)); - resolutionLabel.setLabelFor(resolutionList); - org.openide.awt.Mnemonics.setLocalizedText(resolutionLabel, org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.resolutionLabel.text")); // NOI18N - - priorityScrollPane.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); - - priorityList.setModel(new javax.swing.AbstractListModel() { - String[] strings = { "" }; - public int getSize() { return strings.length; } - public Object getElementAt(int i) { return strings[i]; } - }); - priorityList.setVisibleRowCount(6); - priorityScrollPane.setViewportView(priorityList); - priorityList.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.priorityList.AccessibleContext.accessibleDescription")); // NOI18N - - priorityLabel.setFont(priorityLabel.getFont().deriveFont(priorityLabel.getFont().getStyle() | java.awt.Font.BOLD)); - priorityLabel.setLabelFor(priorityList); - org.openide.awt.Mnemonics.setLocalizedText(priorityLabel, org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.priorityLabel.text")); // NOI18N - - resolutionScrollPane.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); - - resolutionList.setModel(new javax.swing.AbstractListModel() { - String[] strings = { "" }; - public int getSize() { return strings.length; } - public Object getElementAt(int i) { return strings[i]; } - }); - resolutionList.setVisibleRowCount(6); - resolutionScrollPane.setViewportView(resolutionList); - resolutionList.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.resolutionList.AccessibleContext.accessibleDescription")); // NOI18N - - componentLabel.setFont(componentLabel.getFont().deriveFont(componentLabel.getFont().getStyle() | java.awt.Font.BOLD)); - componentLabel.setLabelFor(componentList); - org.openide.awt.Mnemonics.setLocalizedText(componentLabel, org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.componentLabel.text")); // NOI18N - - componentScrollPane.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); - - componentList.setModel(new javax.swing.AbstractListModel() { - String[] strings = { "" }; - public int getSize() { return strings.length; } - public Object getElementAt(int i) { return strings[i]; } - }); - componentList.setVisibleRowCount(6); - componentScrollPane.setViewportView(componentList); - componentList.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.componentList.AccessibleContext.accessibleDescription")); // NOI18N - - productScrollPane.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); - - productList.setModel(new javax.swing.AbstractListModel() { - String[] strings = { "" }; - public int getSize() { return strings.length; } - public Object getElementAt(int i) { return strings[i]; } - }); - productList.setVisibleRowCount(6); - productScrollPane.setViewportView(productList); - productList.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.productList.AccessibleContext.accessibleDescription")); // NOI18N - - severityLabel.setFont(severityLabel.getFont().deriveFont(severityLabel.getFont().getStyle() | java.awt.Font.BOLD)); - severityLabel.setLabelFor(severityList); - org.openide.awt.Mnemonics.setLocalizedText(severityLabel, org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.severityLabel.text")); // NOI18N - - severityScrollPane.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); - - severityList.setModel(new javax.swing.AbstractListModel() { - String[] strings = { "" }; - public int getSize() { return strings.length; } - public Object getElementAt(int i) { return strings[i]; } - }); - severityList.setVisibleRowCount(6); - severityScrollPane.setViewportView(severityList); - severityList.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.severityList.AccessibleContext.accessibleDescription")); // NOI18N - - issueTypeLabel.setFont(issueTypeLabel.getFont().deriveFont(issueTypeLabel.getFont().getStyle() | java.awt.Font.BOLD)); - issueTypeLabel.setLabelFor(severityList); - org.openide.awt.Mnemonics.setLocalizedText(issueTypeLabel, org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.issueTypeLabel.text")); // NOI18N - - issueTypeScrollPane.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); - - issueTypeList.setModel(new javax.swing.AbstractListModel() { - String[] strings = { "" }; - public int getSize() { return strings.length; } - public Object getElementAt(int i) { return strings[i]; } - }); - issueTypeList.setVisibleRowCount(6); - issueTypeScrollPane.setViewportView(issueTypeList); - - tmLabel.setFont(tmLabel.getFont().deriveFont(tmLabel.getFont().getStyle() | java.awt.Font.BOLD)); - tmLabel.setLabelFor(severityList); - org.openide.awt.Mnemonics.setLocalizedText(tmLabel, org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.tmLabel.text")); // NOI18N - - tmScrollPane.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); - - tmList.setModel(new javax.swing.AbstractListModel() { - String[] strings = { "" }; - public int getSize() { return strings.length; } - public Object getElementAt(int i) { return strings[i]; } - }); - tmList.setVisibleRowCount(6); - tmScrollPane.setViewportView(tmList); - - javax.swing.GroupLayout byDetailsPanelLayout = new javax.swing.GroupLayout(byDetailsPanel); - byDetailsPanel.setLayout(byDetailsPanelLayout); - byDetailsPanelLayout.setHorizontalGroup( - byDetailsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(byDetailsPanelLayout.createSequentialGroup() - .addContainerGap() - .addGroup(byDetailsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(productLabel) - .addComponent(productScrollPane, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addGroup(byDetailsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(componentLabel) - .addComponent(componentScrollPane, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addGroup(byDetailsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(versionLabel) - .addComponent(versionScrollPane, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addGap(18, 18, 18) - .addGroup(byDetailsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(statusLabel) - .addComponent(statusScrollPane, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addGroup(byDetailsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(resolutionLabel) - .addComponent(resolutionScrollPane, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addGroup(byDetailsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) - .addComponent(priorityScrollPane) - .addComponent(priorityLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addGroup(byDetailsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(severityLabel) - .addComponent(severityScrollPane, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addGroup(byDetailsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(issueTypeLabel) - .addComponent(issueTypeScrollPane, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addGroup(byDetailsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(tmLabel) - .addComponent(tmScrollPane, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) - ); - byDetailsPanelLayout.setVerticalGroup( - byDetailsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(byDetailsPanelLayout.createSequentialGroup() - .addContainerGap() - .addGroup(byDetailsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(byDetailsPanelLayout.createSequentialGroup() - .addComponent(tmLabel) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(tmScrollPane)) - .addGroup(byDetailsPanelLayout.createSequentialGroup() - .addComponent(issueTypeLabel) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(issueTypeScrollPane)) - .addGroup(byDetailsPanelLayout.createSequentialGroup() - .addGroup(byDetailsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) - .addComponent(productLabel) - .addComponent(componentLabel) - .addComponent(versionLabel) - .addComponent(statusLabel) - .addComponent(resolutionLabel) - .addComponent(priorityLabel) - .addComponent(severityLabel)) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addGroup(byDetailsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(priorityScrollPane) - .addComponent(productScrollPane) - .addComponent(componentScrollPane) - .addComponent(versionScrollPane) - .addComponent(statusScrollPane) - .addComponent(resolutionScrollPane) - .addComponent(severityScrollPane)))) - .addContainerGap()) - ); - - byTextPanel.setBackground(javax.swing.UIManager.getDefaults().getColor("TextArea.background")); - - summaryLabel.setLabelFor(summaryComboBox); - org.openide.awt.Mnemonics.setLocalizedText(summaryLabel, org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.summaryLabel.text_1")); // NOI18N - - commentLabel.setLabelFor(commentComboBox); - org.openide.awt.Mnemonics.setLocalizedText(commentLabel, org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.commentLabel.text")); // NOI18N - - keywordsLabel.setLabelFor(keywordsComboBox); - org.openide.awt.Mnemonics.setLocalizedText(keywordsLabel, org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.keywordsLabel.text")); // NOI18N - - summaryComboBox.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" })); - - commentComboBox.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" })); - - keywordsComboBox.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" })); - - summaryTextField.setColumns(30); - - commentTextField.setColumns(30); - - keywordsTextField.setColumns(30); - - org.openide.awt.Mnemonics.setLocalizedText(keywordsButton, org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.keywordsButton.text")); // NOI18N - keywordsButton.addActionListener(new java.awt.event.ActionListener() { - public void actionPerformed(java.awt.event.ActionEvent evt) { - keywordsButtonActionPerformed(evt); - } - }); - - whiteboardLabel.setLabelFor(commentComboBox); - org.openide.awt.Mnemonics.setLocalizedText(whiteboardLabel, org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.whiteboardLabel.text")); // NOI18N - - whiteboardComboBox.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" })); - - whiteboardTextField.setColumns(30); - - javax.swing.GroupLayout byTextPanelLayout = new javax.swing.GroupLayout(byTextPanel); - byTextPanel.setLayout(byTextPanelLayout); - byTextPanelLayout.setHorizontalGroup( - byTextPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(byTextPanelLayout.createSequentialGroup() - .addContainerGap() - .addGroup(byTextPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(summaryLabel) - .addComponent(commentLabel) - .addComponent(whiteboardLabel) - .addComponent(keywordsLabel)) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addGroup(byTextPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(commentComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(summaryComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(whiteboardComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(keywordsComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addGroup(byTextPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(commentTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 1, Short.MAX_VALUE) - .addComponent(summaryTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 1, Short.MAX_VALUE) - .addGroup(byTextPanelLayout.createSequentialGroup() - .addGroup(byTextPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(keywordsTextField, javax.swing.GroupLayout.DEFAULT_SIZE, 82, Short.MAX_VALUE) - .addComponent(whiteboardTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 1, Short.MAX_VALUE)) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(keywordsButton))) - .addContainerGap()) - ); - byTextPanelLayout.setVerticalGroup( - byTextPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(byTextPanelLayout.createSequentialGroup() - .addContainerGap() - .addGroup(byTextPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) - .addComponent(summaryLabel) - .addComponent(summaryComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(summaryTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addGroup(byTextPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) - .addComponent(commentLabel) - .addComponent(commentTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(commentComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addGroup(byTextPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) - .addComponent(whiteboardLabel) - .addComponent(whiteboardTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(whiteboardComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addGroup(byTextPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) - .addComponent(keywordsLabel) - .addComponent(keywordsComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(keywordsTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(keywordsButton)) - .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) - ); - - summaryComboBox.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.summaryComboBox.AccessibleContext.accessibleDescription")); // NOI18N - commentComboBox.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.commentComboBox.AccessibleContext.accessibleDescription")); // NOI18N - keywordsComboBox.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.keywordsComboBox.AccessibleContext.accessibleDescription")); // NOI18N - summaryTextField.getAccessibleContext().setAccessibleName(org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.summaryTextField.AccessibleContext.accessibleName")); // NOI18N - summaryTextField.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.summaryTextField.AccessibleContext.accessibleDescription")); // NOI18N - commentTextField.getAccessibleContext().setAccessibleName(org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.commentTextField.AccessibleContext.accessibleName")); // NOI18N - commentTextField.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.commentTextField.AccessibleContext.accessibleDescription")); // NOI18N - keywordsTextField.getAccessibleContext().setAccessibleName(org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.keywordsTextField.AccessibleContext.accessibleName")); // NOI18N - keywordsTextField.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.keywordsTextField.AccessibleContext.accessibleDescription")); // NOI18N - keywordsButton.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.keywordsButton.AccessibleContext.accessibleDescription")); // NOI18N - - setBackground(javax.swing.UIManager.getDefaults().getColor("TextArea.background")); - - tableFieldsPanel.setBackground(javax.swing.UIManager.getDefaults().getColor("TextArea.background")); - - tablePanel.setBackground(new java.awt.Color(224, 224, 224)); - tablePanel.setBorder(javax.swing.BorderFactory.createEtchedBorder()); - tablePanel.setMinimumSize(new java.awt.Dimension(100, 350)); - tablePanel.setLayout(new java.awt.BorderLayout()); - - tableHeaderPanel.setBackground(javax.swing.UIManager.getDefaults().getColor("TextArea.background")); - - org.openide.awt.Mnemonics.setLocalizedText(tableSummaryLabel, org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.tableSummaryLabel.text_1")); // NOI18N - - filterComboBox.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" })); - - filterLabel.setLabelFor(filterComboBox); - org.openide.awt.Mnemonics.setLocalizedText(filterLabel, org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.filterLabel.text_1")); // NOI18N - - javax.swing.GroupLayout tableHeaderPanelLayout = new javax.swing.GroupLayout(tableHeaderPanel); - tableHeaderPanel.setLayout(tableHeaderPanelLayout); - tableHeaderPanelLayout.setHorizontalGroup( - tableHeaderPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(tableHeaderPanelLayout.createSequentialGroup() - .addComponent(tableSummaryLabel) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addComponent(filterLabel) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(filterComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) - ); - tableHeaderPanelLayout.setVerticalGroup( - tableHeaderPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(tableHeaderPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) - .addComponent(tableSummaryLabel) - .addComponent(filterComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(filterLabel)) - ); - - filterComboBox.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.filterComboBox.AccessibleContext.accessibleDescription")); // NOI18N - - javax.swing.GroupLayout tableFieldsPanelLayout = new javax.swing.GroupLayout(tableFieldsPanel); - tableFieldsPanel.setLayout(tableFieldsPanelLayout); - tableFieldsPanelLayout.setHorizontalGroup( - tableFieldsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(tableFieldsPanelLayout.createSequentialGroup() - .addContainerGap() - .addGroup(tableFieldsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(tablePanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addComponent(tableHeaderPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))) - ); - tableFieldsPanelLayout.setVerticalGroup( - tableFieldsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(tableFieldsPanelLayout.createSequentialGroup() - .addComponent(tableHeaderPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(tablePanel, javax.swing.GroupLayout.DEFAULT_SIZE, 350, Short.MAX_VALUE) - .addContainerGap()) - ); - - searchPanel.setBackground(javax.swing.UIManager.getDefaults().getColor("TextArea.background")); - - org.openide.awt.Mnemonics.setLocalizedText(webButton, org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.webButton.text")); // NOI18N - webButton.addActionListener(new java.awt.event.ActionListener() { - public void actionPerformed(java.awt.event.ActionEvent evt) { - webButtonActionPerformed(evt); - } - }); - - org.openide.awt.Mnemonics.setLocalizedText(urlToggleButton, org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.urlToggleButton.textUrl")); // NOI18N - urlToggleButton.addActionListener(new java.awt.event.ActionListener() { - public void actionPerformed(java.awt.event.ActionEvent evt) { - urlToggleButtonActionPerformed(evt); - } - }); - - org.openide.awt.Mnemonics.setLocalizedText(searchButton, org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.searchButton.text")); // NOI18N - - criteriaPanel.setBackground(new java.awt.Color(224, 224, 224)); - - byTextLabel.setFont(byTextLabel.getFont().deriveFont(byTextLabel.getFont().getStyle() | java.awt.Font.BOLD)); - org.openide.awt.Mnemonics.setLocalizedText(byTextLabel, org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.byTextLabel.text_1")); // NOI18N - - byTextContainer.setLayout(new java.awt.BorderLayout()); - - byDetailsContainer.setLayout(new java.awt.BorderLayout()); - - byDetailsLabel.setFont(byDetailsLabel.getFont().deriveFont(byDetailsLabel.getFont().getStyle() | java.awt.Font.BOLD)); - org.openide.awt.Mnemonics.setLocalizedText(byDetailsLabel, org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.byDetailsLabel.text")); // NOI18N - - byPeopleLabel.setFont(byPeopleLabel.getFont().deriveFont(byPeopleLabel.getFont().getStyle() | java.awt.Font.BOLD)); - org.openide.awt.Mnemonics.setLocalizedText(byPeopleLabel, org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.byPeopleLabel.text")); // NOI18N - - byPeopleContainer.setLayout(new java.awt.BorderLayout()); - - byLastChangeLabel.setFont(byLastChangeLabel.getFont().deriveFont(byLastChangeLabel.getFont().getStyle() | java.awt.Font.BOLD)); - org.openide.awt.Mnemonics.setLocalizedText(byLastChangeLabel, org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.byLastChangeLabel.text")); // NOI18N - - byLastChangeContainer.setLayout(new java.awt.BorderLayout()); - - urlPanel.setBackground(new java.awt.Color(224, 224, 224)); - - jLabel2.setLabelFor(urlTextField); - org.openide.awt.Mnemonics.setLocalizedText(jLabel2, org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.jLabel2.text_1")); // NOI18N - - urlTextField.setColumns(50); - - javax.swing.GroupLayout urlPanelLayout = new javax.swing.GroupLayout(urlPanel); - urlPanel.setLayout(urlPanelLayout); - urlPanelLayout.setHorizontalGroup( - urlPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(urlPanelLayout.createSequentialGroup() - .addContainerGap() - .addComponent(jLabel2) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(urlTextField) - .addContainerGap()) - ); - urlPanelLayout.setVerticalGroup( - urlPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(urlPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) - .addComponent(urlTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(jLabel2)) - ); - - urlTextField.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.urlTextField.AccessibleContext.accessibleDescription")); // NOI18N - - javax.swing.GroupLayout criteriaPanelLayout = new javax.swing.GroupLayout(criteriaPanel); - criteriaPanel.setLayout(criteriaPanelLayout); - criteriaPanelLayout.setHorizontalGroup( - criteriaPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(urlPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addComponent(byDetailsContainer, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addGroup(criteriaPanelLayout.createSequentialGroup() - .addGroup(criteriaPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(byLastChangeContainer, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addGroup(criteriaPanelLayout.createSequentialGroup() - .addContainerGap() - .addGroup(criteriaPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(byTextLabel) - .addComponent(byDetailsLabel) - .addComponent(byPeopleLabel) - .addComponent(byLastChangeLabel))) - .addComponent(byTextContainer, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(byPeopleContainer, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addGap(0, 0, Short.MAX_VALUE)) - ); - criteriaPanelLayout.setVerticalGroup( - criteriaPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(criteriaPanelLayout.createSequentialGroup() - .addComponent(byTextLabel) - .addGap(0, 0, 0) - .addComponent(byTextContainer, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addGap(0, 0, Short.MAX_VALUE) - .addComponent(byDetailsLabel) - .addGap(0, 0, 0) - .addComponent(byDetailsContainer, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addGap(0, 0, 0) - .addComponent(byPeopleLabel) - .addGap(0, 0, 0) - .addComponent(byPeopleContainer, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addGap(0, 0, 0) - .addComponent(byLastChangeLabel) - .addGap(0, 0, 0) - .addComponent(byLastChangeContainer, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addGap(0, 0, 0) - .addComponent(urlPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) - ); - - org.openide.awt.Mnemonics.setLocalizedText(cancelChangesButton, org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.cancelChangesButton.text")); // NOI18N - - org.openide.awt.Mnemonics.setLocalizedText(saveChangesButton, org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.saveChangesButton.text")); // NOI18N - - gotoPanel.setBackground(new java.awt.Color(224, 224, 224)); - - jLabel1.setLabelFor(idTextField); - org.openide.awt.Mnemonics.setLocalizedText(jLabel1, org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.jLabel1.text_1")); // NOI18N - - idTextField.setColumns(6); - - org.openide.awt.Mnemonics.setLocalizedText(gotoIssueButton, org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.gotoIssueButton.text")); // NOI18N - - javax.swing.GroupLayout gotoPanelLayout = new javax.swing.GroupLayout(gotoPanel); - gotoPanel.setLayout(gotoPanelLayout); - gotoPanelLayout.setHorizontalGroup( - gotoPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(gotoPanelLayout.createSequentialGroup() - .addContainerGap() - .addComponent(jLabel1) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(idTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(gotoIssueButton) - .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) - ); - gotoPanelLayout.setVerticalGroup( - gotoPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(gotoPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) - .addComponent(gotoIssueButton) - .addComponent(jLabel1) - .addComponent(idTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) - ); - - idTextField.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.idTextField.AccessibleContext.accessibleDescription")); // NOI18N - gotoIssueButton.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.gotoIssueButton.AccessibleContext.accessibleDescription")); // NOI18N - - org.openide.awt.Mnemonics.setLocalizedText(separatorLabel2, org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.separatorLabel2.text")); // NOI18N - separatorLabel2.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0))); - - org.openide.awt.Mnemonics.setLocalizedText(refreshConfigurationButton, org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.refreshConfigurationButton.text")); // NOI18N - refreshConfigurationButton.addActionListener(new java.awt.event.ActionListener() { - public void actionPerformed(java.awt.event.ActionEvent evt) { - refreshConfigurationButtonActionPerformed(evt); - } - }); - - org.openide.awt.Mnemonics.setLocalizedText(separatorLabel3, org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.separatorLabel3.text")); // NOI18N - separatorLabel3.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0))); - - javax.swing.GroupLayout searchPanelLayout = new javax.swing.GroupLayout(searchPanel); - searchPanel.setLayout(searchPanelLayout); - searchPanelLayout.setHorizontalGroup( - searchPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(gotoPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, searchPanelLayout.createSequentialGroup() - .addContainerGap() - .addComponent(searchButton) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) - .addComponent(saveChangesButton) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) - .addComponent(cancelChangesButton) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 496, Short.MAX_VALUE) - .addComponent(webButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(separatorLabel2) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(urlToggleButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(separatorLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 2, javax.swing.GroupLayout.PREFERRED_SIZE) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(refreshConfigurationButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addContainerGap()) - .addComponent(criteriaPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - ); - searchPanelLayout.setVerticalGroup( - searchPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(searchPanelLayout.createSequentialGroup() - .addComponent(gotoPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) - .addComponent(criteriaPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 8, Short.MAX_VALUE) - .addGroup(searchPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(searchPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) - .addComponent(searchButton) - .addComponent(cancelChangesButton) - .addComponent(saveChangesButton)) - .addGroup(searchPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) - .addComponent(refreshConfigurationButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(urlToggleButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(webButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(separatorLabel2) - .addComponent(separatorLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 18, javax.swing.GroupLayout.PREFERRED_SIZE))) - .addContainerGap()) - ); - - searchPanelLayout.linkSize(javax.swing.SwingConstants.VERTICAL, new java.awt.Component[] {separatorLabel2, urlToggleButton, webButton}); - - webButton.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.webButton.AccessibleContext.accessibleDescription")); // NOI18N - urlToggleButton.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.urlToggleButton.AccessibleContext.accessibleDescription")); // NOI18N - searchButton.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.searchButton.AccessibleContext.accessibleDescription")); // NOI18N - cancelChangesButton.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.cancelChangesButton.AccessibleContext.accessibleDescription")); // NOI18N - saveChangesButton.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.saveChangesButton.AccessibleContext.accessibleDescription")); // NOI18N - refreshConfigurationButton.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.refreshConfigurationButton.AccessibleContext.accessibleDescription")); // NOI18N - - queryHeaderPanel.setBackground(javax.swing.UIManager.getDefaults().getColor("TextArea.background")); - - org.openide.awt.Mnemonics.setLocalizedText(seenButton, org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.seenButton.text")); // NOI18N - seenButton.addActionListener(new java.awt.event.ActionListener() { - public void actionPerformed(java.awt.event.ActionEvent evt) { - seenButtonActionPerformed(evt); - } - }); - - org.openide.awt.Mnemonics.setLocalizedText(lastRefreshLabel, org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.lastRefreshLabel.text_1")); // NOI18N - - org.openide.awt.Mnemonics.setLocalizedText(removeButton, org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.removeButton.text")); // NOI18N - removeButton.addActionListener(new java.awt.event.ActionListener() { - public void actionPerformed(java.awt.event.ActionEvent evt) { - removeButtonActionPerformed(evt); - } - }); - - org.openide.awt.Mnemonics.setLocalizedText(lastRefreshDateLabel, org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.lastRefreshDateLabel.text_1")); // NOI18N - - org.openide.awt.Mnemonics.setLocalizedText(refreshButton, org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.refreshButton.text")); // NOI18N - refreshButton.addActionListener(new java.awt.event.ActionListener() { - public void actionPerformed(java.awt.event.ActionEvent evt) { - refreshButtonActionPerformed(evt); - } - }); - - org.openide.awt.Mnemonics.setLocalizedText(nameLabel, org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.nameLabel.text_1")); // NOI18N - - org.openide.awt.Mnemonics.setLocalizedText(modifyButton, org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.modifyButton.text")); // NOI18N - modifyButton.addActionListener(new java.awt.event.ActionListener() { - public void actionPerformed(java.awt.event.ActionEvent evt) { - modifyButtonActionPerformed(evt); - } - }); - - org.openide.awt.Mnemonics.setLocalizedText(jLabel4, org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.jLabel4.text_1")); // NOI18N - jLabel4.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0))); - - org.openide.awt.Mnemonics.setLocalizedText(jLabel5, org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.jLabel5.text")); // NOI18N - jLabel5.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0))); - - org.openide.awt.Mnemonics.setLocalizedText(jLabel6, org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.jLabel6.text")); // NOI18N - jLabel6.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0))); - - org.openide.awt.Mnemonics.setLocalizedText(jLabel7, org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.jLabel7.text")); // NOI18N - jLabel7.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0))); - - org.openide.awt.Mnemonics.setLocalizedText(cloneQueryButton, org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.cloneQueryButton.text")); // NOI18N - cloneQueryButton.addActionListener(new java.awt.event.ActionListener() { - public void actionPerformed(java.awt.event.ActionEvent evt) { - cloneQueryButtonActionPerformed(evt); - } - }); - - javax.swing.GroupLayout queryHeaderPanelLayout = new javax.swing.GroupLayout(queryHeaderPanel); - queryHeaderPanel.setLayout(queryHeaderPanelLayout); - queryHeaderPanelLayout.setHorizontalGroup( - queryHeaderPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(queryHeaderPanelLayout.createSequentialGroup() - .addContainerGap() - .addGroup(queryHeaderPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(queryHeaderPanelLayout.createSequentialGroup() - .addComponent(nameLabel) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addComponent(lastRefreshLabel) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(lastRefreshDateLabel)) - .addGroup(queryHeaderPanelLayout.createSequentialGroup() - .addComponent(seenButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, 2, javax.swing.GroupLayout.PREFERRED_SIZE) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) - .addComponent(modifyButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addGap(7, 7, 7) - .addComponent(jLabel5, javax.swing.GroupLayout.PREFERRED_SIZE, 2, javax.swing.GroupLayout.PREFERRED_SIZE) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(refreshButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addGap(5, 5, 5) - .addComponent(jLabel6) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(removeButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(jLabel7) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(cloneQueryButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addGap(0, 0, Short.MAX_VALUE))) - .addContainerGap()) - ); - queryHeaderPanelLayout.setVerticalGroup( - queryHeaderPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(queryHeaderPanelLayout.createSequentialGroup() - .addGroup(queryHeaderPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(queryHeaderPanelLayout.createSequentialGroup() - .addGap(11, 11, 11) - .addComponent(nameLabel)) - .addGroup(queryHeaderPanelLayout.createSequentialGroup() - .addContainerGap() - .addGroup(queryHeaderPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) - .addComponent(lastRefreshDateLabel) - .addComponent(lastRefreshLabel)))) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 12, Short.MAX_VALUE) - .addGroup(queryHeaderPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER) - .addComponent(jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, 11, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(jLabel5, javax.swing.GroupLayout.PREFERRED_SIZE, 11, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(jLabel6) - .addComponent(modifyButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(refreshButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(removeButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(seenButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(jLabel7) - .addComponent(cloneQueryButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addContainerGap()) - ); - - queryHeaderPanelLayout.linkSize(javax.swing.SwingConstants.VERTICAL, new java.awt.Component[] {jLabel4, jLabel5, jLabel6, jLabel7, modifyButton, refreshButton, removeButton}); - - seenButton.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.refreshButton.AccessibleContext.accessibleDescription")); // NOI18N - removeButton.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.removeButton.AccessibleContext.accessibleDescription")); // NOI18N - refreshButton.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.seenButton.AccessibleContext.accessibleDescription")); // NOI18N - modifyButton.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.modifyButton.AccessibleContext.accessibleDescription")); // NOI18N - - noContentPanel.setBackground(javax.swing.UIManager.getDefaults().getColor("TextArea.background")); - noContentPanel.setLayout(new java.awt.GridBagLayout()); - - org.openide.awt.Mnemonics.setLocalizedText(noContentLabel, org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.noContentLabel.text")); // NOI18N - noContentPanel.add(noContentLabel, new java.awt.GridBagConstraints()); - - javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); - this.setLayout(layout); - layout.setHorizontalGroup( - layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(queryHeaderPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addComponent(searchPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addGroup(layout.createSequentialGroup() - .addComponent(tableFieldsPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addContainerGap()) - .addComponent(noContentPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - ); - layout.setVerticalGroup( - layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(layout.createSequentialGroup() - .addComponent(queryHeaderPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(searchPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(tableFieldsPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(noContentPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addContainerGap()) - ); - }// //GEN-END:initComponents - - private void seenButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_seenButtonActionPerformed - // TODO add your handling code here: -}//GEN-LAST:event_seenButtonActionPerformed - - private void modifyButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_modifyButtonActionPerformed - // TODO add your handling code here: -}//GEN-LAST:event_modifyButtonActionPerformed - - private void refreshButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_refreshButtonActionPerformed - // TODO add your handling code here: -}//GEN-LAST:event_refreshButtonActionPerformed - - private void removeButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_removeButtonActionPerformed - // TODO add your handling code here: -}//GEN-LAST:event_removeButtonActionPerformed - - private void webButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_webButtonActionPerformed - // TODO add your handling code here: -}//GEN-LAST:event_webButtonActionPerformed - - private void urlToggleButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_urlToggleButtonActionPerformed - // TODO add your handling code here: -}//GEN-LAST:event_urlToggleButtonActionPerformed - - private void keywordsButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_keywordsButtonActionPerformed - // TODO add your handling code here: - }//GEN-LAST:event_keywordsButtonActionPerformed - - private void reporterCheckBoxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_reporterCheckBoxActionPerformed - // TODO add your handling code here: - }//GEN-LAST:event_reporterCheckBoxActionPerformed - - private void refreshConfigurationButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_refreshConfigurationButtonActionPerformed - // TODO add your handling code here: - }//GEN-LAST:event_refreshConfigurationButtonActionPerformed - - private void cloneQueryButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cloneQueryButtonActionPerformed - // TODO add your handling code here: - }//GEN-LAST:event_cloneQueryButtonActionPerformed - - - // Variables declaration - do not modify//GEN-BEGIN:variables - final javax.swing.JCheckBox bugAssigneeCheckBox = new javax.swing.JCheckBox(); - final javax.swing.JPanel byDetailsContainer = new javax.swing.JPanel(); - final javax.swing.JLabel byDetailsLabel = new javax.swing.JLabel(); - final javax.swing.JPanel byDetailsPanel = new javax.swing.JPanel(); - final javax.swing.JPanel byLastChangeContainer = new javax.swing.JPanel(); - final javax.swing.JLabel byLastChangeLabel = new javax.swing.JLabel(); - private javax.swing.JPanel byLastChangePanel; - final javax.swing.JPanel byPeopleContainer = new javax.swing.JPanel(); - final javax.swing.JLabel byPeopleLabel = new javax.swing.JLabel(); - private javax.swing.JPanel byPeoplePanel; - final javax.swing.JPanel byTextContainer = new javax.swing.JPanel(); - final javax.swing.JLabel byTextLabel = new javax.swing.JLabel(); - private javax.swing.JPanel byTextPanel; - final javax.swing.JButton cancelChangesButton = new javax.swing.JButton(); - final javax.swing.JCheckBox ccCheckBox = new javax.swing.JCheckBox(); - private javax.swing.JLabel changedAndLabel; - private javax.swing.JLabel changedBlaBlaLabel; - final javax.swing.JTextField changedFromTextField = new javax.swing.JTextField(); - private javax.swing.JLabel changedHintLabel; - private javax.swing.JLabel changedLabel; - final javax.swing.JList changedList = new javax.swing.JList(); - final javax.swing.JTextField changedToTextField = new javax.swing.JTextField(); - private javax.swing.JLabel changedWhereLabel; - public final org.netbeans.modules.bugtracking.commons.LinkButton cloneQueryButton = new org.netbeans.modules.bugtracking.commons.LinkButton(); - final javax.swing.JComboBox commentComboBox = new javax.swing.JComboBox(); - final javax.swing.JLabel commentLabel = new javax.swing.JLabel(); - final javax.swing.JTextField commentTextField = new javax.swing.JTextField(); - final javax.swing.JCheckBox commenterCheckBox = new javax.swing.JCheckBox(); - final javax.swing.JLabel componentLabel = new javax.swing.JLabel(); - final javax.swing.JList componentList = new javax.swing.JList(); - final javax.swing.JScrollPane componentScrollPane = new HackedScrollPane(); - private javax.swing.JPanel criteriaPanel; - final javax.swing.JComboBox filterComboBox = new javax.swing.JComboBox(); - private javax.swing.JLabel filterLabel; - final javax.swing.JButton gotoIssueButton = new javax.swing.JButton(); - final javax.swing.JPanel gotoPanel = new javax.swing.JPanel(); - final javax.swing.JTextField idTextField = new javax.swing.JTextField(); - final javax.swing.JLabel issueTypeLabel = new javax.swing.JLabel(); - final javax.swing.JList issueTypeList = new javax.swing.JList(); - final javax.swing.JScrollPane issueTypeScrollPane = new HackedScrollPane(); - private javax.swing.JLabel jLabel1; - private javax.swing.JLabel jLabel2; - private javax.swing.JLabel jLabel4; - private javax.swing.JLabel jLabel5; - private javax.swing.JLabel jLabel6; - private javax.swing.JLabel jLabel7; - private javax.swing.JScrollPane jScrollPane1; - final javax.swing.JButton keywordsButton = new javax.swing.JButton(); - final javax.swing.JComboBox keywordsComboBox = new javax.swing.JComboBox(); - final javax.swing.JLabel keywordsLabel = new javax.swing.JLabel(); - final javax.swing.JTextField keywordsTextField = new javax.swing.JTextField(); - final javax.swing.JLabel lastRefreshDateLabel = new javax.swing.JLabel(); - private javax.swing.JLabel lastRefreshLabel; - public final org.netbeans.modules.bugtracking.commons.LinkButton modifyButton = new org.netbeans.modules.bugtracking.commons.LinkButton(); - final javax.swing.JLabel nameLabel = new javax.swing.JLabel(); - final javax.swing.JTextField newValueTextField = new javax.swing.JTextField(); - private javax.swing.JLabel noContentLabel; - private javax.swing.JPanel noContentPanel; - final javax.swing.JComboBox peopleComboBox = new javax.swing.JComboBox(); - final javax.swing.JLabel peopleLabel = new javax.swing.JLabel(); - final javax.swing.JTextField peopleTextField = new javax.swing.JTextField(); - final javax.swing.JLabel priorityLabel = new javax.swing.JLabel(); - final javax.swing.JList priorityList = new javax.swing.JList(); - final javax.swing.JScrollPane priorityScrollPane = new HackedScrollPane(); - final javax.swing.JLabel productLabel = new javax.swing.JLabel(); - final javax.swing.JList productList = new javax.swing.JList(); - final javax.swing.JScrollPane productScrollPane = new javax.swing.JScrollPane(); - private javax.swing.JPanel queryHeaderPanel; - final org.netbeans.modules.bugtracking.commons.LinkButton refreshButton = new org.netbeans.modules.bugtracking.commons.LinkButton(); - final org.netbeans.modules.bugtracking.commons.LinkButton refreshConfigurationButton = new org.netbeans.modules.bugtracking.commons.LinkButton(); - public final org.netbeans.modules.bugtracking.commons.LinkButton removeButton = new org.netbeans.modules.bugtracking.commons.LinkButton(); - final javax.swing.JCheckBox reporterCheckBox = new javax.swing.JCheckBox(); - final javax.swing.JLabel resolutionLabel = new javax.swing.JLabel(); - final javax.swing.JList resolutionList = new javax.swing.JList(); - final javax.swing.JScrollPane resolutionScrollPane = new HackedScrollPane(); - final javax.swing.JButton saveChangesButton = new javax.swing.JButton(); - final javax.swing.JButton searchButton = new javax.swing.JButton(); - final javax.swing.JPanel searchPanel = new javax.swing.JPanel(); - final org.netbeans.modules.bugtracking.commons.LinkButton seenButton = new org.netbeans.modules.bugtracking.commons.LinkButton(); - private javax.swing.JLabel separatorLabel2; - private javax.swing.JLabel separatorLabel3; - final javax.swing.JLabel severityLabel = new javax.swing.JLabel(); - final javax.swing.JList severityList = new javax.swing.JList(); - final javax.swing.JScrollPane severityScrollPane = new HackedScrollPane(); - final javax.swing.JLabel statusLabel = new javax.swing.JLabel(); - final javax.swing.JList statusList = new javax.swing.JList(); - final javax.swing.JScrollPane statusScrollPane = new HackedScrollPane(); - final javax.swing.JComboBox summaryComboBox = new javax.swing.JComboBox(); - final javax.swing.JLabel summaryLabel = new javax.swing.JLabel(); - final javax.swing.JTextField summaryTextField = new javax.swing.JTextField(); - private javax.swing.JPanel tableFieldsPanel; - private javax.swing.JPanel tableHeaderPanel; - final javax.swing.JPanel tablePanel = new javax.swing.JPanel(); - final javax.swing.JLabel tableSummaryLabel = new javax.swing.JLabel(); - final javax.swing.JLabel tmLabel = new javax.swing.JLabel(); - final javax.swing.JList tmList = new javax.swing.JList(); - final javax.swing.JScrollPane tmScrollPane = new HackedScrollPane(); - final javax.swing.JPanel urlPanel = new javax.swing.JPanel(); - final javax.swing.JTextField urlTextField = new javax.swing.JTextField(); - final org.netbeans.modules.bugtracking.commons.LinkButton urlToggleButton = new org.netbeans.modules.bugtracking.commons.LinkButton(); - final javax.swing.JLabel versionLabel = new javax.swing.JLabel(); - final javax.swing.JList versionList = new javax.swing.JList(); - final javax.swing.JScrollPane versionScrollPane = new HackedScrollPane(); - final org.netbeans.modules.bugtracking.commons.LinkButton webButton = new org.netbeans.modules.bugtracking.commons.LinkButton(); - final javax.swing.JComboBox whiteboardComboBox = new javax.swing.JComboBox(); - final javax.swing.JLabel whiteboardLabel = new javax.swing.JLabel(); - final javax.swing.JTextField whiteboardTextField = new javax.swing.JTextField(); - // End of variables declaration//GEN-END:variables - - /** - * enables/disables all but the parameter fields - * @param enable - */ - void enableFields(final boolean enable) { - - UIUtils.runInAWT(new Runnable() { - @Override - public void run() { - summaryLabel.setEnabled(enable); - whiteboardLabel.setEnabled(enable); - commentLabel.setEnabled(enable); - keywordsLabel.setEnabled(enable); - keywordsButton.setEnabled(enable); - - productLabel.setEnabled(enable); - componentLabel.setEnabled(enable); - versionLabel.setEnabled(enable); - statusLabel.setEnabled(enable); - severityLabel.setEnabled(enable); - resolutionLabel.setEnabled(enable); - priorityLabel.setEnabled(enable); - tmLabel.setEnabled(enable); - issueTypeLabel.setEnabled(enable); - - peopleLabel.setEnabled(enable); - peopleTextField.setEnabled(enable); - - searchButton.setEnabled(enable); - webButton.setEnabled(enable); - urlToggleButton.setEnabled(enable); - refreshConfigurationButton.setEnabled(enable); - - changedLabel.setEnabled(enable); - changedAndLabel.setEnabled(enable); - changedWhereLabel.setEnabled(enable); - changedBlaBlaLabel.setEnabled(enable); - changedHintLabel.setEnabled(enable); - } - }); - } - - void switchQueryFields(final boolean showAdvanced) { - UIUtils.runInAWT(new Runnable() { - @Override - public void run() { - byDetails.setVisible(showAdvanced); - byText.setVisible(showAdvanced); - byLastChange.setVisible(showAdvanced); - byPeople.setVisible(showAdvanced); - - urlPanel.setVisible(!showAdvanced); - if (showAdvanced) { - urlToggleButton.setText(org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.urlToggleButton.textUrl")); - } else { - urlToggleButton.setText(org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.urlToggleButton.textForm")); - } - } - }); - } - - void showError(final String text) { - UIUtils.runInAWT(new Runnable() { - @Override - public void run() { - noContentPanel.setVisible(true); - tableSummaryLabel.setVisible(false); - tableFieldsPanel.setVisible(false); - if (text != null) { - noContentLabel.setForeground(BugzillaUtil.getErrorForegroundColor()); - noContentLabel.setText(text); - } - } - }); - } - - void showSearchingProgress(final boolean on, final String text) { - UIUtils.runInAWT(new Runnable() { - public void run() { - noContentPanel.setVisible(on); - tableSummaryLabel.setVisible(!on); - tableFieldsPanel.setVisible(!on); - if (on && text != null) { - noContentLabel.setForeground(defaultTextColor); - noContentLabel.setText(text); - } - } - }); - } - - void showRetrievingProgress(final boolean on, final String text, final boolean searchPanelVisible) { - UIUtils.runInAWT(new Runnable() { - @Override - public void run() { - noContentPanel.setVisible(on); - noContentLabel.setForeground(Color.red); - if (searchPanelVisible) { - searchPanel.setVisible(!on); - } - if (on && text != null) { - noContentLabel.setForeground(defaultTextColor); - noContentLabel.setText(text); - } - } - }); - } - - void showNoContentPanel(boolean on) { - showSearchingProgress(on, null); - } - - void setModifyVisible(final boolean b) { - UIUtils.runInAWT(new Runnable() { - @Override - public void run() { - searchPanel.setVisible(b); - cancelChangesButton.setVisible(b); - saveChangesButton.setVisible(b); - - webButton.setVisible(b); - separatorLabel2.setVisible(b); - - tableFieldsPanel.setVisible(!b); - searchButton.setVisible(!b); - urlToggleButton.setVisible(!b); - - separatorLabel3.setVisible(!b); - } - }); - } - - void setSaved(final String name, final String lastRefresh) { - UIUtils.runInAWT(new Runnable() { - @Override - public void run() { - searchPanel.setVisible(false); - gotoPanel.setVisible(false); - queryHeaderPanel.setVisible(true); - tableHeaderPanel.setVisible(true); - filterComboBox.setVisible(true); // XXX move to bugtracking IssueTable component - filterLabel.setVisible(true); - tablePanel.setVisible(true); - nameLabel.setText(name); - setLastRefresh(lastRefresh); - } - }); - } - - void setLastRefresh(final String lastRefresh) { - UIUtils.runInAWT(new Runnable() { - @Override - public void run() { - lastRefreshDateLabel.setText(lastRefresh); - } - }); - } - - void setNBFieldsVisible(final boolean visible) { - UIUtils.runInAWT(new Runnable() { - @Override - public void run() { - whiteboardLabel.setVisible(visible); - whiteboardComboBox.setVisible(visible); - whiteboardTextField.setVisible(visible); - - issueTypeLabel.setVisible(visible); - issueTypeList.setVisible(visible); - issueTypeScrollPane.setVisible(visible); - severityLabel.setVisible(!visible); - severityList.setVisible(!visible); - severityScrollPane.setVisible(!visible); - } - }); - } - - public void focusLost(FocusEvent e) { - // do nothing - } - - class ExpandablePanel { - private final JPanel panel; - private final JLabel label; - private final Icon ei; - private final Icon ci; - private boolean expaned = true; - public ExpandablePanel(JLabel l, JPanel p, final Icon ei, final Icon ci) { - this.panel = p; - this.label = l; - this.ci = ci; - this.ei = ei; - this.label.addMouseListener(new MouseAdapter() { - @Override - public void mouseClicked(MouseEvent e) { - if(panel.isVisible()) { - colapse(); - } else { - expand(); - } - } - }); - } - public void expand() { - expaned = true; - panel.setVisible(true); - label.setIcon(ei); - } - public void colapse() { - expaned = false; - panel.setVisible(false); - label.setIcon(ci); - } - public void setVisible(boolean visible ) { - label.setVisible(visible); - panel.setVisible(visible && expaned); - } - } - - private static class FilterCellRenderer extends DefaultListCellRenderer { - @Override - public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) { - if(value instanceof Filter) { - value = ((Filter)value).getDisplayName(); - } - return super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus); - } - } - - static class HackedScrollPane extends JScrollPane { - @Override - public Dimension getPreferredSize() { - setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS); - Dimension dim = super.getPreferredSize(); - setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED); - return dim; - } - } - -} diff --git a/ide/bugzilla/src/org/netbeans/modules/bugzilla/query/QueryParameter.java b/ide/bugzilla/src/org/netbeans/modules/bugzilla/query/QueryParameter.java deleted file mode 100644 index 95e6f9c340ac..000000000000 --- a/ide/bugzilla/src/org/netbeans/modules/bugzilla/query/QueryParameter.java +++ /dev/null @@ -1,675 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.netbeans.modules.bugzilla.query; - -import java.awt.Component; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.awt.event.ItemEvent; -import java.awt.event.ItemListener; -import java.io.UnsupportedEncodingException; -import java.net.URLEncoder; -import java.util.Arrays; -import java.util.LinkedList; -import java.util.List; -import java.util.logging.Level; -import javax.swing.DefaultComboBoxModel; -import javax.swing.DefaultListCellRenderer; -import javax.swing.DefaultListModel; -import javax.swing.JCheckBox; -import javax.swing.JComboBox; -import javax.swing.JLabel; -import javax.swing.JList; -import javax.swing.JTextField; -import javax.swing.ListModel; -import javax.swing.event.ChangeListener; -import javax.swing.event.DocumentEvent; -import javax.swing.event.DocumentListener; -import javax.swing.event.ListSelectionEvent; -import javax.swing.event.ListSelectionListener; -import org.netbeans.modules.bugzilla.Bugzilla; -import org.netbeans.modules.bugzilla.BugzillaConfig; -import org.openide.util.ChangeSupport; - -/** - * - * @author Tomas Stupka - */ -public abstract class QueryParameter { - static final ParameterValue[] EMPTY_PARAMETER_VALUE = new ParameterValue[] {new ParameterValue("", "")}; // NOI18N - - static final ParameterValue PV_CONTAINS_ALL_KEYWORDS = new ParameterValue("contains all keywords", "allwords"); // NOI18N - static final ParameterValue PV_CONTAINS_ANY_KEYWORDS = new ParameterValue("contains any keywords", "anywords"); // NOI18N - static final ParameterValue PV_CONTAINS_NONE_KEYWORDS = new ParameterValue("contains none keywords", "nowords"); // NOI18N - - static final ParameterValue PV_CONTAINS = new ParameterValue("contains", "substring"); // NOI18N - static final ParameterValue PV_IS = new ParameterValue("is", "exact"); // NOI18N - static final ParameterValue PV_MATCHES_REGEX = new ParameterValue("matches the regexp", "regexp"); // NOI18N - static final ParameterValue PV_DOESNT_MATCH_REGEX = new ParameterValue("doesn't match the regexp", "notregexp"); // NOI18N - - static final ParameterValue PV_CONTAINS_ALL_STRINGS = new ParameterValue("contains all of the words/strings", "allwordssubstr"); // NOI18N - static final ParameterValue PV_CONTAINS_ANY_STRINGS = new ParameterValue("contains any of the words/strings", "anywordssubstr"); // NOI18N - static final ParameterValue PV_CONTAINS_THE_STRING = new ParameterValue("contains the string", "substring"); // NOI18N - static final ParameterValue PV_CONTAINS_THE_STRING_CASE = new ParameterValue("contains the string (exact case)", "casesubstring"); // NOI18N - static final ParameterValue PV_CONTAINS_ALL_WORDS = new ParameterValue("contains all of the words", "allwords"); // NOI18N - static final ParameterValue PV_CONTAINS_ANY_WORDS = new ParameterValue("contains any of the words", "anywords"); // NOI18N - - static final ParameterValue PV_FIELD_BUG_CREATION = new ParameterValue("[Bug creation]", "[Bug+creation]"); // NOI18N - static final ParameterValue PV_FIELD_ALIAS = new ParameterValue("alias", "alias"); // NOI18N - static final ParameterValue PV_FIELD_ASSIGNED_TO = new ParameterValue("assigned_to", "assigned_to"); // NOI18N - static final ParameterValue PV_FIELD_LIST_ACCESSIBLE = new ParameterValue("cclist_accessible", "cclist_accessible"); // NOI18N - static final ParameterValue PV_FIELD_COMPONENT = new ParameterValue("component", "component"); // NOI18N - static final ParameterValue PV_FIELD_DEADLINE = new ParameterValue("deadline", "deadline"); // NOI18N - static final ParameterValue PV_FIELD_EVER_CONFIRMED = new ParameterValue("everconfirmed", "everconfirmed"); // NOI18N - static final ParameterValue PV_FIELD_REP_PLARFORM = new ParameterValue("rep_platform", "rep_platform"); // NOI18N - static final ParameterValue PV_FIELD_REMAINING_TIME = new ParameterValue("remaining_time", "remaining_time"); // NOI18N - static final ParameterValue PV_FIELD_WORK_TIME = new ParameterValue("work_time", "work_time"); // NOI18N - static final ParameterValue PV_FIELD_KEYWORDS = new ParameterValue("keywords", "keywords"); // NOI18N - static final ParameterValue PV_FIELD_ESTIMATED_TIME = new ParameterValue("estimated_time", "estimated_time"); // NOI18N - static final ParameterValue PV_FIELD_OP_SYS = new ParameterValue("op_sys", "op_sys"); // NOI18N - static final ParameterValue PV_FIELD_PRIORITY = new ParameterValue("priority", "priority"); // NOI18N - static final ParameterValue PV_FIELD_PRODUCT = new ParameterValue("product", "product"); // NOI18N - static final ParameterValue PV_FIELD_QA_CONTACT = new ParameterValue("qa_contact", "qa_contact"); // NOI18N - static final ParameterValue PV_FIELD_REPORTER_ACCESSIBLE = new ParameterValue("reporter_accessible", "reporter_accessible"); // NOI18N - static final ParameterValue PV_FIELD_RESOLUTION = new ParameterValue("resolution", "resolution"); // NOI18N - static final ParameterValue PV_FIELD_BUG_SEVERITY = new ParameterValue("bug_severity", "bug_severity"); // NOI18N - static final ParameterValue PV_FIELD_BUG_STATUS = new ParameterValue("bug_status", "bug_status"); // NOI18N - static final ParameterValue PV_FIELD_SHORT_DESC = new ParameterValue("short_desc", "short_desc"); // NOI18N - static final ParameterValue PV_FIELD_TARGET_MILESTONE = new ParameterValue("target_milestone", "target_milestone"); // NOI18N - static final ParameterValue PV_FIELD_BUG_FILE_LOC = new ParameterValue("bug_file_loc", "bug_file_loc"); // NOI18N - static final ParameterValue PV_FIELD_VERSION = new ParameterValue("version", "version"); // NOI18N - static final ParameterValue PV_FIELD_VOTES = new ParameterValue("votes", "votes"); // NOI18N - static final ParameterValue PV_FIELD_STATUS_WHITEBOARD = new ParameterValue("status_whiteboard", "status_whiteboard"); // NOI18N - - static final ParameterValue[] PV_TEXT_SEARCH_VALUES = new ParameterValue[] { - PV_CONTAINS_ALL_STRINGS, - PV_CONTAINS_ANY_STRINGS, - PV_CONTAINS_THE_STRING, - PV_CONTAINS_THE_STRING_CASE, - PV_CONTAINS_ALL_WORDS, - PV_CONTAINS_ANY_WORDS, - PV_MATCHES_REGEX, - PV_DOESNT_MATCH_REGEX - }; - static final ParameterValue[] PV_KEYWORDS_VALUES = new ParameterValue[] { - PV_CONTAINS_ALL_KEYWORDS, - PV_CONTAINS_ANY_KEYWORDS, - PV_CONTAINS_NONE_KEYWORDS - }; - static final ParameterValue[] PV_PEOPLE_VALUES = new ParameterValue[] { - PV_CONTAINS, - PV_IS, - PV_MATCHES_REGEX, - PV_DOESNT_MATCH_REGEX - }; - static final ParameterValue[] PV_LAST_CHANGE = new ParameterValue[] { - PV_FIELD_BUG_CREATION, - PV_FIELD_ALIAS, - PV_FIELD_ASSIGNED_TO, - PV_FIELD_LIST_ACCESSIBLE, - PV_FIELD_COMPONENT, - PV_FIELD_DEADLINE, - PV_FIELD_EVER_CONFIRMED, - PV_FIELD_REP_PLARFORM, - PV_FIELD_REMAINING_TIME, - PV_FIELD_WORK_TIME, - PV_FIELD_KEYWORDS, - PV_FIELD_ESTIMATED_TIME, - PV_FIELD_OP_SYS, - PV_FIELD_PRIORITY, - PV_FIELD_PRODUCT, - PV_FIELD_QA_CONTACT, - PV_FIELD_REPORTER_ACCESSIBLE, - PV_FIELD_RESOLUTION, - PV_FIELD_BUG_SEVERITY, - PV_FIELD_BUG_STATUS, - PV_FIELD_SHORT_DESC, - PV_FIELD_TARGET_MILESTONE, - PV_FIELD_BUG_FILE_LOC, - PV_FIELD_VERSION, - PV_FIELD_VOTES, - PV_FIELD_STATUS_WHITEBOARD - }; - - private final ChangeSupport support = new ChangeSupport(this); - private final String parameter; - private final String encoding; - protected boolean alwaysDisabled = false; - public QueryParameter(String parameter, String encoding) { - this.parameter = parameter; - this.encoding = encoding; - } - public String getParameter() { - return parameter; - } - - void addChangeListener(ChangeListener l) { - support.addChangeListener(l); - } - - void removeChangeListener(ChangeListener l) { - support.removeChangeListener(l); - } - - protected void fireStateChanged() { - support.fireChange(); - } - - abstract boolean isChanged(); - - abstract void reset(); - - abstract ParameterValue[] getValues(); - abstract void setValues(ParameterValue[] pvs); - void setAlwaysDisabled(boolean bl) { - this.alwaysDisabled = bl; - setEnabled(false); // true or false, who cares. this is only to trigger the state change - } - abstract void setEnabled(boolean b); - - public StringBuffer get(boolean encode) { - StringBuffer sb = new StringBuffer(); - ParameterValue[] values = getValues(); - for (ParameterValue pv : values) { - sb.append("&"); // NOI18N - sb.append(getParameter()); - sb.append("="); // NOI18N - if(encode) { - try { - String value = pv.getValue(); - if(value.equals("[Bug+creation]")) { // NOI18N - // workaround: while encoding '+' in a products name works fine, - // encoding it in in [Bug+creation] causes an error - sb.append(URLEncoder.encode("[", encoding)); // NOI18N - sb.append("Bug+creation"); // NOI18N - sb.append(URLEncoder.encode("]", encoding)); // NOI18N - } else { - // use URLEncoder as it is used also by other clients of the bugzilla connector - sb.append(URLEncoder.encode(value, encoding)); - } - } catch (UnsupportedEncodingException ex) { - sb.append(URLEncoder.encode(pv.getValue())); - Bugzilla.LOG.log(Level.WARNING, null, ex); - } - } else { - sb.append(pv.getValue()); - } - } - return sb; - } - - @Override - public String toString() { - StringBuffer sb = new StringBuffer(); - sb.append("["); // NOI18N - sb.append(get(true)); - sb.append("]"); // NOI18N - return sb.toString(); - } - - static class ComboParameter extends QueryParameter { - private final JComboBox combo; - ParameterValue original = null; - public ComboParameter(JComboBox combo, String parameter, String encoding) { - super(parameter, encoding); - this.combo = combo; - combo.setModel(new DefaultComboBoxModel()); - combo.addItemListener(new ItemListener() { - @Override - public void itemStateChanged(ItemEvent e) { - fireStateChanged(); - } - }); - original = (ParameterValue) combo.getSelectedItem(); - } - - @Override - public boolean isChanged() { - Object item = ComboParameter.this.combo.getSelectedItem(); - if(item instanceof ParameterValue) { - ParameterValue pv = (ParameterValue) item; - if(original == null && pv == null) { - return false; - } - if((original != null && pv == null) || - (original == null && pv != null)) - { - return true; - } - return !pv.equals(original); - } - return false; - } - - @Override - void reset() { - original = (ParameterValue) combo.getSelectedItem(); - fireStateChanged(); - } - - @Override - public ParameterValue[] getValues() { - ParameterValue value = (ParameterValue) combo.getSelectedItem(); - return value != null ? new ParameterValue[] { value } : EMPTY_PARAMETER_VALUE; - } - public void setParameterValues(ParameterValue[] values) { - combo.setModel(new DefaultComboBoxModel(values)); - } - @Override - public void setValues(ParameterValue[] values) { - assert values.length < 2; - if(values.length == 0) return; - ParameterValue pv = values[0]; - - // need the index as the given ParameterValue might have a different displayName - int idx = ((DefaultComboBoxModel)combo.getModel()).getIndexOf(pv); - if(idx != -1) { - combo.setSelectedIndex(idx); - } - reset(); - } - @Override - void setEnabled(boolean b) { - combo.setEnabled(alwaysDisabled ? false : b); - } - } - - static class ListParameter extends QueryParameter { - private final JList list; - private int[] original; - public ListParameter(JList list, String parameter, String encoding) { - super(parameter, encoding); - this.list = list; - list.setModel(new DefaultListModel()); - list.addListSelectionListener(new ListSelectionListener(){ - @Override - public void valueChanged(ListSelectionEvent e) { - int[] s = ListParameter.this.list.getSelectedIndices(); - if(e.getValueIsAdjusting()) { - return; - } - fireStateChanged(); - }; - }); - original = list.getSelectedIndices(); - fireStateChanged(); - } - @Override - public ParameterValue[] getValues() { - Object[] values = list.getSelectedValues(); - if(values == null || values.length == 0) { - return EMPTY_PARAMETER_VALUE; - } - ParameterValue[] ret = new ParameterValue[values.length]; - for (int i = 0; i < values.length; i++) { - ret[i] = (ParameterValue) values[i]; - } - return ret; - } - public void setParameterValues(List values) { - setParameterValues(values.toArray(new ParameterValue[0])); - } - public void setParameterValues(ParameterValue[] values) { - DefaultListModel m = new DefaultListModel<>(); - for (ParameterValue pv : values) { - m.addElement(pv); - } - list.setModel(m); - } - - @Override - public void setValues(ParameterValue[] values) { - if(values.length == 0) return; // should not happen XXX do we need this? - list.clearSelection(); - if(values.length == 1 && "".equals(values[0].getValue().trim())) return; // 1 empty ParameterValue stands for no selection XXX rewrite this - List selectionList = new LinkedList(); - for (int i = 0; i < values.length; i++) { - ListModel model = list.getModel(); - // need case sensitive compare - for(int j = 0; j < model.getSize(); j++) { - ParameterValue pv = (ParameterValue) model.getElementAt(j); - if(pv.getValue().equalsIgnoreCase(values[i].getValue())) { - selectionList.add(j); - break; - } - } - } - int[] selection = new int[selectionList.size()]; - int i = 0; - for (int s : selectionList) { - selection[i++] = s; - } - list.setSelectedIndices(selection); - reset(); - int idx = selection.length > 0 ? selection[0] : -1; - if(idx > -1) list.scrollRectToVisible(list.getCellBounds(idx, idx)); - } - - @Override - void setEnabled(boolean b) { - list.setEnabled(alwaysDisabled ? false : b); - } - - @Override - boolean isChanged() { - int[] s = ListParameter.this.list.getSelectedIndices(); - int[] selection = list.getSelectedIndices(); - if(original == null && selection == null) { - return true; - } - if( (original == null && selection != null) || - (original != null && selection == null) ) - { - return true; - } - if(original.length == selection.length) { - Arrays.sort(original); - Arrays.sort(selection); - return !Arrays.equals(original, selection); - } else { - return true; - } - } - - @Override - void reset() { - original = list.getSelectedIndices(); - fireStateChanged(); - } - } - - /** - * Some parameters should not be present in a query URL when they're empty. - * For example &chfield= does not seem to be valid. - * - * This parameter type works the same way as ListParameter except getValues() - * returns an empty array instead of an array of a single empty value when - * the selection is empty. - */ - static class EmptyValuesListParameter extends ListParameter { - - private final JList list; - - public EmptyValuesListParameter (JList list, String parameter, String encoding) { - super(list, parameter, encoding); - this.list = list; - } - - @Override - public ParameterValue[] getValues() { - if (list.getSelectedValuesList().isEmpty()) { - return new ParameterValue[0]; - } else { - return super.getValues(); - } - } - - @Override - public String toString() { - if (list.getSelectedValuesList().isEmpty()) { - return new StringBuilder("[&").append(getParameter()).append("=]").toString(); //NOI18N - } else { - return super.toString(); - } - } - } - - static class TextFieldParameter extends QueryParameter { - private final JTextField txt; - private final boolean allWords; - private String original; - public TextFieldParameter(JTextField txt, String parameter, String encoding) { - this(txt, parameter, encoding, false); - } - public TextFieldParameter(JTextField txt, String parameter, String encoding, boolean allWords) { - super(parameter, encoding); - this.txt = txt; - this.allWords = allWords; - txt.getDocument().addDocumentListener(new DocumentListener(){ - @Override - public void insertUpdate(DocumentEvent e) { - update(); - } - @Override - public void removeUpdate(DocumentEvent e) { - update(); - } - @Override - public void changedUpdate(DocumentEvent e) { - update(); - } - private void update() { - fireStateChanged(); - } - }); - original = txt.getText(); - } - - @Override - public ParameterValue[] getValues() { - String value = txt.getText(); - if(value == null || value.equals("")) { // NOI18N - return EMPTY_PARAMETER_VALUE; - } - String[] split = value.split(" "); // NOI18N - StringBuffer sb = new StringBuffer(); - for (int i = 0; i < split.length; i++) { - String s = split[i]; - sb.append(s); - if(i < split.length - 1) { - sb.append(allWords ? " " : "+"); // NOI18N - } - } - String v = sb.toString(); - return new ParameterValue[] { new ParameterValue(v, v) }; - } - @Override - public void setValues(ParameterValue[] pvs) { - assert pvs.length < 2; - if(pvs.length == 0 || pvs[0] == null) { - return; - } - String value = pvs[0].getValue(); - if(!allWords) { - value = value.replace("+", " "); // NOI18N - } - txt.setText(value); - reset(); - } - @Override - void setEnabled(boolean b) { - txt.setEnabled(alwaysDisabled ? false : b); - } - - @Override - boolean isChanged() { - String t = txt.getText() + ""; - return !t.equals(original); - } - - @Override - void reset() { - original = txt.getText(); - fireStateChanged(); - } - } - - static class AllWordsTextFieldParameter extends TextFieldParameter { - public AllWordsTextFieldParameter(JTextField txt, String parameter, String encoding) { - super(txt, parameter, encoding, true); - } - } - - static class CheckBoxParameter extends QueryParameter { - private ParameterValue[] selected = new ParameterValue[] {new ParameterValue("1")}; // NOI18N - private final JCheckBox chk; - private boolean original; - public CheckBoxParameter(JCheckBox chk, String parameter, String encoding) { - super(parameter, encoding); - this.chk = chk; - chk.addActionListener(new ActionListener(){ - @Override - public void actionPerformed(ActionEvent e) { - fireStateChanged(); - } - }); - original = chk.isSelected(); - } - @Override - public ParameterValue[] getValues() { - return chk.isSelected() ? selected : EMPTY_PARAMETER_VALUE; - } - @Override - public void setValues(ParameterValue[] pvs) { - assert pvs.length < 2; - if(pvs.length == 0 || pvs[0] == null) { - return; - } - chk.setSelected(pvs[0].getValue().equals("1")); // NOI18N - reset(); - } - @Override - void setEnabled(boolean b) { - chk.setEnabled(alwaysDisabled ? false : b); - } - - @Override - boolean isChanged() { - return chk.isSelected() != original; - } - - @Override - void reset() { - original = chk.isSelected(); - fireStateChanged(); - } - } - - static class ParameterValue { - private final String displayName; - private final String value; - private String toString; - public ParameterValue(String value) { - this(value, value); - } - public ParameterValue(String displayName, String value) { - assert displayName != null; - assert value != null; - this.displayName = displayName; - this.value = value; - } - public String getDisplayName() { - return displayName; - } - public String getValue() { - return value; - } - @Override - public String toString() { - if(toString == null) { - StringBuffer sb = new StringBuffer(); - sb.append(displayName); - sb.append("["); // NOI18N - sb.append(value); - sb.append("]"); // NOI18N - toString = sb.toString(); - } - return toString; - } - @Override - public boolean equals(Object obj) { - if(obj instanceof ParameterValue) { - ParameterValue pv = (ParameterValue) obj; - return value.equals(pv.value); - } - return false; - } - @Override - public int hashCode() { - return value.hashCode(); - } - } - - static class ParameterValueCellRenderer extends DefaultListCellRenderer { - @Override - public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) { - if(value instanceof ParameterValue) value = ((ParameterValue)value).getDisplayName(); - return super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus); - } - } - - static class PriorityRenderer extends ParameterValueCellRenderer { - @Override - public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) { - JLabel renderer = (JLabel) super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus); - if(value instanceof ParameterValue) { - String prio = ((ParameterValue)value).getValue(); - renderer.setIcon(BugzillaConfig.getInstance().getPriorityIcon(prio)); - } else { - renderer.setIcon(null); - } - return renderer; - } - } - - public static class SimpleQueryParameter extends QueryParameter { - private final String[] values; - - public SimpleQueryParameter(String parameter, String[] values, String encoding) { - super(parameter, encoding); - this.values = values; - } - - @Override - ParameterValue[] getValues() { - if(values == null || values.length == 0) { - return EMPTY_PARAMETER_VALUE; - } - ParameterValue[] ret = new ParameterValue[values.length]; - for (int i = 0; i < values.length; i++) { - ret[i] = new ParameterValue(values[i]); - } - return ret; - } - - @Override - void setValues(ParameterValue[] values) { - // not interested - } - - @Override - void setEnabled(boolean b) { - // interested - } - - @Override - boolean isChanged() { - // used only from simple search - not expected to be called - assert false; - return false; - } - - @Override - void reset() { - // used only from simple search - not expected to be called - assert false; - } - } -} diff --git a/ide/bugzilla/src/org/netbeans/modules/bugzilla/repository/BugzillaConfiguration.java b/ide/bugzilla/src/org/netbeans/modules/bugzilla/repository/BugzillaConfiguration.java deleted file mode 100644 index 46ade3342ef7..000000000000 --- a/ide/bugzilla/src/org/netbeans/modules/bugzilla/repository/BugzillaConfiguration.java +++ /dev/null @@ -1,324 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.netbeans.modules.bugzilla.repository; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.LinkedList; -import java.util.List; -import org.eclipse.mylyn.internal.bugzilla.core.BugzillaCustomField; -import org.eclipse.mylyn.internal.bugzilla.core.BugzillaVersion; -import org.eclipse.mylyn.internal.bugzilla.core.RepositoryConfiguration; -import org.netbeans.modules.bugzilla.commands.GetConfigurationCommand; - -/** - * - * @author Tomas Stupka - */ -public class BugzillaConfiguration { - - // XXX simplify this. no need to hold this. - // its cached in bugzillacoreplugin - get it from there. - private RepositoryConfiguration rc; - - public synchronized void initialize(BugzillaRepository repository, boolean forceRefresh) { - this.rc = getRepositoryConfiguration(repository, forceRefresh); - } - - protected RepositoryConfiguration getRepositoryConfiguration(final BugzillaRepository repository, final boolean forceRefresh) { - GetConfigurationCommand cmd = new GetConfigurationCommand(forceRefresh, repository); - repository.getExecutor().execute(cmd, true, false); - return cmd.getConf(); - } - - public boolean isValid() { - return rc != null; - } - - /** - * Returns all products defined in the given repository - * - * @param repository - * @return - */ - public List getProducts() { - if(rc == null) { - return Collections.emptyList(); - } - return rc.getProducts(); - } - - /** - * Returns the componets for the given product or all known components if product is null - * - * @param repository - * @param product - * @return list of components - */ - public List getComponents(String product) { - if(rc == null) { - return Collections.emptyList(); - } - if(product == null) { - return rc.getComponents(); - } else { - return rc. getComponents(product); - } - } - - /** - * Returns all resolutions defined in the given repository - * - * @param repository - * @return - */ - public List getResolutions() { - if(rc == null) { - return Collections.emptyList(); - } - return rc.getResolutions(); - } - - /** - * Returns versiones defined for the given product or all available versions if product is null - * - * @param repository - * @param product - * @return - */ - public List getVersions(String product) { - if(rc == null) { - return Collections.emptyList(); - } - if(product == null) { - return rc.getVersions(); - } else { - return rc.getVersions(product); - } - } - - /** - * Returns all status defined in the given repository - * @param repository - * @return - */ - public List getStatusValues() { - if(rc == null) { - return Collections.emptyList(); - } - List ret = new LinkedList(rc.getOpenStatusValues()); - ret.addAll(rc.getClosedStatusValues()); - return ret; - } - - /** - * Returns all open statuses defined in the given repository. - * @param repository - * @return all open statuses defined in the given repository. - */ - public List getOpenStatusValues() { - if(rc == null) { - return Collections.emptyList(); - } - return rc.getOpenStatusValues(); - } - - /** - * Returns all priorities defined in the given repository - * @param repository - * @return - */ - public List getPriorities() { - if(rc == null) { - return Collections.emptyList(); - } - return rc.getPriorities(); - } - - /** - * Returns all keywords defined in the given repository - * @param repository - * @return - */ - public List getKeywords() { - if(rc == null) { - return Collections.emptyList(); - } - return rc.getKeywords(); - } - - /** - * Returns all platforms defined in the given repository - * @param repository - * @return - */ - public List getPlatforms() { - if(rc == null) { - return Collections.emptyList(); - } - return rc.getPlatforms(); - } - - /** - * Returns all operating systems defined in the given repository - * @param repository - * @return - */ - public List getOSs() { - if(rc == null) { - return Collections.emptyList(); - } - return rc.getOSs(); - } - - /** - * Returns all severities defined in the given repository - * @param repository - * @return - */ - public List getSeverities() { - if(rc == null) { - return Collections.emptyList(); - } - return rc.getSeverities(); - } - - /** - * Returns all issue types defined in the given repository. - * WARNING - works only for the bugzilla hosting netbeans - * - * @param repository - * @return - */ - public List getIssueTypes() { - if(rc == null) { - return Collections.emptyList(); - } - List fields = rc.getCustomFields(); - for (BugzillaCustomField field : fields) { - if(field.getName().equals("cf_bug_type")) { // NOI18N - return field.getOptions(); - } - } - return Collections.emptyList(); - } - - /** - * Returns all custom fields defined in the given repository - * @param repository - * @return - */ - public List getCustomFields() { - if(rc == null) { - return Collections.emptyList(); - } - return rc.getCustomFields(); - } - - /** - * Returns target milestones defined for the given product or all available - * milestones if product is null - * - * @param repository - * @param product - * @return - */ - public List getTargetMilestones(String product) { - if(rc == null) { - return Collections.emptyList(); - } - if(product == null) { - return rc.getTargetMilestones(); - } else { - return rc.getTargetMilestones(product); - } - } - - /** - * Returns the bugzilla repositories version - * @return - */ - public BugzillaVersion getInstalledVersion() { - if(rc == null) { - return null; - } - return rc.getInstallVersion(); - } - - private List issueFields; - public List getFields() { - if (issueFields == null) { - List fields = new ArrayList(40); - fields.add(IssueField.SUMMARY); - fields.add(IssueField.WHITEBOARD); - fields.add(IssueField.STATUS); - fields.add(IssueField.PRIORITY); - fields.add(IssueField.RESOLUTION); - fields.add(IssueField.PRODUCT); - fields.add(IssueField.COMPONENT); - fields.add(IssueField.VERSION); - fields.add(IssueField.PLATFORM); - fields.add(IssueField.OS); - fields.add(IssueField.MILESTONE); - fields.add(IssueField.REPORTER); - fields.add(IssueField.REPORTER_NAME); - fields.add(IssueField.ASSIGNED_TO); - fields.add(IssueField.ASSIGNED_TO_NAME); - fields.add(IssueField.QA_CONTACT); - fields.add(IssueField.QA_CONTACT_NAME); - fields.add(IssueField.DEPENDS_ON); - fields.add(IssueField.BLOCKS); - fields.add(IssueField.URL); - fields.add(IssueField.KEYWORDS); - fields.add(IssueField.SEVERITY); - fields.add(IssueField.ISSUE_TYPE); - fields.add(IssueField.DESCRIPTION); - fields.add(IssueField.CREATION); - fields.add(IssueField.CC); - fields.add(IssueField.MODIFICATION); - fields.add(IssueField.NEWCC); - fields.add(IssueField.REMOVECC); - fields.add(IssueField.COMMENT_COUNT); - fields.add(IssueField.ATTACHEMENT_COUNT); - fields.add(IssueField.ESTIMATED_TIME); - fields.add(IssueField.WORK_TIME); - fields.add(IssueField.REMAINING_TIME); - fields.add(IssueField.DEADLINE); - - if(rc != null) { - // Custom fields - for (BugzillaCustomField field : rc.getCustomFields()) { - fields.add(new CustomIssueField(field)); - } - } - issueFields = fields; - } - return issueFields; - } - - public IssueField getField(String key) { - for (IssueField issueField : getFields()) { - if(issueField.getKey().equals(key)) { - return issueField; - } - } - return null; - } -} diff --git a/ide/bugzilla/src/org/netbeans/modules/bugzilla/repository/BugzillaRepository.java b/ide/bugzilla/src/org/netbeans/modules/bugzilla/repository/BugzillaRepository.java deleted file mode 100644 index b4f1c2c7e107..000000000000 --- a/ide/bugzilla/src/org/netbeans/modules/bugzilla/repository/BugzillaRepository.java +++ /dev/null @@ -1,757 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.netbeans.modules.bugzilla.repository; - -import java.awt.EventQueue; -import org.netbeans.modules.bugzilla.*; -import java.awt.Image; -import java.beans.PropertyChangeEvent; -import java.beans.PropertyChangeListener; -import java.beans.PropertyChangeSupport; -import java.io.UnsupportedEncodingException; -import java.lang.ref.Reference; -import java.lang.ref.SoftReference; -import java.net.URLEncoder; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.HashMap; -import java.util.HashSet; -import java.util.LinkedList; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.logging.Level; -import javax.swing.SwingUtilities; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.OperationCanceledException; -import org.eclipse.mylyn.commons.net.AuthenticationCredentials; -import org.eclipse.mylyn.commons.net.AuthenticationType; -import org.eclipse.mylyn.internal.bugzilla.core.IBugzillaConstants; -import org.eclipse.mylyn.tasks.core.IRepositoryQuery; -import org.eclipse.mylyn.tasks.core.TaskRepository; -import org.netbeans.modules.bugzilla.issue.BugzillaIssue; -import org.netbeans.modules.bugzilla.query.BugzillaQuery; -import org.netbeans.modules.team.spi.RepositoryUser; -import org.netbeans.modules.bugtracking.spi.*; -import org.netbeans.modules.team.spi.OwnerInfo; -import org.netbeans.modules.bugzilla.commands.BugzillaExecutor; -import org.netbeans.modules.bugzilla.query.QueryController; -import org.netbeans.modules.bugzilla.query.QueryParameter; -import org.netbeans.modules.bugzilla.util.BugzillaConstants; -import org.netbeans.modules.bugzilla.util.BugzillaUtil; -import org.netbeans.modules.mylyn.util.commands.GetRepositoryTasksCommand; -import org.netbeans.modules.mylyn.util.MylynSupport; -import org.netbeans.modules.mylyn.util.MylynUtils; -import org.netbeans.modules.mylyn.util.NbTask; -import org.netbeans.modules.mylyn.util.commands.SimpleQueryCommand; -import org.netbeans.modules.mylyn.util.commands.SynchronizeTasksCommand; -import org.netbeans.modules.mylyn.util.UnsubmittedTasksContainer; -import org.netbeans.modules.team.spi.TeamAccessorUtils; -import org.openide.nodes.Node; -import org.openide.util.ImageUtilities; -import org.openide.util.NbBundle; -import org.openide.util.RequestProcessor; -import org.openide.util.RequestProcessor.Task; -import org.openide.util.WeakListeners; -import org.eclipse.mylyn.tasks.core.IRepositoryQuery; - -/** - * - * @author Tomas Stupka, Jan Stola - */ -public class BugzillaRepository { - - private static final String ICON_PATH = "org/netbeans/modules/bugtracking/ui/resources/repository.png"; // NOI18N - - private RepositoryInfo info; - private TaskRepository taskRepository; - private BugzillaRepositoryController controller; - private Set queries = null; - private Cache cache; - private BugzillaExecutor executor; - private Image icon; - private BugzillaConfiguration bc; - - private PropertyChangeSupport support; - - private final Object RC_LOCK = new Object(); - private final Object CACHE_LOCK = new Object(); - private UnsubmittedTasksContainer unsubmittedTasksContainer; - private PropertyChangeListener unsubmittedTasksListener; - private boolean queryCleanedup = false; - - public BugzillaRepository() { - icon = ImageUtilities.loadImage(ICON_PATH, true); - support = new PropertyChangeSupport(this); - } - - public BugzillaRepository(RepositoryInfo info) { - this(); - this.info = checkAndPatchNetbeansUrl(info); - String name = this.info.getDisplayName(); - String url = this.info.getUrl(); - boolean shortLoginEnabled = Boolean.parseBoolean(this.info.getValue(IBugzillaConstants.REPOSITORY_SETTING_SHORT_LOGIN)); - taskRepository = setupTaskRepository(name, null, url, "", new char[0], "", new char[0], shortLoginEnabled); - } - - public RepositoryInfo getInfo() { - return info; - } - - public String getID() { - return info.getID(); - } - - public TaskRepository getTaskRepository() { - return taskRepository; - } - - public BugzillaQuery createQuery() { - BugzillaConfiguration conf = getConfiguration(); - if(conf == null || !conf.isValid()) { - // invalid connection data? - return null; - } - BugzillaQuery q = new BugzillaQuery(this); - return q; - } - - public BugzillaIssue createIssue() { - BugzillaConfiguration conf = getConfiguration(); - if(conf == null || !conf.isValid()) { - // invalid connection data? - return null; - } - - String product = null; - String component = null; - for (String productCandidate : conf.getProducts()) { - // iterates because a product without a component throws NPE inside mylyn - List components = conf.getComponents(productCandidate); - if (!components.isEmpty()) { - product = productCandidate; - component = components.get(0); - break; - } - } - - NbTask task; - try { - task = MylynSupport.getInstance().createTask(taskRepository, new TaskMapping(product, component)); - return getIssueForTask(task); - } catch (OperationCanceledException ex) { - // creation of new task may be immediately canceled - // happens when more repositories are available and - // the RepoComboSupport immediately switches to another repo - Bugzilla.LOG.log(Level.FINE, null, ex); - return null; - } catch (CoreException ex) { - Bugzilla.LOG.log(Level.WARNING, null, ex); - return null; - } - } - - public void remove() { - Collection qs = getQueries(); - BugzillaQuery[] toRemove = qs.toArray(new BugzillaQuery[0]); - for (BugzillaQuery q : toRemove) { - removeQuery(q); - } - resetRepository(true); - if (getTaskRepository() != null) { - // Maybe it's not needed to remove in mylyn? - } - } - - public BugzillaIssue getIssueForTask (NbTask task) { - BugzillaIssue issue = null; - if (task != null) { - synchronized (CACHE_LOCK) { - String taskId = BugzillaIssue.getID(task); - Cache issueCache = getIssueCache(); - issue = issueCache.getIssue(taskId); - if (issue == null) { - issue = issueCache.setIssue(taskId, new BugzillaIssue(task, this)); - } - } - } - return issue; - } - - public void taskDeleted (String taskId) { - getIssueCache().removeIssue(taskId); - } - - public Collection getUnsubmittedIssues () { - try { - UnsubmittedTasksContainer cont = getUnsubmittedTasksContainer(); - List unsubmittedTasks = cont.getTasks(); - List unsubmittedIssues = new ArrayList(unsubmittedTasks.size()); - for (NbTask task : unsubmittedTasks) { - BugzillaIssue issue = getIssueForTask(task); - if (issue != null) { - unsubmittedIssues.add(issue); - } - } - return unsubmittedIssues; - } catch (CoreException ex) { - Bugzilla.LOG.log(Level.INFO, null, ex); - return Collections.emptyList(); - } - } - - /** - * Do not call this method other than from BugzillaConfig. - * To be overridden by KenaiRepository - */ - public BugzillaQuery createPersistentQuery (String queryName, String urlParams, boolean urlDef) { - IRepositoryQuery query = null; - try { - query = MylynSupport.getInstance().getRepositoryQuery(getTaskRepository(), queryName); - } catch (CoreException ex) { - Bugzilla.LOG.log(Level.WARNING, null, ex); - } - return new BugzillaQuery(queryName, query, this, urlParams, true, urlDef, true); - } - - synchronized void resetRepository(boolean keepConfiguration) { - if(!keepConfiguration) { - bc = null; - } - } - - public String getDisplayName() { - return info.getDisplayName(); - } - - private String getTooltip(String repoName, String user, String url) { - return NbBundle.getMessage(BugzillaRepository.class, "LBL_RepositoryTooltip", new Object[] {repoName, user, url}); // NOI18N - } - - public Image getIcon() { - return icon; - } - - public String getUsername() { - AuthenticationCredentials c = getTaskRepository().getCredentials(AuthenticationType.REPOSITORY); - return c != null ? c.getUserName() : ""; // NOI18N - } - - public char[] getPassword() { - AuthenticationCredentials c = getTaskRepository().getCredentials(AuthenticationType.REPOSITORY); - return c != null ? c.getPassword().toCharArray() : new char[0]; - } - - public String getHttpUsername() { - AuthenticationCredentials c = getTaskRepository().getCredentials(AuthenticationType.HTTP); - return c != null ? c.getUserName() : ""; // NOI18N - } - - public char[] getHttpPassword() { - AuthenticationCredentials c = getTaskRepository().getCredentials(AuthenticationType.HTTP); - return c != null ? c.getPassword().toCharArray() : new char[0]; - } - - public List getIssues(final String... ids) { - final List ret = new LinkedList(); - try { - MylynSupport supp = MylynSupport.getInstance(); - Set unknownTasks = new HashSet(ids.length); - for (String id : ids) { - BugzillaIssue issue = findUnsubmitted(id); - if (issue == null) { - issue = getIssueForTask(supp.getTask(getTaskRepository().getUrl(), id)); - } - if (issue == null) { - // must go online - unknownTasks.add(id); - } else { - ret.add(issue); - } - } - if (!unknownTasks.isEmpty()) { - GetRepositoryTasksCommand cmd = supp.getCommandFactory() - .createGetRepositoryTasksCommand(taskRepository, unknownTasks); - getExecutor().execute(cmd, true); - for (NbTask task : cmd.getTasks()) { - BugzillaIssue issue = getIssueForTask(task); - if (issue != null) { - ret.add(issue); - } - } - } - } catch (CoreException ex) { - Bugzilla.LOG.log(Level.INFO, null, ex); - } - return ret; - } - - public BugzillaIssue getIssue(final String id) { - assert !SwingUtilities.isEventDispatchThread() : "Accessing remote host. Do not call in awt"; // NOI18N - BugzillaIssue issue = findUnsubmitted(id); - if (issue == null) { - issue = getIssueForTask(BugzillaUtil.getTask(this, id, true)); - } - return issue; - } - - // XXX create repo wih product if kenai project and use in queries - public Collection simpleSearch(final String criteria) { - assert taskRepository != null; - assert !SwingUtilities.isEventDispatchThread() : "Accessing remote host. Do not call in awt"; // NOI18N - - String[] keywords = criteria.split(" "); // NOI18N - - final List issues = new ArrayList(); - - if(keywords.length == 1 && isInteger(keywords[0])) { - BugzillaIssue issue = getIssueForTask(BugzillaUtil.getTask(this, keywords[0], false)); - if (issue != null) { - issues.add(issue); - } - } - - StringBuilder url = new StringBuilder(); - url.append(BugzillaConstants.URL_ADVANCED_BUG_LIST + "&short_desc_type=allwordssubstr&short_desc="); // NOI18N - for (int i = 0; i < keywords.length; i++) { - String val = keywords[i].trim(); - if(val.equals("")) { - continue; - } // NOI18N - try { - val = URLEncoder.encode(val, getTaskRepository().getCharacterEncoding()); - } catch (UnsupportedEncodingException ueex) { - Bugzilla.LOG.log(Level.INFO, null, ueex); - try { - val = URLEncoder.encode(val, "UTF-8"); // NOI18N - } catch (UnsupportedEncodingException ex) { - // should not happen - } - } - url.append(val); - if(i < keywords.length - 1) { - url.append("+"); // NOI18N - } - } - QueryParameter[] additionalParams = getSimpleSearchParameters(); - for (QueryParameter qp : additionalParams) { - url.append(qp.get(true)); - } - - try { - IRepositoryQuery iquery = MylynSupport.getInstance().createNewQuery(taskRepository, "bugzilla simple search query"); //NOI18N - iquery.setUrl(url.toString()); - SimpleQueryCommand cmd = MylynSupport.getInstance().getCommandFactory().createSimpleQueryCommand(taskRepository, iquery); - getExecutor().execute(cmd, false); - for (NbTask task : cmd.getTasks()) { - BugzillaIssue issue = getIssueForTask(task); - if (issue != null) { - issues.add(issue); - } - } - } catch (CoreException ex) { - // should not happen - Bugzilla.LOG.log(Level.WARNING, null, ex); - } - return issues; - } - - public RepositoryController getController() { - if(controller == null) { - controller = new BugzillaRepositoryController(this); - } - return controller; - } - - public Collection getQueries() { - return getQueriesIntern(); - } - - public Cache getIssueCache() { - synchronized (CACHE_LOCK) { - if(cache == null) { - cache = new Cache(); - } - return cache; - } - } - - public void removeQuery(BugzillaQuery query) { - Bugzilla.LOG.log(Level.FINE, "removing query {0} for repository {1}", new Object[]{query.getDisplayName(), getDisplayName()}); // NOI18N - BugzillaConfig.getInstance().removeQuery(this, query); - getQueriesIntern().remove(query); - fireQueryListChanged(); - } - - public void saveQuery(BugzillaQuery query) { - assert info != null; - Bugzilla.LOG.log(Level.FINE, "saving query {0} for repository {1}", new Object[]{query.getDisplayName(), getDisplayName()}); // NOI18N - BugzillaConfig.getInstance().putQuery(this, query); - getQueriesIntern().add(query); - fireQueryListChanged(); - } - - public void addPropertyChangeListener(PropertyChangeListener listener) { - support.addPropertyChangeListener(listener); - } - - public void removePropertyChangeListener(PropertyChangeListener listener) { - support.removePropertyChangeListener(listener); - } - - private void fireQueryListChanged() { - Bugzilla.LOG.log(Level.FINER, "firing query list changed for repository {0}", new Object[]{getDisplayName()}); // NOI18N - support.firePropertyChange(RepositoryProvider.EVENT_QUERY_LIST_CHANGED, null, null); - } - - private void fireUnsubmittedIssuesChanged() { - Bugzilla.LOG.log(Level.FINER, "firing unsubmitted issues changed for repository {0}", new Object[] { getDisplayName() }); //NOI18N - support.firePropertyChange(RepositoryProvider.EVENT_UNSUBMITTED_ISSUES_CHANGED, null, null); - } - - private Set getQueriesIntern() { - if(queries == null) { - if(!queryCleanedup) { - // clean up. we are deleting adhoc queries when closing the query dialog - // an eventual crash could have left some stored in MylynSupport - queryCleanedup = true; - try { - Set iqs = MylynSupport.getInstance().getRepositoryQueries(taskRepository); - for (IRepositoryQuery q : iqs) { - if(q.getSummary().startsWith(BugzillaQuery.BUGZILLA_ADHOC_QUERY_PREFIX)) { - MylynSupport.getInstance().deleteQuery(q); - } - } - } catch (CoreException ex) { - Bugzilla.LOG.log(Level.INFO, null, ex); - } - } - queries = new HashSet(10); - String[] qs = BugzillaConfig.getInstance().getQueries(getID()); - for (String queryName : qs) { - BugzillaQuery q = BugzillaConfig.getInstance().getQuery(this, queryName); - if(q != null ) { - queries.add(q); - } else { - Bugzilla.LOG.log(Level.WARNING, "Couldn''t find query with stored name {0}", queryName); // NOI18N - } - } - } - return queries; - } - - public synchronized void setInfoValues(String user, char[] password) { - info = createInfo(info.getID(), info.getUrl(), info.getDisplayName(), user, null, password, null, Boolean.parseBoolean(info.getValue(IBugzillaConstants.REPOSITORY_SETTING_SHORT_LOGIN))); - setTaskRepository(info.getDisplayName(), info.getUrl(), user, password, null, null, Boolean.parseBoolean(info.getValue(IBugzillaConstants.REPOSITORY_SETTING_SHORT_LOGIN))); - } - - synchronized void setInfoValues(String name, String url, String user, char[] password, String httpUser, char[] httpPassword, boolean localUserEnabled) { - String id = info != null ? info.getID() : name + System.currentTimeMillis(); - info = createInfo(id, url, name, user, httpUser, password, httpPassword, localUserEnabled); - setTaskRepository(name, url, user, password, httpUser, httpPassword, localUserEnabled); - } - - protected RepositoryInfo createInfo(String id, String url, String name, String user, String httpUser, char[] password, char[] httpPassword, boolean localUserEnabled) { - RepositoryInfo ri = new RepositoryInfo(id, BugzillaConnector.ID, url, name, getTooltip(name, user, url), user, httpUser, password, httpPassword); - ri.putValue(IBugzillaConstants.REPOSITORY_SETTING_SHORT_LOGIN, Boolean.toString(localUserEnabled)); - return ri; - } - - public void ensureCredentials() { - setCredentials(info.getUsername(), info.getPassword(), info.getHttpUsername(), info.getHttpPassword(), true); - } - - public void setCredentials(String user, char[] password, String httpUser, char[] httpPassword) { - setCredentials(user, password, httpUser, httpPassword, false); - } - - private synchronized void setCredentials(String user, char[] password, String httpUser, char[] httpPassword, boolean keepConfiguration) { - MylynUtils.setCredentials(taskRepository, user, password, httpUser, httpPassword); - resetRepository(keepConfiguration); - } - - protected synchronized void setTaskRepository(String user, char[] password) { - setTaskRepository(info.getDisplayName(), info.getUrl(), user, password, null, null, Boolean.parseBoolean(info.getValue(IBugzillaConstants.REPOSITORY_SETTING_SHORT_LOGIN))); - } - - private void setTaskRepository(String name, String url, String user, char[] password, String httpUser, char[] httpPassword, boolean shortLoginEnabled) { - - String oldUrl = taskRepository != null ? taskRepository.getUrl() : ""; - AuthenticationCredentials c = taskRepository != null ? taskRepository.getCredentials(AuthenticationType.REPOSITORY) : null; - String oldUser = c != null ? c.getUserName() : ""; - - taskRepository = setupTaskRepository(name, oldUrl.equals(url) ? null : oldUrl, - url, user, password, httpUser, httpPassword, shortLoginEnabled); - resetRepository(oldUrl.equals(url) && oldUser.equals(user)); - } - - /** - * If oldUrl is not null, gets the repository for the oldUrl and rewrites it - * to the new url. - */ - private static TaskRepository setupTaskRepository (String name, String oldUrl, String url, String user, - char[] password, String httpUser, char[] httpPassword, - boolean shortLoginEnabled) { - TaskRepository repository; - if (oldUrl == null) { - repository = MylynSupport.getInstance().getTaskRepository(Bugzilla.getInstance().getRepositoryConnector(), url); - } else { - repository = MylynSupport.getInstance().getTaskRepository(Bugzilla.getInstance().getRepositoryConnector(), oldUrl); - try { - MylynSupport.getInstance().setRepositoryUrl(repository, url); - } catch (CoreException ex) { - Bugzilla.LOG.log(Level.WARNING, null, ex); - } - } - setupProperties(repository, name, user, password, httpUser, httpPassword, shortLoginEnabled); - return repository; - } - - static TaskRepository createTemporaryTaskRepository (String name, String url, String user, - char[] password, String httpUser, char[] httpPassword, - boolean localUserEnabled) { - TaskRepository taskRepository = new TaskRepository( - Bugzilla.getInstance().getRepositoryConnector().getConnectorKind(), url); - setupProperties(taskRepository, name, user, password, httpUser, httpPassword, localUserEnabled); - return taskRepository; - } - - private static void setupProperties (TaskRepository repository, String displayName, - String user, char[] password, String httpUser, char[] httpPassword, - boolean shortLoginEnabled) { - repository.setRepositoryLabel(displayName); - MylynUtils.setCredentials(repository, user, password, httpUser, httpPassword); - repository.setProperty(IBugzillaConstants.REPOSITORY_SETTING_SHORT_LOGIN, shortLoginEnabled ? "true" : "false"); //NOI18N - } - - public String getUrl() { - return taskRepository != null ? taskRepository.getUrl() : null; - } - - private boolean isInteger(String str) { - try { - Integer.parseInt(str); - return true; - } catch (NumberFormatException e) { - } - return false; - } - - public BugzillaExecutor getExecutor() { - if(executor == null) { - executor = new BugzillaExecutor(this); - } - return executor; - } - - public boolean authenticate(String errroMsg) { - return Bugzilla.getInstance().getBugtrackingFactory().editRepository(this, errroMsg); - } - - /** - * - * @return true if the repository accepts usernames in a short form (without domain specification). - */ - public boolean isShortUsernamesEnabled() { - return taskRepository != null && "true".equals(taskRepository.getProperty(IBugzillaConstants.REPOSITORY_SETTING_SHORT_LOGIN)); - } - - public Collection getUsers() { - return Collections.emptyList(); - } - - public OwnerInfo getOwnerInfo(Node[] nodes) { - if(nodes == null || nodes.length == 0) { - return null; - } - if(BugzillaUtil.isNbRepository(this)) { - if(nodes != null && nodes.length > 0) { - OwnerInfo ownerInfo = TeamAccessorUtils.getOwnerInfo(nodes[0]); - if(ownerInfo != null /*&& ownerInfo.getOwner().equals(product)*/ ) { - return ownerInfo; - } - } - } - return null; - } - - /** - * Returns the bugzilla configuration or null if not available - * - * @return - */ - public BugzillaConfiguration getConfiguration() { - synchronized(RC_LOCK) { - if(bc == null) { - bc = createConfiguration(false); - } else if(!bc.isValid()) { - // there was already an attempt to get the configuration - // yet it happend to be invalid, so try one more time as it - // might have been just a networking glitch - bc = createConfiguration(false); - } - return bc; - } - } - - public synchronized void refreshConfiguration() { - synchronized(RC_LOCK) { - BugzillaConfiguration conf = createConfiguration(true); - if(conf.isValid()) { - bc = conf; - } else { - // Hard to say at this point why the attempt to refresh the - // configuration failed - could be just a temporary networking issue. - // This is called only from ensureConfigurationUptodate(), so even if - // the metadata might not be uptodate anymore, they still may be - // sufficient for what the user plans to do. So let's cross the - // fingers and keep bc the way it is. - } - } - } - - protected BugzillaConfiguration createConfiguration(boolean forceRefresh) { - BugzillaConfiguration conf = new BugzillaConfiguration(); - conf.initialize(this, forceRefresh); - return conf; - } - - public void refreshAllQueries() { - EventQueue.invokeLater(new Runnable() { - @Override - public void run() { - Collection qs = getQueries(); - for (BugzillaQuery q : qs) { - Bugzilla.LOG.log(Level.FINER, "preparing to refresh query {0} - {1}", new Object[] {q.getDisplayName(), getDisplayName()}); // NOI18N - QueryController qc = q.getController(); - qc.onRefresh(); - } - } - }); - } - - @Override - public String toString() { - return super.toString() + " (" + getDisplayName() + ')'; //NOI18N - } - - protected QueryParameter[] getSimpleSearchParameters () { - return new QueryParameter[] {}; - } - - private BugzillaIssue findUnsubmitted (String id) { - try { - for (NbTask task : getUnsubmittedTasksContainer().getTasks()) { - if (id.equals("-" + task.getTaskId())) { - return getIssueForTask(task); - } - } - } catch (CoreException ex) { - Bugzilla.LOG.log(Level.INFO, null, ex); - } - return null; - } - - private UnsubmittedTasksContainer getUnsubmittedTasksContainer () throws CoreException { - synchronized (this) { - if (unsubmittedTasksContainer == null) { - unsubmittedTasksContainer = MylynSupport.getInstance().getUnsubmittedTasksContainer(getTaskRepository()); - unsubmittedTasksContainer.addPropertyChangeListener(WeakListeners.propertyChange(unsubmittedTasksListener = new PropertyChangeListener() { - @Override - public void propertyChange (PropertyChangeEvent evt) { - if (UnsubmittedTasksContainer.EVENT_ISSUES_CHANGED.equals(evt.getPropertyName())) { - fireUnsubmittedIssuesChanged(); - } - } - }, unsubmittedTasksContainer)); - } - return unsubmittedTasksContainer; - } - } - - private RepositoryInfo checkAndPatchNetbeansUrl(RepositoryInfo info) { - if(BugzillaUtil.isNbRepository(info.getUrl()) && info.getUrl().startsWith("http://")) { // NOI18N - RepositoryInfo i = new RepositoryInfo( - info.getID(), - info.getConnectorId(), - NBRepositorySupport.NB_BUGZILLA_URL, - info.getDisplayName(), - info.getTooltip(), - info.getUsername(), - info.getHttpUsername(), - info.getPassword(), - info.getHttpPassword()); - i.putValue(IBugzillaConstants.REPOSITORY_SETTING_SHORT_LOGIN, info.getValue(IBugzillaConstants.REPOSITORY_SETTING_SHORT_LOGIN)); - Bugzilla.LOG.warning("Changed NetBeans repository url protocol to https"); - return i; - } - return info; - } - - private static class TaskMapping extends org.eclipse.mylyn.tasks.core.TaskMapping { - private final String component; - private final String product; - - public TaskMapping (String product, String component) { - this.product = product; - this.component = component; - } - - @Override - public String getProduct () { - return product; - } - - @Override - public String getComponent () { - return component; - } - } - - public class Cache { - - private final Map> issues = new HashMap<>(); - - Cache() { } - - public BugzillaIssue getIssue (String id) { - synchronized (CACHE_LOCK) { - Reference issueRef = issues.get(id); - return issueRef == null ? null : issueRef.get(); - } - } - - public BugzillaIssue setIssue (String id, BugzillaIssue issue) { - synchronized (CACHE_LOCK) { - issues.put(id, new SoftReference<>(issue)); - } - return issue; - } - - private void removeIssue (String id) { - synchronized (CACHE_LOCK) { - issues.remove(id); - } - } - - } - -} diff --git a/ide/bugzilla/src/org/netbeans/modules/bugzilla/repository/BugzillaRepositoryController.java b/ide/bugzilla/src/org/netbeans/modules/bugzilla/repository/BugzillaRepositoryController.java deleted file mode 100644 index 680a0c911efe..000000000000 --- a/ide/bugzilla/src/org/netbeans/modules/bugzilla/repository/BugzillaRepositoryController.java +++ /dev/null @@ -1,472 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.netbeans.modules.bugzilla.repository; - -import java.awt.BorderLayout; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.net.URI; -import java.util.Collection; -import java.util.logging.Level; -import javax.swing.JComponent; -import javax.swing.event.ChangeListener; -import javax.swing.event.DocumentEvent; -import javax.swing.event.DocumentListener; -import org.eclipse.mylyn.tasks.core.TaskRepository; -import org.netbeans.api.progress.ProgressHandle; -import org.netbeans.api.progress.ProgressHandleFactory; -import org.netbeans.modules.bugtracking.api.Repository; -import org.netbeans.modules.bugtracking.api.RepositoryManager; -import org.netbeans.modules.bugtracking.spi.RepositoryController; -import org.netbeans.modules.bugtracking.spi.RepositoryInfo; -import org.netbeans.modules.team.commons.LogUtils; -import org.netbeans.modules.bugtracking.commons.UIUtils; -import org.netbeans.modules.bugzilla.Bugzilla; -import org.netbeans.modules.bugzilla.BugzillaConnector; -import org.netbeans.modules.bugzilla.commands.ValidateCommand; -import org.netbeans.modules.bugzilla.util.BugzillaUtil; -import org.openide.util.*; -import org.openide.util.RequestProcessor.Task; - -/** - * - * @author Tomas Stupka - */ -public class BugzillaRepositoryController implements RepositoryController, DocumentListener, ActionListener { - private final BugzillaRepository repository; - private final RepositoryPanel panel; - private String errorMessage; - private boolean validateError; - private boolean populated = false; - private TaskRunner taskRunner; - private RequestProcessor rp; - private final ChangeSupport support = new ChangeSupport(this); - - BugzillaRepositoryController(BugzillaRepository repository) { - this.repository = repository; - panel = new RepositoryPanel(this); - panel.nameField.getDocument().addDocumentListener(this); - panel.userField.getDocument().addDocumentListener(this); - panel.urlField.getDocument().addDocumentListener(this); - panel.psswdField.getDocument().addDocumentListener(this); - - panel.validateButton.addActionListener(this); - } - - @Override - public JComponent getComponent() { - return panel; - } - - public HelpCtx getHelpContext() { - return new HelpCtx("org.netbeans.modules.bugzilla.repository.BugzillaRepository"); // NOI18N - } - - @Override - public boolean isValid() { - return validate(); - } - - private String getUrl() { - String url = panel.urlField.getText().trim(); - return url.endsWith("/") ? url.substring(0, url.length() - 1) : url; // NOI18N - } - - private String getName() { - return panel.nameField.getText().trim(); - } - - private String getUser() { - return panel.userField.getText(); - } - - private char[] getPassword() { - return panel.psswdField.getPassword(); - } - - private String getHttpUser() { - return panel.httpCheckBox.isSelected() ? panel.httpUserField.getText() : null; - } - - private char[] getHttpPassword() { - return panel.httpCheckBox.isSelected() ? panel.httpPsswdField.getPassword() : new char[0]; - } - - private boolean isLocalUserEnabled () { - return panel.cbEnableLocalUsers.isSelected(); - } - - private boolean validate() { - if(validateError) { - UIUtils.runInAWT(new Runnable() { - @Override - public void run() { - panel.setValidateEnabled(true); - } - }); - return false; - } - panel.setValidateEnabled(false); - - if(!populated) { - return false; - } - errorMessage = null; - - // check name - String name = panel.nameField.getText().trim(); - if(name.equals("")) { // NOI18N - errorMessage = NbBundle.getMessage(BugzillaRepositoryController.class, "MSG_MISSING_NAME"); // NOI18N - return false; - } - - // is name unique? - Collection repositories = null; - if(repository.getTaskRepository() == null) { - repositories = RepositoryManager.getInstance().getRepositories(BugzillaConnector.ID); - for (Repository repo : repositories) { - if(name.equals(repo.getDisplayName())) { - errorMessage = NbBundle.getMessage(BugzillaRepositoryController.class, "MSG_NAME_ALREADY_EXISTS"); // NOI18N - return false; - } - } - } - - // check url - String url = getUrl(); - if(url.equals("")) { // NOI18N - errorMessage = NbBundle.getMessage(BugzillaRepositoryController.class, "MSG_MISSING_URL"); // NOI18N - return false; - } - - if(!isValid(url) || "http://".equals(url) || "https://".equals(url)) { - errorMessage = NbBundle.getMessage(BugzillaRepositoryController.class, "MSG_WRONG_URL_FORMAT"); // NOI18N - return false; - } - - if(url.startsWith("http://netbeans.org/bugzilla")) { - errorMessage = NbBundle.getMessage(BugzillaRepositoryController.class, "MSG_WRONG_NETBEANS_URL_FORMAT"); // NOI18N - return false; - } - - // the url format is ok - lets enable the validate button - panel.setValidateEnabled(true); - - // is url unique? - if(repository.getTaskRepository() == null) { - for (Repository repo : repositories) { - if(url.trim().equals(repo.getUrl())) { - errorMessage = NbBundle.getMessage(BugzillaRepositoryController.class, "MSG_URL_ALREADY_EXISTS"); // NOI18N - return false; - } - } - } - - return true; - } - - @Override - public HelpCtx getHelpCtx() { - return new HelpCtx(getClass()); - } - - @Override - public String getErrorMessage() { - return errorMessage; - } - - @Override - public void applyChanges() { - repository.setInfoValues( - getName(), - getUrl(), - getUser(), - getPassword(), - getHttpUser(), - getHttpPassword(), - isLocalUserEnabled()); - if(BugzillaUtil.isNbRepository(repository)) { - NBRepositorySupport.getInstance().setNBBugzillaRepository(repository); - } - } - - @Override - public void cancelChanges() { - - } - - @Override - public void populate() { - taskRunner = new TaskRunner(NbBundle.getMessage(RepositoryPanel.class, "LBL_ReadingRepoData")) { // NOI18N - @Override - protected void preRun() { - panel.validateButton.setVisible(false); - super.preRun(); - } - @Override - protected void postRun() { - panel.validateButton.setVisible(true); - super.postRun(); - } - @Override - void execute() { - UIUtils.runInAWT(new Runnable() { - @Override - public void run() { - RepositoryInfo info = repository.getInfo(); - if(info != null) { - panel.userField.setText(info.getUsername()); - char[] psswd = info.getPassword(); - panel.psswdField.setText(psswd != null ? new String(psswd) : ""); - String httpUser = info.getHttpUsername(); - char[] httpPsswd = info.getHttpPassword(); - if(httpUser != null && !httpUser.equals("")) { - panel.httpCheckBox.setSelected(true); - panel.httpUserField.setText(httpUser); - } - if(httpPsswd != null && httpPsswd.length > 0) { - panel.httpCheckBox.setSelected(true); - panel.httpPsswdField.setText(new String(httpPsswd)); - } - panel.urlField.setText(info.getUrl()); - panel.nameField.setText(repository.getDisplayName()); - panel.cbEnableLocalUsers.setSelected(repository.isShortUsernamesEnabled()); - } - populated = true; - fireChange(); - } - }); - } - }; - taskRunner.startTask(); - } - - @Override - public void insertUpdate(DocumentEvent e) { - if(!populated) return; - validateErrorOff(e); - fireChange(); - } - - @Override - public void removeUpdate(DocumentEvent e) { - if(!populated) return; - validateErrorOff(e); - fireChange(); - } - - @Override - public void changedUpdate(DocumentEvent e) { - if(!populated) return; - validateErrorOff(e); - fireChange(); - } - - @Override - public void actionPerformed(ActionEvent e) { - if(e.getSource() == panel.validateButton) { - onValidate(); - } - } - - private void onValidate() { - taskRunner = new TaskRunner(NbBundle.getMessage(RepositoryPanel.class, "LBL_Validating")) { // NOI18N - @Override - void execute() { - validateError = false; - repository.resetRepository(true); // reset mylyns caching - - String name = getName(); - String url = getUrl(); - String user = getUser(); - String httpUser = getHttpUser(); - TaskRepository taskRepo = BugzillaRepository.createTemporaryTaskRepository( - name, - url, - user, - getPassword(), - httpUser, - getHttpPassword(), - isLocalUserEnabled()); - - ValidateCommand cmd = new ValidateCommand(taskRepo); - repository.getExecutor().execute(cmd, false, false, false); - if(cmd.hasFailed()) { - if(cmd.getErrorMessage() == null) { - logValidateMessage("validate for [{0},{1},{2},{3},{4},{5}] has failed, yet the returned error message is null.", // NOI18N - Level.WARNING, name, url, user, getPassword(), httpUser, getHttpPassword()); - errorMessage = NbBundle.getMessage(BugzillaRepositoryController.class, "MSG_VALIDATION_FAILED"); // NOI18N - } else { - errorMessage = cmd.getErrorMessage(); - logValidateMessage("validate for [{0},{1},{2},{3},{4},{5}] has failed: " + errorMessage, // NOI18N - Level.WARNING, name, url, user, getPassword(), httpUser, getHttpPassword()); - } - validateError = true; - } else { - UIUtils.runInAWT(new Runnable() { - @Override - public void run() { - panel.connectionLabel.setVisible(true); - } - }); - logValidateMessage("validate for [{0},{1},{2},{3},{4},{5}] ok.", // NOI18N - Level.INFO, name, url, user, getPassword(), httpUser, getHttpPassword()); - } - fireChange(); - } - - private void logValidateMessage(String msg, Level level, String name, String url, String user, char[] psswd, String httpUser, char[] httpPsswd) { - Bugzilla.LOG.log(level, msg, new Object[] {name, url, user, LogUtils.getPasswordLog(psswd), httpUser, LogUtils.getPasswordLog(httpPsswd)}); - } - }; - taskRunner.startTask(); - } - - private void validateErrorOff(DocumentEvent e) { - if (e.getDocument() == panel.userField.getDocument() || e.getDocument() == panel.urlField.getDocument() || e.getDocument() == panel.psswdField.getDocument()) { - validateError = false; - } - } - - void cancel() { - if(taskRunner != null) { - taskRunner.cancel(); - } - } - - private boolean isValid(String url) { - if (!url.startsWith("https://") && !url.startsWith("http://")) { - return false; - } - try { - new URI(url); - return true; - } catch (Exception e) { - return false; - } - } - - private abstract class TaskRunner implements Runnable, Cancellable, ActionListener { - private Task task; - private ProgressHandle handle; - private final String labelText; - - public TaskRunner(String labelText) { - this.labelText = labelText; - } - - final void startTask() { - cancel(); - task = getRequestProcessor().create(this); - task.schedule(0); - } - - @Override - public final void run() { - UIUtils.runInAWT(new Runnable() { - @Override - public void run() { - preRun(); - } - }); - try { - execute(); - } finally { - UIUtils.runInAWT(new Runnable() { - @Override - public void run() { - postRun(); - } - }); - } - } - - abstract void execute(); - - protected void preRun() { - handle = ProgressHandleFactory.createHandle(labelText, this); - JComponent comp = ProgressHandleFactory.createProgressComponent(handle); - panel.progressPanel.removeAll(); - panel.progressPanel.add(comp, BorderLayout.CENTER); - panel.cancelButton.addActionListener(this); - panel.connectionLabel.setVisible(false); - handle.start(); - panel.progressPanel.setVisible(true); - panel.cancelButton.setVisible(true); - panel.validateButton.setVisible(false); - panel.validateLabel.setVisible(true); - panel.enableFields(false); - panel.validateLabel.setText(labelText); // NOI18N - } - - protected void postRun() { - if(handle != null) { - handle.finish(); - } - panel.cancelButton.removeActionListener(this); - panel.progressPanel.setVisible(false); - panel.validateLabel.setVisible(false); - panel.validateButton.setVisible(true); - panel.cancelButton.setVisible(false); - panel.enableFields(true); - } - - @Override - public boolean cancel() { - boolean ret = true; - postRun(); - if(task != null) { - ret = task.cancel(); - } - errorMessage = null; - return ret; - } - - @Override - public void actionPerformed(ActionEvent e) { - if(e.getSource() == panel.cancelButton) { - cancel(); - } - } - - } - - private RequestProcessor getRequestProcessor() { - if(rp == null) { - rp = new RequestProcessor("Bugzilla Repository tasks", 1, true); // NOI18N - } - return rp; - } - - @Override - public void addChangeListener(ChangeListener l) { - support.addChangeListener(l); - } - - @Override - public void removeChangeListener(ChangeListener l) { - support.removeChangeListener(l); - } - - protected void fireChange() { - support.fireChange(); - } - -} diff --git a/ide/bugzilla/src/org/netbeans/modules/bugzilla/repository/Bundle.properties b/ide/bugzilla/src/org/netbeans/modules/bugzilla/repository/Bundle.properties deleted file mode 100644 index 9805840037c9..000000000000 --- a/ide/bugzilla/src/org/netbeans/modules/bugzilla/repository/Bundle.properties +++ /dev/null @@ -1,118 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - -## libs/jsch/manifest.mf -RepositoryPanel.jLabel1.text=Task Repository URL: -RepositoryPanel.jLabel2.text=Username: -RepositoryPanel.jLabel3.text=Password: -RepositoryPanel.jLabel5.text=Name: -HtmlPanel.pane.contentType=text/html - -RepositoryPanel.validateButton.text=Validate -RepositoryPanel.validateLabel.text=jLabel4 -LBL_Validating=Validating... -LBL_ReadingRepoData=Reading repository data... - -RepositoryPanel.validateLabel.text_1=jLabel4 -RepositoryPanel.validateButton.text_1=&Validate -RepositoryPanel.userLabel.text_1=&Username: -RepositoryPanel.urlLabel.text_1=&Task Repository URL: -RepositoryPanel.nameLabel.text_1=&Name: -RepositoryPanel.psswdLabel.text_1=&Password: -RepositoryPanel.psswdLabel1.text=Pa&ssword: -RepositoryPanel.userLabel1.text=Us&ername: -RepositoryPanel.httpCheckBox.text=Use HTTP &Authentication: -RepositoryPanel.nameField.AccessibleContext.accessibleDescription=N/A -RepositoryPanel.urlField.AccessibleContext.accessibleDescription=N/A -RepositoryPanel.userField.AccessibleContext.accessibleDescription=N/A -RepositoryPanel.psswdField.AccessibleContext.accessibleDescription=N/A -RepositoryPanel.httpCheckBox.AccessibleContext.accessibleDescription=N/A -RepositoryPanel.httpUserField.AccessibleContext.accessibleDescription=N/A -RepositoryPanel.httpPsswdField.AccessibleContext.accessibleDescription=N/A -RepositoryPanel.validateButton.AccessibleContext.accessibleDescription=N/A -MSG_VALIDATION_FAILED=Validation failed. -MSG_URL_ALREADY_EXISTS=Task repository with the same url already exists -MSG_WRONG_URL_FORMAT=Wrong URL format -MSG_WRONG_NETBEANS_URL_FORMAT=NetBeans Repository should have protocol https -MSG_MISSING_URL=Missing URL -MSG_NAME_ALREADY_EXISTS=Task repository with the same name already exists -MSG_MISSING_NAME=Missing name -RepositoryPanel.cbEnableLocalUsers.text=Enable &Local Usernames -RepositoryPanel.cbEnableLocalUsers.AccessibleContext.accessibleDescription=If selected then the module will accept also usernames without specification of a domain. -RepositoryPanel.connectionLabel.text_1=Connection successful - -LBL_SUMMARY=Summary -LBL_WHITEBOARD=Status Whiteboard -LBL_STATUS=Status -LBL_PRIORITY=Priority -LBL_RESOLUTION=Resolution -LBL_PRODUCT=Product -LBL_COMPONENT=Component -LBL_VERSION=Version -LBL_PLATFORM=Platform -LBL_OS=OS -LBL_MILESTONE=Milestone -LBL_REPORTER=Reporter -LBL_REPORTER_NAME=Reporter Name -LBL_ASSIGNED_TO=Assigned to -LBL_ASSIGNED_TO_NAME=Assigned to Name -LBL_QA_CONTACT=QA Contact -LBL_QA_CONTACT_NAME=QA Contact Name -# Depends on {$issue_number} -LBL_DEPENDS_ON=Depends on -# Blocks {$issue_number} -LBL_BLOCKS=Blocks -LBL_URL=URL -LBL_KEYWORDS=Keywords -LBL_SEVERITY=Severity -LBL_ISSUE_TYPE=Task Type -LBL_DESCRIPTION=Description -LBL_CREATION=Creation -LBL_CC=CC -LBL_ACTUAL_TIME=Current Est. -LBL_WORK_TIME=Hours Worked -LBL_REMAINING_TIME=Hours Left -LBL_DEADLINE=Deadline -LBL_DUPLICATE_ID=Duplicate of -LBL_ATTACH_IDE_LOG=Attach IDE Log -LBL_NEW_ATTACHMENTS=New Attachments - -LBL_NBRepository=NetBeans -NBRepositorySupport.password_keyring_description=Password for {0} -RepositoryPanel.cancelButton.text=Cancel - -# {repositoryName} : {user}@{url} -LBL_RepositoryTooltip="{0} : {1}@{2} -# {repositoryName} : {url} -LBL_RepositoryTooltipNoUser="{0} : {1} -NBLoginPanel.usernameTextField.text= - -NBLoginPanel.passwordField.text=jPasswordField1 -NBLoginPanel.errorLabel.text=jLabel5 -NBLoginPanel.jLabel2.text=Username: -NBLoginPanel.jLabel3.text=Password: -NBLoginPanel.jLabel4.text=Don't have an account? -NBLoginPanel.jButton1.text=Create it at netbeans.org -NBLoginPanel.jLabel1.text=To report a task with NetBeans IDE, you need an account at netbeans.org. - -MSG_MISSING_USERNAME_PASSWORD=Missing username or password -MSG_CONNECTING_2_NBORG=Connecting to netbeans.org/bugzilla... - -LBL_LOGIN_2_NBORG=Login to netbeans.org - -LBL_Login = Login -LBL_Cancel = Cancel \ No newline at end of file diff --git a/ide/bugzilla/src/org/netbeans/modules/bugzilla/repository/CustomIssueField.java b/ide/bugzilla/src/org/netbeans/modules/bugzilla/repository/CustomIssueField.java deleted file mode 100644 index 692f89433f46..000000000000 --- a/ide/bugzilla/src/org/netbeans/modules/bugzilla/repository/CustomIssueField.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.netbeans.modules.bugzilla.repository; - -import java.util.List; -import org.eclipse.mylyn.internal.bugzilla.core.BugzillaCustomField; - -/** - * Information about a custom issue field. - * - * @author Jan Stola - */ -public class CustomIssueField extends IssueField { - public enum Type {DateTime, DropDown, FreeText, LargeText, MultipleSelection, Unknown}; - private BugzillaCustomField field; - - CustomIssueField(BugzillaCustomField field) { - super(field.getName(), null); - this.field = field; - } - - @Override - public String getDisplayName() { - return field.getDescription(); - } - - public Type getType() { - Type type = Type.Unknown; - switch (field.getFieldType()) { - case DateTime: type = Type.DateTime; break; - case DropDown: type = Type.DropDown; break; - case FreeText: type = Type.FreeText; break; - case LargeText: type = Type.LargeText; break; - case MultipleSelection: type = Type.MultipleSelection; break; - } - return type; - } - - public List getOptions() { - return field.getOptions(); - } - - public boolean getShowOnBugCreation() { - return field.isEnterBug(); - } - -} diff --git a/ide/bugzilla/src/org/netbeans/modules/bugzilla/repository/IssueField.java b/ide/bugzilla/src/org/netbeans/modules/bugzilla/repository/IssueField.java deleted file mode 100644 index 6cbbdaadbf5f..000000000000 --- a/ide/bugzilla/src/org/netbeans/modules/bugzilla/repository/IssueField.java +++ /dev/null @@ -1,106 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.netbeans.modules.bugzilla.repository; - -import org.eclipse.mylyn.internal.bugzilla.core.BugzillaAttribute; -import org.eclipse.mylyn.tasks.core.data.TaskAttribute; -import org.netbeans.modules.mylyn.util.AbstractNbTaskWrapper; -import org.openide.util.NbBundle; - -/** - * Information about an issue field. - * - * @author Jan Stola, Tomas Stupka - */ -public class IssueField { - public static final IssueField SUMMARY = new IssueField(BugzillaAttribute.SHORT_DESC.getKey(), "LBL_SUMMARY"); // NOI18N - public static final IssueField WHITEBOARD = new IssueField(BugzillaAttribute.STATUS_WHITEBOARD.getKey(), "LBL_WHITEBOARD"); // NOI18N - public static final IssueField STATUS = new IssueField(TaskAttribute.STATUS, "LBL_STATUS"); // NOI18N - public static final IssueField PRIORITY = new IssueField(BugzillaAttribute.PRIORITY.getKey(), "LBL_PRIORITY"); // NOI18N - public static final IssueField RESOLUTION = new IssueField(TaskAttribute.RESOLUTION, "LBL_RESOLUTION"); // NOI18N - public static final IssueField PRODUCT = new IssueField(BugzillaAttribute.PRODUCT.getKey(), "LBL_PRODUCT"); // NOI18N - public static final IssueField COMPONENT = new IssueField(BugzillaAttribute.COMPONENT.getKey(), "LBL_COMPONENT"); // NOI18N - public static final IssueField VERSION = new IssueField(BugzillaAttribute.VERSION.getKey(), "LBL_VERSION"); // NOI18N - public static final IssueField PLATFORM = new IssueField(BugzillaAttribute.REP_PLATFORM.getKey(), "LBL_PLATFORM"); // NOI18N - public static final IssueField OS = new IssueField(BugzillaAttribute.OP_SYS.getKey(), "LBL_OS"); // NOI18N - public static final IssueField MILESTONE = new IssueField(BugzillaAttribute.TARGET_MILESTONE.getKey(), "LBL_MILESTONE"); // NOI18N - public static final IssueField REPORTER = new IssueField(BugzillaAttribute.REPORTER.getKey(), "LBL_REPORTER"); // NOI18N - public static final IssueField REPORTER_NAME = new IssueField(BugzillaAttribute.REPORTER_NAME.getKey(), "LBL_REPORTER_NAME"); // NOI18N - public static final IssueField ASSIGNED_TO = new IssueField(BugzillaAttribute.ASSIGNED_TO.getKey(), "LBL_ASSIGNED_TO"); // NOI18N - public static final IssueField ASSIGNED_TO_NAME = new IssueField(BugzillaAttribute.ASSIGNED_TO_NAME.getKey(), "LBL_ASSIGNED_TO_NAME"); // NOI18N - public static final IssueField QA_CONTACT = new IssueField(BugzillaAttribute.QA_CONTACT.getKey(), "LBL_QA_CONTACT"); // NOI18N - public static final IssueField QA_CONTACT_NAME = new IssueField(BugzillaAttribute.QA_CONTACT_NAME.getKey(), "LBL_QA_CONTACT_NAME"); // NOI18N - public static final IssueField DEPENDS_ON = new IssueField(BugzillaAttribute.DEPENDSON.getKey(), "LBL_DEPENDS_ON"); // NOI18N - public static final IssueField BLOCKS = new IssueField(BugzillaAttribute.BLOCKED.getKey(), "LBL_BLOCKS"); // NOI18N - public static final IssueField URL = new IssueField(BugzillaAttribute.BUG_FILE_LOC.getKey(), "LBL_URL"); // NOI18N - public static final IssueField KEYWORDS = new IssueField(BugzillaAttribute.KEYWORDS.getKey(), "LBL_KEYWORDS"); // NOI18N - public static final IssueField SEVERITY = new IssueField(BugzillaAttribute.BUG_SEVERITY.getKey(), "LBL_SEVERITY"); // NOI18N - public static final IssueField ISSUE_TYPE = new IssueField("cf_bug_type", "LBL_ISSUE_TYPE"); // NOI18N - public static final IssueField DESCRIPTION = new IssueField(BugzillaAttribute.LONG_DESC.getKey(), "LBL_DESCRIPTION"); // NOI18N - public static final IssueField CREATION = new IssueField(TaskAttribute.DATE_CREATION, "LBL_CREATION"); // NOI18N - public static final IssueField CC = new IssueField(BugzillaAttribute.CC.getKey(), "LBL_CC"); // NOI18N - public static final IssueField MODIFICATION = new IssueField(TaskAttribute.DATE_MODIFICATION, null); - public static final IssueField NEWCC = new IssueField(BugzillaAttribute.NEWCC.getKey(), null); - public static final IssueField REMOVECC = new IssueField(BugzillaAttribute.REMOVECC.getKey(), null); - public static final IssueField COMMENT_COUNT = new IssueField(TaskAttribute.TYPE_COMMENT, null, false); - public static final IssueField ATTACHEMENT_COUNT = new IssueField(TaskAttribute.TYPE_ATTACHMENT, null, false); - public static final IssueField ACTUAL_TIME = new IssueField(BugzillaAttribute.ACTUAL_TIME.getKey(), "LBL_ACTUAL_TIME", true); - public static final IssueField WORK_TIME = new IssueField(BugzillaAttribute.WORK_TIME.getKey(), "LBL_WORK_TIME", true); - public static final IssueField REMAINING_TIME = new IssueField(BugzillaAttribute.REMAINING_TIME.getKey(), "LBL_REMAINING_TIME", true); - public static final IssueField ESTIMATED_TIME = new IssueField(BugzillaAttribute.ESTIMATED_TIME.getKey(), "LBL_DEADLINE", true); - public static final IssueField DEADLINE = new IssueField(BugzillaAttribute.DEADLINE.getKey(), null, true); - public static final IssueField COMMENT = new IssueField(TaskAttribute.COMMENT_NEW, null, true); - public static final IssueField DUPLICATE_ID = new IssueField(BugzillaAttribute.DUP_ID.getKey(), "LBL_DUPLICATE_ID", true); - public static final IssueField REASSIGN_TO_DEFAULT = new IssueField(BugzillaAttribute.SET_DEFAULT_ASSIGNEE.getKey(), null, true); - public static final IssueField NB_ATTACH_IDE_LOG = new IssueField("nb.attachMessageLog", "LBL_ATTACH_IDE_LOG"); //NOI18N - public static final IssueField NB_NEW_ATTACHMENTS = new IssueField(AbstractNbTaskWrapper.NEW_ATTACHMENT_ATTRIBUTE_ID, "LBL_NEW_ATTACHMENTS", false); //NOI18N - - private final String key; - private final String displayNameKey; - private boolean singleAttribute; - - IssueField(String key, String displayNameKey) { - this(key, displayNameKey, true); - } - - IssueField(String key, String displayNameKey, boolean singleAttribute) { - this.key = key; - this.singleAttribute = singleAttribute; - this.displayNameKey = displayNameKey; - } - - public String getKey() { - return key; - } - - public boolean isSingleAttribute() { - return singleAttribute; - } - - public boolean isReadOnly() { - return !singleAttribute; - } - - public String getDisplayName() { - assert displayNameKey != null; // shouldn't be called for a field with a null display name - return NbBundle.getMessage(IssueField.class, displayNameKey); - } - -} diff --git a/ide/bugzilla/src/org/netbeans/modules/bugzilla/repository/NBLoginPanel.form b/ide/bugzilla/src/org/netbeans/modules/bugzilla/repository/NBLoginPanel.form deleted file mode 100644 index 97b2b43756fc..000000000000 --- a/ide/bugzilla/src/org/netbeans/modules/bugzilla/repository/NBLoginPanel.form +++ /dev/null @@ -1,160 +0,0 @@ - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
diff --git a/ide/bugzilla/src/org/netbeans/modules/bugzilla/repository/NBLoginPanel.java b/ide/bugzilla/src/org/netbeans/modules/bugzilla/repository/NBLoginPanel.java deleted file mode 100644 index 365244e53f0b..000000000000 --- a/ide/bugzilla/src/org/netbeans/modules/bugzilla/repository/NBLoginPanel.java +++ /dev/null @@ -1,227 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -/* - * NBLoginPanel.java - * - * Created on Jan 22, 2010, 11:02:27 AM - */ - -package org.netbeans.modules.bugzilla.repository; - -import java.awt.event.ActionEvent; -import java.net.MalformedURLException; -import java.net.URL; -import java.util.logging.Level; -import javax.swing.AbstractAction; -import javax.swing.JButton; -import javax.swing.event.DocumentEvent; -import javax.swing.event.DocumentListener; -import org.netbeans.modules.bugtracking.commons.LinkButton; -import org.netbeans.modules.bugzilla.Bugzilla; -import org.netbeans.modules.bugzilla.util.BugzillaUtil; -import org.openide.DialogDescriptor; -import org.openide.DialogDisplayer; -import org.openide.awt.HtmlBrowser.URLDisplayer; -import org.openide.util.HelpCtx; -import org.openide.util.NbBundle; - -/** - * - * @author Tomas Stupka - */ -class NBLoginPanel extends javax.swing.JPanel { - - private final JButton login = new JButton(NbBundle.getMessage(NBLoginPanel.class, "LBL_Login")); // NOI18N - private final JButton cancel = new JButton(NbBundle.getMessage(NBLoginPanel.class, "LBL_Cancel")); // NOI18N - - /** Creates new form NBLoginPanel */ - NBLoginPanel() { - initComponents(); - errorLabel.setVisible(false); - - login.getAccessibleContext().setAccessibleDescription(login.getText()); - cancel.getAccessibleContext().setAccessibleDescription(cancel.getText()); - usernameTextField.getDocument().addDocumentListener(new DocumentListener() { - @Override - public void insertUpdate(DocumentEvent e) { - validateFields(); - } - @Override - public void removeUpdate(DocumentEvent e) { - validateFields(); - } - @Override - public void changedUpdate(DocumentEvent e) { - validateFields(); - } - }); - } - - /** This method is called from within the constructor to - * initialize the form. - * WARNING: Do NOT modify this code. The content of this method is - * always regenerated by the Form Editor. - */ - @SuppressWarnings("unchecked") - // //GEN-BEGIN:initComponents - private void initComponents() { - - jLabel1 = new javax.swing.JLabel(); - usernameTextField = new javax.swing.JTextField(); - jLabel2 = new javax.swing.JLabel(); - jLabel3 = new javax.swing.JLabel(); - jLabel4 = new javax.swing.JLabel(); - jButton1 = new LinkButton(new NBRegisterAction()); - passwordField = new javax.swing.JPasswordField(); - errorLabel = new javax.swing.JLabel(); - - jLabel1.setText(org.openide.util.NbBundle.getMessage(NBLoginPanel.class, "NBLoginPanel.jLabel1.text")); // NOI18N - - usernameTextField.setText(org.openide.util.NbBundle.getMessage(NBLoginPanel.class, "NBLoginPanel.usernameTextField.text")); // NOI18N - - jLabel2.setText(org.openide.util.NbBundle.getMessage(NBLoginPanel.class, "NBLoginPanel.jLabel2.text")); // NOI18N - - jLabel3.setText(org.openide.util.NbBundle.getMessage(NBLoginPanel.class, "NBLoginPanel.jLabel3.text")); // NOI18N - - jLabel4.setText(org.openide.util.NbBundle.getMessage(NBLoginPanel.class, "NBLoginPanel.jLabel4.text")); // NOI18N - - jButton1.setText(org.openide.util.NbBundle.getMessage(NBLoginPanel.class, "NBLoginPanel.jButton1.text")); // NOI18N - - passwordField.setText(org.openide.util.NbBundle.getMessage(NBLoginPanel.class, "NBLoginPanel.passwordField.text")); // NOI18N - - errorLabel.setForeground(BugzillaUtil.getErrorForegroundColor()); - errorLabel.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/netbeans/modules/bugzilla/resources/error.gif"))); // NOI18N - errorLabel.setText(org.openide.util.NbBundle.getMessage(NBLoginPanel.class, "NBLoginPanel.errorLabel.text")); // NOI18N - - javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); - this.setLayout(layout); - layout.setHorizontalGroup( - layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(layout.createSequentialGroup() - .addContainerGap() - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(layout.createSequentialGroup() - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(jLabel2) - .addComponent(jLabel3)) - .addGap(18, 18, 18) - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false) - .addComponent(passwordField) - .addComponent(usernameTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 141, javax.swing.GroupLayout.PREFERRED_SIZE))) - .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(errorLabel) - .addGroup(layout.createSequentialGroup() - .addComponent(jLabel4) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(jButton1))) - .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) - ); - layout.setVerticalGroup( - layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(layout.createSequentialGroup() - .addContainerGap() - .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addGap(18, 18, 18) - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) - .addComponent(jLabel2) - .addComponent(usernameTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) - .addComponent(jLabel3) - .addComponent(passwordField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(errorLabel) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(jLabel4) - .addComponent(jButton1)) - .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) - ); - }// //GEN-END:initComponents - - - // Variables declaration - do not modify//GEN-BEGIN:variables - private javax.swing.JLabel errorLabel; - private javax.swing.JButton jButton1; - private javax.swing.JLabel jLabel1; - private javax.swing.JLabel jLabel2; - private javax.swing.JLabel jLabel3; - private javax.swing.JLabel jLabel4; - private javax.swing.JPasswordField passwordField; - private javax.swing.JTextField usernameTextField; - // End of variables declaration//GEN-END:variables - - private class NBRegisterAction extends AbstractAction { - @Override - public void actionPerformed(ActionEvent e) { - try { - URLDisplayer.getDefault().showURL(new URL(NBRepositorySupport.URL_NB_ORG_SIGNUP)); - } catch (MalformedURLException ex) { - Bugzilla.LOG.log(Level.SEVERE, NAME, ex); - } - } - } - - static boolean show(final BugzillaRepository repo, String errorMsg) { - final NBLoginPanel panel = new NBLoginPanel(); - panel.usernameTextField.setText(repo.getUsername()); - panel.passwordField.setText(new String(repo.getPassword())); - panel.validateFields(); - panel.updateErrorMessage(errorMsg); - if(panel.showLogin()) { // NOI18N - repo.setInfoValues(panel.usernameTextField.getText(), panel.passwordField.getPassword()); - return true; - } - return false; - } - - private boolean showLogin() { - DialogDescriptor descriptor = new DialogDescriptor ( - this, - NbBundle.getMessage(NBLoginPanel.class, "LBL_LOGIN_2_NBORG"), // NOI18N - true, - new Object[] {login, cancel}, - login, - DialogDescriptor.DEFAULT_ALIGN, - new HelpCtx("org.netbeans.modules.bugzilla.api.NBLoginPanel"), // NOI18N - null); - return DialogDisplayer.getDefault().notify(descriptor) == login; - } - - private void validateFields() { - if(usernameTextField.getText().trim().equals("")) { // NOI18N - login.setEnabled(false); - updateErrorMessage(NbBundle.getMessage(NBLoginPanel.class, "MSG_MISSING_USERNAME_PASSWORD")); // NOI18N - } else { - login.setEnabled(true); - updateErrorMessage(null); - } - } - - private void updateErrorMessage(String errorMsg) { - if (errorMsg != null) { - errorLabel.setVisible(true); - errorLabel.setText(errorMsg); - } else { - errorLabel.setVisible(false); - errorLabel.setText(""); // NOI18N - } - } -} diff --git a/ide/bugzilla/src/org/netbeans/modules/bugzilla/repository/NBRepositorySupport.java b/ide/bugzilla/src/org/netbeans/modules/bugzilla/repository/NBRepositorySupport.java deleted file mode 100644 index af0ebfd689b5..000000000000 --- a/ide/bugzilla/src/org/netbeans/modules/bugzilla/repository/NBRepositorySupport.java +++ /dev/null @@ -1,185 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.netbeans.modules.bugzilla.repository; - -import java.util.Collection; -import org.netbeans.api.progress.ProgressHandle; -import org.netbeans.api.progress.ProgressHandleFactory; -import org.netbeans.modules.bugtracking.api.Repository; -import org.netbeans.modules.bugtracking.api.RepositoryManager; -import org.netbeans.modules.bugtracking.spi.RepositoryInfo; -import org.netbeans.modules.bugtracking.commons.NBBugzillaUtils; -import org.netbeans.modules.bugzilla.BugzillaConnector; -import org.netbeans.modules.bugzilla.commands.ValidateCommand; -import org.netbeans.modules.bugzilla.util.BugzillaUtil; -import org.netbeans.modules.team.spi.TeamAccessor; -import org.netbeans.modules.team.spi.TeamAccessorUtils; -import org.openide.util.NbBundle; - -/** - * - * @author Tomas Stupka - */ -public class NBRepositorySupport extends BugzillaRepository { - - private static final String NB_BUGZILLA_HOST = "netbeans.org"; // NOI18N - public static final String NB_BUGZILLA_URL = "https://" + NB_BUGZILLA_HOST + "/bugzilla"; // NOI18N - public static final String URL_NB_ORG_SIGNUP = "https://" + NB_BUGZILLA_HOST + "/people/new"; // NOI18N - - private static NBRepositorySupport instance; - private BugzillaRepository bugzillaRepository; - private Repository nbRepository; - private boolean isTeam; - - private NBRepositorySupport() {} - - public static synchronized NBRepositorySupport getInstance() { - if(instance == null) { - instance = new NBRepositorySupport(); - } - return instance; - } - - /** - * Goes through all known bugzilla repositories and returns either the first - * which is registered for a netbeans.org url or creates a new with the netbeans - * bugzilla url and registeres it under services/issue tracking. - * In case there is a non kenai and a kenai repository available, the non kenai will - * be returned. User credentials will be reused in case that netbeans.org was - * already accessed via exception reporter in the past and a new repository - * was created. - * - * @return a BugzillaRepository - */ - public Repository getNBRepository(boolean checkLogin) { - Collection repos; - boolean registered = false; - if(nbRepository != null) { - // check if repository wasn't removed since the last time it was used - if(!isTeam) { - repos = RepositoryManager.getInstance().getRepositories(BugzillaConnector.ID); - for (Repository repo : repos) { - if(NBBugzillaUtils.isNbRepository(repo.getUrl())) { - registered = true; - break; - } - } - if(!registered) { - nbRepository = null; // create a new one - } - } - if(registered) { - return nbRepository; - } - } - repos = RepositoryManager.getInstance().getRepositories(BugzillaConnector.ID); - for (Repository repo : repos) { - if(NBBugzillaUtils.isNbRepository(repo.getUrl())) { - nbRepository = repo; - return repo; - } - } - - if(isNBTeamServerRegistered()) { - isTeam = true; - // there is a nb team server registered in the ide - // create a new repo but _do not register_ in services - nbRepository = createRepositoryIntern(checkLogin); // XXX for now we keep a repository for each - // nb team project. there will be no need - // to create a new instance as soon as we will - // have only one repository instance for all - // team projects. see also issue #177578 - } - - if(nbRepository == null) { // no nb repo yet ... - nbRepository = createRepositoryIntern(checkLogin); // ... create ... - } - - return nbRepository; - } - - public void setNBBugzillaRepository(BugzillaRepository repo) { - bugzillaRepository = repo; - } - - public BugzillaRepository getNBBugzillaRepository(boolean checkLogin) { - if(bugzillaRepository == null) { - getNBRepository(checkLogin); // invoke creation - } - return bugzillaRepository; - } - - private Repository createRepositoryIntern(boolean checkLogin) { - char[] password = NBBugzillaUtils.getNBPassword(); - final String username = NBBugzillaUtils.getNBUsername(); - String name = NbBundle.getMessage(NBRepositorySupport.class, "LBL_NBRepository"); // NOI18N - RepositoryInfo info = new RepositoryInfo( - "NetbeansRepository" + System.currentTimeMillis(), // NOI18N - BugzillaConnector.ID, - NB_BUGZILLA_URL, - NbBundle.getMessage(NBRepositorySupport.class, "LBL_NBRepository"), // NOI18N - NbBundle.getMessage(NBRepositorySupport.class, "LBL_RepositoryTooltip", new Object[] {name, username, NB_BUGZILLA_URL}), // NOI18N - username, - null, - password, - null); - BugzillaRepository repo = new BugzillaRepository(info); - if(checkLogin && !checkLogin(repo)) { - return null; - } - bugzillaRepository = repo; - return BugzillaUtil.getRepository(bugzillaRepository); - } - - private static boolean isNBTeamServerRegistered() { - for (TeamAccessor ka : TeamAccessorUtils.getTeamAccessors()) { - if (ka.isNBTeamServerRegistered()) { - return true; - } - } - return false; - } - - private static boolean checkLogin(final BugzillaRepository repo) { - if(repo.getUsername() != null && !repo.getUsername().equals("")) { // NOI18N - return true; - } - - String errorMsg = NbBundle.getMessage(NBLoginPanel.class, "MSG_MISSING_USERNAME_PASSWORD"); // NOI18N - while(NBLoginPanel.show(repo, errorMsg)) { - - ValidateCommand cmd = new ValidateCommand(repo.getTaskRepository()); - ProgressHandle handle = ProgressHandleFactory.createHandle(NbBundle.getMessage(NBLoginPanel.class, "MSG_CONNECTING_2_NBORG")); // NOI18N - handle.start(); - try { - repo.getExecutor().execute(cmd, false, false, false); - } finally { - handle.finish(); - } - if(cmd.hasFailed()) { - errorMsg = cmd.getErrorMessage(); - continue; - } - return true; - } - repo.setCredentials(null, null, null, null); // reset - return false; - } -} diff --git a/ide/bugzilla/src/org/netbeans/modules/bugzilla/repository/RepositoryPanel.form b/ide/bugzilla/src/org/netbeans/modules/bugzilla/repository/RepositoryPanel.form deleted file mode 100644 index cfc354e32290..000000000000 --- a/ide/bugzilla/src/org/netbeans/modules/bugzilla/repository/RepositoryPanel.form +++ /dev/null @@ -1,392 +0,0 @@ - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
diff --git a/ide/bugzilla/src/org/netbeans/modules/bugzilla/repository/RepositoryPanel.java b/ide/bugzilla/src/org/netbeans/modules/bugzilla/repository/RepositoryPanel.java deleted file mode 100644 index 2f1ad331cb25..000000000000 --- a/ide/bugzilla/src/org/netbeans/modules/bugzilla/repository/RepositoryPanel.java +++ /dev/null @@ -1,306 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -/* - * RepositoryPanel.java - * - * Created on Oct 14, 2008, 5:08:33 PM - */ - -package org.netbeans.modules.bugzilla.repository; - -import java.awt.Color; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import org.netbeans.modules.bugtracking.commons.UIUtils; - -/** - * - * @author Tomas Stupka, Jan Stola - */ -public class RepositoryPanel extends javax.swing.JPanel implements ActionListener { - private final BugzillaRepositoryController controller; - - /** Creates new form RepositoryPanel */ - public RepositoryPanel(BugzillaRepositoryController controller) { - initComponents(); - this.controller = controller; - validateLabel.setVisible(false); - progressPanel.setVisible(false); - httpCheckBox.addActionListener(this); - enableHttpFields(); - connectionLabel.setForeground(new Color(0, 88, 00)); - } - - @Override - public void addNotify() { - super.addNotify(); - controller.populate(); - connectionLabel.setVisible(false); - } - - @Override - public void removeNotify() { - super.removeNotify(); - controller.cancel(); - } - - /** This method is called from within the constructor to - * initialize the form. - * WARNING: Do NOT modify this code. The content of this method is - * always regenerated by the Form Editor. - */ - @SuppressWarnings("unchecked") - // //GEN-BEGIN:initComponents - private void initComponents() { - - urlLabel.setLabelFor(urlField); - org.openide.awt.Mnemonics.setLocalizedText(urlLabel, org.openide.util.NbBundle.getMessage(RepositoryPanel.class, "RepositoryPanel.urlLabel.text_1")); // NOI18N - - urlField.setColumns(30); - - userLabel.setLabelFor(userField); - org.openide.awt.Mnemonics.setLocalizedText(userLabel, org.openide.util.NbBundle.getMessage(RepositoryPanel.class, "RepositoryPanel.userLabel.text_1")); // NOI18N - - psswdLabel.setLabelFor(psswdField); - org.openide.awt.Mnemonics.setLocalizedText(psswdLabel, org.openide.util.NbBundle.getMessage(RepositoryPanel.class, "RepositoryPanel.psswdLabel.text_1")); // NOI18N - - userField.setColumns(15); - userField.addActionListener(new java.awt.event.ActionListener() { - public void actionPerformed(java.awt.event.ActionEvent evt) { - userFieldActionPerformed(evt); - } - }); - - psswdField.setColumns(15); - - nameLabel.setLabelFor(nameField); - org.openide.awt.Mnemonics.setLocalizedText(nameLabel, org.openide.util.NbBundle.getMessage(RepositoryPanel.class, "RepositoryPanel.nameLabel.text_1")); // NOI18N - - nameField.setColumns(30); - - org.openide.awt.Mnemonics.setLocalizedText(validateButton, org.openide.util.NbBundle.getMessage(RepositoryPanel.class, "RepositoryPanel.validateButton.text_1")); // NOI18N - validateButton.setToolTipText(org.openide.util.NbBundle.getMessage(RepositoryPanel.class, "RepositoryPanel.cbEnableLocalUsers.AccessibleContext.accessibleDescription")); // NOI18N - validateButton.addActionListener(new java.awt.event.ActionListener() { - public void actionPerformed(java.awt.event.ActionEvent evt) { - validateButtonActionPerformed(evt); - } - }); - - progressPanel.setLayout(new java.awt.BorderLayout()); - - org.openide.awt.Mnemonics.setLocalizedText(validateLabel, org.openide.util.NbBundle.getMessage(RepositoryPanel.class, "RepositoryPanel.validateLabel.text_1")); // NOI18N - - org.openide.awt.Mnemonics.setLocalizedText(httpCheckBox, org.openide.util.NbBundle.getMessage(RepositoryPanel.class, "RepositoryPanel.httpCheckBox.text")); // NOI18N - httpCheckBox.addActionListener(new java.awt.event.ActionListener() { - public void actionPerformed(java.awt.event.ActionEvent evt) { - httpCheckBoxActionPerformed(evt); - } - }); - - userLabel1.setLabelFor(httpUserField); - org.openide.awt.Mnemonics.setLocalizedText(userLabel1, org.openide.util.NbBundle.getMessage(RepositoryPanel.class, "RepositoryPanel.userLabel1.text")); // NOI18N - - httpUserField.setColumns(15); - httpUserField.addActionListener(new java.awt.event.ActionListener() { - public void actionPerformed(java.awt.event.ActionEvent evt) { - httpUserFieldActionPerformed(evt); - } - }); - - psswdLabel1.setLabelFor(httpPsswdField); - org.openide.awt.Mnemonics.setLocalizedText(psswdLabel1, org.openide.util.NbBundle.getMessage(RepositoryPanel.class, "RepositoryPanel.psswdLabel1.text")); // NOI18N - - httpPsswdField.setColumns(15); - - org.openide.awt.Mnemonics.setLocalizedText(cbEnableLocalUsers, org.openide.util.NbBundle.getMessage(RepositoryPanel.class, "RepositoryPanel.cbEnableLocalUsers.text")); // NOI18N - - connectionLabel.setForeground(java.awt.Color.green); - org.openide.awt.Mnemonics.setLocalizedText(connectionLabel, org.openide.util.NbBundle.getMessage(RepositoryPanel.class, "RepositoryPanel.connectionLabel.text_1")); // NOI18N - - org.openide.awt.Mnemonics.setLocalizedText(cancelButton, org.openide.util.NbBundle.getMessage(RepositoryPanel.class, "RepositoryPanel.cancelButton.text")); // NOI18N - - javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); - this.setLayout(layout); - layout.setHorizontalGroup( - layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(httpCheckBox) - .addGroup(layout.createSequentialGroup() - .addGap(27, 27, 27) - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(psswdLabel1) - .addComponent(userLabel1)) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false) - .addComponent(httpPsswdField, javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(httpUserField, javax.swing.GroupLayout.Alignment.LEADING))) - .addGroup(layout.createSequentialGroup() - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(urlLabel) - .addComponent(psswdLabel) - .addComponent(userLabel) - .addComponent(nameLabel)) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false) - .addComponent(psswdField, javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(userField, javax.swing.GroupLayout.Alignment.LEADING)) - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false) - .addComponent(urlField, javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(nameField, javax.swing.GroupLayout.Alignment.LEADING)))) - .addComponent(cbEnableLocalUsers) - .addGroup(layout.createSequentialGroup() - .addComponent(validateButton) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(validateLabel) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(progressPanel, javax.swing.GroupLayout.DEFAULT_SIZE, 141, Short.MAX_VALUE) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(cancelButton) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(connectionLabel)) - ); - layout.setVerticalGroup( - layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(layout.createSequentialGroup() - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) - .addComponent(nameLabel) - .addComponent(nameField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) - .addComponent(urlField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(urlLabel)) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) - .addComponent(userLabel) - .addComponent(userField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) - .addComponent(psswdField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(psswdLabel)) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(httpCheckBox) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) - .addComponent(userLabel1) - .addComponent(httpUserField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) - .addComponent(httpPsswdField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(psswdLabel1)) - .addGap(18, 18, 18) - .addComponent(cbEnableLocalUsers) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER) - .addComponent(progressPanel, javax.swing.GroupLayout.PREFERRED_SIZE, 15, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(validateLabel) - .addComponent(validateButton, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(cancelButton) - .addComponent(connectionLabel))) - ); - - urlField.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(RepositoryPanel.class, "RepositoryPanel.urlField.AccessibleContext.accessibleDescription")); // NOI18N - userField.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(RepositoryPanel.class, "RepositoryPanel.userField.AccessibleContext.accessibleDescription")); // NOI18N - psswdField.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(RepositoryPanel.class, "RepositoryPanel.psswdField.AccessibleContext.accessibleDescription")); // NOI18N - nameField.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(RepositoryPanel.class, "RepositoryPanel.nameField.AccessibleContext.accessibleDescription")); // NOI18N - validateButton.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(RepositoryPanel.class, "RepositoryPanel.validateButton.AccessibleContext.accessibleDescription")); // NOI18N - httpCheckBox.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(RepositoryPanel.class, "RepositoryPanel.httpCheckBox.AccessibleContext.accessibleDescription")); // NOI18N - httpUserField.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(RepositoryPanel.class, "RepositoryPanel.httpUserField.AccessibleContext.accessibleDescription")); // NOI18N - httpPsswdField.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(RepositoryPanel.class, "RepositoryPanel.httpPsswdField.AccessibleContext.accessibleDescription")); // NOI18N - cbEnableLocalUsers.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(RepositoryPanel.class, "RepositoryPanel.cbEnableLocalUsers.AccessibleContext.accessibleDescription")); // NOI18N - }// //GEN-END:initComponents - - private void userFieldActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_userFieldActionPerformed - // TODO add your handling code here: -}//GEN-LAST:event_userFieldActionPerformed - - private void validateButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_validateButtonActionPerformed - }//GEN-LAST:event_validateButtonActionPerformed - - private void httpUserFieldActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_httpUserFieldActionPerformed - // TODO add your handling code here: - }//GEN-LAST:event_httpUserFieldActionPerformed - - private void httpCheckBoxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_httpCheckBoxActionPerformed - // TODO add your handling code here: - }//GEN-LAST:event_httpCheckBoxActionPerformed - - - // Variables declaration - do not modify//GEN-BEGIN:variables - final javax.swing.JButton cancelButton = new javax.swing.JButton(); - final javax.swing.JCheckBox cbEnableLocalUsers = new javax.swing.JCheckBox(); - final javax.swing.JLabel connectionLabel = new javax.swing.JLabel(); - final javax.swing.JCheckBox httpCheckBox = new javax.swing.JCheckBox(); - final javax.swing.JPasswordField httpPsswdField = new javax.swing.JPasswordField(); - final javax.swing.JTextField httpUserField = new javax.swing.JTextField(); - final javax.swing.JTextField nameField = new javax.swing.JTextField(); - final javax.swing.JLabel nameLabel = new javax.swing.JLabel(); - final javax.swing.JPanel progressPanel = new javax.swing.JPanel(); - final javax.swing.JPasswordField psswdField = new javax.swing.JPasswordField(); - final javax.swing.JLabel psswdLabel = new javax.swing.JLabel(); - final javax.swing.JLabel psswdLabel1 = new javax.swing.JLabel(); - final javax.swing.JTextField urlField = new javax.swing.JTextField(); - final javax.swing.JLabel urlLabel = new javax.swing.JLabel(); - final javax.swing.JTextField userField = new javax.swing.JTextField(); - final javax.swing.JLabel userLabel = new javax.swing.JLabel(); - final javax.swing.JLabel userLabel1 = new javax.swing.JLabel(); - final javax.swing.JButton validateButton = new javax.swing.JButton(); - final javax.swing.JLabel validateLabel = new javax.swing.JLabel(); - // End of variables declaration//GEN-END:variables - - void enableFields(final boolean bl) { - UIUtils.runInAWT(new Runnable() { - @Override - public void run() { - psswdLabel.setEnabled(bl); - psswdField.setEnabled(bl); - userField.setEnabled(bl); - userLabel.setEnabled(bl); - nameField.setEnabled(bl); - nameLabel.setEnabled(bl); - urlField.setEnabled(bl); - urlLabel.setEnabled(bl); - httpCheckBox.setEnabled(bl); - cbEnableLocalUsers.setEnabled(bl); - enableHttpFields(); - } - }); - } - - @Override - public void actionPerformed(ActionEvent e) { - if(e.getSource() == httpCheckBox) { - enableHttpFields(); - } - } - - private void enableHttpFields() { - httpUserField.setEnabled(httpCheckBox.isSelected()); - httpPsswdField.setEnabled(httpCheckBox.isSelected()); - } - - void setValidateEnabled(final boolean b) { - UIUtils.runInAWT(new Runnable() { - @Override - public void run() { - validateButton.setEnabled(b); - } - }); - } -} diff --git a/ide/bugzilla/src/org/netbeans/modules/bugzilla/resources/conflict.png b/ide/bugzilla/src/org/netbeans/modules/bugzilla/resources/conflict.png deleted file mode 100644 index 0f996289344a3c5d8c579bae49729aaf5ddd6278..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 746 zcmV#3&9TvNx}jbmYEo#%&4e22HK3yb>=$vye)Dj$Lhd=m%}*^zw zTQshL){KUmqoJ4w^+H#?7n{uU{6-kSo@lV-dQExWz|BiV+2=|M^vgw#r1|N!sC#jB z^U` zQ2+`Haw%|S;x0P_Q;RmhacqSH0E#mmoGmRP%V`53c<_6bjbMzxuEpj`Akllw#6QK5 zsmOA|&xnO@$HY=PN{)D9{RDhhtiN zezvMg9d$kb!z``yA{ez5qyZ5TCOsYiYI=G=gtr|X*be`QJt9I~Utf~EE4{q{ zOnN+ge>sa-F|r%05yOB(Xw%YC6)>mg*zHXtZEXqp@f>MuW2^Z-+uJ+%me(;w67r2B zC)ExOY@9QU!G@tB0EQYG7004R=004l4008;_004mK004C`008P>0026d000+nm#LZ50007B zNkl*6RSkMLXB7A~?lot?N1Fs~a(Z5^YzVrdr^Z*Td2{Qm7fRJ5K z;;pG$;;v)Nz`(@F!0_h}1H;ds44kYS3_9Y{3|h==Oe-JXEjj+}Ge~VIOcOu=F~OXz zBOz7fu5ZG?AS%MZU}w+3@a-D|!Lw+zY1cfj#Nk}n-atkpiFtHRty$J>Y0mKBQ zy<8O4nHZRu85p#67#M_shPZh!Fns(3)EvyfAT72L^^8 zKY^|Q`a2<+fk9pYqFGUqfuXP%5~zRwFnsv;mjN2JU;q$6FawU>`S2R5IRT>i-aVkr zoj|2`fc60`tf*pO`1haT*8e{Y&~yO?009IuVB5YIPyhY>0(Ab$l|Y+;n%i3$7`_8z zpt+HO;r49?hIw-segkbk^6&RQkb0N_00D%Ykh(27c}hY#`50J!{suc2WFrGq{`dcX z49oxhU^w&dHz*;&(*ZyLAt$7s$TASS{}@B@GV0{~pV(E4hGkgWg!002ovPDHLk FV1h;|DI)*? diff --git a/ide/bugzilla/src/org/netbeans/modules/bugzilla/resources/error.svg b/ide/bugzilla/src/org/netbeans/modules/bugzilla/resources/error.svg deleted file mode 100644 index 57a6e4ba0602..000000000000 --- a/ide/bugzilla/src/org/netbeans/modules/bugzilla/resources/error.svg +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - - - - - - - - - - - - - diff --git a/ide/bugzilla/src/org/netbeans/modules/bugzilla/resources/info.png b/ide/bugzilla/src/org/netbeans/modules/bugzilla/resources/info.png deleted file mode 100644 index 6213c0cf8f22613611764df8cbe08d676b70ccf9..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 766 zcmVC<~1E~Zc4gq2fsPGLSUIWAn?rn^`i>w|XfEbZopy;R*`W4QJ3Biv;mHb@L42T}u43(^CU0|+2+82tP5Gg(_hhX2F2 z{|w*WeP#Ii^($CoVCgQnA>2Qi!88{K3xkG|DF5XfPm+P$Du4h28}R@C-%u_tE{4Z1 zzcT#z@q@wMP?Vt|%@nTLE^RZzk3W#`e*5t!0}oIwNDs&WfB=HUg39Ob3=H3X`~f>^ z^Wi59cbVOdbGf-0uHXNFGwwlZ zL3%&{Ab^-4VetLI&mZ53PCOvBAUz;9KmdUa`1}3+&L7`CFfcJOf${h6-x;)(gy0%L zY>*gC9;6ne2P6j&KwtxYe!R2r?W?DsfB*WI5RS_D1a^a_vgXipC9)Acztohw`V6#0QJ0q=>Z5JM)d3q w@(z#^24X=V=70+S0OI$cbOf^*1^@yK06O#`M#YtE_W%F@07*qoM6N<$f*NpEivR!s diff --git a/ide/bugzilla/src/org/netbeans/modules/bugzilla/resources/info.svg b/ide/bugzilla/src/org/netbeans/modules/bugzilla/resources/info.svg deleted file mode 100644 index db4c01180fbf..000000000000 --- a/ide/bugzilla/src/org/netbeans/modules/bugzilla/resources/info.svg +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - - - - - - - - - diff --git a/ide/bugzilla/src/org/netbeans/modules/bugzilla/resources/p1.png b/ide/bugzilla/src/org/netbeans/modules/bugzilla/resources/p1.png deleted file mode 100644 index 6b22e8872b63d75986a6a7bc688b191922e279a7..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 324 zcmV-K0lWT*P)jchRZ+#$QT5+1Tg>q`ScnXgV@;Av0!lp!!L$4 z*g};NJz_x#00`uOSQO@EAby0Q4u?hts4WaIn+R$o761eo0B4t((gsXSB>(^b07*qo IM6N<$f;R$x@&Et; diff --git a/ide/bugzilla/src/org/netbeans/modules/bugzilla/resources/p3.png b/ide/bugzilla/src/org/netbeans/modules/bugzilla/resources/p3.png deleted file mode 100644 index 973b368667e85793262fb64bd6476af03a3a83b6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 367 zcmV-#0g(QQP)5WfcEM{xDX8i9Zlh{b?d1f~#X0W36eX=FfGhz>9`k_rF<3;+YWd=~?tvRMEC N002ovPDHLkV1gWVmU;jH diff --git a/ide/bugzilla/src/org/netbeans/modules/bugzilla/resources/p4.png b/ide/bugzilla/src/org/netbeans/modules/bugzilla/resources/p4.png deleted file mode 100644 index 0085d7497c8ac94f1b5c6dd7fdee789b3b413a41..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 370 zcmV-&0ge8NP)gQ~&<^=clSD&hX~LH-=fQu?)X||H=em7#o)#8NYmZwI;1%F2lF)e;A&> z{=zV$C4u4huU}v`hz6;_rt$yz9o@xWKE7O&Uq74S3sCc;7oQoXwj_huzkdC|8>)}~ z{{8>`*Uz5}rHwPd8g`v{1knf-!y2kE@b5o!?1YwFh$%0>Fo=loGJN>{7v@x)8X3QT zdAlaFussCBz`wt*q9{a;4k(ZVVo@w{{u<;6tnr9!AQp}Pu_gdg0YHEO09t~R+)QGS QMgRZ+07*qoM6N<$fm7!;|N)7$!`g$MFB(pC_}Iu9b0fuwmGB;0VK; zS1;CpTnEw%*ZBS0_soohD27K*UoiAep2fh-!pvZ4Y9tfj<;<{j%_fE$x9&3h{`KoS zNE6s^AZvjk#c1Lb@UN^e8*GS@oHWD74<8u5eE-S7%*@Qd$IHXO!_CQ%Q&P`xZ09OQ z6sP|9_VsE@N1rxw$o>8En}L;$9nSyv_s>fGMFH05f(_&rgcPEyC#B=Tx7fG4+s*%2n|Zx zB|${E35vjl1|{MmF-kBkXK=1)1O`YegB#eWK;Rpjv@+yf1-{y<;9W}>jC3Ic ztQZ6BKlz_3SxeDyKKcNFH~qKBcp9lRPGAbE{eZlqaB?nqe^KBl4aNryj;oQ%u$&jD zKY*MIsjNg`Hh56-{BDB*kS?H-U<`R>nCuRN0q@c@0+6nYBOT@zGl-zz7eGngHAHV* zEBsUvFkFd70YiUpAD#vs_^jk4zULtw50guc7E`coak=N=)55Y!f?5ETEriE zrIwhUiIL4@NhBAEPkn<-{KYCj06gxjYs*SAaJ#)340QE=;B~B-@l?2YYo(CvV3`>| zJj|z_PP9K-1ORm3+}D5Z*EeglE)Jhn%x;sXEx002ovPDHLk FV1hN-JYN6+ diff --git a/ide/bugzilla/src/org/netbeans/modules/bugzilla/resources/repository.png b/ide/bugzilla/src/org/netbeans/modules/bugzilla/resources/repository.png deleted file mode 100644 index c8952d30951b6cc0312e4a8122fbfc7ff8befb78..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 597 zcmV-b0;>IqP)k zK!o7IkQ{tO2tfQw{J?}I8GEmm9@96Nu*lYJ1~li^K&QySR5dd;LnfQH%|uEgCET^ z-`P*jb7dg}q>MxXOp;2+t?BC_PQ$-36 z{`@^bWl;(Ck4~@<_<}KtbDnjqw*?Ykz$7UZHUsr|)exepL#TN18ab|3v^0D1FFc51 zigTWIthX(0K}LtjB!_y-cTZqtyo#PF$mfGhksY7G#0zWuMrSHp7Gxw6Ye7;%V{57o zFW>*70l^4xwu*zjZ3vQad@E3Abf&UxC4M85I8oibj~VY16YQ{DhbZxi6!3=~h7jH_qoy~E=?59ZdFkX6uPd;uNTn94K*MZF5%g__0>y2sab z>!Hz#f0=zP*3spI6S+j%!}R|rkw{A4u}9Q~zL8`7tbgQre3=|aqWx3ny|$2`yN1tn jI+oAwyT&oVl>h?(`+7iq^;9g(00000NkvXXu0mjfn>Yz3 diff --git a/ide/bugzilla/src/org/netbeans/modules/bugzilla/resources/unsubmitted.png b/ide/bugzilla/src/org/netbeans/modules/bugzilla/resources/unsubmitted.png deleted file mode 100644 index 48e2ee339e5ef8e5b696d486b2962a86f9a6db4b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 748 zcmVbA(YV3Jt8F7D7TLZlYC)6tt0omPKT?N<)(Ho%s(0i|1yAE1nNR9GKwVh@q0$;F>gd35c>eN#0DpniQW>b= z-NYP6c2}{r5G)}8aHL|zkxVV8_%#y+ty_S4;Kv%kane43!W}#LG96`lDTVENc(w~b zb+Ce9poGSTz3^eu2NZ3v-~mumQpCQx5M{+a021D+m4!r>Xi~8_6J49#5Mu6eMHq!i4QW?GR&H{^YS$PHo9X-V zAg?F80N52e#nOKOPoh)xy>hN#(;}aIe6yWMYlxyhg z?*`!N#p@U}4<6rxzn?4zh%Y>wjYK-C%Zf>tmXML9fX$hv&-{+9F#N3*TO|R|o?*0i z{xC3>1H`6AzP}%6i${hAVpM?e<+V_MLgVO_Rks-pFa{ttv?YKeo7H%zGdN<5K?s2{ ehVcEU0QdvP!8xFcX8CFW0000HPWg%;@R>0tlz=M`nor|M+z8|Noya{r~Z3&i~cj5&u8FdBTsb4j_QA zy5Q7O;}#}X9)?ek9x&`)HjUx+Q$_}9SxJVITc>8Cs|5%koPPiM>cs!meaZiAbw&P9 zs|^E(#j1`ljIaO*ASO(|`}PTmYcp{1iZcj_NrS~y6lB1(v=j%!k#(JIyUy)qgsBGz zAPfUOy*O2&$bH;zEL?0J9lgY+Wrrs@auI3Ww~Drhd0kG0dWBWh!K_-CY5^p&x`tl z5lj27Su;3k9mNozw2XxzuX_h0Kmf6z3u1zk3|B6&;LHjD0mMjYZUhJ*CI$)tK!5=N X1rz+?Z_i|w00000NkvXXu0mjfZEN(( diff --git a/ide/bugzilla/src/org/netbeans/modules/bugzilla/resources/warning.svg b/ide/bugzilla/src/org/netbeans/modules/bugzilla/resources/warning.svg deleted file mode 100644 index e5932382e489..000000000000 --- a/ide/bugzilla/src/org/netbeans/modules/bugzilla/resources/warning.svg +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - - - - - - - - - - - diff --git a/ide/bugzilla/src/org/netbeans/modules/bugzilla/util/BugzillaConstants.java b/ide/bugzilla/src/org/netbeans/modules/bugzilla/util/BugzillaConstants.java deleted file mode 100644 index 731db9156e24..000000000000 --- a/ide/bugzilla/src/org/netbeans/modules/bugzilla/util/BugzillaConstants.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.netbeans.modules.bugzilla.util; - -import org.eclipse.mylyn.internal.bugzilla.core.IBugzillaConstants; - -/** - * - * @author Tomas Stupka - */ -public interface BugzillaConstants { - public static final String URL_ADVANCED_BUG_LIST = IBugzillaConstants.URL_BUGLIST + "?query_format=advanced"; //NOI18N - public static final String URL_BUG_IDS = IBugzillaConstants.URL_BUGLIST + "?bug_id="; //NOI18N - public static final String URL_SHOW_BUG = IBugzillaConstants.URL_GET_SHOW_BUG; - public static final String QUERY_COLUMN_LIST = "&columnlist=bug_severity%2Cpriority%2Cbug_status%2Cresolution%2Cshort_desc%2Cchangeddate"; //NOI18N - - public static final String MY_ISSUES_PARAMETERS_FORMAT = - "&product={0}" + // NOI18N - "&bug_status=UNCONFIRMED" + // NOI18N - "&bug_status=NEW" + // NOI18N - "&bug_status=ASSIGNED" + // NOI18N - "&bug_status=REOPENED" + // NOI18N - "&emailassigned_to1=1" + // NOI18N - "&emailreporter1=1" + // NOI18N - "&emailtype1=exact" + // NOI18N - "&email1={1}"; // NOI18N - - public static final String NB_MY_ISSUES_PARAMETERS_FORMAT = - "&product={0}" + // NOI18N - "&bug_status=NEW" + // NOI18N - "&bug_status=STARTED" + // NOI18N - "&bug_status=REOPENED" + // NOI18N - "&emailassigned_to1=1" + // NOI18N - "&emailreporter1=1" + // NOI18N - "&emailtype1=exact" + // NOI18N - "&email1={1}"; // NOI18N - - public static final String ALL_ISSUES_PARAMETERS = - "&product={0}" + // NOI18N - "&bug_status=UNCONFIRMED" + // NOI18N - "&bug_status=NEW" + // NOI18N - "&bug_status=ASSIGNED" + // NOI18N - "&bug_status=REOPENED"; // NOI18N - - public static final String DEFAULT_STATUS_PARAMETERS = - "&bug_status=NEW" + // NOI18N - "&bug_status=ASSIGNED" + // NOI18N - "&bug_status=REOPENED"; // NOI18N - - public static final String DEFAULT_NB_STATUS_PARAMETERS = - "&bug_status=NEW" + // NOI18N - "&bug_status=STARTED" + // NOI18N - "&bug_status=REOPENED"; // NOI18N - -} diff --git a/ide/bugzilla/src/org/netbeans/modules/bugzilla/util/BugzillaUtil.java b/ide/bugzilla/src/org/netbeans/modules/bugzilla/util/BugzillaUtil.java deleted file mode 100644 index ffc7f9ece47e..000000000000 --- a/ide/bugzilla/src/org/netbeans/modules/bugzilla/util/BugzillaUtil.java +++ /dev/null @@ -1,196 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.netbeans.modules.bugzilla.util; - -import java.awt.Color; -import java.util.Collections; -import java.util.MissingResourceException; -import org.netbeans.modules.bugtracking.commons.ListValuePicker; -import java.util.logging.Level; -import javax.swing.JButton; -import javax.swing.JPanel; -import javax.swing.UIManager; -import org.eclipse.core.runtime.CoreException; -import org.netbeans.modules.bugtracking.api.Repository; -import org.netbeans.modules.bugtracking.api.RepositoryManager; -import org.netbeans.modules.bugtracking.spi.RepositoryProvider; -import org.netbeans.modules.bugtracking.commons.NBBugzillaUtils; -import org.netbeans.modules.bugzilla.Bugzilla; -import org.netbeans.modules.bugzilla.BugzillaConnector; -import org.netbeans.modules.bugzilla.repository.BugzillaRepository; -import org.netbeans.modules.bugzilla.issue.BugzillaIssue; -import org.netbeans.modules.bugzilla.query.BugzillaQuery; -import org.netbeans.modules.bugzilla.repository.BugzillaConfiguration; -import org.netbeans.modules.mylyn.util.commands.GetRepositoryTasksCommand; -import org.netbeans.modules.mylyn.util.MylynSupport; -import org.netbeans.modules.mylyn.util.NbTask; -import org.openide.DialogDescriptor; -import org.openide.DialogDisplayer; -import org.openide.util.HelpCtx; -import org.openide.util.NbBundle; - -/** - * - * @author Tomas Stupka, Jan Stola - */ -public class BugzillaUtil { - - private static final Color ERROR_COLOR; - static { - Color c = UIManager.getColor("nb.errorForeground"); //NOI18N - if (c == null) { - c = new Color(153, 0, 0); - } - ERROR_COLOR = c; - } - - public static boolean show(JPanel panel, String title, String okName) { - return show(panel, title, okName, new HelpCtx(panel.getClass())); - } - - public static boolean show(JPanel panel, String title, String okName, HelpCtx helpCtx) { - JButton ok = new JButton(okName); - ok.getAccessibleContext().setAccessibleDescription(ok.getText()); - JButton cancel = new JButton(NbBundle.getMessage(BugzillaUtil.class, "LBL_Cancel")); // NOI18N - cancel.getAccessibleContext().setAccessibleDescription(cancel.getText()); - DialogDescriptor descriptor = new DialogDescriptor ( - panel, - title, - true, - new Object[] {ok, cancel}, - ok, - DialogDescriptor.DEFAULT_ALIGN, - helpCtx, - null); - return DialogDisplayer.getDefault().notify(descriptor) == ok; - } - - /** - * Returns Task for the given issue id or null if an error occurred - * @param repository - * @param id - * @return - */ - public static NbTask getTask (final BugzillaRepository repository, final String id, boolean handleExceptions) { - MylynSupport supp = MylynSupport.getInstance(); - try { - GetRepositoryTasksCommand cmd = supp.getCommandFactory() - .createGetRepositoryTasksCommand(repository.getTaskRepository(), Collections.singleton(id)); - repository.getExecutor().execute(cmd, handleExceptions); - if(cmd.hasFailed() && Bugzilla.LOG.isLoggable(Level.FINE)) { - Bugzilla.LOG.log(Level.FINE, cmd.getErrorMessage()); - } - if (cmd.getTasks().isEmpty()) { - // fallback on local - NbTask task = supp.getTask(repository.getTaskRepository().getRepositoryUrl(), id); - if (cmd.hasFailed() && task != null) { - return task; - } - } else { - return cmd.getTasks().iterator().next(); - } - } catch (CoreException ex) { - Bugzilla.LOG.log(Level.INFO, null, ex); - } - return null; - } - - public static String getKeywords(String message, String keywordsString, BugzillaRepository repository) { - - try { - BugzillaConfiguration bc = repository.getConfiguration(); - if(bc == null || !bc.isValid()) { - // XXX is there something else we could do at this point? - return keywordsString; - } - return ListValuePicker.getValues( - NbBundle.getMessage(BugzillaUtil.class, "CTL_KeywordsTitle"), - NbBundle.getMessage(BugzillaUtil.class, "LBL_Keywords"), - message, - keywordsString, - bc.getKeywords()); - } catch (MissingResourceException ex) { - Bugzilla.LOG.log(Level.SEVERE, null, ex); - return keywordsString; - } - } - - public static boolean isAssertEnabled() { - boolean retval = false; - assert retval = true; - return retval; - } - - /** - * Determines wheter the given {@link RepositoryProvider} is the - * repository hosting netbeans or not - * - * @param repo - * @return true if the given repository is the netbenas bugzilla, otherwise false - */ - public static boolean isNbRepository(BugzillaRepository repo) { - return isNbRepository(repo.getUrl()); - } - - public static boolean isNbRepository(String url) { - return NBBugzillaUtils.isNbRepository(url); - } - - public static boolean showQAContact(BugzillaRepository repo) { - return true; - } - - public static boolean showStatusWhiteboard(BugzillaRepository repo) { - return true; - } - - public static boolean showIssueType(BugzillaRepository repo) { - return NBBugzillaUtils.isNbRepository(repo.getUrl()); - } - - public static Repository getRepository(BugzillaRepository bugzillaRepository) { - Repository repository = RepositoryManager.getInstance().getRepository(BugzillaConnector.ID, bugzillaRepository.getID()); - if(repository == null) { - repository = createRepository(bugzillaRepository); - } - return repository; - } - - public static Repository createRepository(BugzillaRepository bugzillaRepository) { - return Bugzilla.getInstance().getBugtrackingFactory().createRepository( - bugzillaRepository, - Bugzilla.getInstance().getStatusProvider(), - Bugzilla.getInstance().getSchedulingProvider(), - Bugzilla.getInstance().createPriorityProvider(bugzillaRepository), - Bugzilla.getInstance().getBugzillaIssueFinder()); - } - - public static void openIssue(BugzillaIssue bugzillaIssue) { - Bugzilla.getInstance().getBugtrackingFactory().openIssue(bugzillaIssue.getRepository(), bugzillaIssue); - } - - public static void openQuery(BugzillaQuery bugzillaQuery) { - Bugzilla.getInstance().getBugtrackingFactory().editQuery(bugzillaQuery.getRepository(), bugzillaQuery); - } - - public static Color getErrorForegroundColor () { - return ERROR_COLOR; - } -} diff --git a/ide/bugzilla/src/org/netbeans/modules/bugzilla/util/Bundle.properties b/ide/bugzilla/src/org/netbeans/modules/bugzilla/util/Bundle.properties deleted file mode 100644 index d00cf8911249..000000000000 --- a/ide/bugzilla/src/org/netbeans/modules/bugzilla/util/Bundle.properties +++ /dev/null @@ -1,20 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - -LBL_Cancel=Cancel -CTL_KeywordsTitle=Select Keywords -LBL_Keywords=&Keywords: diff --git a/ide/bugzilla/src/org/netbeans/modules/bugzilla/util/FileUtils.java b/ide/bugzilla/src/org/netbeans/modules/bugzilla/util/FileUtils.java deleted file mode 100644 index 901c3e0d2f80..000000000000 --- a/ide/bugzilla/src/org/netbeans/modules/bugzilla/util/FileUtils.java +++ /dev/null @@ -1,308 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.netbeans.modules.bugzilla.util; - -import java.io.*; -import java.util.logging.Level; -import org.netbeans.modules.bugzilla.Bugzilla; -import org.openide.filesystems.FileUtil; - -/** - * Copy 'n paste from jira - * XXX move to bugtracking.util? - * @author Ondra Vrabec - */ -public class FileUtils { - - /** - * Copies the specified sourceFile to the specified targetFile. - */ - public static void copyFile(File sourceFile, File targetFile) throws IOException { - if (sourceFile == null || targetFile == null) { - throw new NullPointerException("sourceFile and targetFile must not be null"); // NOI18N - } - - InputStream inputStream = null; - try { - inputStream = createInputStream(sourceFile); - copyStreamToFile(inputStream, targetFile); - } finally { - if (inputStream != null) { - try { - inputStream.close(); - } - catch (IOException ex) { - // ignore - } - } - } - } - - public static void copyDirFiles(File sourceDir, File targetDir) { - copyDirFiles(sourceDir, targetDir, false); - } - - public static void copyDirFiles(File sourceDir, File targetDir, boolean preserveTimestamp) { - File[] files = sourceDir.listFiles(); - - if(files==null || files.length == 0) { - targetDir.mkdirs(); - if(preserveTimestamp) targetDir.setLastModified(sourceDir.lastModified()); - return; - } - if(preserveTimestamp) targetDir.setLastModified(sourceDir.lastModified()); - for (int i = 0; i < files.length; i++) { - try { - File target = FileUtil.normalizeFile(new File(targetDir.getAbsolutePath() + "/" + files[i].getName())); // NOI18N - if(files[i].isDirectory()) { - copyDirFiles(files[i], target, preserveTimestamp); - } else { - FileUtils.copyFile (files[i], target); - if(preserveTimestamp) target.setLastModified(files[i].lastModified()); - } - } catch (IOException ex) { - Bugzilla.LOG.log(Level.INFO, null, ex); // should not happen - } - } - } - - /** - * Copies the specified sourceFile to the specified targetFile. - * It closes the input stream. - */ - public static void copyStreamToFile(InputStream inputStream, File targetFile) throws IOException { - if (inputStream == null || targetFile == null) { - throw new NullPointerException("sourcStream and targetFile must not be null"); // NOI18N - } - - // ensure existing parent directories - File directory = targetFile.getParentFile(); - if (!directory.exists() && !directory.mkdirs()) { - throw new IOException("Could not create directory '" + directory + "'"); // NOI18N - } - copyStream(inputStream, createOutputStream(targetFile)); - } - - public static void copyStream(InputStream inputStream, OutputStream outputStream) throws IOException { - if (inputStream == null || outputStream == null) { - throw new NullPointerException("sourcStream and targetFile must not be null"); // NOI18N - } - try { - try { - byte[] buffer = new byte[32768]; - for (int readBytes = inputStream.read(buffer); readBytes > 0; readBytes = inputStream.read(buffer)) { - outputStream.write(buffer, 0, readBytes); - } - } - catch (IOException ex) { - outputStream.close(); - throw ex; - } - } - finally { - try { - inputStream.close(); - } - catch (IOException ex) { - // ignore - } - try { - outputStream.close(); - } - catch (IOException ex) { - // ignore - } - } - } - - /** - * Reads the data from the file and returns it as an array of bytes. - * @param file file to be read - * @return file contents as a byte array - * @throws java.io.IOException - */ - public static byte[] getFileContentsAsByteArray (File file) throws IOException { - ByteArrayOutputStream baos = new ByteArrayOutputStream(1024 * 5); - BufferedInputStream bis = null; - try { - bis = createInputStream(file); - byte[] buffer = new byte[1024]; - for (int byteRead = bis.read(buffer); byteRead > 0; byteRead = bis.read(buffer)) { - baos.write(buffer, 0, byteRead); - } - } finally { - if (bis != null) { - bis.close(); - } - } - return baos.toByteArray(); - } - - /** - * Recursively deletes all files and directories under a given file/directory. - * - * @param file file/directory to delete - */ - public static void deleteRecursively(File file) { - if (file.isDirectory()) { - File [] files = file.listFiles(); - for (int i = 0; i < files.length; i++) { - deleteRecursively(files[i]); - } - } - file.delete(); - } - - /** - * Do the best to rename the file. - * @param orig regular file - * @param dest regular file (if exists it's rewritten) - */ - public static void renameFile(File orig, File dest) throws IOException { - boolean destExists = dest.exists(); - if (destExists) { - for (int i = 0; i<3; i++) { - if (dest.delete()) { - destExists = false; - break; - } - try { - Thread.sleep(71); - } catch (InterruptedException e) { - } - } - } - - if (destExists == false) { - for (int i = 0; i<3; i++) { - if (orig.renameTo(dest)) { - return; - } - try { - Thread.sleep(71); - } catch (InterruptedException e) { - } - } - } - - // requires less permisions than renameTo - FileUtils.copyFile(orig, dest); - - for (int i = 0; i<3; i++) { - if (orig.delete()) { - return; - } - try { - Thread.sleep(71); - } catch (InterruptedException e) { - } - } - throw new IOException("Can not delete: " + orig.getAbsolutePath()); // NOI18N - } - - /** - * This utility class needs not to be instantiated anywhere. - */ - private FileUtils() { - } - - public static BufferedInputStream createInputStream(File file) throws IOException { - int retry = 0; - while (true) { - try { - return new BufferedInputStream(new FileInputStream(file)); - } catch (IOException ex) { - retry++; - if (retry > 7) { - throw ex; - } - try { - Thread.sleep(retry * 34); - } catch (InterruptedException iex) { - throw ex; - } - } - } - } - - public static BufferedOutputStream createOutputStream(File file) throws IOException { - int retry = 0; - while (true) { - try { - return new BufferedOutputStream(new FileOutputStream(file)); - } catch (IOException ex) { - retry++; - if (retry > 7) { - throw ex; - } - try { - Thread.sleep(retry * 34); - } catch (InterruptedException iex) { - throw ex; - } - } - } - } - - /** Creates new tmp dir in java.io.tmpdir */ - public static File createTmpFolder(String prefix) { - String tmpDir = System.getProperty("java.io.tmpdir"); // NOI18N - File tmpFolder = new File(tmpDir); - File checkoutFolder = null; - try { - // generate unique name for tmp folder - File tmp = File.createTempFile(prefix, "", tmpFolder); // NOI18N - if (tmp.delete() == false) { - return checkoutFolder; - } - if (tmp.mkdirs() == false) { - return checkoutFolder; - } - checkoutFolder = FileUtil.normalizeFile(tmp); - } catch (IOException e) { - Bugzilla.LOG.log(Level.SEVERE, null, e); - } - return checkoutFolder; - } - - /** - * Returns the first found file whose filename is the same (in a case insensitive way) as given file's. - * @param file - * @return the first found file with the same name, but ignoring case, or null if no such file is found. - */ - public static String getExistingFilenameInParent(File file) { - String filename = null; - if (file == null) { - return filename; - } - File parent = file.getParentFile(); - if (parent == null) { - return filename; - } - File[] children = parent.listFiles(); - for (File child : children) { - if (file.getName().equalsIgnoreCase(child.getName())) { - filename = child.getName(); - break; - } - } - return filename; - } -} diff --git a/ide/bugzilla/src/org/netbeans/modules/bugzilla/util/NbBugzillaConstants.java b/ide/bugzilla/src/org/netbeans/modules/bugzilla/util/NbBugzillaConstants.java deleted file mode 100644 index 050181c2e6a8..000000000000 --- a/ide/bugzilla/src/org/netbeans/modules/bugzilla/util/NbBugzillaConstants.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.netbeans.modules.bugzilla.util; - -/** - * - * @author Tomas Stupka - */ -public interface NbBugzillaConstants { - public static final String NB_LOG_FILE_PATH = "var/log/messages.log"; // NOI18N - public static final String NB_LOG_FILE_ATT_CONT_TYPE = "text/plain"; // NOI18N -} diff --git a/ide/bugzilla/test/unit/src/org/netbeans/modules/bugzilla/BugzillaTest.java b/ide/bugzilla/test/unit/src/org/netbeans/modules/bugzilla/BugzillaTest.java deleted file mode 100644 index c20a4e085bcf..000000000000 --- a/ide/bugzilla/test/unit/src/org/netbeans/modules/bugzilla/BugzillaTest.java +++ /dev/null @@ -1,483 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.netbeans.modules.bugzilla; - -import java.io.ByteArrayOutputStream; -import java.io.File; -import java.io.FileWriter; -import java.io.IOException; -import java.io.InputStream; -import java.io.UnsupportedEncodingException; -import java.net.MalformedURLException; -import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.Date; -import java.util.HashSet; -import java.util.List; -import java.util.Set; -import java.util.logging.Level; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.NullProgressMonitor; -import org.eclipse.mylyn.commons.net.AuthenticationCredentials; -import org.eclipse.mylyn.commons.net.AuthenticationType; -import org.eclipse.mylyn.commons.net.WebUtil; -import org.eclipse.mylyn.internal.bugzilla.core.BugzillaAttribute; -import org.eclipse.mylyn.internal.bugzilla.core.BugzillaClient; -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.tasks.core.AbstractTask; -import org.eclipse.mylyn.internal.tasks.core.RepositoryQuery; -import org.eclipse.mylyn.internal.tasks.core.TaskRepositoryManager; -import org.eclipse.mylyn.internal.tasks.core.data.FileTaskAttachmentSource; -import org.eclipse.mylyn.internal.tasks.core.data.TaskDataStore; -import org.eclipse.mylyn.tasks.core.IRepositoryQuery; -import org.eclipse.mylyn.tasks.core.RepositoryResponse; -import org.eclipse.mylyn.tasks.core.TaskRepository; -import org.eclipse.mylyn.tasks.core.data.TaskAttachmentMapper; -import org.eclipse.mylyn.tasks.core.data.TaskAttribute; -import org.eclipse.mylyn.tasks.core.data.TaskData; -import org.eclipse.mylyn.tasks.core.data.TaskDataCollector; -import org.netbeans.junit.NbTestCase; -import org.netbeans.modules.bugzilla.util.FileUtils; - -/** - * - * @author tomas - */ -public class BugzillaTest extends NbTestCase implements TestConstants { - - static NullProgressMonitor nullProgressMonitor = new NullProgressMonitor(); - private TaskRepository repository; - private BugzillaRepositoryConnector brc; - private TaskRepositoryManager trm; - - public BugzillaTest(String arg0) { - super(arg0); - } - - @Override - protected Level logLevel() { - return Level.ALL; - } - - @Override - protected void setUp() throws Exception { - super.setUp(); - System.setProperty("netbeans.user", getWorkDir().getAbsolutePath()); - repository = new TaskRepository("bugzilla", REPO_URL); - AuthenticationCredentials authenticationCredentials = new AuthenticationCredentials(REPO_USER, REPO_PASSWD); - repository.setCredentials(AuthenticationType.REPOSITORY, authenticationCredentials, false); - repository.setCredentials(AuthenticationType.HTTP, authenticationCredentials, false); - - trm = new TaskRepositoryManager(); - brc = new BugzillaRepositoryConnector(new File(getWorkDir().getAbsolutePath(), "bugzillaconfiguration")); - - trm.addRepository(repository); - trm.addRepositoryConnector(brc); - - WebUtil.init(); - } - - public void testBugzilla() throws Throwable { -// TaskDataState state; -// TaskData d; - try { - - // create issue - TaskData data = createIssue(brc, repository, "bug pruser", "pruser", "bug"); - - TaskDataStore tds = new TaskDataStore(trm); - - // update issue - updateTaskData(data, brc, repository); - - // hours worked - timeTracking(data, brc, repository); - - // add atachment - data = addAttachement(data, brc, repository, "Adding attachement", "some file", "crap"); - - // read attachment - readAttachement(data, brc, repository, "crap"); - - // add comment - String comment = "this is not a comment " + System.currentTimeMillis(); - RepositoryResponse rr = TestUtil.addComment(repository, data, comment); - assertEquals(RepositoryResponse.ResponseKind.TASK_UPDATED, rr.getReposonseKind()); - - // read comments - readComment(data, brc, repository, comment); - - changeProduct(data, brc, repository); - - // resolve - closeIssue(data, brc, repository); - - - } catch (Exception e) { - TestUtil.handleException(e); - } - } - - public static TaskData createIssue(BugzillaRepositoryConnector brc, TaskRepository repository, String summary, String desc, String typeName) throws CoreException, MalformedURLException { - TaskData data = TestUtil.createTaskData(brc, repository, summary, desc, typeName); - RepositoryResponse rr = TestUtil.postTaskData(brc, repository, data); - String taskId = rr.getTaskId(); - data = brc.getTaskData(repository, taskId, nullProgressMonitor); - assertEquals(rr.getReposonseKind(), RepositoryResponse.ResponseKind.TASK_CREATED); - assertNotNull(data); - - return data; - } - - private void assertChanged(Task task, TaskData data, boolean changed) { - boolean hasChanged = brc.hasTaskChanged(repository, task, data); - assertEquals(changed, hasChanged); - } - - - private void listIssues(BugzillaRepositoryConnector brc, TaskRepository repository, TaskData data) throws UnsupportedEncodingException { - String dateString = repository.getSynchronizationTimeStamp(); - if (dateString == null) { - dateString = ""; - } -// -// IRepositoryQuery query = new RepositoryQuery(repository.getConnectorKind(), ""); -// String urlQueryBase = repository.getRepositoryUrl() + CHANGED_BUGS_CGI_QUERY -// + URLEncoder.encode(dateString, repository.getCharacterEncoding()) + CHANGED_BUGS_CGI_ENDDATE; - - String url = "/buglist.cgi?query_format=advanced&short_desc_type=allwordssubstr"; - IRepositoryQuery query = new RepositoryQuery(repository.getConnectorKind(), ""); - query.setUrl(url); - final List collectedData = new ArrayList(); - TaskDataCollector collector = new TaskDataCollector() { - public void accept(TaskData taskData) { - collectedData.add(taskData); - } - }; - brc.performQuery(repository, query, collector, null, nullProgressMonitor); - assertTrue(collectedData.size() > 0); - String taskId = data.getTaskId(); - data = null; - for (TaskData taskData : collectedData) { - if(taskData.getTaskId().equals(taskId)) { - data = taskData; - break; - } - } - assertNotNull(data); - } - - private void readComment(TaskData data, BugzillaRepositoryConnector brc, TaskRepository repository, String comment) throws CoreException { - // refresh - data = brc.getTaskData(repository, data.getTaskId(), nullProgressMonitor); - - List attributes = data.getAttributeMapper().getAttributesByType(data, TaskAttribute.TYPE_COMMENT); - assertNotNull(attributes); - - boolean fail = true; - for (TaskAttribute ta : attributes) { - if(ta.getMappedAttribute(TaskAttribute.COMMENT_TEXT).getValue().equals(comment)) { - fail = false; - break; - } - } - if(fail) { - fail("Couldn't find comment text [" + comment + "] for taskdata [" + data.getTaskId() + "]"); - } - } - - private void updateTaskData(TaskData data, BugzillaRepositoryConnector brc, TaskRepository repository) throws CoreException { - data = brc.getTaskData(repository, data.getTaskId(), nullProgressMonitor); - TaskAttribute attrModification1 = data.getRoot().getMappedAttribute(TaskAttribute.DATE_MODIFICATION); - - TaskAttribute rta = data.getRoot(); - TaskAttribute ta = rta.getMappedAttribute(TaskAttribute.USER_ASSIGNED); - ta = rta.getMappedAttribute(TaskAttribute.SUMMARY); - String val = ta.getValue(); - ta.setValue(val + " updated"); - Set attrs = new HashSet(); - attrs.add(ta); - RepositoryResponse rr = brc.getTaskDataHandler().postTaskData(repository, data, attrs, new NullProgressMonitor()); - assertEquals(rr.getReposonseKind(), RepositoryResponse.ResponseKind.TASK_UPDATED); - - data = brc.getTaskData(repository, data.getTaskId(), nullProgressMonitor); - rta = data.getRoot(); - ta = rta.getMappedAttribute(TaskAttribute.SUMMARY); - assertEquals(val + " updated", ta.getValue()); - - TaskAttribute attrModification2 = data.getRoot().getMappedAttribute(TaskAttribute.DATE_MODIFICATION); - assertNotSame(attrModification1, attrModification2); - - } - - private void timeTracking(TaskData data, BugzillaRepositoryConnector brc, TaskRepository repository) throws CoreException { - data = brc.getTaskData(repository, data.getTaskId(), nullProgressMonitor); - TaskAttribute attrModification1 = data.getRoot().getMappedAttribute(TaskAttribute.DATE_MODIFICATION); - - // Orig. Est. - TaskAttribute taEstimatedTime = data.getRoot().getMappedAttribute(BugzillaAttribute.ESTIMATED_TIME.getKey()); - - // Hours left - TaskAttribute taRemainingTime = data.getRoot().getMappedAttribute(BugzillaAttribute.REMAINING_TIME.getKey()); - - // Current Est. - TaskAttribute taActualTime = data.getRoot().getMappedAttribute(BugzillaAttribute.ACTUAL_TIME.getKey()); - - // Deadline - TaskAttribute taDeadline = data.getRoot().getMappedAttribute(BugzillaAttribute.DEADLINE.getKey()); - - // need a comment when changing Hours Worked - TaskAttribute taComment = data.getRoot().createMappedAttribute(TaskAttribute.COMMENT_NEW); - - // Hours Worked - TaskAttribute taWorkTime = data.getRoot().getMappedAttribute(BugzillaAttribute.WORK_TIME.getKey()); - assertNull(taWorkTime); - taWorkTime = data.getRoot().createMappedAttribute(BugzillaAttribute.WORK_TIME.getKey()); - assertNotNull(taWorkTime); - - // estimate 10, work 3 => actuall == 3, - taEstimatedTime.setValue("10"); - taWorkTime.setValue("3"); - taRemainingTime.setValue("3"); - taActualTime.setValue("7"); // will have no effect on the returned value - taComment.setValue("worked 3"); - taDeadline.setValue(new SimpleDateFormat("yyyy-MM-dd").format(new Date(System.currentTimeMillis() + (24*60*60*1000)))); - - Set attrs = new HashSet(); - attrs.add(taEstimatedTime); - attrs.add(taWorkTime); - attrs.add(taComment); - attrs.add(taActualTime); - attrs.add(taRemainingTime); - RepositoryResponse rr = brc.getTaskDataHandler().postTaskData(repository, data, attrs, new NullProgressMonitor()); - assertEquals(rr.getReposonseKind(), RepositoryResponse.ResponseKind.TASK_UPDATED); - - data = brc.getTaskData(repository, data.getTaskId(), nullProgressMonitor); - - List attributes = data.getAttributeMapper().getAttributesByType(data, TaskAttribute.TYPE_COMMENT); - assertNotNull(attributes); - assertEquals(1, attributes.size()); - taComment = attributes.get(0); - TaskAttribute ta = taComment.getMappedAttribute(BugzillaAttribute.WORK_TIME.getKey()); - assertEquals("3.0", ta.getValue()); - - ta = data.getRoot().getMappedAttribute(BugzillaAttribute.ESTIMATED_TIME.getKey()); - assertEquals("10.00", ta.getValue()); - ta = data.getRoot().getMappedAttribute(BugzillaAttribute.REMAINING_TIME.getKey()); - assertEquals("3.00", ta.getValue()); - ta = data.getRoot().getMappedAttribute(BugzillaAttribute.ACTUAL_TIME.getKey()); - assertEquals("3.00", ta.getValue()); - ta = data.getRoot().getMappedAttribute(BugzillaAttribute.DEADLINE.getKey()); - assertEquals(new SimpleDateFormat("yyyy-MM-dd").format(new Date(System.currentTimeMillis() + (24*60*60*1000))), ta.getValue()); - - - // orig est == Hours left + Hours worked - // Hours left 2 => actuall == 2 + 3; - - // Hours left - taRemainingTime = data.getRoot().getMappedAttribute(BugzillaAttribute.REMAINING_TIME.getKey()); - taWorkTime = data.getRoot().createMappedAttribute(BugzillaAttribute.WORK_TIME.getKey()); - taComment = data.getRoot().createMappedAttribute(TaskAttribute.COMMENT_NEW); - - taRemainingTime.setValue("2"); - taWorkTime.setValue("2"); - taComment.setValue("worked 2"); - attrs = new HashSet(); - attrs.add(taRemainingTime); - attrs.add(taWorkTime); - attrs.add(taComment); - rr = brc.getTaskDataHandler().postTaskData(repository, data, attrs, new NullProgressMonitor()); - assertEquals(rr.getReposonseKind(), RepositoryResponse.ResponseKind.TASK_UPDATED); - - data = brc.getTaskData(repository, data.getTaskId(), nullProgressMonitor); - ta = data.getRoot().getMappedAttribute(BugzillaAttribute.REMAINING_TIME.getKey()); - assertEquals("2.00", ta.getValue()); - ta = data.getRoot().getMappedAttribute(BugzillaAttribute.ACTUAL_TIME.getKey()); - assertEquals("5.00", ta.getValue()); - ta = data.getRoot().getMappedAttribute(BugzillaAttribute.ESTIMATED_TIME.getKey()); - assertEquals("10.00", ta.getValue()); - - TaskAttribute attrModification2 = data.getRoot().getMappedAttribute(TaskAttribute.DATE_MODIFICATION); - assertNotSame(attrModification1, attrModification2); - - } - - private void changeProduct(TaskData data, BugzillaRepositoryConnector brc, TaskRepository repository) throws CoreException, IOException { - data = brc.getTaskData(repository, data.getTaskId(), nullProgressMonitor); - - TaskAttribute rta = data.getRoot(); - TaskAttribute ta = rta.getMappedAttribute(TaskAttribute.PRODUCT); - - BugzillaClient client = brc.getClientManager().getClient(repository, NULL_PROGRESS_MONITOR); - - List products = client.getRepositoryConfiguration().getProducts(); - String newProject = TEST_PROJECT2; - assertNotNull(newProject); - ta.setValue(newProject); - - String version = client.getRepositoryConfiguration(NULL_PROGRESS_MONITOR).getVersions(newProject).get(0); - ta = rta.getMappedAttribute(BugzillaAttribute.VERSION.getKey()); - ta.setValue(version); - - String component = client.getRepositoryConfiguration(NULL_PROGRESS_MONITOR).getComponents(newProject).get(0); - ta = rta.getMappedAttribute(BugzillaAttribute.COMPONENT.getKey()); - ta.setValue(component); - - String milestone = client.getRepositoryConfiguration(NULL_PROGRESS_MONITOR).getTargetMilestones(newProject).get(0); - ta = rta.getMappedAttribute(BugzillaAttribute.TARGET_MILESTONE.getKey()); - ta.setValue(milestone); - - ta = rta.getMappedAttribute(BugzillaAttribute.SET_DEFAULT_ASSIGNEE.getKey()); - if (ta != null) { - ta.setValue("1"); - } - - ta = rta.getMappedAttribute(BugzillaAttribute.CONFIRM_PRODUCT_CHANGE.getKey()); - if (ta == null) { - ta = BugzillaTaskDataHandler.createAttribute(rta, BugzillaAttribute.CONFIRM_PRODUCT_CHANGE); - } - - if (ta != null) { - ta.setValue("1"); - } - - RepositoryResponse rr = brc.getTaskDataHandler().postTaskData(repository, data, null, new NullProgressMonitor()); - assertEquals(rr.getReposonseKind(), RepositoryResponse.ResponseKind.TASK_UPDATED); - - - } - - private TaskData addAttachement(TaskData data, BugzillaRepositoryConnector brc, TaskRepository repository, String comment, String desc, String content) throws Exception { -// Task task = new Task(getRepository().getRepositoryUrl(), getRepository().getConnectorKind(), key, taskId, ""); - File f = getAttachmentFile(content); - - FileTaskAttachmentSource attachmentSource = new FileTaskAttachmentSource(f); - attachmentSource.setContentType("text/plain"); - -// List attributes = data.getAttributeMapper().getAttributesByType(data, TaskAttribute.TYPE_ATTACHMENT); - TaskAttribute attAttribute = new TaskAttribute(data.getRoot(), TaskAttribute.TYPE_ATTACHMENT); - TaskAttribute a = attAttribute.createMappedAttribute(TaskAttribute.ATTACHMENT_DESCRIPTION); - a.setValue(desc); - String bugId = data.getTaskId(); - brc.getClientManager().getClient(repository, nullProgressMonitor) - .postAttachment(bugId, comment, attachmentSource, attAttribute, nullProgressMonitor); - - data = brc.getTaskData(repository, data.getTaskId(), nullProgressMonitor); - List attributes = data.getAttributeMapper().getAttributesByType(data, TaskAttribute.TYPE_ATTACHMENT); - assertTrue(attributes.size() > 0); - return data; - } - - private void readAttachement(TaskData data, BugzillaRepositoryConnector brc, TaskRepository repository, String content) throws Exception { - // refresh - data = brc.getTaskData(repository, data.getTaskId(), nullProgressMonitor); - - List attributes = data.getAttributeMapper().getAttributesByType(data, TaskAttribute.TYPE_ATTACHMENT); - TaskAttribute attribute = attributes.get(0); - TaskAttachmentMapper attachment = TaskAttachmentMapper.createFrom(attribute); - ByteArrayOutputStream os = new ByteArrayOutputStream(); - InputStream is = brc.getClientManager().getClient(repository, nullProgressMonitor).getAttachmentData(attachment.getAttachmentId(), nullProgressMonitor); - FileUtils.copyStream(is, os); - - try { -// byte[] d = new byte[4]; -// os.read(d); - assertEquals(content, os.toString()); - } finally { - if(os != null) os.close(); - } - } - - private File getAttachmentFile(String content) throws Exception { - FileWriter fw = null; - File f = null; - try { - f = File.createTempFile("bugzillatest", null); - f.deleteOnExit(); - try { - f.createNewFile(); - } catch (IOException ex) { - ex.printStackTrace(); - // ignore - } - fw = new FileWriter(f); - fw.write(content); - fw.flush(); - return f; - } finally { - try { if (fw != null) fw.close(); } catch (IOException iOException) { } - } - } - - private void closeIssue(TaskData data, BugzillaRepositoryConnector brc, TaskRepository repository) throws Exception { - //RepositoryConfiguration rc = brc.getClientManager().getClient(repository, nullProgressMonitor).getRepositoryConfiguration(); - - // refresh - data = brc.getTaskData(repository, data.getTaskId(), nullProgressMonitor); - - Set attrs = new HashSet(); - TaskAttribute rta = data.getRoot(); - - TaskAttribute ta = rta.getMappedAttribute(TaskAttribute.OPERATION); - ta.setValue("resolve"); - attrs.add(ta); - - ta = rta.getMappedAttribute(TaskAttribute.STATUS); - ta.setValue("FIXED"); - attrs.add(ta); - - RepositoryResponse rr = brc.getTaskDataHandler().postTaskData(repository, data, attrs, nullProgressMonitor); - assertEquals(rr.getReposonseKind(), RepositoryResponse.ResponseKind.TASK_UPDATED); - - data = brc.getTaskData(repository, rr.getTaskId(), nullProgressMonitor); - rta = data.getRoot(); - ta = rta.getMappedAttribute(TaskAttribute.STATUS); - assertEquals("RESOLVED", ta.getValue()); - } - - - // XXX how to get task!!! - // XXX TaskTask isn't working - returns taskId instead of taskKey - private class Task extends AbstractTask { - private String key; - - public Task(String repositoryUrl, String key, String taskId, String summary) { - super(repositoryUrl, taskId, summary); - this.key = key; - } - - @Override - public boolean isLocal() { - return true; - } - - @Override - public String getConnectorKind() { - return repository.getConnectorKind(); - } - - @Override - public String getTaskKey() { - return key; - } - } -} diff --git a/ide/bugzilla/test/unit/src/org/netbeans/modules/bugzilla/HtmlPanel.form b/ide/bugzilla/test/unit/src/org/netbeans/modules/bugzilla/HtmlPanel.form deleted file mode 100644 index 794796a27f94..000000000000 --- a/ide/bugzilla/test/unit/src/org/netbeans/modules/bugzilla/HtmlPanel.form +++ /dev/null @@ -1,67 +0,0 @@ - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
diff --git a/ide/bugzilla/test/unit/src/org/netbeans/modules/bugzilla/HtmlPanel.java b/ide/bugzilla/test/unit/src/org/netbeans/modules/bugzilla/HtmlPanel.java deleted file mode 100644 index 3c48b18a024e..000000000000 --- a/ide/bugzilla/test/unit/src/org/netbeans/modules/bugzilla/HtmlPanel.java +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -/* - * HtmlPanel.java - * - * Created on Oct 27, 2008, 11:48:29 AM - */ - -package org.netbeans.modules.bugzilla; - -/** - * - * @author tomas - */ -public class HtmlPanel extends javax.swing.JPanel { - - /** Creates new form HtmlPanel */ - public HtmlPanel() { - initComponents(); - } - - void setHtml(String html) { - pane.setText(html); - } - - /** This method is called from within the constructor to - * initialize the form. - * WARNING: Do NOT modify this code. The content of this method is - * always regenerated by the Form Editor. - */ - @SuppressWarnings("unchecked") - // //GEN-BEGIN:initComponents - private void initComponents() { - - jScrollPane1 = new javax.swing.JScrollPane(); - pane = new javax.swing.JTextPane(); - - pane.setContentType(org.openide.util.NbBundle.getMessage(HtmlPanel.class, "HtmlPanel.pane.contentType")); // NOI18N - jScrollPane1.setViewportView(pane); - - javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); - this.setLayout(layout); - layout.setHorizontalGroup( - layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 544, Short.MAX_VALUE) - ); - layout.setVerticalGroup( - layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 425, Short.MAX_VALUE) - ); - }// //GEN-END:initComponents - - - // Variables declaration - do not modify//GEN-BEGIN:variables - private javax.swing.JScrollPane jScrollPane1; - private javax.swing.JTextPane pane; - // End of variables declaration//GEN-END:variables - -} diff --git a/ide/bugzilla/test/unit/src/org/netbeans/modules/bugzilla/LogHandler.java b/ide/bugzilla/test/unit/src/org/netbeans/modules/bugzilla/LogHandler.java deleted file mode 100644 index 1c98ffc8f409..000000000000 --- a/ide/bugzilla/test/unit/src/org/netbeans/modules/bugzilla/LogHandler.java +++ /dev/null @@ -1,121 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.netbeans.modules.bugzilla; - -import java.text.MessageFormat; -import java.util.logging.Handler; -import java.util.logging.LogRecord; - -/** - * - * @author tomas - */ -public class LogHandler extends Handler { - public static long DEFAULT_TIMEOUT = 30 * 1000; - private long TIMEOUT = DEFAULT_TIMEOUT; - private final String messageToWaitFor; - private String interceptedMessage; - private boolean done = false; - private final Compare compare; - private final int expectedCount; - private int interceptedCount = 0; - private boolean reset = false; - public enum Compare { - STARTS_WITH, - ENDS_WITH - } - - public LogHandler(String msg, Compare compare) { - this(msg, compare, DEFAULT_TIMEOUT); - } - - public LogHandler(String msg, Compare compare, long timeout) { - this(msg, compare, timeout, 1); - } - - public LogHandler(String msg, Compare compare, long timeout, int count) { - this.expectedCount = count; - this.messageToWaitFor = msg; - this.compare = compare; - Bugzilla.LOG.addHandler(this); - if(timeout > -1) { - TIMEOUT = timeout * 1000; - } - } - - @Override - public void publish(LogRecord record) { - if(!done) { - String message = record.getMessage(); - if(message == null) { - return; - } - message = MessageFormat.format(message, record.getParameters()); - boolean intercepted = false; - switch (compare) { - case STARTS_WITH : - intercepted = message.startsWith(messageToWaitFor); - break; - case ENDS_WITH : - intercepted = message.endsWith(messageToWaitFor); - break; - default: - throw new IllegalStateException("wrong value " + compare); - } - if(intercepted) { - interceptedCount++; - interceptedMessage = message; - } - done = intercepted && interceptedCount >= expectedCount; - } - } - - public int getInterceptedCount() { - return interceptedCount; - } - - public boolean isDone() { - return done; - } - - public void reset() { - reset = true; - } - - public String getInterceptedMessage() { - return interceptedMessage; - } - - @Override - public void flush() { } - @Override - public void close() throws SecurityException { } - - public void waitUntilDone() throws InterruptedException { - reset = false; - long t = System.currentTimeMillis(); - while(!done && !reset && interceptedCount < expectedCount) { - Thread.sleep(200); - if(System.currentTimeMillis() - t > TIMEOUT) { - throw new IllegalStateException("Timeout > " + TIMEOUT + " for " + messageToWaitFor); - } - } - } -} diff --git a/ide/bugzilla/test/unit/src/org/netbeans/modules/bugzilla/MylynStorageTest.java b/ide/bugzilla/test/unit/src/org/netbeans/modules/bugzilla/MylynStorageTest.java deleted file mode 100644 index 5514f044a95f..000000000000 --- a/ide/bugzilla/test/unit/src/org/netbeans/modules/bugzilla/MylynStorageTest.java +++ /dev/null @@ -1,1220 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.netbeans.modules.bugzilla; - -import java.beans.PropertyChangeEvent; -import java.beans.PropertyChangeListener; -import java.io.File; -import java.lang.reflect.Field; -import java.lang.reflect.Method; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.concurrent.CountDownLatch; -import java.util.concurrent.TimeUnit; -import java.util.logging.Level; -import junit.framework.Test; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.NullProgressMonitor; -import org.eclipse.mylyn.internal.bugzilla.core.BugzillaOperation; -import org.eclipse.mylyn.internal.bugzilla.core.BugzillaRepositoryConnector; -import org.eclipse.mylyn.internal.tasks.core.data.TaskDataManager; -import org.eclipse.mylyn.tasks.core.IRepositoryQuery; -import org.eclipse.mylyn.tasks.core.ITask; -import org.eclipse.mylyn.tasks.core.ITaskMapping; -import org.eclipse.mylyn.tasks.core.TaskMapping; -import org.eclipse.mylyn.tasks.core.TaskRepository; -import org.eclipse.mylyn.tasks.core.data.TaskAttribute; -import org.eclipse.mylyn.tasks.core.data.TaskData; -import org.eclipse.mylyn.tasks.core.data.TaskOperation; -import org.netbeans.junit.NbModuleSuite; -import org.netbeans.junit.NbTestCase; -import org.netbeans.modules.bugtracking.util.BugtrackingUtil; -import static org.netbeans.modules.bugzilla.TestConstants.REPO_PASSWD; -import static org.netbeans.modules.bugzilla.TestConstants.REPO_URL; -import static org.netbeans.modules.bugzilla.TestConstants.REPO_USER; -import org.netbeans.modules.bugzilla.repository.BugzillaRepository; -import org.netbeans.modules.mylyn.util.commands.GetRepositoryTasksCommand; -import org.netbeans.modules.mylyn.util.MylynSupport; -import org.netbeans.modules.mylyn.util.NbTask; -import org.netbeans.modules.mylyn.util.NbTask.SynchronizationState; -import org.netbeans.modules.mylyn.util.NbTaskDataModel; -import org.netbeans.modules.mylyn.util.NbTaskDataState; -import org.netbeans.modules.mylyn.util.commands.SimpleQueryCommand; -import org.netbeans.modules.mylyn.util.SubmitCommand; -import org.netbeans.modules.mylyn.util.commands.SubmitTaskCommand; -import org.netbeans.modules.mylyn.util.commands.SynchronizeQueryCommand; -import org.netbeans.modules.mylyn.util.commands.SynchronizeTasksCommand; -import org.netbeans.modules.mylyn.util.TaskDataListener; -import org.netbeans.modules.mylyn.util.NbTaskListener; -import org.openide.util.RequestProcessor; -import org.openide.util.test.MockLookup; - -/** - * - * @author Ondrej Vrabec - */ -public class MylynStorageTest extends NbTestCase { - - private static final String QUERY_NAME = "My new query"; - private BugzillaRepository br; - private TaskRepository btr; - - private static final String PRODUCT = "mylyn"; //NOI18N - private static final String COMPONENT = "default"; //NOI18N - - public MylynStorageTest (String arg0) { - super(arg0); - } - - @Override - protected Level logLevel() { - return Level.ALL; - } - - @Override - protected void setUp() throws Exception { - super.setUp(); - System.setProperty("netbeans.user", new File(getDataDir(), "userdir").getAbsolutePath()); - MockLookup.setLayersAndInstances(); - BugtrackingUtil.getBugtrackingConnectors(); // ensure conector - - // reset - Method m = MylynSupport.class.getDeclaredMethod("reset", new Class[0]); - m.setAccessible(true); - m.invoke(MylynSupport.class); - - Field f = Bugzilla.class.getDeclaredField("instance"); - f.setAccessible(true); - f.set(Bugzilla.class, null); - - br = TestUtil.getRepository("testbugzilla", REPO_URL, REPO_USER, REPO_PASSWD); - btr = br.getTaskRepository(); - } - - @Override - protected void tearDown () throws Exception { - // persist for next round and shutdown - Method m = MylynSupport.class.getDeclaredMethod("finish"); - m.setAccessible(true); - m.invoke(MylynSupport.getInstance()); - - super.tearDown(); - } - - public static Test suite () { - return NbModuleSuite.emptyConfiguration() - - .addTest(MylynStorageTest.class, - // creates an offline temporary task - "testCreateUnsubmittedTask", - // submit the temporary task to the server and turn it into a full remote task - "testSubmitTemporaryTask", - // repository settings modifications should keep the single instance of TR - "testEditRepository", - // edit task - "testEditTask", - // submit task - "testSubmitTask", - // external changes - "testIncomingChanges", - // external changes and refresh in editor page - "testIncomingChangesInEditorPage", - // conflicts in incoming and outgoing - "testConflicts", - // conflicts in incoming and outgoing in editor page - "testConflictsInEditorPage", - // open task editor for unknown task - "testOpenUnknownTask", - // open task editor for task with deleted/corrupted task data in storage - "testOpenTaskWithDeletedData", - - // create and init query - "testCreateQuery", - // synchronize and get external changes - "testSynchronizeQuery", - // modify query - "testModifyQuery", - // remove from query internal - closing a task - "testTaskRemovedFromQueryInt", - // remove from query externally - closing a task - "testTaskRemovedFromQueryExt", - // test simple search - temporary query not added to the tasklist - "testSimpleSearch" - ).gui(false) - .suite(); - } - - public void testCreateUnsubmittedTask () throws Exception { - MylynSupport supp = MylynSupport.getInstance(); - ITaskMapping mapping = new TaskMapping() { - - @Override - public String getProduct () { - return PRODUCT; - } - - @Override - public String getComponent () { - return COMPONENT; - } - - }; - NbTask task = supp.createTask(btr, mapping); - Collection allLocalTasks = supp.getTasks(supp.getLocalTaskRepository()); - Collection allUnsubmittedTasks = supp.getUnsubmittedTasksContainer(btr).getTasks(); - - /*************** TEST *******************/ - // is it really in the tasklist - assertEquals(0, allLocalTasks.size()); -// assertTrue(allLocalTasks.contains(task)); - assertEquals(1, allUnsubmittedTasks.size()); - assertTrue(allUnsubmittedTasks.contains(task)); - assertEquals(0, supp.getTasks(btr).size()); // not yet in the repository - assertEquals("1", task.getTaskId()); - } - - public void testSubmitTemporaryTask () throws Exception { - MylynSupport supp = MylynSupport.getInstance(); - NbTask task = supp.getUnsubmittedTasksContainer(btr).getTasks().iterator().next(); - // edit the task - NbTaskDataModel model = task.getTaskDataModel(); - - // model.getTaskData returns our local data - String defaultSummary = task.getSummary(); - TaskAttribute rta = model.getLocalTaskData().getRoot(); - assertFalse(model.isDirty()); - // now edit summary, product and component - String newSummary = "Task summary testSubmitTemporaryTask"; - TaskAttribute ta = rta.getMappedAttribute(TaskAttribute.SUMMARY); - ta.setValue(newSummary); - model.attributeChanged(ta); - - // now we have unsaved changes, the task is dirty - assertTrue(model.isDirty()); - // not yet saved - assertEquals(defaultSummary, task.getSummary()); - // save - model.save(new NullProgressMonitor()); - // all saved? - assertFalse(model.isDirty()); - // well, not exactly, for new unsubmitted task we need to manually refresh task's attributes - assertEquals(defaultSummary, task.getSummary()); - if (task.getSynchronizationState() == SynchronizationState.OUTGOING_NEW) { - task.setSummary(newSummary); - } - assertEquals(newSummary, task.getSummary()); - - // let's submit finally - NbTask submittedTask = submitTask(task, model); - - assertNotSame(task, submittedTask); // they difer, the new task is a persistent, not local one - assertEquals(0, supp.getUnsubmittedTasksContainer(btr).getTasks().size()); - assertSame(submittedTask, supp.getTask(btr.getUrl(), submittedTask.getTaskId())); - - assertEquals(newSummary, task.getSummary()); - model = submittedTask.getTaskDataModel(); - assertSame(btr, model.getTaskRepository()); - assertSame(submittedTask, model.getTask()); - assertFalse(model.isDirty()); - assertTrue(model.hasBeenRead()); - assertTrue(model.getChangedAttributes().isEmpty()); - assertTrue(model.getChangedOldAttributes().isEmpty()); - assertEquals(SynchronizationState.SYNCHRONIZED, submittedTask.getSynchronizationState()); - } - - public void testEditRepository () throws Exception { - MylynSupport supp = MylynSupport.getInstance(); - Collection tasks = supp.getTasks(btr); - assertEquals(1, tasks.size()); - NbTask task = tasks.iterator().next(); - assertNotNull(task); - - // TR should be singleton - BugzillaRepository otherRepository = TestUtil.getRepository("testbugzilla", REPO_URL, REPO_USER, REPO_PASSWD); - TaskRepository otherTaskRepository = otherRepository.getTaskRepository(); - assertSame(btr, otherTaskRepository); - assertNotNull(task.getTaskDataState()); - - // now lets change URL, it should propagate to the tasklist and rewrite all tasks - Method m = BugzillaRepository.class.getDeclaredMethod("setupTaskRepository", - String.class, String.class, String.class, String.class, - char[].class, String.class, char[].class, - Boolean.TYPE); - m.setAccessible(true); - m.invoke(otherRepository, "testbugzilla", REPO_URL, REPO_URL + "/OTHER", - REPO_USER, REPO_PASSWD.toCharArray(), null, null, false); - assertSame(btr, otherTaskRepository); - assertEquals(REPO_URL + "/OTHER", otherRepository.getUrl()); - assertEquals(otherRepository.getUrl(), task.getRepositoryUrl()); - assertNotNull(task.getTaskDataState()); - NbTask task2 = supp.getTasks(otherTaskRepository).iterator().next(); - assertSame(task, task2); - assertEquals(otherRepository.getUrl(), task2.getRepositoryUrl()); - assertNotNull(task2.getTaskDataState()); - - // and back to clean - m.invoke(otherRepository, "testbugzilla", REPO_URL + "/OTHER", REPO_URL, - REPO_USER, REPO_PASSWD.toCharArray(), null, null, false); - assertEquals(REPO_URL, otherRepository.getUrl()); - assertEquals(otherRepository.getUrl(), task.getRepositoryUrl()); - } - - public void testEditTask () throws Exception { - MylynSupport supp = MylynSupport.getInstance(); - Collection tasks = supp.getTasks(btr); - assertEquals(1, tasks.size()); - NbTask task = tasks.iterator().next(); - assertNotNull(task); - - // the task should be clean, synchronized and without any modifications - NbTaskDataModel model = task.getTaskDataModel(); - assertFalse(model.isDirty()); - assertEquals(SynchronizationState.SYNCHRONIZED, task.getSynchronizationState()); - // edit - TaskAttribute rta = model.getLocalTaskData().getRoot(); - String oldSummary = task.getSummary(); - String newSummary = getName() + "_" + task.getTaskId(); - // change the task summary - TaskAttribute summaryAttr = rta.getMappedAttribute(TaskAttribute.SUMMARY); - summaryAttr.setValue(newSummary); - model.attributeChanged(summaryAttr); - // task is dirty - not saved and has modifications - assertTrue(model.isDirty()); - assertEquals(1, model.getChangedAttributes().size()); - for (TaskAttribute attr : model.getChangedAttributes()) { - // unsaved modifications - assertEquals(newSummary, attr.getValue()); - // no outgoing until save - assertFalse(model.hasOutgoingChanges(attr)); - } - - // unsubmitted tasks should be empty - assertEquals(0, br.getUnsubmittedIssues().size()); - final CountDownLatch l = new CountDownLatch(1); - PropertyChangeListener list = new PropertyChangeListener() { - @Override - public void propertyChange (PropertyChangeEvent evt) { - l.countDown(); - } - }; - br.addPropertyChangeListener(list); - - // save - model.save(new NullProgressMonitor()); - l.await(); - assertEquals(1, br.getUnsubmittedIssues().size()); - br.removePropertyChangeListener(list); - - // task is clean (saved) - and has modifications - assertFalse(model.isDirty()); - assertEquals(1, model.getChangedAttributes().size()); - for (TaskAttribute attr : model.getChangedAttributes()) { - // unsaved modifications - assertEquals(newSummary, attr.getValue()); - // no outgoing until save - assertTrue(model.hasOutgoingChanges(attr)); - } - assertEquals(SynchronizationState.OUTGOING, task.getSynchronizationState()); - } - - public void testSubmitTask () throws Exception { - MylynSupport supp = MylynSupport.getInstance(); - Collection tasks = supp.getTasks(btr); - assertEquals(1, tasks.size()); - NbTask task = tasks.iterator().next(); - assertNotNull(task); - - // outgoing unsubmitted changes - assertEquals(SynchronizationState.OUTGOING, task.getSynchronizationState()); - NbTaskDataModel model = task.getTaskDataModel(); - String oldSummary = task.getSummary(); - TaskAttribute summaryAttr = model.getLocalTaskData().getRoot().getMappedAttribute(TaskAttribute.SUMMARY); - String newSummary = summaryAttr.getValue(); - assertTrue(model.hasOutgoingChanges(summaryAttr)); - assertFalse(oldSummary.equals(newSummary)); - - // unsubmitted tasks should contain the task - assertEquals(1, br.getUnsubmittedIssues().size()); - final CountDownLatch l = new CountDownLatch(1); - PropertyChangeListener list = new PropertyChangeListener() { - @Override - public void propertyChange (PropertyChangeEvent evt) { - l.countDown(); - } - }; - br.addPropertyChangeListener(list); - - // submit - task = submitTask(task, model); - l.await(); - assertEquals(0, br.getUnsubmittedIssues().size()); - br.removePropertyChangeListener(list); - - // test - assertFalse(model.isDirty()); - assertTrue(model.getChangedAttributes().isEmpty()); - assertTrue(model.getChangedOldAttributes().isEmpty()); - assertEquals(SynchronizationState.SYNCHRONIZED, task.getSynchronizationState()); - assertEquals(newSummary, task.getSummary()); - } - - public void testIncomingChanges () throws Exception { - MylynSupport supp = MylynSupport.getInstance(); - Collection tasks = supp.getTasks(btr); - assertEquals(1, tasks.size()); - NbTask task = tasks.iterator().next(); - assertNotNull(task); - - DummyTaskWrapper wrapper = new DummyTaskWrapper(task); - String oldSummary = task.getSummary(); - String newSummary = getName() + "_" + task.getTaskId(); - assertEquals(SynchronizationState.SYNCHRONIZED, wrapper.getSynchronizationState()); - makeExternalChange(task, newSummary); - - // still no change, need to do a sync job - assertEquals(oldSummary, wrapper.getSummary()); - assertEquals(SynchronizationState.SYNCHRONIZED, task.getSynchronizationState()); - assertEquals(SynchronizationState.SYNCHRONIZED, wrapper.getSynchronizationState()); - - - // sync with server - SynchronizeTasksCommand cmd = supp.getCommandFactory().createSynchronizeTasksCommand(btr, Collections.singleton(task)); - br.getExecutor().execute(cmd); - assertEquals(SynchronizationState.INCOMING, task.getSynchronizationState()); - assertEquals(SynchronizationState.INCOMING, wrapper.getSynchronizationState()); - assertEquals(newSummary, wrapper.getSummary()); - assertEquals("Summary from " + oldSummary + " to " + newSummary, wrapper.getIncomingChangesText()); - wrapper.forget(); - } - - public void testIncomingChangesInEditorPage () throws Exception { - MylynSupport supp = MylynSupport.getInstance(); - Collection tasks = supp.getTasks(btr); - assertEquals(1, tasks.size()); - NbTask task = tasks.iterator().next(); - assertNotNull(task); - - String oldSummary = task.getSummary(); - String newSummary = getName() + "_" + task.getTaskId(); - DummyTaskWrapper wrapper = new DummyTaskWrapper(task); - assertEquals(SynchronizationState.INCOMING, wrapper.getSynchronizationState()); - DummyEditorPage page = new DummyEditorPage(task); - page.open(); - page.assertOpened(); - assertEquals(oldSummary, page.taskDataSummary); - assertTrue(page.summaryChanged); - page.clear(); - assertEquals(SynchronizationState.SYNCHRONIZED, wrapper.getSynchronizationState()); - assertEquals(SynchronizationState.SYNCHRONIZED, wrapper.getSynchronizationState()); - makeExternalChange(task, newSummary); - - // still no change, need to do a sync job - assertEquals(oldSummary, wrapper.getSummary()); - assertEquals(SynchronizationState.SYNCHRONIZED, wrapper.getSynchronizationState()); - - - // sync with server - SynchronizeTasksCommand cmd = supp.getCommandFactory().createSynchronizeTasksCommand(btr, Collections.singleton(task)); - br.getExecutor().execute(cmd); - // synchronized because it's refreshed in the editor page automatically - assertTrue(page.summaryChanged); - assertEquals(newSummary, page.taskDataSummary); - assertEquals(SynchronizationState.SYNCHRONIZED, wrapper.getSynchronizationState()); - assertEquals(newSummary, wrapper.getSummary()); - assertEquals("", wrapper.getIncomingChangesText()); - - page.close(); - wrapper.forget(); - } - - public void testConflicts () throws Exception { - MylynSupport supp = MylynSupport.getInstance(); - Collection tasks = supp.getTasks(btr); - assertEquals(1, tasks.size()); - NbTask task = tasks.iterator().next(); - assertNotNull(task); - - DummyTaskWrapper wrapper = new DummyTaskWrapper(task); - String oldSummary = task.getSummary(); - String newSummary = getName() + "_" + task.getTaskId(); - assertEquals(SynchronizationState.SYNCHRONIZED, wrapper.getSynchronizationState()); - makeExternalChange(task, newSummary); - - // still no change, need to do a sync job - assertEquals(oldSummary, wrapper.getSummary()); - assertEquals(SynchronizationState.SYNCHRONIZED, task.getSynchronizationState()); - assertEquals(SynchronizationState.SYNCHRONIZED, wrapper.getSynchronizationState()); - - // make local changes - DummyEditorPage page = new DummyEditorPage(task); - page.open(); - page.assertOpened(); - page.changeSummary(newSummary + "_local"); - // save - page.close(); - - // still no change, need to do a sync job - assertEquals(SynchronizationState.OUTGOING, wrapper.getSynchronizationState()); - - // sync with server - SynchronizeTasksCommand cmd = supp.getCommandFactory().createSynchronizeTasksCommand(btr, Collections.singleton(task)); - br.getExecutor().execute(cmd); - assertEquals(SynchronizationState.CONFLICT, wrapper.getSynchronizationState()); - assertEquals(newSummary, wrapper.getSummary()); - assertEquals("Summary from " + oldSummary + " to " + newSummary, wrapper.getIncomingChangesText()); - - // open editor and clear - page.open(); - assertEquals(SynchronizationState.OUTGOING, wrapper.getSynchronizationState()); - assertEquals("", wrapper.getIncomingChangesText()); - assertTrue(page.summaryChangedLocally); - - // revert to synchronized - page.revert(); - assertEquals(SynchronizationState.SYNCHRONIZED, task.getSynchronizationState()); - assertEquals(SynchronizationState.SYNCHRONIZED, wrapper.getSynchronizationState()); - - wrapper.forget(); - } - - public void testConflictsInEditorPage () throws Exception { - MylynSupport supp = MylynSupport.getInstance(); - Collection tasks = supp.getTasks(btr); - assertEquals(1, tasks.size()); - NbTask task = tasks.iterator().next(); - assertNotNull(task); - - DummyTaskWrapper wrapper = new DummyTaskWrapper(task); - String oldSummary = task.getSummary(); - String newSummary = getName() + "_" + task.getTaskId(); - assertEquals(SynchronizationState.SYNCHRONIZED, wrapper.getSynchronizationState()); - makeExternalChange(task, newSummary); - - // still no change, need to do a sync job - assertEquals(oldSummary, wrapper.getSummary()); - assertEquals(SynchronizationState.SYNCHRONIZED, task.getSynchronizationState()); - assertEquals(SynchronizationState.SYNCHRONIZED, wrapper.getSynchronizationState()); - - // make local changes - DummyEditorPage page = new DummyEditorPage(task); - page.open(); - page.assertOpened(); - page.changeSummary(newSummary + "_local"); - // save - page.save(); - - // still no change, need to do a sync job - assertEquals(SynchronizationState.OUTGOING, wrapper.getSynchronizationState()); - - // sync with server - SynchronizeTasksCommand cmd = supp.getCommandFactory().createSynchronizeTasksCommand(btr, Collections.singleton(task)); - br.getExecutor().execute(cmd); - // not in conflict because it's refreshed in the editor page automatically - assertTrue(page.summaryChangedLocally); - assertEquals(newSummary + "_local", page.taskDataSummary); - assertEquals(SynchronizationState.OUTGOING, wrapper.getSynchronizationState()); - assertEquals(newSummary, wrapper.getSummary()); - assertEquals("", wrapper.getIncomingChangesText()); - - // revert to synchronized - page.revert(); - assertEquals(SynchronizationState.SYNCHRONIZED, task.getSynchronizationState()); - assertEquals(SynchronizationState.SYNCHRONIZED, wrapper.getSynchronizationState()); - assertEquals(newSummary, page.taskDataSummary); - assertEquals(newSummary, wrapper.getSummary()); - assertEquals("", wrapper.getIncomingChangesText()); - - page.close(); - wrapper.forget(); - } - - public void testOpenUnknownTask () throws Exception { - MylynSupport supp = MylynSupport.getInstance(); - - String taskId = "1"; - Collection tasks = supp.getTasks(btr); - for (NbTask t : tasks) { - assertFalse(taskId.equals(t.getTaskId())); - } - - DummyEditorPage page = new DummyEditorPage(taskId); - page.open(); - page.waitUntilOpened(); - page.assertOpened(); - - page.close(); - - assertTrue(supp.getTasks(btr).contains(page.task)); - page.task.delete(); - assertFalse(supp.getTasks(btr).contains(page.task)); - } - - public void testOpenTaskWithDeletedData () throws Exception { - MylynSupport supp = MylynSupport.getInstance(); - - Collection tasks = supp.getTasks(btr); - assertEquals(1, tasks.size()); - NbTask task = tasks.iterator().next(); - assertNotNull(task); - // delete task data - assertNotNull(task.getTaskDataState()); - deleteTaskData(task); - assertNull(task.getTaskDataState()); - - DummyEditorPage page = new DummyEditorPage(task); - page.open(); - page.waitUntilOpened(); - page.assertOpened(); - assertEquals(task, page.task); - - page.close(); - } - - public void testCreateQuery () throws Exception { - MylynSupport supp = MylynSupport.getInstance(); - - Collection tasks = supp.getTasks(btr); - assertEquals(1, tasks.size()); - // task already known, will be up to date - NbTask task = tasks.iterator().next(); - assertNotNull(task); - - // query list is empty - assertEquals(0, supp.getRepositoryQueries(btr).size()); - // create new query - final IRepositoryQuery query = supp.createNewQuery(btr, QUERY_NAME); - query.setUrl("/buglist.cgi?query_format=advanced&product=" + PRODUCT + "&component=" + COMPONENT); - supp.addQuery(btr, query); - // was it added? - assertSame(query, supp.getRepositoryQueries(btr).iterator().next()); - - // it's still empty, need to sync first - assertEquals(0, supp.getTasks(query).size()); - - DummyQueryController controller = new DummyQueryController(query); - // synchronize - SynchronizeQueryCommand cmd = supp.getCommandFactory().createSynchronizeQueriesCommand(btr, query); - cmd.addCommandProgressListener(controller); - br.getExecutor().execute(cmd); - - // all pages should be opened - controller.closeAllPages(); - // get all tasks for the query - tasks = controller.getTasks(); - assertEquals(new HashSet(supp.getTasks(query)), new HashSet(tasks)); - assertTrue(tasks.contains(task)); - - // all tasks are NEW - except for the known old task - for (NbTask t : tasks) { - if (t == task || controller.getOpenedTasks().contains(t)) { - assertEquals(SynchronizationState.SYNCHRONIZED, t.getSynchronizationState()); - } else { - if (t.getSynchronizationState() == SynchronizationState.SYNCHRONIZED) { - // prehistoric tasks are marked as synchronized - // but have a specific flag - assertEquals("true", t.getAttribute("NetBeans.task.unseen")); - } else { - assertEquals(SynchronizationState.INCOMING_NEW, t.getSynchronizationState()); - } - DummyEditorPage p = new DummyEditorPage(t); - p.open(); - p.assertOpened(); - p.close(); - assertEquals(SynchronizationState.SYNCHRONIZED, t.getSynchronizationState()); - assertNull(t.getAttribute("NetBeans.task.unseen")); - } - } - } - - public void testSynchronizeQuery () throws Exception { - MylynSupport supp = MylynSupport.getInstance(); - IRepositoryQuery q = supp.getRepositoryQuery(btr, QUERY_NAME); - Collection tasks = supp.getTasks(q); - Set wrappers = new HashSet(tasks.size()); - - // get tasks from the query - assertFalse(tasks.isEmpty()); - - // make external changes in summaries - Map oldSummaries = new HashMap(tasks.size()); - Map newSummaries = new HashMap(tasks.size()); - int i = 0; - for (NbTask task : tasks) { - // make at most 10 changes so this ends sometimes - if (++i > 10) { - break; - } - wrappers.add(new DummyTaskWrapper(task)); - assertEquals(SynchronizationState.SYNCHRONIZED, task.getSynchronizationState()); - String newSummary = getName() + "_" + task.getTaskId() + "_" + System.currentTimeMillis(); - oldSummaries.put(task, task.getSummary()); - newSummaries.put(task, newSummary); - makeExternalChange(task, newSummary); - } - - // no change yet - for (DummyTaskWrapper wrapper : wrappers) { - assertEquals(SynchronizationState.SYNCHRONIZED, wrapper.getSynchronizationState()); - assertEquals(SynchronizationState.SYNCHRONIZED, wrapper.task.getSynchronizationState()); - } - SynchronizeQueryCommand cmd = supp.getCommandFactory().createSynchronizeQueriesCommand(btr, q); - br.getExecutor().execute(cmd); - - // all tasks have incoming changes - for (DummyTaskWrapper wrapper : wrappers) { - String newSummary = newSummaries.get(wrapper.task); - assertEquals(SynchronizationState.INCOMING, wrapper.getSynchronizationState()); - assertEquals(SynchronizationState.INCOMING, wrapper.task.getSynchronizationState()); - assertEquals(newSummary, wrapper.getSummary()); - assertEquals("Summary from " + oldSummaries.get(wrapper.task) + " to " + newSummary, wrapper.getIncomingChangesText()); - - // open and see changes - DummyEditorPage p = new DummyEditorPage(wrapper.task); - p.open(); - assertTrue(p.summaryChanged); - assertEquals(newSummary, p.taskDataSummary); - assertEquals(SynchronizationState.SYNCHRONIZED, wrapper.getSynchronizationState()); - assertEquals(SynchronizationState.SYNCHRONIZED, wrapper.task.getSynchronizationState()); - p.close(); - } - for (DummyTaskWrapper wrapper : wrappers) { - wrapper.forget(); - } - } - - public void testModifyQuery () throws Exception { - MylynSupport supp = MylynSupport.getInstance(); - IRepositoryQuery query = supp.getRepositoryQuery(btr, QUERY_NAME); - Collection tasks = supp.getTasks(query); - Collection toRemove = new HashSet(); - for (NbTask task : tasks) { - if (task.isCompleted()) { - toRemove.add(task); - } - } - assertFalse(toRemove.isEmpty()); - - // make another new task so the query is not empty - NbTask createdTask = createNewTask("New task testModifyQuery"); - - // modify query to make it more precise - will not list closed tasks - assertFalse(tasks.isEmpty()); - DummyQueryController controller = new DummyQueryController(query); - query.setUrl(query.getUrl() + "&bug_status=NEW" + "&bug_status=REOPENED"); //NOI18N - // synchronize - SynchronizeQueryCommand cmd = supp.getCommandFactory().createSynchronizeQueriesCommand(btr, query); - cmd.addCommandProgressListener(controller); - br.getExecutor().execute(cmd); - - tasks = controller.tasks; - assertFalse(tasks.isEmpty()); - assertEquals(new HashSet(supp.getTasks(query)), new HashSet(tasks)); - for (NbTask removedTask : toRemove) { - assertFalse(tasks.contains(removedTask)); - } - assertTrue(tasks.contains(createdTask)); - } - - public void testTaskRemovedFromQueryInt () throws Exception { - MylynSupport supp = MylynSupport.getInstance(); - IRepositoryQuery q = supp.getRepositoryQuery(btr, QUERY_NAME); - Collection tasks = supp.getTasks(q); - - // get tasks from the query - assertFalse(tasks.isEmpty()); - DummyQueryController controller = new DummyQueryController(q); - // get a task to close - NbTask task = tasks.iterator().next(); - assertTrue(controller.tasks.contains(task)); - // close the task in editor - DummyEditorPage page = new DummyEditorPage(task); - page.open(); - page.closeTask("WONTFIX"); - page.save(); - - // submit - page.submit(); - assertTrue(task.isCompleted()); - - // refresh query - SynchronizeQueryCommand cmd = supp.getCommandFactory().createSynchronizeQueriesCommand(btr, q); - cmd.addCommandProgressListener(controller); - br.getExecutor().execute(cmd); - - // task should be removed from the list - assertFalse(controller.getTasks().contains(task)); - - page.close(); - } - - public void testTaskRemovedFromQueryExt () throws Exception { - MylynSupport supp = MylynSupport.getInstance(); - IRepositoryQuery q = supp.getRepositoryQuery(btr, QUERY_NAME); - Collection tasks = supp.getTasks(q); - - // get tasks from the query - assertFalse(tasks.isEmpty()); - DummyQueryController controller = new DummyQueryController(q); - // get a task to close - NbTask task = tasks.iterator().next(); - assertTrue(controller.tasks.contains(task)); - - // close the task externally - assertFalse(task.isCompleted()); - TaskData external = task.getTaskDataState().getRepositoryData(); - TaskAttribute opAttr = external.getRoot().getMappedAttribute(TaskAttribute.OPERATION); - TaskOperation taskOperation = null; - for (TaskOperation op : external.getAttributeMapper().getTaskOperations(opAttr)) { - if (BugzillaOperation.resolve.getLabel().equals(op.getLabel())) { - taskOperation = op; - break; - } - } - assertNotNull(taskOperation); - external.getAttributeMapper().setTaskOperation(opAttr, taskOperation); - TaskAttribute resolutionAttr = external.getRoot().getMappedAttribute(BugzillaOperation.resolve.getInputId()); - resolutionAttr.setValue("WONTFIX"); - SubmitCommand submitCmd = new SubmitCommand(Bugzilla.getInstance().getRepositoryConnector(), btr, external); - br.getExecutor().execute(submitCmd); - - // refresh query - SynchronizeQueryCommand cmd = supp.getCommandFactory().createSynchronizeQueriesCommand(btr, q); - cmd.addCommandProgressListener(controller); - br.getExecutor().execute(cmd); - - // task should be removed from the list - assertFalse(controller.getTasks().contains(task)); - } - - public void testSimpleSearch () throws Exception { - MylynSupport supp = MylynSupport.getInstance(); - String queryName = "Temporary query"; - - IRepositoryQuery q = supp.createNewQuery(btr, queryName); - q.setUrl("/buglist.cgi?query_format=advanced&bug_id=1%2C2%2C3"); // three tasks - // query list is empty - assertFalse(supp.getRepositoryQueries(btr).contains(q)); - // it's still empty, need to sync first - - // synchronize - SimpleQueryCommand cmd = supp.getCommandFactory().createSimpleQueryCommand(btr, q); - br.getExecutor().execute(cmd); - - // get all tasks for the query - Collection tasks = cmd.getTasks(); - assertEquals(3, tasks.size()); - - Collection tasklistTasks = supp.getTasks(btr); - // all tasks are in the tasklist - for (NbTask t : tasks) { - assertTrue(tasklistTasks.contains(t)); - } - assertFalse(supp.getRepositoryQueries(btr).contains(q)); - - // open tasks - for (NbTask t : tasks) { - DummyEditorPage p = new DummyEditorPage(t); - p.open(); - p.waitUntilOpened(); - p.assertOpened(); - p.close(); - } - } - - /** - * This should be done in the editor page upon click on Submit - */ - private NbTask submitTask (NbTask task, NbTaskDataModel model) throws CoreException { - SubmitTaskCommand cmd = MylynSupport.getInstance().getCommandFactory().createSubmitTaskCommand(model); - br.getExecutor().execute(cmd); - NbTask newTask = cmd.getSubmittedTask(); - if (task == newTask) { - // refresh model and whole editor page if opened - model.refresh(); - } - - return newTask; - } - - private void makeExternalChange (NbTask task, String newSummary) throws CoreException { - MylynSupport supp = MylynSupport.getInstance(); - TaskData taskData = task.getTaskDataState().getRepositoryData(); - - // edit the task externally - TaskAttribute rta = taskData.getRoot(); - // now make an external change in summary - TaskData external = new TaskData(taskData.getAttributeMapper(), - taskData.getConnectorKind(), - taskData.getRepositoryUrl(), - taskData.getTaskId()); - external.setVersion(taskData.getVersion()); - for (TaskAttribute child : rta.getAttributes().values()) { - external.getRoot().deepAddCopy(child); - } - external.getRoot().getMappedAttribute(TaskAttribute.SUMMARY).setValue(newSummary); - SubmitCommand submitCmd = new SubmitCommand(Bugzilla.getInstance().getRepositoryConnector(), btr, external); - br.getExecutor().execute(submitCmd); - } - - private NbTask createNewTask (String summary) throws CoreException { - MylynSupport supp = MylynSupport.getInstance(); - ITaskMapping mapping = new TaskMapping() { - - @Override - public String getProduct () { - return PRODUCT; - } - - @Override - public String getComponent () { - return COMPONENT; - } - - }; - NbTask task = supp.createTask(btr, mapping); - NbTaskDataModel model = task.getTaskDataModel(); - - // model.getTaskData returns our local data - TaskAttribute rta = model.getLocalTaskData().getRoot(); - assertFalse(model.isDirty()); - // now edit summary, product and component - String newSummary = summary; - TaskAttribute ta = rta.getMappedAttribute(TaskAttribute.SUMMARY); - ta.setValue(newSummary); - model.attributeChanged(ta); - - // save - model.save(new NullProgressMonitor()); - if (task.getSynchronizationState() == SynchronizationState.OUTGOING_NEW) { - task.setSummary(newSummary); - } - return submitTask(task, model); - } - - private void deleteTaskData (NbTask task) throws Exception { - MylynSupport supp = MylynSupport.getInstance(); - Field f = MylynSupport.class.getDeclaredField("taskDataManager"); - f.setAccessible(true); - TaskDataManager mgr = (TaskDataManager) f.get(supp); - f = NbTask.class.getDeclaredField("delegate"); - f.setAccessible(true); - mgr.deleteTaskData((ITask) f.get(task)); - } - - // something like BugzillaIssue - private class DummyTaskWrapper implements NbTaskListener { - private final NbTask task; - private SynchronizationState syncState; - private String summary; - private String incomingChanges; - - public DummyTaskWrapper (NbTask task) { - this.task = task; - syncState = task.getSynchronizationState(); - summary = task.getSummary(); - task.addNbTaskListener(this); - } - - // should be moved to a central place - // maybe a BugzillaIssueManager - @Override - public void taskModified (TaskEvent ev) { - if (ev.getTask() == task && ev.getKind() == TaskEvent.Kind.MODIFIED) { - syncState = task.getSynchronizationState(); - summary = task.getSummary(); - incomingChanges = ""; - if (syncState == SynchronizationState.INCOMING - || syncState == SynchronizationState.CONFLICT) { - try { - NbTaskDataState taskDataState = task.getTaskDataState(); - Set changedAttributes = MylynSupport.getInstance().countDiff( - taskDataState.getRepositoryData(), - taskDataState.getLastReadData()); - for (TaskAttribute changedAttr : changedAttributes) { - if (changedAttr.getId().equals(taskDataState.getRepositoryData().getRoot() - .getMappedAttribute(TaskAttribute.SUMMARY).getId())) { - incomingChanges = "Summary from " - + taskDataState.getLastReadData().getRoot().getMappedAttribute(TaskAttribute.SUMMARY).getValue() - + " to " - + taskDataState.getRepositoryData().getRoot().getMappedAttribute(TaskAttribute.SUMMARY).getValue(); - } - } - } catch (CoreException ex) { - log(ex.toString()); - } - } - } - } - - void forget () { - task.removeNbTaskListener(this); - } - - private SynchronizationState getSynchronizationState () { - return syncState; - } - - private String getSummary () { - return summary; - } - - private String getIncomingChangesText () { - return incomingChanges; - } - } - - private class DummyEditorPage implements TaskDataListener { - private NbTask task; - private String taskId; - private NbTaskDataModel model; - private String taskDataSummary; - private boolean summaryChanged; - private boolean summaryChangedLocally; - private volatile boolean waitingToOpen; - private MylynSupport supp; - - public DummyEditorPage (NbTask task) { - this.task = task; - } - - public DummyEditorPage (String taskId) { - this.taskId = taskId; - } - - void open () throws CoreException { - supp = MylynSupport.getInstance(); - supp.addTaskDataListener(this); - if (task == null || task.getTaskDataState() == null) { - waitingToOpen = true; - RequestProcessor.getDefault().schedule(new Runnable() { - @Override - public void run () { - if (waitingToOpen) { - try { - GetRepositoryTasksCommand cmd = supp.getCommandFactory().createGetRepositoryTasksCommand( - btr, Collections.singleton(task == null ? taskId : task.getTaskId())); - br.getExecutor().execute(cmd); - if (!cmd.getTasks().isEmpty()) { - task = cmd.getTasks().iterator().next(); - if (task != null) { - finishOpen(); - } - } - } catch (CoreException ex) { - log(ex.toString()); - } - } - } - }, 2, TimeUnit.SECONDS); - } else { - model = task.getTaskDataModel(); - if (model.getLocalTaskData().isPartial()) { - waitingToOpen = true; - } else { - finishOpen(); - } - } - } - - void close () throws CoreException { - save(); - MylynSupport.getInstance().removeTaskDataListener(this); - } - - @Override - public void taskDataUpdated (TaskDataEvent event) { - if (event.getTask() == task) { - if (event.getTaskData() != null && !event.getTaskData().isPartial() && waitingToOpen) { - try { - finishOpen(); - } catch (CoreException ex) { - log(ex.getMessage()); - } - } - if (event.getTaskDataUpdated()) { - refresh(); - } - } - } - - private void clear () { - summaryChanged = summaryChangedLocally = false; - } - - private void changeSummary (String newSummary) { - TaskAttribute summaryAttr = model.getLocalTaskData().getRoot().getMappedAttribute(TaskAttribute.SUMMARY); - summaryAttr.setValue(newSummary); - model.attributeChanged(summaryAttr); - assertTrue(model.isDirty()); - } - - private void save () throws CoreException { - if (model.isDirty()) { - model.save(null); - } - } - - private void revert () throws CoreException { - task.discardLocalEdits(); - refresh(); - } - - private void refresh () { - if (model == null) { - return; - } - // maybe show a warning before overwriting the state - try { - model.refresh(); - TaskAttribute ta = model.getLocalTaskData().getRoot().getMappedAttribute(TaskAttribute.SUMMARY); - summaryChangedLocally = model.hasOutgoingChanges(ta); - summaryChanged = model.hasIncomingChanges(ta, true); - taskDataSummary = ta.getValue(); - } catch (CoreException ex) { - log(ex.toString()); - } - } - - private void finishOpen () throws CoreException { - if (model == null) { - model = task.getTaskDataModel(); - } - taskDataSummary = model.getLocalTaskData().getRoot().getMappedAttribute(TaskAttribute.SUMMARY).getValue(); - TaskAttribute ta = model.getLocalTaskData().getRoot().getMappedAttribute(TaskAttribute.SUMMARY); - summaryChangedLocally = model.hasOutgoingChanges(ta); - summaryChanged = model.hasIncomingChanges(ta, true); - waitingToOpen = false; - } - - private void assertOpened () { - assertFalse(waitingToOpen); - } - - private void closeTask (String resolution) { - TaskOperation taskOperation = null; - TaskAttribute opAttr = model.getLocalTaskData().getRoot().getMappedAttribute(TaskAttribute.OPERATION); - for (TaskOperation op : model.getLocalTaskData().getAttributeMapper().getTaskOperations(opAttr)) { - if (BugzillaOperation.resolve.getLabel().equals(op.getLabel())) { - taskOperation = op; - break; - } - } - assertNotNull(taskOperation); - assertFalse(task.isCompleted()); - model.getLocalTaskData().getAttributeMapper().setTaskOperation(opAttr, taskOperation); - model.attributeChanged(opAttr); - TaskAttribute resolutionAttr = model.getLocalTaskData().getRoot().getMappedAttribute(BugzillaOperation.resolve.getInputId()); - resolutionAttr.setValue(resolution); - model.attributeChanged(resolutionAttr); - } - - private void submit () throws CoreException { - SubmitTaskCommand cmd = supp.getCommandFactory().createSubmitTaskCommand(model); - br.getExecutor().execute(cmd); - } - - private void waitUntilOpened () throws Exception { - for (int i = 0; i < 50; ++i) { - if (!waitingToOpen) { - break; - } - Thread.sleep(1000); - } - assertOpened(); - } - } - - private class DummyQueryController implements SynchronizeQueryCommand.CommandProgressListener { - private final IRepositoryQuery query; - private final MylynSupport supp; - private final Set tasks; - private final List pages; - private boolean flag = true; - - public DummyQueryController (IRepositoryQuery query) throws CoreException { - this.query = query; - this.supp = MylynSupport.getInstance(); - this.tasks = new HashSet(supp.getTasks(query)); - this.pages = new ArrayList(); - } - - @Override - public void queryRefreshStarted (Collection tasks) { - for (NbTask task : tasks) { - taskAdded(task); - } - } - - @Override - public void tasksRefreshStarted (Collection tasks) { - } - - @Override - public void taskAdded (NbTask task) { - tasks.add(task); - // open every other task to simulate fast clicking on task in query - // when the task is not yet ready - if (flag = !flag) { - // open page - DummyEditorPage page = new DummyEditorPage(task); - pages.add(page); - try { - page.open(); - } catch (CoreException ex) { - log(ex.getMessage()); - } - } - } - - @Override - public void taskRemoved (NbTask task) { - tasks.remove(task); - } - - @Override - public void taskSynchronized (NbTask task) { - } - - void closeAllPages () throws CoreException { - for (DummyEditorPage page : pages) { - page.assertOpened(); - page.close(); - } - } - - private Collection getTasks () { - return tasks; - } - - private Set getOpenedTasks () { - Set retval = new HashSet(pages.size()); - for (DummyEditorPage p : pages) { - retval.add(p.task); - } - return retval; - } - } - -} diff --git a/ide/bugzilla/test/unit/src/org/netbeans/modules/bugzilla/TestConstants.java b/ide/bugzilla/test/unit/src/org/netbeans/modules/bugzilla/TestConstants.java deleted file mode 100644 index 7d3728c31b18..000000000000 --- a/ide/bugzilla/test/unit/src/org/netbeans/modules/bugzilla/TestConstants.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.netbeans.modules.bugzilla; - -import org.eclipse.core.runtime.NullProgressMonitor; - -/** - * - * @author tomas - */ -public interface TestConstants { - public static final String TEST_PROJECT = "unittest"; - public static final String TEST_PROJECT2 = "unittest2"; - public static final String REPO_PASSWD = "unittest"; - public static final String REPO_HOST = "bugtracking-test.cz.oracle.com"; - public static final String REPO_URL = "http://" + REPO_HOST + "/bugzilla"; - public static final String REPO_USER = "unittest@unit.test"; - public static final String REPO_USER_NAME = "Mr. Unit Test Sr."; - public static final String REPO_USER2 = "unittest2@unit.test"; - public static final String REPO_USER2_NAME = "Mr. Unit Test Jr."; - public static final String REPO_USER3 = "unittest3@unit.test"; - public static final String REPO_USER4 = "unittest4@unit.test"; - - public static final String ISSUE_SEVERITY = "bug"; - public static final String ISSUE_DESCRIPTION = "big bug"; - - static NullProgressMonitor NULL_PROGRESS_MONITOR = new NullProgressMonitor(); - -} diff --git a/ide/bugzilla/test/unit/src/org/netbeans/modules/bugzilla/TestQueryNotifyListener.java b/ide/bugzilla/test/unit/src/org/netbeans/modules/bugzilla/TestQueryNotifyListener.java deleted file mode 100644 index 5bb0759af563..000000000000 --- a/ide/bugzilla/test/unit/src/org/netbeans/modules/bugzilla/TestQueryNotifyListener.java +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.netbeans.modules.bugzilla; - -import java.util.ArrayList; -import java.util.EnumSet; -import java.util.List; -import org.netbeans.modules.bugtracking.spi.IssueStatusProvider; -import org.netbeans.modules.bugzilla.issue.BugzillaIssue; -import org.netbeans.modules.bugzilla.query.BugzillaQuery; -import org.netbeans.modules.bugzilla.query.QueryNotifyListener; - -/** - * - * @author tomas - */ -public class TestQueryNotifyListener implements QueryNotifyListener { - public boolean started = false; - public boolean finished = false; - public List issues = new ArrayList(); - private BugzillaQuery q; - public TestQueryNotifyListener(BugzillaQuery q) { - this.q = q; - q.addNotifyListener(this); - } - public void started() { - started = true; - } - public void notifyDataAdded (BugzillaIssue issue) { - issues.add(issue); - } - public void notifyDataRemoved (BugzillaIssue issue) { - issues.remove(issue); - } - public void finished() { - finished = true; - } - public void reset() { - started = false; - finished = false; - issues = new ArrayList(); - } - public List getIssues(EnumSet includeStatus) { - List ret = new ArrayList(); - for (BugzillaIssue issue : issues) { - if (q == null || includeStatus.contains(q.getIssueStatus(issue.getID()))) { - ret.add(issue); - } - } - return ret; - } -} diff --git a/ide/bugzilla/test/unit/src/org/netbeans/modules/bugzilla/TestUtil.java b/ide/bugzilla/test/unit/src/org/netbeans/modules/bugzilla/TestUtil.java deleted file mode 100644 index 940be397caa4..000000000000 --- a/ide/bugzilla/test/unit/src/org/netbeans/modules/bugzilla/TestUtil.java +++ /dev/null @@ -1,199 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.netbeans.modules.bugzilla; - -import org.netbeans.modules.bugzilla.repository.BugzillaRepository; -import java.net.MalformedURLException; -import java.util.HashSet; -import java.util.Set; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.NullProgressMonitor; -import org.eclipse.mylyn.internal.bugzilla.core.BugzillaAttribute; -import org.eclipse.mylyn.internal.bugzilla.core.BugzillaClient; -import org.eclipse.mylyn.internal.bugzilla.core.BugzillaRepositoryConnector; -import org.eclipse.mylyn.internal.bugzilla.core.RepositoryConfiguration; -import org.eclipse.mylyn.tasks.core.RepositoryResponse; -import org.eclipse.mylyn.tasks.core.RepositoryStatus; -import org.eclipse.mylyn.tasks.core.TaskRepository; -import org.eclipse.mylyn.tasks.core.data.TaskAttribute; -import org.eclipse.mylyn.tasks.core.data.TaskAttributeMapper; -import org.eclipse.mylyn.tasks.core.data.TaskData; -import org.netbeans.modules.bugtracking.APIAccessor; -import org.netbeans.modules.bugtracking.IssueImpl; -import org.netbeans.modules.bugtracking.QueryImpl; -import org.netbeans.modules.bugtracking.RepositoryImpl; -import org.netbeans.modules.bugtracking.api.Issue; -import org.netbeans.modules.bugtracking.api.Query; -import org.netbeans.modules.bugtracking.api.Repository; -import org.netbeans.modules.bugtracking.spi.RepositoryInfo; -import org.netbeans.modules.bugzilla.issue.BugzillaIssue; -import org.netbeans.modules.bugzilla.query.BugzillaQuery; -import org.netbeans.modules.bugzilla.util.BugzillaUtil; - -/** - * - * @author tomas - */ -public class TestUtil implements TestConstants { - public static void handleException(Exception exception) throws Throwable { - if (exception instanceof CoreException) { - CoreException e = (CoreException) exception; - IStatus status = e.getStatus(); - if (status instanceof RepositoryStatus) { - RepositoryStatus rs = (RepositoryStatus) status; - String html = rs.getHtmlMessage(); - if(html != null && !html.trim().equals("")) { -// HtmlBrowser.URLDisplayer displayer = HtmlBrowser.URLDisplayer.getDefault (); -// if (displayer != null) { -// displayer.showURL (url); -// } else { -// //LOG.info("No URLDisplayer found."); -// } - - final HtmlPanel p = new HtmlPanel(); - p.setHtml(html); - BugzillaUtil.show(p, "html", "ok"); - } - throw new Exception(rs.getHtmlMessage()); - } - if (e.getStatus().getException() != null) { - throw e.getStatus().getException(); - } - if (e.getCause() != null) { - throw e.getCause(); - } - throw e; - } - exception.printStackTrace(); - throw exception; - } - - public static TaskData createTaskData(BugzillaRepositoryConnector brc, TaskRepository repository, String summary, String desc, String typeName) throws MalformedURLException, CoreException { - TaskAttributeMapper attributeMapper = brc.getTaskDataHandler().getAttributeMapper(repository); - TaskData data = new TaskData(attributeMapper, repository.getConnectorKind(), repository.getRepositoryUrl(), ""); - TaskAttribute rta = data.getRoot(); - TaskAttribute ta = rta.getMappedAttribute(TaskAttribute.USER_ASSIGNED); - ta = rta.createMappedAttribute(TaskAttribute.SUMMARY); - ta.setValue(summary); - ta = rta.createMappedAttribute(TaskAttribute.DESCRIPTION); - ta.setValue(desc); - - BugzillaClient client = brc.getClientManager().getClient(repository, NULL_PROGRESS_MONITOR); - RepositoryConfiguration rc = brc.getRepositoryConfiguration(repository, false, new NullProgressMonitor()); - String os = client.getRepositoryConfiguration().getOSs().get(0); - ta = rta.createMappedAttribute(BugzillaAttribute.OP_SYS.getKey()); - ta.setValue(os); - - ta = rta.createMappedAttribute(BugzillaAttribute.PRODUCT.getKey()); - ta.setValue(TEST_PROJECT); - - String platform = client.getRepositoryConfiguration().getPlatforms().get(0); - ta = rta.createMappedAttribute(BugzillaAttribute.REP_PLATFORM.getKey()); - ta.setValue(platform); - - String version = client.getRepositoryConfiguration().getVersions(TEST_PROJECT).get(0); - ta = rta.createMappedAttribute(BugzillaAttribute.VERSION.getKey()); - ta.setValue(version); - - String component = client.getRepositoryConfiguration().getComponents(TEST_PROJECT).get(0); - ta = rta.createMappedAttribute(BugzillaAttribute.COMPONENT.getKey()); - ta.setValue(component); - - return data; - } - - public static RepositoryResponse postTaskData(BugzillaRepositoryConnector brc, TaskRepository repository, TaskData data) throws CoreException { - Set attrs = new HashSet(); // XXX what is this for - return brc.getTaskDataHandler().postTaskData(repository, data, attrs, NULL_PROGRESS_MONITOR); - } - - public static TaskData getTaskData(TaskRepository taskRepository, String id) throws CoreException { - BugzillaRepositoryConnector brc = Bugzilla.getInstance().getRepositoryConnector(); - return brc.getTaskData(taskRepository, id, new NullProgressMonitor()); - } - - public static String createIssue(BugzillaRepository repo, String summary) throws MalformedURLException, CoreException { - BugzillaRepositoryConnector brc = Bugzilla.getInstance().getRepositoryConnector(); - TaskRepository tr = repo.getTaskRepository(); - TaskData data = TestUtil.createTaskData(brc, tr, summary, ISSUE_DESCRIPTION, ISSUE_SEVERITY); - RepositoryResponse rr = TestUtil.postTaskData(brc, tr, data); - return rr.getTaskId(); - } -// -// public static RepositoryResponse addComment(BugzillaRepository repository, TaskData data, String comment) throws CoreException { -// return addComment(repository.getTaskRepository(), id, comment); -// } - - public static RepositoryResponse addComment(TaskRepository taskRepository, String id, String comment) throws CoreException { - TaskData data = getTaskData(taskRepository, id); - return addComment(taskRepository, data, comment); - } - - public static RepositoryResponse addComment(TaskRepository taskRepository, TaskData data, String comment) throws CoreException { - TaskAttribute ta = data.getRoot().createMappedAttribute(TaskAttribute.COMMENT_NEW); - ta.setValue(comment); - - Set attrs = new HashSet(); - attrs.add(ta); - return Bugzilla.getInstance().getRepositoryConnector().getTaskDataHandler().postTaskData(taskRepository, data, attrs, new NullProgressMonitor()); - } - - public static BugzillaRepository getRepository(String name, String url, String user, String psswd) { - RepositoryInfo info = new RepositoryInfo(name, BugzillaConnector.ID, url, name, name, user, null, psswd.toCharArray(), null); - BugzillaRepository repo = new BugzillaRepository(info); - repo.ensureCredentials(); - return repo; - } - - public static void validate(BugzillaRepositoryConnector brc, TaskRepository repository) throws Throwable { - try { - brc.getClientManager().getClient(repository, NULL_PROGRESS_MONITOR).validate(NULL_PROGRESS_MONITOR); - } catch (Exception ex) { - handleException(ex); - } - } - - public static Query getQuery(BugzillaQuery bugzillaQuery) { - Repository repository = BugzillaUtil.getRepository(bugzillaQuery.getRepository()); - return getQuery(repository, bugzillaQuery); - } - - public static Issue getIssue(BugzillaIssue bugzillaIssue) { - Repository repository = BugzillaUtil.getRepository(bugzillaIssue.getRepository()); - return getIssue(repository, bugzillaIssue); - } - - private static Query getQuery(Repository repository, BugzillaQuery q) { - RepositoryImpl repositoryImpl = APIAccessor.IMPL.getImpl(repository); - QueryImpl impl = repositoryImpl.getQuery(q); - if(impl == null) { - return null; - } - return impl.getQuery(); - } - - private static Issue getIssue(Repository repository, BugzillaIssue i) { - RepositoryImpl repositoryImpl = APIAccessor.IMPL.getImpl(repository); - IssueImpl impl = repositoryImpl.getIssue(i); - return impl != null ? impl.getIssue() : null; - } - -} diff --git a/ide/bugzilla/test/unit/src/org/netbeans/modules/bugzilla/autoupdate/BugzillaNotSupportedTest.java b/ide/bugzilla/test/unit/src/org/netbeans/modules/bugzilla/autoupdate/BugzillaNotSupportedTest.java deleted file mode 100644 index 83be6de73dc9..000000000000 --- a/ide/bugzilla/test/unit/src/org/netbeans/modules/bugzilla/autoupdate/BugzillaNotSupportedTest.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.netbeans.modules.bugzilla.autoupdate; - -import org.eclipse.mylyn.internal.bugzilla.core.BugzillaVersion; -import org.netbeans.junit.NbTestCase; -import org.netbeans.modules.bugzilla.TestConstants; -import static org.netbeans.modules.bugzilla.TestConstants.REPO_PASSWD; -import static org.netbeans.modules.bugzilla.TestConstants.REPO_URL; -import static org.netbeans.modules.bugzilla.TestConstants.REPO_USER; -import org.netbeans.modules.bugzilla.TestUtil; - -/** - * - * @author tomas - */ -public class BugzillaNotSupportedTest extends NbTestCase implements TestConstants { - - public BugzillaNotSupportedTest(String testName) { - super(testName); - } - - @Override - protected void setUp() throws Exception { - System.setProperty("netbeans.t9y.bugzilla.supported.version", "0.0.0"); - System.setProperty("netbeans.user", getWorkDir().getAbsolutePath()); - super.setUp(); - } - - public void testIsNotSupportedBugzillaVersion() { - BugzillaVersion version = BugzillaAutoupdate.getInstance().getServerVersion(TestUtil.getRepository("test", REPO_URL, REPO_USER, REPO_PASSWD)); - assertFalse(BugzillaAutoupdate.getInstance().isSupportedVersion(version)); - } - -} diff --git a/ide/bugzilla/test/unit/src/org/netbeans/modules/bugzilla/autoupdate/BugzillaPluginUCTest.java b/ide/bugzilla/test/unit/src/org/netbeans/modules/bugzilla/autoupdate/BugzillaPluginUCTest.java deleted file mode 100644 index a99f7f79180d..000000000000 --- a/ide/bugzilla/test/unit/src/org/netbeans/modules/bugzilla/autoupdate/BugzillaPluginUCTest.java +++ /dev/null @@ -1,210 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.netbeans.modules.bugzilla.autoupdate; - -import org.netbeans.modules.bugtracking.commons.AutoupdatePluginUCTestCase; -import org.eclipse.mylyn.internal.bugzilla.core.BugzillaVersion; -import org.netbeans.junit.NbModuleSuite; -import org.netbeans.modules.bugtracking.commons.AutoupdateSupport; -import org.openide.util.NbBundle; - -/** - * - * @author tomas - */ -public class BugzillaPluginUCTest extends AutoupdatePluginUCTestCase { - - String CATALOG_CONTENTS_FORMAT = - "" + - "" + - "" + - "" + - " 1.5\" " + - "OpenIDE-Module-Long-Description=\"This module bundles the Bugzilla connector implementation\" " + - "OpenIDE-Module-Module-Dependencies=\"org.jdesktop.layout/1 > 1.6, " + - "org.netbeans.libs.bugtracking > 1.0, " + - "org.netbeans.libs.commons_logging/1 > 1.7, " + - "org.openide.awt > 7.3, " + - "org.openide.dialogs > 7.8, " + - "org.openide.modules > 6.0, " + - "org.openide.nodes > 7.7, " + - "org.openide.util > 7.18, " + - "org.openide.windows > 6.24\" " + - "OpenIDE-Module-Name=\"Bugzilla Libraries\" " + - "OpenIDE-Module-Requires=\"org.openide.modules.ModuleFormat1\" " + - "OpenIDE-Module-Short-Description=\"Bundles Bugzilla Libraries\" " + - "OpenIDE-Module-Specification-Version=\"1.0.0\"/>" + - "" + - "" + - " 1.5\" " + - "OpenIDE-Module-Long-Description=\"Support for Bugzilla issue tracker up to version {1} \" " + - "OpenIDE-Module-Module-Dependencies=\"org.jdesktop.layout/1 > 1.6, " + - "org.netbeans.api.progress/1 > 1.13, " + - "org.netbeans.libs.bugtracking > 1.0, " + - "org.netbeans.libs.commons_logging/1 > 1.7, " + - "org.netbeans.libs.bugzilla > 1.0, " + - "org.netbeans.modules.bugtracking > 1.0, " + - "org.netbeans.modules.kenai > 0.1, " + - "org.openide.awt > 7.3, " + - "org.openide.dialogs > 7.8, " + - "org.openide.filesystems > 7.21, " + - "org.openide.loaders > 7.5, " + - "org.openide.modules > 6.0, " + - "org.openide.nodes > 7.7, " + - "org.openide.util > 7.18, " + - "org.openide.windows > 6.24\" " + - "OpenIDE-Module-Name=\"Bugzilla\" " + - "OpenIDE-Module-Requires=\"org.openide.modules.ModuleFormat1\" " + - "OpenIDE-Module-Short-Description=\"Bugzilla\" " + - "OpenIDE-Module-Specification-Version=\"{2}\"/>" + - "" + - ""; - - public BugzillaPluginUCTest(String testName) { - super(testName); - } - - public static junit.framework.Test suite() { - return NbModuleSuite.create(BugzillaPluginUCTest.class, null, null); - } - - public void testIsSupported() { - assertTrue(BugzillaAutoupdate.getInstance().isSupportedVersion(BugzillaVersion.MIN_VERSION)); - assertTrue(BugzillaAutoupdate.getInstance().isSupportedVersion(BugzillaVersion.BUGZILLA_3_2)); - assertTrue(BugzillaAutoupdate.getInstance().isSupportedVersion(new BugzillaVersion("3.2.1"))); - assertTrue(BugzillaAutoupdate.getInstance().isSupportedVersion(getLower(BugzillaAutoupdate.SUPPORTED_BUGZILLA_VERSION.toString()))); - } - - public void testIsNotSupported() { - assertFalse(BugzillaAutoupdate.getInstance().isSupportedVersion(getHigherMicro(BugzillaAutoupdate.SUPPORTED_BUGZILLA_VERSION.toString()))); - assertFalse(BugzillaAutoupdate.getInstance().isSupportedVersion(getHigherMinor(BugzillaAutoupdate.SUPPORTED_BUGZILLA_VERSION.toString()))); - assertFalse(BugzillaAutoupdate.getInstance().isSupportedVersion(getHigherMajor(BugzillaAutoupdate.SUPPORTED_BUGZILLA_VERSION.toString()))); - } - - public void testGetVersion() { - assertEquals(new BugzillaVersion("1.1.1").toString(), BugzillaAutoupdate.getInstance().getVersion("test version 1.1.1 test").toString()); - assertEquals(new BugzillaVersion("1.1.1").toString(), BugzillaAutoupdate.getInstance().getVersion("test version 1.1.1 test").toString()); - assertEquals(new BugzillaVersion("1.1.1").toString(), BugzillaAutoupdate.getInstance().getVersion("test version 1.1.1").toString()); - assertEquals(new BugzillaVersion("1.1.1").toString(), BugzillaAutoupdate.getInstance().getVersion("version 1.1.1").toString()); - assertEquals(new BugzillaVersion("1.1").toString(), BugzillaAutoupdate.getInstance().getVersion("version 1.1").toString()); - } - - public void testGotVersion() { - String desc = NbBundle.getBundle("org/netbeans/modules/bugzilla/Bundle").getString("OpenIDE-Module-Long-Description"); - BugzillaVersion version = BugzillaAutoupdate.getInstance().getVersion(desc); - assertNotNull(version); - assertEquals(BugzillaAutoupdate.SUPPORTED_BUGZILLA_VERSION.toString(), version.toString()); - } - - private BugzillaVersion getHigherMicro(String version) { - String[] segments = version == null ? new String[0] : version.split("\\."); //$NON-NLS-1$ - int major = segments.length > 0 ? toInt(segments[0]) : 0; - int minor = segments.length > 1 ? toInt(segments[1]) : 0; - int micro = segments.length > 2 ? toInt(segments[2]) : 0; - return new BugzillaVersion(new String("" + major + "." + minor + "." + ++micro)); - } - - private BugzillaVersion getHigherMinor(String version) { - String[] segments = version == null ? new String[0] : version.split("\\."); //$NON-NLS-1$ - int major = segments.length > 0 ? toInt(segments[0]) : 0; - int minor = segments.length > 1 ? toInt(segments[1]) : 0; - int micro = segments.length > 2 ? toInt(segments[2]) : 0; - return new BugzillaVersion(new String("" + major + "." + ++minor + "." + micro)); - } - - private BugzillaVersion getHigherMajor(String version) { - String[] segments = version == null ? new String[0] : version.split("\\."); //$NON-NLS-1$ - int major = segments.length > 0 ? toInt(segments[0]) : 0; - int minor = segments.length > 1 ? toInt(segments[1]) : 0; - int micro = segments.length > 2 ? toInt(segments[2]) : 0; - return new BugzillaVersion(new String("" + ++major + "." + minor + "." + micro)); - } - - private BugzillaVersion getLower(String version) { - String[] segments = version == null ? new String[0] : version.split("\\."); //$NON-NLS-1$ - int major = segments.length > 0 ? toInt(segments[0]) : 0; - int minor = segments.length > 1 ? toInt(segments[1]) : 0; - int micro = segments.length > 2 ? toInt(segments[2]) : 0; - if(micro > 0) { - micro--; - } else { - if(minor > 0) { - minor--; - } else { - major--; - } - } - return new BugzillaVersion(new String("" + major + "." + minor + "." + ++micro)); - } - - private int toInt(String segment) { - try { - return segment.length() == 0 ? 0 : Integer.parseInt(getVersion(segment)); - } catch (NumberFormatException e) { - return 0; - } - } - - private String getVersion(String segment) { - int n = segment.indexOf('-'); - return n == -1 ? segment : segment.substring(0, n); - } - - @Override - protected AutoupdateSupport getAutoupdateSupport() { - return BugzillaAutoupdate.getInstance().getAutoupdateSupport(); - } - - @Override - protected String getContentFormat() { - return CATALOG_CONTENTS_FORMAT; - } - - @Override - protected String getCNB() { - return BugzillaAutoupdate.BUGZILLA_MODULE_CODE_NAME; - } - -} diff --git a/ide/bugzilla/test/unit/src/org/netbeans/modules/bugzilla/autoupdate/BugzillaSupportedTest.java b/ide/bugzilla/test/unit/src/org/netbeans/modules/bugzilla/autoupdate/BugzillaSupportedTest.java deleted file mode 100644 index ed039702cdee..000000000000 --- a/ide/bugzilla/test/unit/src/org/netbeans/modules/bugzilla/autoupdate/BugzillaSupportedTest.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.netbeans.modules.bugzilla.autoupdate; - -import org.eclipse.mylyn.internal.bugzilla.core.BugzillaVersion; -import org.netbeans.junit.NbTestCase; -import org.netbeans.modules.bugzilla.TestConstants; -import static org.netbeans.modules.bugzilla.TestConstants.REPO_PASSWD; -import static org.netbeans.modules.bugzilla.TestConstants.REPO_URL; -import static org.netbeans.modules.bugzilla.TestConstants.REPO_USER; -import org.netbeans.modules.bugzilla.TestUtil; - - -/** - * - * @author tomas - */ -public class BugzillaSupportedTest extends NbTestCase implements TestConstants { - - public BugzillaSupportedTest(String testName) { - super(testName); - } - - @Override - protected void setUp() throws Exception { - System.setProperty("netbeans.user", getWorkDir().getAbsolutePath()); - System.setProperty("netbeans.t9y.bugzilla.supported.version", "9999.9999.9999"); // should be enough - super.setUp(); - } - - public void testIsSupportedBugzillaVersion() { - BugzillaVersion version = BugzillaAutoupdate.getInstance().getServerVersion(TestUtil.getRepository("test", REPO_URL, REPO_USER, REPO_PASSWD)); - assertTrue(BugzillaAutoupdate.getInstance().isSupportedVersion(version)); - } - -} diff --git a/ide/bugzilla/test/unit/src/org/netbeans/modules/bugzilla/commands/ExceptionHandlerTest.java b/ide/bugzilla/test/unit/src/org/netbeans/modules/bugzilla/commands/ExceptionHandlerTest.java deleted file mode 100644 index 53bb6c485a61..000000000000 --- a/ide/bugzilla/test/unit/src/org/netbeans/modules/bugzilla/commands/ExceptionHandlerTest.java +++ /dev/null @@ -1,232 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.netbeans.modules.bugzilla.commands; - -import java.io.File; -import java.io.IOException; -import java.lang.reflect.Field; -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; -import java.net.Proxy; -import java.net.ProxySelector; -import java.net.SocketAddress; -import java.net.URI; -import java.util.Collections; -import java.util.List; -import org.netbeans.modules.bugzilla.*; -import java.util.logging.Level; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.mylyn.commons.net.WebUtil; -import org.eclipse.mylyn.internal.bugzilla.core.BugzillaRepositoryConnector; -import org.eclipse.mylyn.internal.tasks.core.TaskRepositoryManager; -import org.eclipse.mylyn.tasks.core.data.TaskAttribute; -import org.eclipse.mylyn.tasks.core.data.TaskData; -import org.netbeans.junit.NbTestCase; -import org.netbeans.junit.RandomlyFails; -import org.netbeans.modules.bugtracking.spi.RepositoryInfo; -import static org.netbeans.modules.bugzilla.TestConstants.REPO_PASSWD; -import static org.netbeans.modules.bugzilla.TestConstants.REPO_URL; -import static org.netbeans.modules.bugzilla.TestConstants.REPO_USER; -import org.netbeans.modules.bugzilla.issue.BugzillaIssue; -import org.netbeans.modules.bugzilla.issue.IssueTestUtils; -import org.netbeans.modules.bugzilla.repository.BugzillaRepository; -import org.netbeans.modules.mylyn.util.MylynSupport; - -/** - * - * @author tomas - */ -public class ExceptionHandlerTest extends NbTestCase implements TestConstants { - public static final String EXCEPTION_HANDLER_CLASS_NAME = "org.netbeans.modules.bugzilla.commands.BugzillaExecutor$ExceptionHandler"; - private TaskRepositoryManager trm; - private BugzillaRepositoryConnector brc; - private ProxySelector defaultPS; - - public ExceptionHandlerTest(String arg0) { - super(arg0); - } - - @Override - protected Level logLevel() { - return Level.ALL; - } - - @Override - protected void setUp() throws Exception { - super.setUp(); - System.setProperty("netbeans.user", getWorkDir().getAbsolutePath()); - - // reset - Method m = MylynSupport.class.getDeclaredMethod("reset", new Class[0]); - m.setAccessible(true); - m.invoke(MylynSupport.class); - - Field f = Bugzilla.class.getDeclaredField("instance"); - f.setAccessible(true); - f.set(Bugzilla.class, null); - - brc = Bugzilla.getInstance().getRepositoryConnector(); - - WebUtil.init(); - - if (defaultPS == null) { - defaultPS = ProxySelector.getDefault(); - } - } - - @Override - protected void tearDown() throws Exception { - super.tearDown(); - ProxySelector.setDefault(defaultPS); - } - - @RandomlyFails - public void testIsLoginHandler() throws Throwable { - RepositoryInfo info = new RepositoryInfo("bgzll", BugzillaConnector.ID, REPO_URL, "bgzll", "bgzll", "XXX", null , "XXX".toCharArray(), null); - BugzillaRepository repository = new BugzillaRepository(info); - repository.ensureCredentials(); - assertHandler(repository, "LoginHandler"); - - info = new RepositoryInfo("bgzll", BugzillaConnector.ID, REPO_URL, "bgzll", "bgzll", REPO_USER, null , "XXX".toCharArray(), null); - repository = new BugzillaRepository(info); - repository.ensureCredentials(); - assertHandler(repository, "LoginHandler"); - - } - - public void testIsNotFoundHandler() throws Throwable { - ProxySelector ps = new ProxySelector() { - @Override - public List select(URI uri) { - return Collections.singletonList(Proxy.NO_PROXY); - } - @Override - public void connectFailed(URI uri, SocketAddress sa, IOException ioe) { - throw new UnsupportedOperationException("Not supported yet."); - } - }; - ProxySelector.setDefault(ps); - - RepositoryInfo info = new RepositoryInfo("bgzll", BugzillaConnector.ID, "http://crap", "bgzll", "bgzll", null, null, null , null); - BugzillaRepository repository = new BugzillaRepository(info); - repository.ensureCredentials(); - assertHandler(repository, "NotFoundHandler"); - } - - public void testIsDefaultHandler() throws Throwable { - ProxySelector ps = new ProxySelector() { - @Override - public List select(URI uri) { - return Collections.singletonList(Proxy.NO_PROXY); - } - @Override - public void connectFailed(URI uri, SocketAddress sa, IOException ioe) { - throw new UnsupportedOperationException("Not supported yet."); - } - }; - ProxySelector.setDefault(ps); - - RepositoryInfo info = new RepositoryInfo("bgzll", BugzillaConnector.ID, "dil://dil.com", "bgzll", "bgzll", null, null, null , null); - BugzillaRepository repository = new BugzillaRepository(info); - repository.ensureCredentials(); - assertHandler(repository, "DefaultHandler"); - - info = new RepositoryInfo("bgzll", BugzillaConnector.ID, "crap", "bgzll", "bgzll", null, null, null , null); - repository = new BugzillaRepository(info); - repository.ensureCredentials(); - assertHandler(repository, "DefaultHandler"); - - // XXX need more tests - } - - public void testIsMidAirHandler() throws Throwable { - BugzillaRepository repository = TestUtil.getRepository("test", REPO_URL, REPO_USER, REPO_PASSWD); - - String id = TestUtil.createIssue(repository, "testIsMidairHandler"); - - TaskData data1 = TestUtil.getTaskData(repository.getTaskRepository(), id); - TaskAttribute ta1 = data1.getRoot().createMappedAttribute(TaskAttribute.COMMENT_NEW); - ta1.setValue("comment1"); - - // add comment bypassing data1 to cause a midair collision - TaskData data2 = TestUtil.getTaskData(repository.getTaskRepository(), id); - TaskAttribute ta2 = data2.getRoot().createMappedAttribute(TaskAttribute.COMMENT_NEW); - ta2.setValue("midairingcomment"); - TestUtil.postTaskData(brc, repository.getTaskRepository(), data2); - - try { - TestUtil.postTaskData(brc, repository.getTaskRepository(), data1); - } catch (CoreException ex) { - assertEquals(EXCEPTION_HANDLER_CLASS_NAME + "$" + "MidAirHandler", getHandler(repository, ex).getClass().getName()); - } catch (Exception ex) { - TestUtil.handleException(ex); - } - } - - public void testRefreshConfigOnMidAir() throws Throwable { - BugzillaRepository repository = TestUtil.getRepository("test", REPO_URL, REPO_USER, REPO_PASSWD); - - String id = TestUtil.createIssue(repository, "testRefreshConfigOnMidAir"); - - BugzillaIssue issue = repository.getIssue(id); - issue.addComment("comment1"); - - // add comment bypassing the issue to cause a midair collision - TaskData data2 = TestUtil.getTaskData(repository.getTaskRepository(), id); - TaskAttribute ta2 = data2.getRoot().createMappedAttribute(TaskAttribute.COMMENT_NEW); - ta2.setValue("midairingcomment"); - TestUtil.postTaskData(brc, repository.getTaskRepository(), data2); - - // try to submit - LogHandler lhExecute = new LogHandler("execute SubmitTaskCommand [task #"+id, LogHandler.Compare.STARTS_WITH, LogHandler.DEFAULT_TIMEOUT, 2); - LogHandler lhRefresh = new LogHandler(" Refresh bugzilla configuration", LogHandler.Compare.STARTS_WITH, LogHandler.DEFAULT_TIMEOUT, 1); - System.setProperty("netbeans.t9y.throwOnClientError", "true"); - - Throwable st = null; - try { - IssueTestUtils.submit(issue); - } catch (Throwable t) { - st = t; - } - lhExecute.waitUntilDone(); - lhRefresh.waitUntilDone(); - assertEquals(2, lhExecute.getInterceptedCount()); - assertTrue(lhRefresh.isDone()); - assertTrue(st.getMessage().contains("Mid-air collision occurred while submitting")); - } - - private void assertHandler(BugzillaRepository repository, String name) throws Throwable { - try { - brc.getClientManager().getClient(repository.getTaskRepository(), NULL_PROGRESS_MONITOR).validate(NULL_PROGRESS_MONITOR); - } catch (CoreException ex) { - assertEquals(EXCEPTION_HANDLER_CLASS_NAME + "$" + name, getHandler(repository, ex).getClass().getName()); - } catch (Exception ex) { - TestUtil.handleException(ex); - } - } - - private Object getHandler(BugzillaRepository repository, CoreException ce) throws NoSuchMethodException, IllegalAccessException, IllegalArgumentException, InvocationTargetException, ClassNotFoundException { - BugzillaExecutor executor = repository.getExecutor(); - Class c = Class.forName(EXCEPTION_HANDLER_CLASS_NAME); - Method m = c.getDeclaredMethod("createHandler", CoreException.class, BugzillaExecutor.class, BugzillaRepository.class, ValidateCommand.class, boolean.class); - m.setAccessible(true); - return m.invoke(executor, new Object[]{ce, executor, repository, null, true}); - } -} diff --git a/ide/bugzilla/test/unit/src/org/netbeans/modules/bugzilla/issue/AttachmentHyperlinkSupportTest.java b/ide/bugzilla/test/unit/src/org/netbeans/modules/bugzilla/issue/AttachmentHyperlinkSupportTest.java deleted file mode 100644 index 524917c445bf..000000000000 --- a/ide/bugzilla/test/unit/src/org/netbeans/modules/bugzilla/issue/AttachmentHyperlinkSupportTest.java +++ /dev/null @@ -1,243 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.netbeans.modules.bugzilla.issue; - -import java.util.ArrayList; -import java.util.Collection; -import org.junit.Test; -import static org.junit.Assert.*; -import org.netbeans.modules.bugzilla.issue.AttachmentHyperlinkSupport.Attachement; - -/** - * - * @author Marian Petras - */ -public class AttachmentHyperlinkSupportTest { - - public AttachmentHyperlinkSupportTest() { - } - - @Test - public void test() { - checkBoundaries("", null, null); - checkBoundaries("C", null, null); - checkBoundaries("(id=123)", null, null); - - checkBoundaries("Created an attachment", null, null); - checkBoundaries("Created an attachment (id=", null, null); - checkBoundaries("Created an attachment (id=1", null, null); - checkBoundaries("Created an attachment (id=12", null, null); - checkBoundaries("Created an attachment (id=123", null, null); - checkBoundaries("Created an attachment (id=)", null, null); - checkBoundaries("Created an attachment (id=1)", "attachment (id=1)", "1"); - checkBoundaries("Created an attachment (id=12)", "attachment (id=12)", "12"); - checkBoundaries("Created an attachment (id=123)", "attachment (id=123)", "123"); - checkBoundaries("Created an atmachment (id=123)", null, null); - checkBoundaries("Created an attachment (id=1a5)", null, null); - checkBoundaries("Created an attachment (id=123) [details]", "attachment (id=123)", "123"); - checkBoundaries("Created an attachment (id=123) [details]", "attachment (id=123)", "123"); - checkBoundaries("Created an attachment (id=123)\t[details]", "attachment (id=123)", "123"); - checkBoundaries("Created an attachment (id=123)\t\t[details]", "attachment (id=123)", "123"); - checkBoundaries("Created an attachment (id=123)\t [details]", "attachment (id=123)", "123"); - checkBoundaries("Created an attachment (id=123) \t[details]", "attachment (id=123)", "123"); - checkBoundaries("Created an attachment (id=123) [details] ", "attachment (id=123)", "123"); - checkBoundaries("Created an attachment (id=123) [details] ", "attachment (id=123)", "123"); - checkBoundaries("Created an attachment (id=123) [details]\t", "attachment (id=123)", "123"); - checkBoundaries("Created an attachment (id=123) [details]\t\t", "attachment (id=123)", "123"); - checkBoundaries("Created an attachment (id=123) [details]\t ", "attachment (id=123)", "123"); - checkBoundaries("Created an attachment (id=123) [details] \t", "attachment (id=123)", "123"); - checkBoundaries("Created an attachment (id=123) [details]\n", "attachment (id=123)", "123"); - checkBoundaries("Created an attachment (id=123) [details] \n", "attachment (id=123)", "123"); - checkBoundaries("Created an attachment (id=123) [details] \n", "attachment (id=123)", "123"); - checkBoundaries("Created an attachment (id=123) [details]\t\n", "attachment (id=123)", "123"); - checkBoundaries("Created an attachment (id=123) [details]\t\t\n", "attachment (id=123)", "123"); - checkBoundaries("Created an attachment (id=123) [details]\t \n", "attachment (id=123)", "123"); - checkBoundaries("Created an attachment (id=123) [details] \t\n", "attachment (id=123)", "123"); - checkBoundaries("Created an attachment (id=123) [details] \n ", "attachment (id=123)", "123"); - checkBoundaries("Created an attachment (id=123) [details]\t\n ", "attachment (id=123)", "123"); - checkBoundaries("Created an attachment (id=123)\nfoo", "foo", "123"); - checkBoundaries("Created an attachment (id=123)\n\tfoo", "foo", "123"); - checkBoundaries("Created an attachment (id=123)\n \tfoo", "foo", "123"); - checkBoundaries("Created an attachment (id=123)\n\t foo", "foo", "123"); - checkBoundaries("Created an attachment (id=123)\t\nfoo", "foo", "123"); - checkBoundaries("Created an attachment (id=123)\t\t\n\t\tfoo", "foo", "123"); - checkBoundaries("Created an attachment (id=123)\t\t\n\t\tfoo\tbar", "foo\tbar", "123"); - checkBoundaries("Created an attachment (id=123)\t \n \tfoo\tbar", "foo\tbar", "123"); - checkBoundaries("Created an attachment (id=123)\t \n \tfoo\tbar baz", "foo\tbar baz", "123"); - checkBoundaries("Created an attachment (id=123)\t \n \tfoo\tbar baz", "foo\tbar baz", "123"); - checkBoundaries("Created an attachment (id=123)\t \n \tfoo bar\nbaz", "foo bar", "123"); - checkBoundaries("Created an attachment (id=123) [details]\nfoo", "foo", "123"); - checkBoundaries("Created an attachment (id=123) [details]\n\tfoo", "foo", "123"); - checkBoundaries("Created an attachment (id=123) [details]\n \tfoo", "foo", "123"); - checkBoundaries("Created an attachment (id=123) [details]\n\t foo", "foo", "123"); - checkBoundaries("Created an attachment (id=123) [details]\t\nfoo", "foo", "123"); - checkBoundaries("Created an attachment (id=123) [details]\t\t\n\t\tfoo", "foo", "123"); - checkBoundaries("Created an attachment (id=123) [details]\t\t\n\t\tfoo\tbar", "foo\tbar", "123"); - checkBoundaries("Created an attachment (id=123) [details]\t \n \tfoo\tbar", "foo\tbar", "123"); - checkBoundaries("Created an attachment (id=123) [details]\t \n \tfoo\tbar baz", "foo\tbar baz", "123"); - checkBoundaries("Created an attachment (id=123) [details]\t \n \tfoo\tbar baz", "foo\tbar baz", "123"); - checkBoundaries("Created an attachment (id=123) [details]\t \n \tfoo bar\nbaz", "foo bar", "123"); - - checkBoundaries("Created an attachment (id=123)\nScreenshot", "Screenshot", "123"); - checkBoundaries("Created an attachment (id=123)\n\nScreenshot", "attachment (id=123)", "123"); - checkBoundaries("Created an attachment (id=123) [details]\nScreenshot", "Screenshot", "123"); - checkBoundaries("Created an attachment (id=123) [details]\n\nScreenshot", "attachment (id=123)", "123"); - - checkBoundaries("Created an attachment (id=92562)\n" - + "Screenshot\n" - + '\n' - + "I used NetBeans without connection to internet and when I tried to generate javadoc for openide.util project, strange dialog appeared. I suspect it is warning from Kenai about inability to connect to network.\n" - + '\n' - + "The dialog is shown when I right-click a node. This is not the right time to display dialogs (from UI point of view) nor to check internet connectivity (from performance point of view).\n" - + '\n' - + "Please eliminate such checks at this time.", - "Screenshot", - "92562"); - - checkBoundaries("Created an attachment (id=123)", "attachment (id=123)", "123"); - checkBoundaries("Created an attachment (id=123)", new int[] {}, null, null); - checkBoundaries("Created an attachment (id=123)", new int[] {123}, "attachment (id=123)", "123"); - checkBoundaries("Created an attachment (id=123)", new int[] {123, 789}, "attachment (id=123)", "123"); - checkBoundaries("Created an attachment (id=789)", new int[] {123, 789}, "attachment (id=789)", "789"); - checkBoundaries("Created an attachment (id=456)", new int[] {123, 456, 789}, "attachment (id=456)", "456"); - checkBoundaries("Created an attachment (id=456)", new int[] {123, 473, 789}, null, null); - - checkBoundaries("Created attachment", null, null); - checkBoundaries("Created attachment (id=", null, null); - checkBoundaries("Created attachment 1", null, null); - checkBoundaries("Created attachment 12", null, null); - checkBoundaries("Created attachment 123", null, null); - checkBoundaries("Created attachment )", null, null); - checkBoundaries("Created attachment 1", new int[] {1}, "attachment 1", "1"); - checkBoundaries("Created attachment 12", new int[] {12}, "attachment 12", "12"); - checkBoundaries("Created attachment 123", new int[] {123}, "attachment 123", "123"); - checkBoundaries("Created atmachment 123", null, null); - checkBoundaries("Created attachment 1a5", null, null); - checkBoundaries("Created attachment 123 [details]", new int[] {123}, "attachment 123", "123"); - checkBoundaries("Created attachment 123 [details]", new int[] {123}, "attachment 123", "123"); - checkBoundaries("Created attachment 123\t[details]", new int[] {123}, "attachment 123", "123"); - checkBoundaries("Created attachment 123\t\t[details]", new int[] {123}, "attachment 123", "123"); - checkBoundaries("Created attachment 123\t [details]", new int[] {123}, "attachment 123", "123"); - checkBoundaries("Created attachment 123 \t[details]", new int[] {123}, "attachment 123", "123"); - checkBoundaries("Created attachment 123 [details] ", new int[] {123}, "attachment 123", "123"); - checkBoundaries("Created attachment 123 [details] ", new int[] {123}, "attachment 123", "123"); - checkBoundaries("Created attachment 123 [details]\t", new int[] {123}, "attachment 123", "123"); - checkBoundaries("Created attachment 123 [details]\t\t", new int[] {123}, "attachment 123", "123"); - checkBoundaries("Created attachment 123 [details]\t ", new int[] {123}, "attachment 123", "123"); - checkBoundaries("Created attachment 123 [details] \t", new int[] {123}, "attachment 123", "123"); - checkBoundaries("Created attachment 123 [details]\n", new int[] {123}, "attachment 123", "123"); - checkBoundaries("Created attachment 123 [details] \n", new int[] {123}, "attachment 123", "123"); - checkBoundaries("Created attachment 123 [details] \n", new int[] {123}, "attachment 123", "123"); - checkBoundaries("Created attachment 123 [details]\t\n", new int[] {123}, "attachment 123", "123"); - checkBoundaries("Created attachment 123 [details]\t\t\n", new int[] {123}, "attachment 123", "123"); - checkBoundaries("Created attachment 123 [details]\t \n", new int[] {123}, "attachment 123", "123"); - checkBoundaries("Created attachment 123 [details] \t\n", new int[] {123}, "attachment 123", "123"); - checkBoundaries("Created attachment 123 [details] \n ", new int[] {123}, "attachment 123", "123"); - checkBoundaries("Created attachment 123 [details]\t\n ", new int[] {123}, "attachment 123", "123"); - checkBoundaries("Created attachment 123\nfoo", new int[] {123}, "foo", "123"); - checkBoundaries("Created attachment 123\n\tfoo", new int[] {123}, "foo", "123"); - checkBoundaries("Created attachment 123\n \tfoo", new int[] {123}, "foo", "123"); - checkBoundaries("Created attachment 123\n\t foo", new int[] {123}, "foo", "123"); - checkBoundaries("Created attachment 123\t\nfoo", new int[] {123}, "foo", "123"); - checkBoundaries("Created attachment 123\t\t\n\t\tfoo", new int[] {123}, "foo", "123"); - checkBoundaries("Created attachment 123\t\t\n\t\tfoo\tbar", new int[] {123}, "foo\tbar", "123"); - checkBoundaries("Created attachment 123\t \n \tfoo\tbar", new int[] {123}, "foo\tbar", "123"); - checkBoundaries("Created attachment 123\t \n \tfoo\tbar baz", new int[] {123}, "foo\tbar baz", "123"); - checkBoundaries("Created attachment 123\t \n \tfoo\tbar baz", new int[] {123}, "foo\tbar baz", "123"); - checkBoundaries("Created attachment 123\t \n \tfoo bar\nbaz", new int[] {123}, "foo bar", "123"); - checkBoundaries("Created attachment 123 [details]\nfoo", new int[] {123}, "foo", "123"); - checkBoundaries("Created attachment 123 [details]\n\tfoo", new int[] {123}, "foo", "123"); - checkBoundaries("Created attachment 123 [details]\n \tfoo", new int[] {123}, "foo", "123"); - checkBoundaries("Created attachment 123 [details]\n\t foo", new int[] {123}, "foo", "123"); - checkBoundaries("Created attachment 123 [details]\t\nfoo", new int[] {123}, "foo", "123"); - checkBoundaries("Created attachment 123 [details]\t\t\n\t\tfoo", new int[] {123}, "foo", "123"); - checkBoundaries("Created attachment 123 [details]\t\t\n\t\tfoo\tbar", new int[] {123}, "foo\tbar", "123"); - checkBoundaries("Created attachment 123 [details]\t \n \tfoo\tbar", new int[] {123}, "foo\tbar", "123"); - checkBoundaries("Created attachment 123 [details]\t \n \tfoo\tbar baz", new int[] {123}, "foo\tbar baz", "123"); - checkBoundaries("Created attachment 123 [details]\t \n \tfoo\tbar baz", new int[] {123}, "foo\tbar baz", "123"); - checkBoundaries("Created attachment 123 [details]\t \n \tfoo bar\nbaz", new int[] {123}, "foo bar", "123"); - - checkBoundaries("Created attachment 123\nScreenshot", new int[] {123}, "Screenshot", "123"); - checkBoundaries("Created attachment 123\n\nattachment", new int[] {123}, "attachment 123", "123"); - checkBoundaries("Created attachment 123 [details]\nScreenshot", new int[] {123}, "Screenshot", "123"); - checkBoundaries("Created attachment 123 [details]\n\nattachment", new int[] {123}, "attachment 123", "123"); - - checkBoundaries("Created attachment 92562\n" - + "Screenshot\n" - + '\n' - + "I used NetBeans without connection to internet and when I tried to generate javadoc for openide.util project, strange dialog appeared. I suspect it is warning from Kenai about inability to connect to network.\n" - + '\n' - + "The dialog is shown when I right-click a node. This is not the right time to display dialogs (from UI point of view) nor to check internet connectivity (from performance point of view).\n" - + '\n' - + "Please eliminate such checks at this time.", - new int[] {92562}, - "Screenshot", - "92562"); - - checkBoundaries("Created attachment 123", new int[] {}, null, null); - checkBoundaries("Created attachment 123", new int[] {123}, "attachment 123", "123"); - checkBoundaries("Created attachment 123", new int[] {123, 789}, "attachment 123", "123"); - checkBoundaries("Created attachment 789", new int[] {123, 789}, "attachment 789", "789"); - checkBoundaries("Created attachment 456", new int[] {123, 456, 789}, "attachment 456", "456"); - checkBoundaries("Created attachment 456", new int[] {123, 473, 789}, null, null); - } - - private void checkBoundaries(String stringToParse, - String expectedHyperlinkText, - String expectedId) { - checkBoundaries(stringToParse, null, expectedHyperlinkText, expectedId); - } - - private void checkBoundaries(String stringToParse, - int[] knownIds, - String expectedHyperlinkText, - String expectedId) { - int[] expected; - if (expectedHyperlinkText == null) { - expected = null; - } else { - int index = stringToParse.indexOf(expectedHyperlinkText); - assert index != -1; - expected = new int[] {index, index + expectedHyperlinkText.length()}; - } - - Collection knownIdsColl; - if (knownIds != null) { - knownIdsColl = new ArrayList(knownIds.length); - for (int knownId : knownIds) { - knownIdsColl.add(Integer.toString(knownId)); - } - } else { - knownIdsColl = null; - } - - Attachement attachment = AttachmentHyperlinkSupport.findAttachment(stringToParse, knownIdsColl); - - if (expected != null) { - assertNotNull(attachment); - assertEquals(expected[0], attachment.idx1); - assertEquals(expected[1], attachment.idx2); - assertEquals(expectedId, attachment.id); - } else { - assertNull(attachment); - } - } - -} \ No newline at end of file diff --git a/ide/bugzilla/test/unit/src/org/netbeans/modules/bugzilla/issue/CurrentNBVersionTest.java b/ide/bugzilla/test/unit/src/org/netbeans/modules/bugzilla/issue/CurrentNBVersionTest.java deleted file mode 100644 index 7833ac53206f..000000000000 --- a/ide/bugzilla/test/unit/src/org/netbeans/modules/bugzilla/issue/CurrentNBVersionTest.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.netbeans.modules.bugzilla.issue; - -import java.util.regex.Matcher; -import java.util.regex.Pattern; -import org.netbeans.junit.NbTestCase; - -/** - * - * @author tomas - */ -public class CurrentNBVersionTest extends NbTestCase { - - public CurrentNBVersionTest(String arg0) { - super(arg0); - } - - @Override - protected void setUp() throws Exception { - super.setUp(); - - } - - public void testVersionParsing() { - - assertEquals("Dev", IssuePanel.parseProductVersion("NetBeans IDE Dev 101010-000000000000")); - assertEquals("Dev", IssuePanel.parseProductVersion("NetBeans IDE Dev")); - assertEquals("Dev", IssuePanel.parseProductVersion("NetBeans IDE Dev ")); - assertEquals("6.9", IssuePanel.parseProductVersion("NetBeans IDE 6.9 101010-000000000000")); - assertEquals("6.9.1", IssuePanel.parseProductVersion("NetBeans IDE 6.9.1 101010-000000000000")); - assertEquals("6.9", IssuePanel.parseProductVersion("NetBeans IDE 6.9")); - assertEquals("6.9", IssuePanel.parseProductVersion("NetBeans IDE 6.9 ")); - assertEquals("6.9.1", IssuePanel.parseProductVersion("NetBeans IDE 6.9.1")); - assertEquals("6.9.1", IssuePanel.parseProductVersion("NetBeans IDE 6.9.1 ")); - assertEquals("6.9.1", IssuePanel.parseProductVersion("NetBeans IDE 6.9.1 6.9.1")); - - assertNull(IssuePanel.parseProductVersion("xxx")); - assertNull(IssuePanel.parseProductVersion("NetBeans IDE")); - } - -} diff --git a/ide/bugzilla/test/unit/src/org/netbeans/modules/bugzilla/issue/IssueTest.java b/ide/bugzilla/test/unit/src/org/netbeans/modules/bugzilla/issue/IssueTest.java deleted file mode 100644 index 00161176e4e9..000000000000 --- a/ide/bugzilla/test/unit/src/org/netbeans/modules/bugzilla/issue/IssueTest.java +++ /dev/null @@ -1,376 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.netbeans.modules.bugzilla.issue; - -import java.io.File; -import java.io.FileWriter; -import java.io.IOException; -import java.lang.reflect.Field; -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; -import java.util.ArrayList; -import java.util.List; -import java.util.logging.Handler; -import java.util.logging.LogRecord; -import org.eclipse.core.runtime.CoreException; -import org.netbeans.modules.bugzilla.*; -import java.util.logging.Level; -import javax.swing.SwingUtilities; -import junit.framework.Test; -import org.eclipse.mylyn.internal.bugzilla.core.BugzillaRepositoryConnector; -import org.eclipse.mylyn.tasks.core.data.TaskAttribute; -import org.eclipse.mylyn.tasks.core.data.TaskData; -import org.netbeans.junit.NbModuleSuite; -import org.netbeans.junit.NbTestCase; -import org.netbeans.modules.bugtracking.BugtrackingManager; -import org.netbeans.modules.bugtracking.util.BugtrackingUtil; -import org.netbeans.modules.bugzilla.repository.BugzillaRepository; -import org.netbeans.modules.bugzilla.repository.IssueField; -import org.netbeans.modules.bugzilla.repository.RepositoryTest; -import org.netbeans.modules.bugzilla.util.BugzillaUtil; -import org.netbeans.modules.mylyn.util.MylynSupport; -import org.netbeans.modules.mylyn.util.NbTask; -import org.netbeans.modules.mylyn.util.SubmitCommand; -import org.openide.util.test.MockLookup; - -/** - * - * @author tomas - */ -public class IssueTest extends NbTestCase implements TestConstants { - - private static final String REPO_NAME = "Beautiful"; - - public IssueTest(String arg0) { - super(arg0); - } - - @Override - protected Level logLevel() { - return Level.ALL; - } - - @Override - protected void setUp() throws Exception { - super.setUp(); - - // reset - Method m = MylynSupport.class.getDeclaredMethod("reset", new Class[0]); - m.setAccessible(true); - m.invoke(MylynSupport.class); - - Field f = Bugzilla.class.getDeclaredField("instance"); - f.setAccessible(true); - f.set(Bugzilla.class, null); - - System.setProperty("netbeans.user", getWorkDir().getAbsolutePath()); - MockLookup.setLayersAndInstances(); - BugtrackingUtil.getBugtrackingConnectors(); // ensure conector - } - - public static Test suite () { - return NbModuleSuite.createConfiguration(IssueTest.class).gui(false).suite(); - } - - public void testIsFinished() throws Throwable { - BugzillaRepository br = TestUtil.getRepository("test", REPO_URL, REPO_USER, REPO_PASSWD); - String id = TestUtil.createIssue(br, "testIsFinished "); - BugzillaIssue issue = (BugzillaIssue) getRepository().getIssue(id); - assertFalse(issue.isFinished()); - issue.resolve("FIXED"); - issue.submitAndRefresh(); - assertTrue(issue.isFinished()); - } - - public void testCC() throws Throwable { - // WARNING: the test assumes that there are more than one value - // for atributes like platform, versions etc. - - long ts = System.currentTimeMillis(); - String summary = "somary" + ts; - String id = TestUtil.createIssue(getRepository(), summary); - BugzillaIssue issue = (BugzillaIssue) getRepository().getIssue(id); - openTask(issue); - assertEquals(summary, issue.getFieldValue(IssueField.SUMMARY)); - - resetStatusValues(issue); - - BugzillaRepository repository = getRepository(); - BugzillaRepositoryConnector brc = new BugzillaRepositoryConnector(new File(getWorkDir().getAbsolutePath(), "bugzillaconfiguration")); - NbTask task = BugzillaUtil.getTask(repository, id, false); - TaskData td = task.getTaskDataState().getRepositoryData(); - - // add a cc - assertNotSame(REPO_USER, issue.getFieldValue(IssueField.CC)); - setFieldValue(td, IssueField.NEWCC, REPO_USER); - getRepository().getExecutor().execute(new SubmitCommand(brc, getRepository().getTaskRepository(), td)); - issue.refresh(); - - assertEquals(REPO_USER, issue.getFieldValue(IssueField.CC)); - assertStatus(BugzillaIssue.FIELD_STATUS_MODIFIED, issue, IssueField.CC); - - resetStatusValues(issue); - - // add new cc - td = task.getTaskDataState().getRepositoryData(); - setFieldValue(td, IssueField.NEWCC, REPO_USER2); - getRepository().getExecutor().execute(new SubmitCommand(brc, getRepository().getTaskRepository(), td)); - issue.refresh(); - - List ccs = issue.getFieldValues(IssueField.CC); - assertEquals(2, ccs.size()); - assertTrue(ccs.contains(REPO_USER)); - assertTrue(ccs.contains(REPO_USER2)); - assertStatus(BugzillaIssue.FIELD_STATUS_MODIFIED, issue, IssueField.CC); - - resetStatusValues(issue); - - // add two cc-s at once - td = task.getTaskDataState().getRepositoryData(); - setFieldValue(td, IssueField.NEWCC, REPO_USER3 + ", " + REPO_USER4); - getRepository().getExecutor().execute(new SubmitCommand(brc, getRepository().getTaskRepository(), td)); - issue.refresh(); - - ccs = issue.getFieldValues(IssueField.CC); - assertEquals(4, ccs.size()); - assertTrue(ccs.contains(REPO_USER)); - assertTrue(ccs.contains(REPO_USER2)); - assertTrue(ccs.contains(REPO_USER3)); - assertTrue(ccs.contains(REPO_USER4)); - assertStatus(BugzillaIssue.FIELD_STATUS_MODIFIED, issue, IssueField.CC); - - resetStatusValues(issue); - - // remove a cc - td = task.getTaskDataState().getRepositoryData(); - ccs = new ArrayList(); - ccs.add(REPO_USER4); - ccs.add(REPO_USER); - setFieldValues(td, IssueField.REMOVECC, ccs); - getRepository().getExecutor().execute(new SubmitCommand(brc, getRepository().getTaskRepository(), td)); - issue.refresh(); - - ccs = issue.getFieldValues(IssueField.CC); - assertEquals(2, ccs.size()); - assertTrue(ccs.contains(REPO_USER2)); - assertTrue(ccs.contains(REPO_USER3)); - assertStatus(BugzillaIssue.FIELD_STATUS_MODIFIED, issue, IssueField.CC); - - resetStatusValues(issue); - - // remove all - td = task.getTaskDataState().getRepositoryData(); - ccs = new ArrayList(); - ccs.add(REPO_USER3); - ccs.add(REPO_USER2); - setFieldValues(td, IssueField.REMOVECC, ccs); - getRepository().getExecutor().execute(new SubmitCommand(brc, getRepository().getTaskRepository(), td)); - issue.refresh(); - ccs = issue.getFieldValues(IssueField.CC); - assertEquals(0, ccs.size()); - assertStatus(BugzillaIssue.FIELD_STATUS_MODIFIED, issue, IssueField.CC); - - } - - // XXX test new issue - - private void addHandler(LogHandler lh) { - BugtrackingManager.LOG.addHandler(lh); - } - - private void assertStatus(int expectedStatus, BugzillaIssue issue, IssueField f) throws IllegalAccessException, IllegalArgumentException, NoSuchMethodException, InvocationTargetException { - int status = issue.getFieldStatus(f); - //System.out.println(issue.getID() + " " + f + " " + getName(expectedStatus) + " " + getName(status) + " " + "[" + issue.getFieldValue(f) + "] vs [" + getSeenValue(issue, f) + "]"); - if(status != expectedStatus) { - fail("expected [" + getName(expectedStatus) + "], " + - "was [" + getName(status)+ "] " + - "because of value [" + issue.getFieldValue(f) + "] "); - } - } - - private String getName(int s) { - switch(s) { - case BugzillaIssue.FIELD_STATUS_IRELEVANT: - return "Irelevant"; - case BugzillaIssue.FIELD_STATUS_MODIFIED : - return "Modified"; - case BugzillaIssue.FIELD_STATUS_UPTODATE : - return "Uptodate"; - case BugzillaIssue.FIELD_STATUS_OUTGOING : - return "Outgoing"; - case BugzillaIssue.FIELD_STATUS_CONFLICT : - return "Conflict"; - default : - throw new IllegalStateException("Wrong status " + s); - } - } - - private BugzillaRepository getRepository() { - return TestUtil.getRepository(REPO_NAME, REPO_URL, REPO_USER, REPO_PASSWD); - } - - private String getOtherKeyword(BugzillaIssue issue) throws IOException, CoreException { - List l = getRepository().getConfiguration().getKeywords(); - return getDifferentServerValue(l, issue.getFieldValue(IssueField.KEYWORDS), IssueField.KEYWORDS.getKey()); - } - - private String getOtherMilestone(BugzillaIssue issue, String product) throws IOException, CoreException { - List l = getRepository().getConfiguration().getTargetMilestones(product); - return getDifferentServerValue(l, issue.getFieldValue(IssueField.MILESTONE), IssueField.MILESTONE.getKey()); - } - - private String getOtherMilestone(BugzillaIssue issue) throws IOException, CoreException { - return getOtherMilestone(issue, TEST_PROJECT); - } - - private String getOtherPlatform(BugzillaIssue issue) throws IOException, CoreException { - List l = getRepository().getConfiguration().getPlatforms(); - return getDifferentServerValue(l, issue.getFieldValue(IssueField.PLATFORM), IssueField.PLATFORM.getKey()); - } - - private String getOtherProduct(BugzillaIssue issue) throws IOException, CoreException { - List l = getRepository().getConfiguration().getProducts(); - return getDifferentServerValue(l, issue.getFieldValue(IssueField.PRODUCT), IssueField.PRODUCT.getKey()); - } - - private String getOtherPriority(BugzillaIssue issue) throws IOException, CoreException { - List l = getRepository().getConfiguration().getPriorities(); - return getDifferentServerValue(l, issue.getFieldValue(IssueField.PRIORITY), IssueField.PRIORITY.getKey()); - } - - private String getOtherVersion(BugzillaIssue issue, String product) throws IOException, CoreException { - List l = getRepository().getConfiguration().getVersions(product); - return getDifferentServerValue(l, issue.getFieldValue(IssueField.VERSION), IssueField.VERSION.getKey()); - } - - private String getOtherVersion(BugzillaIssue issue) throws IOException, CoreException { - return getOtherVersion(issue, TEST_PROJECT); - } - - private String getOtherSeverity(BugzillaIssue issue) throws IOException, CoreException { - List l = getRepository().getConfiguration().getSeverities(); - return getDifferentServerValue(l, issue.getFieldValue(IssueField.SEVERITY), IssueField.SEVERITY.getKey()); - } - - private String getOtherResolution(BugzillaIssue issue) throws IOException, CoreException { - List l = getRepository().getConfiguration().getResolutions(); - return getDifferentServerValue(l, issue.getFieldValue(IssueField.RESOLUTION), IssueField.RESOLUTION.getKey()); - } - - private String getOtherComponent(BugzillaIssue issue, String project) throws IOException, CoreException { - List l = getRepository().getConfiguration().getComponents(project); - return getDifferentServerValue(l, issue.getFieldValue(IssueField.COMPONENT), IssueField.COMPONENT.getKey()); - } - - private String getOtherComponent(BugzillaIssue issue) throws IOException, CoreException { - return getOtherComponent(issue, TEST_PROJECT); - } - - private String getDifferentServerValue(List l, String v, String field) { - if(v != null) { - for (String s : l) { - if(!s.equals(v)) { - return s; - } - } - fail("there is no different value for field " + field + " then [" + v + "] on the server."); - } - return l.get(0); - } - - private void resetStatusValues(BugzillaIssue issue) throws InterruptedException, SecurityException, IOException, IllegalAccessException, IllegalArgumentException, NoSuchMethodException, InvocationTargetException { - issue.setUpToDate(true); - issue.closed(); - openTask(issue); - for (IssueField f : issue.getRepository().getConfiguration().getFields()) { - // seen -> everything's uptodate - assertStatus(BugzillaIssue.FIELD_STATUS_UPTODATE, issue, f); - } - } - - private void submit(BugzillaIssue issue) throws Throwable { - issue.submitAndRefresh(); - } - - private File getAttachmentFile(String content) throws Exception { - FileWriter fw = null; - File f = null; - try { - f = File.createTempFile("bugzillatest", null); - f.deleteOnExit(); - try { - f.createNewFile(); - } catch (IOException ex) { - ex.printStackTrace(); - // ignore - } - fw = new FileWriter(f); - fw.write(content); - fw.flush(); - return f; - } finally { - try { if (fw != null) fw.close(); } catch (IOException iOException) { } - } - } - - private void openTask (BugzillaIssue issue) throws InterruptedException { - // make sure model is loaded - issue.opened(); - for (int i = 0; i < 10; ++i) { - if (!issue.getFieldValue(IssueField.SUMMARY).isEmpty()) { - break; - } - Thread.sleep(1000); - } - } - - private void setFieldValue (TaskData td, IssueField f, String value) { - TaskAttribute a = td.getRoot().getMappedAttribute(f.getKey()); - if(a == null) { - a = new TaskAttribute(td.getRoot(), f.getKey()); - } - a.setValue(value); - } - - private void setFieldValues (TaskData td, IssueField f, List values) { - TaskAttribute a = td.getRoot().getMappedAttribute(f.getKey()); - if(a == null) { - a = new TaskAttribute(td.getRoot(), f.getKey()); - } - a.setValues(values); - } - - private class LogHandler extends Handler { - private final String msg; - private boolean done = false; - public LogHandler(String msg) { - this.msg = msg; - } - - @Override - public void publish(LogRecord record) { - if(!done) done = record.getMessage().startsWith(msg); - } - @Override - public void flush() { } - @Override - public void close() throws SecurityException { } - } -} diff --git a/ide/bugzilla/test/unit/src/org/netbeans/modules/bugzilla/issue/IssueTestUtils.java b/ide/bugzilla/test/unit/src/org/netbeans/modules/bugzilla/issue/IssueTestUtils.java deleted file mode 100644 index 662a8f493782..000000000000 --- a/ide/bugzilla/test/unit/src/org/netbeans/modules/bugzilla/issue/IssueTestUtils.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.netbeans.modules.bugzilla.issue; - -/** - * - * @author tomas - */ -public class IssueTestUtils { - - private IssueTestUtils(){} - - public static void submit(BugzillaIssue issue) { - issue.submitAndRefresh(); - } -} diff --git a/ide/bugzilla/test/unit/src/org/netbeans/modules/bugzilla/issue/OpenIssueTest.java b/ide/bugzilla/test/unit/src/org/netbeans/modules/bugzilla/issue/OpenIssueTest.java deleted file mode 100644 index 173ae648b3ad..000000000000 --- a/ide/bugzilla/test/unit/src/org/netbeans/modules/bugzilla/issue/OpenIssueTest.java +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.netbeans.modules.bugzilla.issue; - -import java.util.logging.Level; -import org.netbeans.junit.NbTestCase; -import org.netbeans.junit.RandomlyFails; -import org.netbeans.modules.bugzilla.TestConstants; -import org.netbeans.modules.bugzilla.TestUtil; -import org.netbeans.modules.bugzilla.LogHandler; -import org.netbeans.modules.bugzilla.repository.BugzillaRepository; -import org.netbeans.modules.bugzilla.util.BugzillaUtil; - -/** - * - * @author tomas - */ -public class OpenIssueTest extends NbTestCase implements TestConstants { - - private static String REPO_NAME = "Beautiful"; - - public OpenIssueTest(String arg0) { - super(arg0); - } - - @Override - protected Level logLevel() { - return Level.ALL; - } - - @Override - protected void setUp() throws Exception { - super.setUp(); - System.setProperty("netbeans.user", getWorkDir().getAbsolutePath()); - } - - @RandomlyFails - public void testOpenNewIssue() throws Throwable { - BugzillaRepository repository = getRepository(); - BugzillaIssue issue = repository.createIssue(); - - LogHandler handler = new LogHandler("open finish", LogHandler.Compare.ENDS_WITH); - BugzillaUtil.openIssue(issue); - handler.waitUntilDone(); - assertTrue(handler.isDone()); - } - - private BugzillaRepository getRepository() { - return TestUtil.getRepository(REPO_NAME, REPO_URL, REPO_USER, REPO_PASSWD); - } -} diff --git a/ide/bugzilla/test/unit/src/org/netbeans/modules/bugzilla/issue/ShowLogActionTest.java b/ide/bugzilla/test/unit/src/org/netbeans/modules/bugzilla/issue/ShowLogActionTest.java deleted file mode 100644 index 3e23247afb45..000000000000 --- a/ide/bugzilla/test/unit/src/org/netbeans/modules/bugzilla/issue/ShowLogActionTest.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.netbeans.modules.bugzilla.issue; - -import org.netbeans.modules.bugzilla.*; -import java.util.logging.Level; -import org.netbeans.junit.NbTestCase; -import org.netbeans.modules.bugtracking.util.BugtrackingUtil; -import org.openide.util.test.MockLookup; - -/** - * - * @author tomas - */ -public class ShowLogActionTest extends NbTestCase implements TestConstants { - - public ShowLogActionTest(String arg0) { - super(arg0); - } - - @Override - protected Level logLevel() { - return Level.ALL; - } - - @Override - protected void setUp() throws Exception { - super.setUp(); - System.setProperty("netbeans.user", getWorkDir().getAbsolutePath()); - MockLookup.setLayersAndInstances(); - BugtrackingUtil.getBugtrackingConnectors(); // ensure conector - } - - public void testGetShowLogAction() throws Throwable { - assertNotNull(IssuePanel.getShowLogAction()); - } - -} diff --git a/ide/bugzilla/test/unit/src/org/netbeans/modules/bugzilla/query/ControllerTest.java b/ide/bugzilla/test/unit/src/org/netbeans/modules/bugzilla/query/ControllerTest.java deleted file mode 100644 index 9a9502c38021..000000000000 --- a/ide/bugzilla/test/unit/src/org/netbeans/modules/bugzilla/query/ControllerTest.java +++ /dev/null @@ -1,205 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.netbeans.modules.bugzilla.query; - -import java.io.UnsupportedEncodingException; -import java.util.logging.LogRecord; -import org.netbeans.modules.bugzilla.*; -import java.net.MalformedURLException; -import java.net.URLEncoder; -import java.util.HashSet; -import java.util.Set; -import java.util.logging.Handler; -import java.util.logging.Level; -import org.eclipse.core.runtime.CoreException; -import org.netbeans.junit.NbTestCase; -import org.netbeans.junit.RandomlyFails; -import org.netbeans.modules.bugtracking.util.BugtrackingUtil; -import org.openide.util.test.MockLookup; - -/** - * - * @author tomas - */ -public class ControllerTest extends NbTestCase implements TestConstants { - - private static String REPO_NAME = "Beautiful"; - private static String QUERY_NAME = "Hilarious"; - - public ControllerTest(String arg0) { - super(arg0); - } - - @Override - protected Level logLevel() { - return Level.ALL; - } - - @Override - protected void setUp() throws Exception { - super.setUp(); - - MockLookup.setLayersAndInstances(); - BugtrackingUtil.getBugtrackingConnectors(); // ensure conector - - System.setProperty("netbeans.user", getWorkDir().getAbsolutePath()); - } - - public void testParameters() throws MalformedURLException, CoreException, InterruptedException, UnsupportedEncodingException { - LogHandler h = new LogHandler("Finnished populate query controller"); - Bugzilla.LOG.addHandler(h); - String parametersUrl = getParametersUrl(); - BugzillaQuery q = new BugzillaQuery(QUERY_NAME, QueryTestUtil.getRepository(), parametersUrl, true, false, true); - QueryController c = q.getController(); - assertParameters(h, parametersUrl, c); - - // lets make sure that what was returned (not encoded) will work next time as well - h.done = false; - parametersUrl = c.getUrlParameters(false); - q = new BugzillaQuery(QUERY_NAME, QueryTestUtil.getRepository(), parametersUrl, true, false, true); - c = q.getController(); - assertParameters(h, parametersUrl, c); - } - - private void assertParameters(LogHandler h, String parametersUrl, QueryController c) throws UnsupportedEncodingException, InterruptedException, IllegalStateException { - // wait while populate - int timeout = 60000; - long ts = System.currentTimeMillis(); - while(!h.done) { - Thread.sleep(500); - if(ts + timeout < System.currentTimeMillis()) throw new IllegalStateException("timeout"); - } - - // get the paramters in an encoded form - String[] parametersGiven = parametersUrl.split("&"); - String params = c.getUrlParameters(true); - assertTrue(params.startsWith("&")); - params = params.substring(1); - String[] parametersReturned = params.split("&"); -// assertEquals(parametersGiven.length, parametersReturned.length); - - Set returnedSet = new HashSet(parametersReturned.length); - for (String string : parametersReturned) { - returnedSet.add(string); - } - for (int i = 1; i < parametersGiven.length; i++) { // skip the first elemenent - its = "" - String p = parametersGiven[i]; - p = handleEncoding(p); // encode provided parameter - if(!returnedSet.contains(p)) { // compare originaly provided with returned - fail("missing given parameter [" + p + "] between returned at index " + i); - } - } - - returnedSet.clear(); - for (String p : parametersGiven) { - p = handleEncoding(p); - returnedSet.add(p); - } - for (int i = 1; i < parametersReturned.length; i++) { // skip the first elemenent - its = "" - String p = parametersReturned[i]; - if(!returnedSet.contains(p)) { - fail("missing returned parameter [" + p + "] between given"); - } - } - } - - private String handleEncoding(String p) throws UnsupportedEncodingException { - int idx = p.indexOf("="); - if(p.contains("Bug+creation")) { - // got some special handling - see also QueryParameter.java - p = p.substring(0, idx + 1) + URLEncoder.encode("[", "UTF-8") + "Bug+creation" + URLEncoder.encode("]", "UTF-8"); - } else { - p = p.substring(0, idx + 1) + URLEncoder.encode(p.substring(idx + 1), "UTF-8"); - } - return p; - } - - private String getParametersUrl() { - return "&short_desc_type=allwordssubstr" + - "&status_whiteboard_type=allwordssubstr" + - "&status_whiteboard=xxx" + - "&short_desc=xxx" + - "&product=some+product" + - "&component=some+component" + - "&version=unspecified" + - "&long_desc_type=substring" + - "&long_desc=xxx" + - "&bug_severity=blocker" + - "&keywords_type=allwords" + - "&keywords=xxx" + - "&bug_status=NEW" + - "&resolution=FIXED" + - "&priority=P1" + - "&target_milestone=" + - "&emailassigned_to1=1&emailreporter1=1&emailcc1=1&emaillongdesc1=1&emailtype1=substring&email1=xxx" + - "&chfieldfrom=2009-01-01&chfieldto=Now" + - "&chfield=[Bug+creation]" + - "&chfield=alias" + - "&chfield=assigned_to" + - "&chfield=cclist_accessible" + - "&chfield=component" + - "&chfield=deadline" + - "&chfield=everconfirmed" + - "&chfield=rep_platform" + - "&chfield=remaining_time" + - "&chfield=work_time" + - "&chfield=keywords" + - "&chfield=estimated_time" + - "&chfield=op_sys" + - "&chfield=priority" + - "&chfield=product" + - "&chfield=qa_contact" + - "&chfield=reporter_accessible" + - "&chfield=resolution" + - "&chfield=bug_severity" + - "&chfield=bug_status" + - "&chfield=short_desc" + - "&chfield=target_milestone" + - "&chfield=bug_file_loc" + - "&chfield=version" + - "&chfield=votes" + - "&chfield=status_whiteboard" + - "&chfieldvalue=xxx"; - } - - private class LogHandler extends Handler { - final String msg; - boolean done = false; - public LogHandler(String msg) { - this.msg = msg; - } - - @Override - public void publish(LogRecord record) { - if(!done) { - done = record.getMessage().startsWith(msg); - } - } - - @Override - public void flush() { - } - - @Override - public void close() throws SecurityException { - } - - } -} diff --git a/ide/bugzilla/test/unit/src/org/netbeans/modules/bugzilla/query/IssueTableTest.java b/ide/bugzilla/test/unit/src/org/netbeans/modules/bugzilla/query/IssueTableTest.java deleted file mode 100644 index 9dde147db046..000000000000 --- a/ide/bugzilla/test/unit/src/org/netbeans/modules/bugzilla/query/IssueTableTest.java +++ /dev/null @@ -1,115 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.netbeans.modules.bugzilla.query; - -import java.text.MessageFormat; -import java.util.HashMap; -import java.util.Map; -import junit.framework.Test; -import org.netbeans.junit.NbTestSuite; -import org.netbeans.modules.bugtracking.api.Query; -import org.netbeans.modules.bugtracking.issuetable.IssueTable; -import org.netbeans.modules.bugtracking.issuetable.IssuetableTestFactory; -import org.netbeans.modules.bugtracking.util.BugtrackingUtil; -import org.netbeans.modules.bugzilla.TestConstants; -import org.netbeans.modules.bugzilla.TestUtil; -import org.netbeans.modules.bugzilla.repository.BugzillaRepository; -import org.openide.util.test.MockLookup; - -/** - * - * @author tomas - */ -public class IssueTableTest extends IssuetableTestFactory implements QueryConstants, TestConstants { - - private Map queries = new HashMap<>(); - - public IssueTableTest(Test test) { - super(test); - } - - public static void main(String args[]) { - junit.textui.TestRunner.run(suite()); - } - - public static Test suite() { - NbTestSuite suite = new NbTestSuite(); - suite.addTestSuite(org.netbeans.modules.bugtracking.issuetable.IssueTableTestCase.class); - return new IssueTableTest(suite); - } - - @Override - protected void setUp() throws Exception { - System.setProperty("netbeans.user", System.getProperty("java.io.tmpdir")); - System.setProperty("netbeans.t9y.bugzilla.force.refresh.delay", "please!"); - - MockLookup.setLayersAndInstances(); - BugtrackingUtil.getBugtrackingConnectors(); // ensure conector - } - - @Override - protected void tearDown() throws Exception { - } - - @Override - public Query createQuery() { - final String summary = "summary" + System.currentTimeMillis(); - - final BugzillaRepository repo = QueryTestUtil.getRepository(); - - String p = MessageFormat.format(PARAMETERS_FORMAT, summary); - String queryName = QUERY_NAME + System.currentTimeMillis(); - final BugzillaQuery bugzillaQuery = new BugzillaQuery(queryName, repo, p, false, false, true); // false = not saved - assertEquals(0,bugzillaQuery.getIssues().size()); - Query query = TestUtil.getQuery(bugzillaQuery); - queries.put(queryName, bugzillaQuery); - return query; - } - - @Override - public void setSaved(Query q) { - BugzillaQuery bugzillaQuery = queries.get(q.getDisplayName()); - bugzillaQuery.getController().save(q.getDisplayName()); - } - - @Override - public IssueTable getTable(Query q) { - try { - BugzillaQuery bugzillaQuery = queries.get(q.getDisplayName()); - QueryController c = bugzillaQuery.getController(); - return c.getIssueTable(); - } catch (Exception ex) { - throw new RuntimeException(ex); - } - } - - @Override - public int getColumnsCountBeforeSave() { - return 7; - } - - @Override - public int getColumnsCountAfterSave() { - return 9; - } - - - -} diff --git a/ide/bugzilla/test/unit/src/org/netbeans/modules/bugzilla/query/QueryConstants.java b/ide/bugzilla/test/unit/src/org/netbeans/modules/bugzilla/query/QueryConstants.java deleted file mode 100644 index 968857848fb0..000000000000 --- a/ide/bugzilla/test/unit/src/org/netbeans/modules/bugzilla/query/QueryConstants.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.netbeans.modules.bugzilla.query; - -/** - * - * @author tomas - */ -public interface QueryConstants { - String REPO_NAME = "Beautiful"; - String QUERY_NAME = "Hilarious"; - String PARAMETERS_FORMAT = - "&short_desc_type=allwordssubstr&short_desc={0}" + - "&long_desc_type=substring&long_desc=&bug_file_loc_type=allwordssubstr" + - "&bug_file_loc=&status_whiteboard_type=allwordssubstr&status_whiteboard=" + - "&keywords_type=allwords&keywords=&deadlinefrom=&deadlineto=&bug_status=NEW" + - "&bug_status=ASSIGNED&bug_status=REOPENED&emailassigned_to1=1&emailtype1=substring" + - "&email1=&emailassigned_to2=1&emailreporter2=1&emailqa_contact2=1&emailcc2=1" + - "&emailtype2=substring&email2=&bugidtype=include&bug_id=&votes=&chfieldfrom=" + - "&chfieldto=Now&chfieldvalue=&cmdtype=doit&order=Reuse+same+sort+as+last+time" + "" + - "&field0-0-0=noop&type0-0-0=noop&value0-0-0="; -} diff --git a/ide/bugzilla/test/unit/src/org/netbeans/modules/bugzilla/query/QueryParameterTest.java b/ide/bugzilla/test/unit/src/org/netbeans/modules/bugzilla/query/QueryParameterTest.java deleted file mode 100644 index 8c391f69dfc0..000000000000 --- a/ide/bugzilla/test/unit/src/org/netbeans/modules/bugzilla/query/QueryParameterTest.java +++ /dev/null @@ -1,284 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.netbeans.modules.bugzilla.query; - -import java.io.UnsupportedEncodingException; -import java.net.URLEncoder; -import org.netbeans.modules.bugzilla.*; -import java.util.HashSet; -import java.util.Set; -import java.util.logging.Level; -import javax.swing.JCheckBox; -import javax.swing.JComboBox; -import javax.swing.JList; -import javax.swing.JTextField; -import org.netbeans.junit.NbTestCase; -import org.netbeans.modules.bugzilla.query.QueryParameter.AllWordsTextFieldParameter; -import org.netbeans.modules.bugzilla.query.QueryParameter.CheckBoxParameter; -import org.netbeans.modules.bugzilla.query.QueryParameter.ComboParameter; -import org.netbeans.modules.bugzilla.query.QueryParameter.EmptyValuesListParameter; -import org.netbeans.modules.bugzilla.query.QueryParameter.ListParameter; -import org.netbeans.modules.bugzilla.query.QueryParameter.ParameterValue; -import org.netbeans.modules.bugzilla.query.QueryParameter.TextFieldParameter; - -/** - * - * @author tomas - */ -public class QueryParameterTest extends NbTestCase implements TestConstants { - - private static final String PARAMETER = "parameter"; - private static final ParameterValue PV1 = new ParameterValue("pv1"); - private static final ParameterValue PV2 = new ParameterValue("pv2"); - private static final ParameterValue PV3 = new ParameterValue("pv3"); - private static final ParameterValue PV4 = new ParameterValue("pv4"); - private static final ParameterValue[] VALUES = new ParameterValue[] {PV1, PV2, PV3, PV4}; - - public QueryParameterTest(String arg0) { - super(arg0); - } - - @Override - protected Level logLevel() { - return Level.ALL; - } - - @Override - protected void setUp() throws Exception { - super.setUp(); - System.setProperty("netbeans.user", getWorkDir().getAbsolutePath()); - } - - public void testComboParameters() { - JComboBox combo = new JComboBox(); - ComboParameter cp = new QueryParameter.ComboParameter(combo, PARAMETER, "UTF-8"); - assertEquals(PARAMETER, cp.getParameter()); - assertNull(combo.getSelectedItem()); - assertEquals(cp.get(false).toString(), "&" + PARAMETER + "="); - assertFalse(cp.isChanged()); - cp.setParameterValues(VALUES); - cp.setValues(new ParameterValue[] {PV2}); - - Object item = combo.getSelectedItem(); - assertNotNull(item); - assertEquals(PV2, item); - - ParameterValue[] v = cp.getValues(); - assertEquals(1, v.length); - assertEquals(PV2, v[0]); - - assertEquals(cp.get(false).toString(), "&" + PARAMETER + "=" + PV2.getValue()); - - combo.setSelectedItem(PV3); - assertEquals(cp.get(false).toString(), "&" + PARAMETER + "=" + PV3.getValue()); - - assertTrue(cp.isChanged()); - cp.reset(); - assertFalse(cp.isChanged()); - } - - public void testListParameters() { - JList list = new JList(); - ListParameter lp = new ListParameter(list, PARAMETER, "UTF-8"); - assertEquals(PARAMETER, lp.getParameter()); - assertEquals(-1, list.getSelectedIndex()); - assertEquals(lp.get(false).toString(), "&" + PARAMETER + "="); - assertFalse(lp.isChanged()); - lp.setParameterValues(VALUES); - lp.setValues(new ParameterValue[] {PV2, PV3}); - - Object[] items = list.getSelectedValues(); - assertNotNull(items); - assertEquals(2, items.length); - Set s = new HashSet(); - for (Object i : items) s.add((ParameterValue)i); - if(!s.contains(PV2)) fail("mising parameter [" + PV2 + "]"); - if(!s.contains(PV3)) fail("mising parameter [" + PV3 + "]"); - - ParameterValue[] v = lp.getValues(); - assertEquals(2, v.length); - s.clear(); - for (ParameterValue pv : v) s.add(pv); - if(!s.contains(PV2)) fail("mising parameter [" + PV2 + "]"); - if(!s.contains(PV3)) fail("mising parameter [" + PV3 + "]"); - - String get = lp.get(false).toString(); - String[] returned = get.split("&"); - Set ss = new HashSet(); - for (int i = 1; i < returned.length; i++) ss.add(returned[i]); - assertEquals(2, ss.size()); - if(!ss.contains(PARAMETER + "=" + PV2.getValue())) fail("mising parameter [" + PV2 + "]"); - if(!ss.contains(PARAMETER + "=" + PV3.getValue())) fail("mising parameter [" + PV3 + "]"); - - list.setSelectedValue(PV4, false); - assertEquals(lp.get(false).toString(), "&" + PARAMETER + "=" + PV4.getValue()); - assertTrue(lp.isChanged()); - lp.reset(); - assertFalse(lp.isChanged()); - } - - public void testEmptyValuesListParameters() { - JList list = new JList(); - EmptyValuesListParameter lp = new EmptyValuesListParameter(list, PARAMETER, "UTF-8"); - assertEquals(PARAMETER, lp.getParameter()); - assertEquals(-1, list.getSelectedIndex()); - assertEquals("", lp.get(false).toString()); - assertEquals("[&" + PARAMETER + "=]", lp.toString()); - assertFalse(lp.isChanged()); - lp.setParameterValues(VALUES); - lp.setValues(new ParameterValue[] {PV2, PV3}); - - Object[] items = list.getSelectedValues(); - assertNotNull(items); - assertEquals(2, items.length); - Set s = new HashSet(); - for (Object i : items) s.add((ParameterValue)i); - if(!s.contains(PV2)) fail("mising parameter [" + PV2 + "]"); - if(!s.contains(PV3)) fail("mising parameter [" + PV3 + "]"); - - ParameterValue[] v = lp.getValues(); - assertEquals(2, v.length); - s.clear(); - for (ParameterValue pv : v) s.add(pv); - if(!s.contains(PV2)) fail("mising parameter [" + PV2 + "]"); - if(!s.contains(PV3)) fail("mising parameter [" + PV3 + "]"); - - String get = lp.get(false).toString(); - String[] returned = get.split("&"); - Set ss = new HashSet(); - for (int i = 1; i < returned.length; i++) ss.add(returned[i]); - assertEquals(2, ss.size()); - if(!ss.contains(PARAMETER + "=" + PV2.getValue())) fail("mising parameter [" + PV2 + "]"); - if(!ss.contains(PARAMETER + "=" + PV3.getValue())) fail("mising parameter [" + PV3 + "]"); - - list.setSelectedValue(PV4, false); - assertEquals(lp.get(false).toString(), "&" + PARAMETER + "=" + PV4.getValue()); - assertTrue(lp.isChanged()); - lp.reset(); - assertFalse(lp.isChanged()); - } - - public void testTextFieldParameter() throws UnsupportedEncodingException { - JTextField text = new JTextField(); - TextFieldParameter tp = new TextFieldParameter(text, PARAMETER, "UTF-8"); - assertEquals(PARAMETER, tp.getParameter()); - assertEquals("", text.getText()); - assertEquals(tp.get(false).toString(), "&" + PARAMETER + "="); - assertFalse(tp.isChanged()); - - tp.setValues(new ParameterValue[] {PV2}); - assertEquals(PV2.getValue(), text.getText()); - assertEquals(1, tp.getValues().length); - assertEquals(PV2, tp.getValues()[0]); - assertEquals(tp.get(false).toString(), "&" + PARAMETER + "=" + PV2.getValue()); - - String parameterValue = "New+Value"; - tp.setValues(new ParameterValue[] {new ParameterValue(parameterValue)}); - assertEquals("New Value", text.getText()); - assertEquals(1, tp.getValues().length); - assertEquals(new ParameterValue(parameterValue), tp.getValues()[0]); - assertEquals(tp.get(true).toString(), "&" + PARAMETER + "=" + URLEncoder.encode(parameterValue, "UTF-8")); - - parameterValue = "NewValue"; - text.setText(parameterValue); - assertEquals(1, tp.getValues().length); - assertEquals(new ParameterValue(parameterValue), tp.getValues()[0]); - assertEquals(tp.get(true).toString(), "&" + PARAMETER + "=" + URLEncoder.encode(parameterValue, "UTF-8")); - assertEquals("NewValue", text.getText()); - - text.setText("New Value1"); - assertEquals(1, tp.getValues().length); - parameterValue = "New+Value1"; - assertEquals(new ParameterValue(parameterValue), tp.getValues()[0]); - assertEquals(tp.get(true).toString(), "&" + PARAMETER + "=" + URLEncoder.encode(parameterValue, "UTF-8")); - - assertTrue(tp.isChanged()); - tp.reset(); - assertFalse(tp.isChanged()); - } - - public void testAllWordsTextFieldParameter() throws UnsupportedEncodingException { - JTextField text = new JTextField(); - TextFieldParameter tp = new AllWordsTextFieldParameter(text, PARAMETER, "UTF-8"); - assertEquals(PARAMETER, tp.getParameter()); - assertEquals("", text.getText()); - assertEquals(tp.get(false).toString(), "&" + PARAMETER + "="); - assertFalse(tp.isChanged()); - - tp.setValues(new ParameterValue[] {PV2}); - assertEquals(PV2.getValue(), text.getText()); - assertEquals(1, tp.getValues().length); - assertEquals(PV2, tp.getValues()[0]); - assertEquals(tp.get(false).toString(), "&" + PARAMETER + "=" + PV2.getValue()); - - String parameterValue = "New+Value"; - tp.setValues(new ParameterValue[] {new ParameterValue(parameterValue)}); - assertEquals("New+Value", text.getText()); - assertEquals(1, tp.getValues().length); - assertEquals(new ParameterValue(parameterValue), tp.getValues()[0]); - assertEquals(tp.get(true).toString(), "&" + PARAMETER + "=" + URLEncoder.encode(parameterValue, "UTF-8")); - - parameterValue = "NewValue"; - text.setText(parameterValue); - assertEquals(1, tp.getValues().length); - assertEquals(new ParameterValue(parameterValue), tp.getValues()[0]); - assertEquals(tp.get(true).toString(), "&" + PARAMETER + "=" + URLEncoder.encode(parameterValue, "UTF-8")); - assertEquals("NewValue", text.getText()); - - text.setText("New Value1"); - assertEquals(1, tp.getValues().length); - parameterValue = "New Value1"; - assertEquals(new ParameterValue(parameterValue), tp.getValues()[0]); - assertEquals(tp.get(true).toString(), "&" + PARAMETER + "=" + URLEncoder.encode(parameterValue, "UTF-8")); - - assertTrue(tp.isChanged()); - tp.reset(); - assertFalse(tp.isChanged()); - } - - public void testCheckBoxParameter() { - JCheckBox checkbox = new JCheckBox(); - CheckBoxParameter cp = new CheckBoxParameter(checkbox, PARAMETER, "UTF-8"); - assertEquals(PARAMETER, cp.getParameter()); - assertFalse(checkbox.isSelected()); - assertEquals(cp.get(false).toString(), "&" + PARAMETER + "="); - assertFalse(cp.isChanged()); - - ParameterValue pv = new ParameterValue("1"); - cp.setValues(new ParameterValue[] {pv}); - assertTrue(checkbox.isSelected()); - assertEquals(1, cp.getValues().length); - assertEquals(pv, cp.getValues()[0]); - assertEquals(cp.get(false).toString(), "&" + PARAMETER + "=1"); - - pv = new ParameterValue("0"); - cp.setValues(new ParameterValue[] {pv}); - assertFalse(checkbox.isSelected()); - assertEquals(1, cp.getValues().length); - assertEquals(QueryParameter.EMPTY_PARAMETER_VALUE[0], cp.getValues()[0]); - assertEquals(cp.get(false).toString(), "&" + PARAMETER + "="); - - checkbox.setSelected(!checkbox.isSelected()); - assertTrue(cp.isChanged()); - cp.reset(); - assertFalse(cp.isChanged()); - } - -} diff --git a/ide/bugzilla/test/unit/src/org/netbeans/modules/bugzilla/query/QueryRefreshTest.java b/ide/bugzilla/test/unit/src/org/netbeans/modules/bugzilla/query/QueryRefreshTest.java deleted file mode 100644 index 10d59370d3c0..000000000000 --- a/ide/bugzilla/test/unit/src/org/netbeans/modules/bugzilla/query/QueryRefreshTest.java +++ /dev/null @@ -1,113 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.netbeans.modules.bugzilla.query; - -import java.lang.reflect.Field; -import java.lang.reflect.Method; -import java.text.MessageFormat; -import java.util.logging.Level; -import org.netbeans.junit.NbTestCase; -import org.netbeans.modules.bugtracking.TestKit; -import org.netbeans.modules.bugtracking.dummies.DummyBugtrackingOwnerSupport; -import org.netbeans.modules.bugtracking.util.BugtrackingUtil; -import org.netbeans.modules.bugzilla.Bugzilla; -import org.netbeans.modules.bugzilla.LogHandler; -import org.netbeans.modules.bugzilla.TestConstants; -import static org.netbeans.modules.bugzilla.TestConstants.REPO_PASSWD; -import static org.netbeans.modules.bugzilla.TestConstants.REPO_URL; -import static org.netbeans.modules.bugzilla.TestConstants.REPO_USER; -import org.netbeans.modules.bugzilla.TestUtil; -import org.netbeans.modules.bugzilla.issue.BugzillaIssue; -import org.netbeans.modules.bugzilla.repository.BugzillaRepository; -import org.netbeans.modules.mylyn.util.MylynSupport; -import org.openide.util.lookup.AbstractLookup; -import org.openide.util.lookup.InstanceContent; -import org.openide.util.test.MockLookup; - -/** - * - * @author tomas - */ -public class QueryRefreshTest extends NbTestCase implements TestConstants, QueryConstants { - - public QueryRefreshTest(String arg0) { - super(arg0); - } - - @Override - protected Level logLevel() { - return Level.ALL; - } - - @Override - protected void setUp() throws Exception { - System.setProperty("netbeans.user", getWorkDir().getAbsolutePath()); - // bypass bugtracking owner logic - System.setProperty("org.openide.util.Lookup", TestLookup.class.getName()); - - // refresh faster - System.setProperty("netbeans.t9y.bugzilla.force.refresh.schedule", "60000"); - - MockLookup.setLayersAndInstances(); - BugtrackingUtil.getBugtrackingConnectors(); // ensure conector - } - - @Override - protected void tearDown() throws Exception { - } - - public void testQueryOpenNoRefresh() throws Throwable { - long ts = System.currentTimeMillis(); - final String summary = "summary" + System.currentTimeMillis(); - - final BugzillaRepository repo = QueryTestUtil.getRepository(); - String id = TestUtil.createIssue(repo, summary); - assertNotNull(id); - - LogHandler h = new LogHandler("Finnished populate", LogHandler.Compare.STARTS_WITH); - - String p = MessageFormat.format(PARAMETERS_FORMAT, summary); - final BugzillaQuery q = new BugzillaQuery(QUERY_NAME, repo, p, false, false, true); - ts = System.currentTimeMillis(); - h.waitUntilDone(); - - - LogHandler lh = new LogHandler("scheduling query", LogHandler.Compare.STARTS_WITH); - Bugzilla.getInstance().getRequestProcessor().post(new Runnable() { - public void run() { - // init columndescriptors before opening query to prevent some "do not call in awt asserts" - BugzillaIssue.getColumnDescriptors(repo); - TestKit.openQuery(TestUtil.getQuery(q)); - } - }).waitFinished(); - assertFalse(lh.isDone()); // but this one wasn't yet - } - - public static final class TestLookup extends AbstractLookup { - public TestLookup() { - this(new InstanceContent()); - } - private TestLookup(InstanceContent ic) { - super(ic); - ic.add(new DummyBugtrackingOwnerSupport()); - } - } - -} diff --git a/ide/bugzilla/test/unit/src/org/netbeans/modules/bugzilla/query/QueryTest.java b/ide/bugzilla/test/unit/src/org/netbeans/modules/bugzilla/query/QueryTest.java deleted file mode 100644 index dee63deed6a1..000000000000 --- a/ide/bugzilla/test/unit/src/org/netbeans/modules/bugzilla/query/QueryTest.java +++ /dev/null @@ -1,411 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.netbeans.modules.bugzilla.query; - -import java.beans.PropertyChangeEvent; -import java.beans.PropertyChangeListener; -import java.lang.reflect.Field; -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; -import org.netbeans.modules.bugzilla.*; -import java.net.MalformedURLException; -import java.text.MessageFormat; -import java.util.ArrayList; -import java.util.Collection; -import java.util.EnumSet; -import java.util.List; -import java.util.logging.Level; -import org.eclipse.core.runtime.CoreException; -import org.netbeans.junit.NbTestCase; -import org.netbeans.junit.RandomlyFails; -import org.netbeans.modules.bugtracking.spi.IssueStatusProvider; -import org.netbeans.modules.bugtracking.spi.QueryController.QueryMode; -import org.netbeans.modules.bugtracking.spi.RepositoryProvider; -import org.netbeans.modules.bugtracking.util.BugtrackingUtil; -import org.netbeans.modules.bugzilla.issue.BugzillaIssue; -import org.netbeans.modules.bugzilla.repository.BugzillaRepository; -import org.openide.util.test.MockLookup; - -/** - * - * @author tomas - */ -public class QueryTest extends NbTestCase implements TestConstants, QueryConstants { - - private static final EnumSet STATUS_ALL = EnumSet.allOf(IssueStatusProvider.Status.class); - - public QueryTest(String arg0) { - super(arg0); - } - - @Override - protected Level logLevel() { - return Level.ALL; - } - - @Override - protected void setUp() throws Exception { - super.setUp(); - - MockLookup.setLayersAndInstances(); - BugtrackingUtil.getBugtrackingConnectors(); // ensure connector - - System.setProperty("netbeans.user", getWorkDir().getAbsolutePath()); - } - - public void testRefresh() throws MalformedURLException, CoreException, InterruptedException { - long ts = System.currentTimeMillis(); - String summary = "somary" + ts; - String id1 = TestUtil.createIssue(QueryTestUtil.getRepository(), summary); - - LogHandler h = new LogHandler("Finnished populate", LogHandler.Compare.STARTS_WITH); - - String p = MessageFormat.format(PARAMETERS_FORMAT, summary); - BugzillaQuery q = new BugzillaQuery(QUERY_NAME + ts, QueryTestUtil.getRepository(), p, true, false, true); - ts = System.currentTimeMillis(); - h.waitUntilDone(); - - TestQueryNotifyListener nl = new TestQueryNotifyListener(q); - - nl.reset(); - q.refreshIntern(false); - Collection is = q.getIssues(); - assertEquals(1, is.size()); - assertTrue(nl.started); - assertTrue(nl.finished); - List il = nl.getIssues(STATUS_ALL); - assertEquals(1, il.size()); - BugzillaIssue i = il.get(0); - assertEquals(summary, i.getSummary()); - assertEquals(id1, i.getID()); - - nl.reset(); - q.refresh(p, false); - assertTrue(nl.started); - assertTrue(nl.finished); - il = nl.getIssues(EnumSet.allOf(IssueStatusProvider.Status.class)); - assertEquals(1, il.size()); - i = il.get(0); - assertEquals(summary, i.getSummary()); - assertEquals(id1, i.getID()); - is = q.getIssues(); - assertEquals(1, is.size()); - } - - public void testGetIssues() throws MalformedURLException, CoreException { - long ts = System.currentTimeMillis(); - String summary1 = "somary1" + ts; - String id1 = TestUtil.createIssue(QueryTestUtil.getRepository(), summary1); - String summary2 = "somary2" + ts; - String id2 = TestUtil.createIssue(QueryTestUtil.getRepository(), summary2); - - // query for issue1 - String p = MessageFormat.format(PARAMETERS_FORMAT, summary1); - BugzillaQuery q = new BugzillaQuery(QUERY_NAME + ts, QueryTestUtil.getRepository(), p, true, false, true); - TestQueryNotifyListener nl = new TestQueryNotifyListener(q); - - Collection bugzillaIssues = q.getIssues(); - assertEquals(0, nl.issues.size()); - - nl.reset(); - q.refreshIntern(false); - assertTrue(nl.started); - assertTrue(nl.finished); - assertEquals(1, nl.getIssues(EnumSet.allOf(IssueStatusProvider.Status.class)).size()); - assertEquals(1, q.getIssues().size()); - BugzillaIssue i = q.getIssues().iterator().next(); - assertEquals(summary1, i.getSummary()); - assertEquals(id1, i.getID()); - - nl.reset(); - q.refresh(p, false); - assertTrue(nl.started); - assertTrue(nl.finished); - assertEquals(1, nl.getIssues(STATUS_ALL).size()); - assertEquals(1, q.getIssues().size()); - i = q.getIssues().iterator().next(); - assertEquals(summary1, i.getSummary()); - assertEquals(id1, i.getID()); - - // query for issue1 & issue2 - p = MessageFormat.format(PARAMETERS_FORMAT, Long.toString(ts)); - nl.reset(); - q.refresh(p, false); - bugzillaIssues = q.getIssues(); - assertTrue(nl.started); - assertTrue(nl.finished); - assertEquals(2, nl.getIssues(STATUS_ALL).size()); - assertEquals(2, bugzillaIssues.size()); - List summaries = new ArrayList(); - List ids = new ArrayList(); - for(BugzillaIssue issue : bugzillaIssues) { - summaries.add(issue.getSummary()); - ids.add(issue.getID()); - } - assertTrue(summaries.contains(summary1)); - assertTrue(summaries.contains(summary2)); - assertTrue(ids.contains(id1)); - assertTrue(ids.contains(id2)); - -// Collection is = BugtrackingUtil.getByIdOrSummary(BugzillaUtil.getQuery(q).getIssues(), "" + ts); // shoud return both issues -// assertEquals(2, is.size()); -// summaries = new ArrayList(); -// ids = new ArrayList(); -// for(Issue issue : is) { -// summaries.add(issue.getSummary()); -// ids.add(issue.getID()); -// } -// assertTrue(summaries.contains(summary1)); -// assertTrue(summaries.contains(summary2)); -// assertTrue(ids.contains(id1)); -// assertTrue(ids.contains(id2)); -// -// is = BugtrackingUtil.getByIdOrSummary(BugzillaUtil.getQuery(q).getIssues(), summary1); // shoud return 1st issue -// assertEquals(1, is.size()); -// assertEquals(id1, is.iterator().next().getID()); -// assertEquals(summary1, is.iterator().next().getSummary()); - } - - - // XXX test obsolete status - - // XXX shoud be on the spi - public void testLastRefresh() { - String parameters = "query_format=advanced&" + - "short_desc_type=allwordssubstr&" + - "short_desc=whatever112233445566778899&" + - "product=TestProduct"; - String qname = "q" + System.currentTimeMillis(); - BugzillaQuery q = new BugzillaQuery(qname, QueryTestUtil.getRepository(), parameters, true, true, false); - long lastRefresh = q.getLastRefresh(); - assertEquals(-1, lastRefresh); - long ts = System.currentTimeMillis(); - - ts = System.currentTimeMillis(); - q.refresh(parameters, false); - assertTrue(q.getLastRefresh() >= ts); - - ts = System.currentTimeMillis(); - q.refreshIntern(false); - lastRefresh = q.getLastRefresh(); - assertTrue(lastRefresh >= ts); - - // emulate restart - q = new BugzillaQuery(qname, QueryTestUtil.getRepository(), parameters, true, true, false); - assertEquals((int)(lastRefresh/1000), (int)(q.getLastRefresh()/1000)); - - } - - @RandomlyFails - public void testSaveAterSearch() throws MalformedURLException, CoreException, NoSuchMethodException, IllegalAccessException, IllegalArgumentException, InvocationTargetException, InterruptedException, NoSuchFieldException { - long ts = System.currentTimeMillis(); - String summary = "somary" + ts; - BugzillaRepository repository = QueryTestUtil.getRepository(); - String id1 = TestUtil.createIssue( repository, summary); - - LogHandler h = new LogHandler("Finnished populate", LogHandler.Compare.STARTS_WITH); - - // create query - BugzillaQuery q = new BugzillaQuery(repository); - - // get controler and wait until populated with default values - QueryController c = q.getController(); - ts = System.currentTimeMillis(); - h.waitUntilDone(); - - // populate with parameters - summary - populate(c, summary); - - TestQueryNotifyListener nl = new TestQueryNotifyListener(q); - - // search - nl.reset(); - h = new LogHandler("refresh finish", LogHandler.Compare.STARTS_WITH); - search(c); // search button and wait until done - ts = System.currentTimeMillis(); - h.waitUntilDone(); - - assertTrue(nl.started); - assertTrue(nl.finished); - List il = nl.getIssues(STATUS_ALL); - assertEquals(1, il.size()); - BugzillaIssue i = il.get(0); - assertEquals(summary, i.getSummary()); - assertEquals(id1, i.getID()); - - // save - nl.reset(); - String name = QUERY_NAME + ts; - h = new LogHandler(" saved", LogHandler.Compare.ENDS_WITH); - q.setName(name); - q.getController().save(name); - save(c); // save button - h.waitUntilDone(); - assertTrue(q.isSaved()); - // create a new repo instance and check if our query is between them - repository = QueryTestUtil.getRepository(); - Collection queries = repository.getQueries(); - boolean bl = false; - for (BugzillaQuery query : queries) { - bl = query.getDisplayName().equals(name); - if(bl) break; - } - assertTrue(bl); - } - - public void testSaveBeforeSearch() throws MalformedURLException, CoreException, NoSuchMethodException, IllegalAccessException, IllegalArgumentException, InvocationTargetException, InterruptedException, NoSuchFieldException { - long ts = System.currentTimeMillis(); - String summary = "somary" + ts; - String id1 = TestUtil.createIssue(QueryTestUtil.getRepository(), summary); - - LogHandler h = new LogHandler("Finnished populate ", LogHandler.Compare.STARTS_WITH); - - // create query - BugzillaQuery q = new BugzillaQuery(QueryTestUtil.getRepository()); - - // get controler and wait until populated with default values - QueryController c = q.getController(); - h.waitUntilDone(); - - // populate with parameters - summary - populate(c, summary); - - TestQueryNotifyListener nl = new TestQueryNotifyListener(q); - nl.reset(); - - QueryListener ql = new QueryListener(q.getRepository(), q); - q.getController().addPropertyChangeListener(ql); - - String name = QUERY_NAME + ts; - q.setName(name); - q.setSaved(true); - - h = new LogHandler("refresh finish", LogHandler.Compare.STARTS_WITH); // we wan't to check - // if the refresh is made after save - save(c); // save button - h.waitUntilDone(); - assertEquals(1, ql.saved); - - assertTrue(nl.started); - assertTrue(nl.finished); - List il = nl.getIssues(STATUS_ALL); - assertEquals(1, il.size()); - BugzillaIssue i = il.get(0); - assertEquals(summary, i.getSummary()); - assertEquals(id1, i.getID()); - } - - public void testSaveRemove() throws MalformedURLException, CoreException, InterruptedException, NoSuchMethodException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { - long ts = System.currentTimeMillis(); - - // create query - LogHandler h = new LogHandler("Finnished populate", LogHandler.Compare.STARTS_WITH); - BugzillaQuery q = new BugzillaQuery(QueryTestUtil.getRepository()); - - // get controler and wait until populated with default values - QueryController c = q.getController(); - h.waitUntilDone(); - Collection qs = QueryTestUtil.getRepository().getQueries(); - int queriesCount = qs.size(); - - QueryListener ql = new QueryListener(q.getRepository(), q); - q.getController().addPropertyChangeListener(ql); - - String name = QUERY_NAME + ts; - q.setName(name); - q.setSaved(true); - - // save - h = new LogHandler(" saved", LogHandler.Compare.ENDS_WITH); - save(c); - h.waitUntilDone(); - assertEquals(1, ql.saved); - - qs = QueryTestUtil.getRepository().getQueries(); - assertEquals(queriesCount + 1, qs.size()); - - // remove - remove(c); - assertEquals(1, ql.removed); - qs = QueryTestUtil.getRepository().getQueries(); - assertEquals(queriesCount, qs.size()); - } - - private void save(QueryController c) throws NoSuchMethodException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { - Method m = c.getClass().getDeclaredMethod("onSave"); - m.setAccessible(true); - m.invoke(c); - } - - private void remove(QueryController c) throws NoSuchMethodException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { - Method m = c.getClass().getDeclaredMethod("remove"); - m.setAccessible(true); - m.invoke(c); - } - - private void search(QueryController c) throws NoSuchMethodException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { - Method m = c.getClass().getDeclaredMethod("onRefresh"); - m.setAccessible(true); - m.invoke(c); - } - - private void populate(QueryController c, String summary) throws NoSuchFieldException, IllegalArgumentException, IllegalAccessException { - QueryPanel p = (QueryPanel) c.getComponent(QueryMode.EDIT); - p.summaryTextField.setText(summary); - p.productList.getSelectionModel().clearSelection(); // no product - Field f = c.getClass().getDeclaredField("populated"); - f.setAccessible(true); - f.set(c, true); - } - - private class QueryListener implements PropertyChangeListener { - int saved = 0; - int removed = 0; - private final BugzillaRepository repo; - private final BugzillaQuery query; - - public QueryListener(BugzillaRepository repo, BugzillaQuery query) { - this.repo = repo; - this.query = query; - } - - @Override - public void propertyChange(PropertyChangeEvent evt) { - if(evt.getPropertyName().equals(RepositoryProvider.EVENT_QUERY_LIST_CHANGED)) { - Collection queries = repo.getQueries(); - for (BugzillaQuery q : queries) { - if(q.getDisplayName().equals(query.getDisplayName())) { - // this query wasn't removed - return; - } - } - removed++; - } - if(evt.getPropertyName().equals(QueryController.PROP_CHANGED)) { - saved++; - } - } - void reset() { - saved = 0; - removed = 0; - } - - } -} diff --git a/ide/bugzilla/test/unit/src/org/netbeans/modules/bugzilla/query/QueryTestUtil.java b/ide/bugzilla/test/unit/src/org/netbeans/modules/bugzilla/query/QueryTestUtil.java deleted file mode 100644 index 5abeb2a05e6c..000000000000 --- a/ide/bugzilla/test/unit/src/org/netbeans/modules/bugzilla/query/QueryTestUtil.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.netbeans.modules.bugzilla.query; - -import javax.swing.ListModel; -import org.netbeans.modules.bugtracking.spi.QueryController.QueryMode; -import org.netbeans.modules.bugzilla.TestConstants; -import org.netbeans.modules.bugzilla.TestUtil; -import org.netbeans.modules.bugzilla.query.QueryParameter.ParameterValue; -import org.netbeans.modules.bugzilla.repository.BugzillaRepository; - -/** - * - * @author tomas - */ -public class QueryTestUtil implements TestConstants, QueryConstants { - public static void selectTestProject(final BugzillaQuery q) { - QueryPanel qp = (QueryPanel) q.getController().getComponent(QueryMode.EDIT); - ListModel model = qp.productList.getModel(); - for (int i = 0; i < model.getSize(); i++) { - QueryParameter.ParameterValue pv = (ParameterValue) model.getElementAt(i); - if (pv.getValue().equals(TEST_PROJECT)) { - qp.productList.setSelectedIndex(i); - break; - } - } - } - - public static BugzillaRepository getRepository() { - BugzillaRepository repo = TestUtil.getRepository(REPO_NAME, REPO_URL, REPO_USER, REPO_PASSWD); - repo.ensureCredentials(); - return repo; - } - -} diff --git a/ide/bugzilla/test/unit/src/org/netbeans/modules/bugzilla/repository/RepositoryControllerTest.java b/ide/bugzilla/test/unit/src/org/netbeans/modules/bugzilla/repository/RepositoryControllerTest.java deleted file mode 100644 index 34065259fdc7..000000000000 --- a/ide/bugzilla/test/unit/src/org/netbeans/modules/bugzilla/repository/RepositoryControllerTest.java +++ /dev/null @@ -1,211 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.netbeans.modules.bugzilla.repository; - -import java.io.IOException; -import org.netbeans.modules.bugzilla.*; -import java.lang.reflect.Field; -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; -import java.net.MalformedURLException; -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; -import java.util.logging.Level; -import junit.framework.Test; -import org.eclipse.core.runtime.CoreException; -import org.netbeans.junit.NbModuleSuite; -import org.netbeans.junit.NbTestCase; -import org.netbeans.modules.bugtracking.spi.*; -import org.netbeans.modules.bugtracking.util.BugtrackingUtil; -import org.netbeans.modules.bugzilla.issue.BugzillaIssue; -import org.netbeans.modules.bugzilla.query.BugzillaQuery; -import org.openide.util.test.MockLookup; - -/** - * - * @author tomas - */ -public class RepositoryControllerTest extends NbTestCase implements TestConstants { - - private static String REPO_NAME; - - public RepositoryControllerTest(String arg0) { - super(arg0); - } - - @Override - protected Level logLevel() { - return Level.ALL; - } - - @Override - protected void setUp() throws Exception { - super.setUp(); - REPO_NAME = "Beautiful-" + System.currentTimeMillis(); - System.setProperty("netbeans.user", getWorkDir().getAbsolutePath()); - MockLookup.setLayersAndInstances(); - } - - @Override - protected void tearDown() throws Exception { - super.tearDown(); - } - - public void testController() throws Throwable { - BugzillaConnector bc = getConnector(); - BugzillaRepository repo = new BugzillaRepository(); - BugzillaRepositoryController c = getController(repo); - - // populate - // only name - populate(c, REPO_NAME, "", "", ""); - assertFalse(c.isValid()); - - // only url - populate(c, "", REPO_URL, "", ""); - assertFalse(c.isValid()); - - // only user - populate(c, "", "", REPO_USER, ""); - assertFalse(c.isValid()); - - // only passwd - populate(c, "", "", "", REPO_PASSWD); - assertFalse(c.isValid()); - - // only user & passwd - populate(c, "", "", REPO_USER, REPO_PASSWD); - assertFalse(c.isValid()); - - // name & url - populate(c, REPO_NAME, REPO_URL, "", ""); - assertTrue(c.isValid()); - - // full house - populate(c, REPO_NAME, REPO_URL, REPO_USER, REPO_PASSWD); - assertTrue(c.isValid()); - - // no crap, its valid! - c.applyChanges(); - try { - Bugzilla.getInstance().getRepositoryConnector().getClientManager().getClient(repo.getTaskRepository(), NULL_PROGRESS_MONITOR).validate(NULL_PROGRESS_MONITOR); - } catch (CoreException ex) { - TestUtil.handleException(ex); - } catch (IOException ex) { - TestUtil.handleException(ex); - } - } - - public void testControllerOnValidate() throws NoSuchFieldException, IllegalArgumentException, IllegalAccessException, Throwable { - BugzillaRepository repo = new BugzillaRepository(); - BugzillaRepositoryController c = getController(repo); - - checkOnValidate(c, REPO_NAME, REPO_URL, null, REPO_PASSWD, true); - - checkOnValidate(c, REPO_NAME, REPO_URL, "", REPO_PASSWD, true); - - checkOnValidate(c, REPO_NAME, REPO_URL, "xxx", REPO_PASSWD, false); - - checkOnValidate(c, REPO_NAME, REPO_URL, REPO_USER, null, true); - - checkOnValidate(c, REPO_NAME, REPO_URL, REPO_USER, "", true); - - checkOnValidate(c, REPO_NAME, REPO_URL, REPO_USER, "xxx", true); - - checkOnValidate(c, REPO_NAME, REPO_URL, REPO_USER, REPO_PASSWD, true); - } - - private void checkOnValidate(BugzillaRepositoryController c, String repoName, String repoUrl, String user, String psswd, boolean assertWorked) throws Throwable { - - populate(c, repoName, repoUrl, user, psswd); // - assertTrue(c.isValid()); - - LogHandler lh = new LogHandler("validate for", LogHandler.Compare.STARTS_WITH); - LogHandler lhAutoupdate = new LogHandler("AutoupdateSupport.checkAndNotify start", LogHandler.Compare.ENDS_WITH); - onValidate(c); - lh.waitUntilDone(); - assertFalse(lhAutoupdate.isDone()); - lhAutoupdate.reset(); - String msg = lh.getInterceptedMessage(); - boolean worked = msg.indexOf("ok.") > -1; - if(assertWorked) { - assertTrue(worked); - } else { - assertFalse(worked); - } - } - - private BugzillaConnector getConnector() { - BugtrackingConnector[] c = BugtrackingUtil.getBugtrackingConnectors(); - BugzillaConnector bc = null; - for (BugtrackingConnector bugtrackingConnector : c) { - if(bugtrackingConnector instanceof BugzillaConnector) { - bc = (BugzillaConnector) bugtrackingConnector; - break; - } - } - assertNotNull(bc); - return bc; - } - - private BugzillaRepositoryController getController(BugzillaRepository repo) { - assertNotNull(repo); - RepositoryController c = repo.getController(); - assertNotNull(c); - assertFalse(c.isValid()); - return (BugzillaRepositoryController) c; - } - - private RepositoryPanel getRepositoryPanel(RepositoryController c) throws NoSuchFieldException, IllegalArgumentException, IllegalAccessException { - Field f = c.getClass().getDeclaredField("panel"); - f.setAccessible(true); - return (RepositoryPanel) f.get(c); - } - - private void populate(BugzillaRepositoryController c, String name, String url, String user, String psswd) throws NoSuchFieldException, IllegalArgumentException, IllegalAccessException, NoSuchMethodException, InvocationTargetException { - RepositoryPanel panel = getRepositoryPanel(c); - resetPanel(panel); - panel.nameField.setText(name); - panel.urlField.setText(url); - panel.userField.setText(user); - panel.psswdField.setText(psswd); - setPopulated(c); - } - - private void resetPanel(RepositoryPanel panel) { - panel.nameField.setText(""); - panel.urlField.setText(""); - panel.userField.setText(""); - panel.psswdField.setText(""); - } - - private void onValidate(BugzillaRepositoryController c) throws NoSuchMethodException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { - Method m = c.getClass().getDeclaredMethod("onValidate"); - m.setAccessible(true); - m.invoke(c); - } - - private void setPopulated(BugzillaRepositoryController c) throws NoSuchMethodException, IllegalAccessException, IllegalArgumentException, InvocationTargetException, NoSuchFieldException { - Field f = c.getClass().getDeclaredField("populated"); - f.setAccessible(true); - f.set(c, true); - } -} diff --git a/ide/bugzilla/test/unit/src/org/netbeans/modules/bugzilla/repository/RepositoryTest.java b/ide/bugzilla/test/unit/src/org/netbeans/modules/bugzilla/repository/RepositoryTest.java deleted file mode 100644 index cdf31d6a6344..000000000000 --- a/ide/bugzilla/test/unit/src/org/netbeans/modules/bugzilla/repository/RepositoryTest.java +++ /dev/null @@ -1,167 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.netbeans.modules.bugzilla.repository; - -import org.netbeans.modules.bugzilla.*; -import java.lang.reflect.Field; -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; -import java.net.MalformedURLException; -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; -import java.util.logging.Level; -import junit.framework.Test; -import org.eclipse.core.runtime.CoreException; -import org.netbeans.junit.NbModuleSuite; -import org.netbeans.junit.NbTestCase; -import org.netbeans.modules.bugtracking.spi.*; -import org.netbeans.modules.bugtracking.util.BugtrackingUtil; -import static org.netbeans.modules.bugzilla.TestConstants.REPO_PASSWD; -import static org.netbeans.modules.bugzilla.TestConstants.REPO_URL; -import static org.netbeans.modules.bugzilla.TestConstants.REPO_USER; -import org.netbeans.modules.bugzilla.issue.BugzillaIssue; -import org.netbeans.modules.bugzilla.query.BugzillaQuery; -import org.netbeans.modules.mylyn.util.MylynSupport; -import org.openide.util.test.MockLookup; - -/** - * - * @author tomas - */ -public class RepositoryTest extends NbTestCase implements TestConstants { - - private static String REPO_NAME; - private static String QUERY_NAME = "Hilarious"; - - public RepositoryTest(String arg0) { - super(arg0); - } - - @Override - protected Level logLevel() { - return Level.ALL; - } - - @Override - protected void setUp() throws Exception { - super.setUp(); - - // reset - Method m = MylynSupport.class.getDeclaredMethod("reset", new Class[0]); - m.setAccessible(true); - m.invoke(MylynSupport.class); - - Field f = Bugzilla.class.getDeclaredField("instance"); - f.setAccessible(true); - f.set(Bugzilla.class, null); - - REPO_NAME = "Beautiful-" + System.currentTimeMillis(); - System.setProperty("netbeans.user", getWorkDir().getAbsolutePath()); - MockLookup.setLayersAndInstances(); - } - - public static Test suite () { - return NbModuleSuite.createConfiguration(RepositoryTest.class).gui(false).suite(); - } - - @Override - protected void tearDown() throws Exception { - super.tearDown(); - } - - public void testRepo() throws NoSuchFieldException, IllegalArgumentException, IllegalAccessException, Throwable { - RepositoryInfo info = new RepositoryInfo(REPO_NAME, BugzillaConnector.ID, REPO_URL, REPO_NAME, REPO_NAME, REPO_USER, null, REPO_PASSWD.toCharArray() , null); - BugzillaRepository repo = new BugzillaRepository(info); - repo.ensureCredentials(); - - // test queries - Collection queries = repo.getQueries(); - assertEquals(0, queries.size()); - - BugzillaQuery q = repo.createQuery(); - queries = repo.getQueries(); - assertEquals(0, queries.size()); // returns only saved queries - - // save query - long lastRefresh = System.currentTimeMillis(); - String parameters = "&product=zaibatsu"; - BugzillaQuery bq = new BugzillaQuery(QUERY_NAME, repo, parameters, true, false, true); - repo.saveQuery(bq); - queries = repo.getQueries(); - assertEquals(1, queries.size()); // returns only saved queries - - // remove query - repo.removeQuery(bq); - queries = repo.getQueries(); - assertEquals(0, queries.size()); - - // XXX repo.createIssue(); - - // get issue - String id = TestUtil.createIssue(repo, "somari"); - BugzillaIssue i = repo.getIssue(id); - assertNotNull(i); - assertEquals(id, i.getID()); - assertEquals("somari", i.getSummary()); - } - - public void testSimpleSearch() throws MalformedURLException, CoreException { - long ts = System.currentTimeMillis(); - String summary1 = "somary" + ts; - String summary2 = "mary" + ts; - RepositoryInfo info = new RepositoryInfo(REPO_NAME, BugzillaConnector.ID, REPO_URL, REPO_NAME, REPO_NAME, REPO_USER, null, REPO_PASSWD.toCharArray() , null); - BugzillaRepository repo = new BugzillaRepository(info); - repo.ensureCredentials(); - - String id1 = TestUtil.createIssue(repo, summary1); - String id2 = TestUtil.createIssue(repo, summary2); - - Collection issues = repo.simpleSearch(summary1); - assertEquals(1, issues.size()); - assertEquals(summary1, issues.iterator().next().getSummary()); - - issues = repo.simpleSearch(id1); - // at least one as id might be also contained - // in another issues summary - assertTrue(issues.size() > 0); - BugzillaIssue i = null; - for(BugzillaIssue issue : issues) { - if(issue.getID().equals(id1)) { - i = issue; - break; - } - } - assertNotNull(i); - - issues = repo.simpleSearch(summary2); - assertEquals(2, issues.size()); - List summaries = new ArrayList(); - List ids = new ArrayList(); - for(BugzillaIssue issue : issues) { - summaries.add(issue.getSummary()); - ids.add(issue.getID()); - } - assertTrue(summaries.contains(summary1)); - assertTrue(summaries.contains(summary2)); - assertTrue(ids.contains(id1)); - assertTrue(ids.contains(id2)); - } -} diff --git a/ide/localtasks/build.xml b/ide/localtasks/build.xml deleted file mode 100644 index 52ff94f2a9ef..000000000000 --- a/ide/localtasks/build.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - Builds, tests, and runs the project org.netbeans.modules.localtasks - - diff --git a/ide/localtasks/licenseinfo.xml b/ide/localtasks/licenseinfo.xml deleted file mode 100644 index e7def4616d68..000000000000 --- a/ide/localtasks/licenseinfo.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - src/org/netbeans/modules/localtasks/resources/error.gif - src/org/netbeans/modules/localtasks/resources/info.png - src/org/netbeans/modules/localtasks/resources/warning.gif - src/org/netbeans/modules/localtasks/resources/local_repo.png - - - - diff --git a/ide/localtasks/manifest.mf b/ide/localtasks/manifest.mf deleted file mode 100644 index d6f2e539be7b..000000000000 --- a/ide/localtasks/manifest.mf +++ /dev/null @@ -1,5 +0,0 @@ -Manifest-Version: 1.0 -AutoUpdate-Show-In-Client: true -OpenIDE-Module: org.netbeans.modules.localtasks -OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/localtasks/Bundle.properties -OpenIDE-Module-Specification-Version: 1.56 diff --git a/ide/localtasks/nbproject/project.properties b/ide/localtasks/nbproject/project.properties deleted file mode 100644 index 6e9636092651..000000000000 --- a/ide/localtasks/nbproject/project.properties +++ /dev/null @@ -1,21 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - -javac.source=1.8 -javac.compilerargs=-Xlint -Xlint:-serial - -test.config.stableBTD.includes=**/*Test.class diff --git a/ide/localtasks/nbproject/project.xml b/ide/localtasks/nbproject/project.xml deleted file mode 100644 index 040f968d4195..000000000000 --- a/ide/localtasks/nbproject/project.xml +++ /dev/null @@ -1,157 +0,0 @@ - - - - org.netbeans.modules.apisupport.project - - - org.netbeans.modules.localtasks - - - org.eclipse.core.runtime - - - - - - org.eclipse.equinox.common - - - - 3.6.0 - - - - org.eclipse.mylyn.tasks.core - - - - - - org.netbeans.modules.bugtracking - - - - 1.95 - - - - org.netbeans.modules.bugtracking.commons - - - - 1.0 - - - - org.netbeans.modules.mylyn.util - - - - 1.24 - - - - org.netbeans.modules.spellchecker.apimodule - - - - 1.19 - - - - org.netbeans.modules.team.commons - - - - 1.31 - - - - org.openide.awt - - - - 7.60 - - - - org.openide.dialogs - - - - 7.35 - - - - org.openide.filesystems - - - - 9.0 - - - - org.openide.modules - - - - 7.40 - - - - org.openide.util.ui - - - - 9.3 - - - - org.openide.util - - - - 9.3 - - - - org.openide.util.lookup - - - - 8.25 - - - - org.openide.windows - - - - 6.66 - - - - - - - - diff --git a/ide/localtasks/src/org/netbeans/modules/localtasks/Bundle.properties b/ide/localtasks/src/org/netbeans/modules/localtasks/Bundle.properties deleted file mode 100644 index 43fa832a0352..000000000000 --- a/ide/localtasks/src/org/netbeans/modules/localtasks/Bundle.properties +++ /dev/null @@ -1,24 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - -OpenIDE-Module-Display-Category=Base IDE -OpenIDE-Module-Long-Description=Support for the Local Tasks tracker -OpenIDE-Module-Name=Local Tasks -OpenIDE-Module-Short-Description=Local Tasks Tracker - -LBL_ConnectorName=Local Tasks -LBL_ConnectorTooltip=Local Tasks Tracking System diff --git a/ide/localtasks/src/org/netbeans/modules/localtasks/IssueProviderImpl.java b/ide/localtasks/src/org/netbeans/modules/localtasks/IssueProviderImpl.java deleted file mode 100644 index 03cf4e23fbcc..000000000000 --- a/ide/localtasks/src/org/netbeans/modules/localtasks/IssueProviderImpl.java +++ /dev/null @@ -1,101 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.netbeans.modules.localtasks; - -import java.beans.PropertyChangeListener; -import java.io.File; -import java.util.Collection; -import java.util.Collections; -import org.netbeans.modules.localtasks.task.LocalTask; -import org.netbeans.modules.bugtracking.spi.IssueController; -import org.netbeans.modules.bugtracking.spi.IssueProvider; - -/** - * - * @author Ondrej Vrabec - */ -public class IssueProviderImpl implements IssueProvider { - - @Override - public String getDisplayName (LocalTask data) { - return data.getDisplayName(); - } - - @Override - public String getTooltip (LocalTask data) { - return data.getTooltip(); - } - - @Override - public String getID (LocalTask data) { - return data.getID(); - } - - @Override - public Collection getSubtasks (LocalTask data) { - return Collections.emptyList(); - } - - @Override - public String getSummary (LocalTask data) { - return data.getSummary(); - } - - @Override - public boolean isNew (LocalTask data) { - return false; - } - - @Override - public boolean isFinished (LocalTask data) { - return data.isFinished(); - } - - @Override - public boolean refresh (LocalTask data) { - return data.synchronizeTask(); - } - - @Override - public void addComment (LocalTask data, String comment, boolean closeAsFixed) { - data.addComment(comment, closeAsFixed); - } - - @Override - public void attachFile (LocalTask data, File file, String description, boolean isPatch) { - data.attachPatch(file, description); - } - - @Override - public IssueController getController (LocalTask data) { - return data.getController(); - } - - @Override - public void addPropertyChangeListener (LocalTask data, PropertyChangeListener listener) { - data.addPropertyChangeListener(listener); - } - - @Override - public void removePropertyChangeListener (LocalTask data, PropertyChangeListener listener) { - data.removePropertyChangeListener(listener); - } - -} diff --git a/ide/localtasks/src/org/netbeans/modules/localtasks/IssueSchedulingProviderImpl.java b/ide/localtasks/src/org/netbeans/modules/localtasks/IssueSchedulingProviderImpl.java deleted file mode 100644 index c4e0d5ba620e..000000000000 --- a/ide/localtasks/src/org/netbeans/modules/localtasks/IssueSchedulingProviderImpl.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.netbeans.modules.localtasks; - -import java.util.Date; -import org.netbeans.modules.bugtracking.spi.IssueScheduleInfo; -import org.netbeans.modules.bugtracking.spi.IssueScheduleProvider; -import org.netbeans.modules.localtasks.task.LocalTask; - -/** - * - * @author Ondrej Vrabec - */ -class IssueSchedulingProviderImpl implements IssueScheduleProvider { - - @Override - public void setSchedule (LocalTask i, IssueScheduleInfo date) { - i.setTaskScheduleDate(date, true); - } - - @Override - public Date getDueDate (LocalTask i) { - return i.getPersistentDueDate(); - } - - @Override - public IssueScheduleInfo getSchedule (LocalTask i) { - return i.getPersistentScheduleInfo(); - } - - } diff --git a/ide/localtasks/src/org/netbeans/modules/localtasks/IssueStatusProviderImpl.java b/ide/localtasks/src/org/netbeans/modules/localtasks/IssueStatusProviderImpl.java deleted file mode 100644 index c37d166c918d..000000000000 --- a/ide/localtasks/src/org/netbeans/modules/localtasks/IssueStatusProviderImpl.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.netbeans.modules.localtasks; - -import java.beans.PropertyChangeListener; -import java.util.Collection; -import java.util.Collections; -import org.netbeans.modules.bugtracking.spi.IssueStatusProvider; -import org.netbeans.modules.localtasks.task.LocalTask; - -/** - * - * @author tomas - */ -public class IssueStatusProviderImpl implements IssueStatusProvider { - - @Override - public Status getStatus(LocalTask issue) { - return Status.SEEN; - } - - @Override - public Collection getUnsubmittedIssues(LocalRepository r) { - return Collections.emptyList(); - } - - @Override - public void discardOutgoing(LocalTask i) { - i.delete(); - } - - @Override - public boolean submit(LocalTask data) { - return false; - } - - @Override public void setSeenIncoming(LocalTask issue, boolean seen) { } - @Override public void removePropertyChangeListener(LocalTask issue, PropertyChangeListener listener) { } - @Override public void addPropertyChangeListener(LocalTask issue, PropertyChangeListener listener) { } - -} diff --git a/ide/localtasks/src/org/netbeans/modules/localtasks/LocalQuery.java b/ide/localtasks/src/org/netbeans/modules/localtasks/LocalQuery.java deleted file mode 100644 index f4df60768d5d..000000000000 --- a/ide/localtasks/src/org/netbeans/modules/localtasks/LocalQuery.java +++ /dev/null @@ -1,115 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.netbeans.modules.localtasks; - -import java.beans.PropertyChangeListener; -import java.beans.PropertyChangeSupport; -import java.util.Collection; -import org.eclipse.core.runtime.CoreException; -import org.netbeans.modules.bugtracking.spi.QueryProvider; -import org.netbeans.modules.localtasks.task.LocalTask; -import org.openide.util.Exceptions; -import org.openide.util.NbBundle; - -/** - * - * @author Ondrej Vrabec - */ -public final class LocalQuery { - - private static LocalQuery instance; - private final PropertyChangeSupport support; - private QueryProvider.IssueContainer delegatingIssueContainer; - - static LocalQuery getInstance () { - if (instance == null) { - instance = new LocalQuery(); - } - return instance; - } - - private LocalQuery () { - support = new PropertyChangeSupport(this); - } - - @NbBundle.Messages({ - "LBL_LocalQuery.displayName=All Tasks" - }) - String getDisplayName () { - return Bundle.LBL_LocalQuery_displayName(); - } - - @NbBundle.Messages({ - "LBL_LocalQuery.tooltip=All tasks from the local repository" - }) - String getTooltip () { - return Bundle.LBL_LocalQuery_tooltip(); - } - - Collection getIssues () { - return LocalRepository.getInstance().getTasks(); - } - - void refresh () { - try { - if(delegatingIssueContainer != null) { - delegatingIssueContainer.refreshingStarted(); - for(LocalTask t : getIssues()) { - delegatingIssueContainer.add(t); - } - } - } finally { - fireFinished(); - } - } - - void addPropertyChangeListener (PropertyChangeListener listener) { - support.addPropertyChangeListener(listener); - } - - void removePropertyChangeListener (PropertyChangeListener listener) { - support.removePropertyChangeListener(listener); - } - - void setIssueContainer(QueryProvider.IssueContainer c) { - delegatingIssueContainer = c; - } - - void addTask(LocalTask lt) { - if(delegatingIssueContainer != null) { - delegatingIssueContainer.add(lt); - } - fireFinished(); - } - - void removeTask(LocalTask lt) { - if(delegatingIssueContainer != null) { - delegatingIssueContainer.remove(lt); - } - fireFinished(); - } - - void fireFinished() { - if(delegatingIssueContainer != null) { - delegatingIssueContainer.refreshingFinished(); - } - } - -} diff --git a/ide/localtasks/src/org/netbeans/modules/localtasks/LocalRepository.java b/ide/localtasks/src/org/netbeans/modules/localtasks/LocalRepository.java deleted file mode 100644 index bfcedd4ff957..000000000000 --- a/ide/localtasks/src/org/netbeans/modules/localtasks/LocalRepository.java +++ /dev/null @@ -1,322 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.netbeans.modules.localtasks; - -import java.awt.Image; -import java.beans.PropertyChangeListener; -import java.beans.PropertyChangeSupport; -import java.lang.ref.Reference; -import java.lang.ref.SoftReference; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.HashSet; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.logging.Level; -import java.util.logging.Logger; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.OperationCanceledException; -import org.eclipse.mylyn.tasks.core.TaskMapping; -import org.eclipse.mylyn.tasks.core.TaskRepository; -import org.netbeans.modules.bugtracking.api.Repository; -import org.netbeans.modules.localtasks.task.LocalTask; -import org.netbeans.modules.bugtracking.spi.BugtrackingSupport; -import org.netbeans.modules.mylyn.util.MylynSupport; -import org.netbeans.modules.mylyn.util.NbTask; -import org.openide.util.Exceptions; -import org.openide.util.ImageUtilities; -import org.openide.util.NbBundle; -import org.openide.util.RequestProcessor; - -/** - * - * @author Ondrej Vrabec - */ -public final class LocalRepository { - private static final String ID = "LocalRepositoryInstance"; //NOI18N - private static LocalRepository instance; - private final Repository repository; - private final BugtrackingSupport fac; - private final PropertyChangeSupport propertySuport; - private static final String ICON_PATH = "org/netbeans/modules/localtasks/resources/local_repo.png"; // NOI18N - private final Image icon; - private TaskRepository taskRepository; - private final Object CACHE_LOCK = new Object(); - private Cache cache; - private boolean initialized; - public static final Logger LOG = Logger.getLogger(LocalRepository.class.getName()); - private static final RequestProcessor RP = new RequestProcessor("Local Task Repository"); //NOI18N - - public static synchronized LocalRepository getInstance () { - if (instance == null) { - instance = new LocalRepository(); - } - return instance; - } - - public LocalRepository () { - fac = new BugtrackingSupport<>(new RepositoryProviderImpl(), new QueryProviderImpl(), new IssueProviderImpl()); - icon = ImageUtilities.loadImage(ICON_PATH, true); - propertySuport = new PropertyChangeSupport(this); - repository = fac.createRepository(this, new IssueStatusProviderImpl(), - new IssueSchedulingProviderImpl(), null, null); - } - - public Repository getRepository () { - return repository; - } - - void addPropertyChangeListener (PropertyChangeListener listener) { - propertySuport.addPropertyChangeListener(listener); - } - - void removePropertyChangeListener (PropertyChangeListener listener) { - propertySuport.removePropertyChangeListener(listener); - } - - Image getIcon () { - return icon; - } - - String getID () { - return ID; - } - - String getDisplayName () { - return getTaskRepository().getRepositoryLabel(); - } - - @NbBundle.Messages({ - "# {0} - repository URL", "CTL_LocalRepository.tooltip=Local Repository: {0}" - }) - String getTooltip () { - return Bundle.CTL_LocalRepository_tooltip(getUrl()); - } - - String getUrl () { - return getTaskRepository().getRepositoryUrl(); - } - - Collection getQueries () { - return Collections.singletonList(LocalQuery.getInstance()); - } - - public TaskRepository getTaskRepository () { - if (taskRepository == null) { - taskRepository = MylynSupport.getInstance().getLocalTaskRepository(); - } - return taskRepository; - } - - /** - * @return true if the tasks really changed - */ - boolean refreshTasks () throws CoreException { - Collection oldTasks = getCache().getAllTasks(); - for (NbTask task : MylynSupport.getInstance().getTasks(taskRepository)) { - getLocalTask(task); - } - initialized = true; - return !oldTasks.equals(getCache().getAllTasks()); - } - - LocalTask getLocalTask (NbTask task) { - LocalTask issue = null; - if (task != null) { - synchronized (CACHE_LOCK) { - String taskId = LocalTask.getID(task); - Cache issueCache = getCache(); - issue = issueCache.getTask(taskId); - if (issue == null) { - issue = issueCache.setTask(taskId, new LocalTask(task)); - } - } - } - return issue; - } - - Collection getTasks () { - if (!initialized) { - try { - refreshTasks(); - } catch (CoreException ex) { - Exceptions.printStackTrace(ex); - } - } - return getCache().getAllTasks(); - } - - @NbBundle.Messages({ - "LBL_NewTask_summary=New Local Task" - }) - LocalTask createTask () { - NbTask task; - try { - task = MylynSupport.getInstance().createTask(taskRepository, new TaskMapping() { - - @Override - public String getSummary () { - return Bundle.LBL_NewTask_summary(); - } - - }); - LocalTask lt = getLocalTask(task); - LocalQuery.getInstance().addTask(lt); - return lt; - } catch (OperationCanceledException ex) { - // creation of new task may be immediately canceled - // happens when more repositories are available and - // the RepoComboSupport immediately switches to another repo - LOG.log(Level.FINE, null, ex); - return null; - } catch (CoreException ex) { - LOG.log(Level.WARNING, null, ex); - return null; - } - } - - List getTasks (String[] ids) { - final List ret = new ArrayList<>(ids.length); - boolean queryNeedsRefresh = false; - try { - MylynSupport supp = MylynSupport.getInstance(); - for (String id : ids) { - LocalTask task = getCache().getTask(id); - if (task == null) { - // query not refreshed? - task = getLocalTask(supp.getTask(getTaskRepository().getUrl(), id)); - if (task != null) { - queryNeedsRefresh = true; - } - } - if (task != null) { - ret.add(task); - } - } - } catch (CoreException ex) { - LOG.log(Level.INFO, null, ex); - } - if (queryNeedsRefresh) { - getRequestProcessor().post(new Runnable() { - @Override - public void run () { - LocalQuery.getInstance().fireFinished(); - } - }); - } - return ret; - } - - Collection simpleSearch (String criteria) { - String[] keywords = criteria.split(" "); //NOI18N - Set tasks = new HashSet<>(); - - LocalQuery.getInstance().refresh(); - - if (keywords.length == 1 && isInteger(keywords[0])) { - LocalTask task = getCache().getTask(keywords[0]); - if (task != null) { - tasks.add(task); - } - } - - Collection allTasks = getTasks(); - for (LocalTask task : allTasks) { - if (task.searchFor(keywords)) { - tasks.add(task); - } - } - - return tasks; - } - - private Cache getCache () { - synchronized (CACHE_LOCK) { - if (cache == null) { - cache = new Cache(); - } - return cache; - } - } - - public RequestProcessor getRequestProcessor () { - return RP; - } - - private boolean isInteger(String str) { - try { - Integer.parseInt(str); - return true; - } catch (NumberFormatException e) { - } - return false; - } - - public void taskDeleted (String id) { - LocalRepositoryConfig.getInstance().deleteTaskPreferences(id); - LocalTask lt = getCache().getTask(id); - if(lt != null) { - getCache().removeTask(id); - LocalQuery.getInstance().removeTask(lt); - } - } - - private class Cache { - - private final Map> tasks = new LinkedHashMap<>(); - - public LocalTask getTask (String id) { - synchronized (CACHE_LOCK) { - Reference taskRef = tasks.get(id); - return taskRef == null ? null : taskRef.get(); - } - } - - public LocalTask setTask (String id, LocalTask task) { - synchronized (CACHE_LOCK) { - tasks.put(id, new SoftReference<>(task)); - } - return task; - } - - private void removeTask (String id) { - synchronized (CACHE_LOCK) { - tasks.remove(id); - } - } - - private Collection getAllTasks () { - List allTasks; - synchronized (CACHE_LOCK) { - allTasks = new ArrayList<>(tasks.size()); - for (Reference ref : tasks.values()) { - LocalTask task = ref.get(); - if (task != null) { - allTasks.add(task); - } - } - } - return allTasks; - } - } -} diff --git a/ide/localtasks/src/org/netbeans/modules/localtasks/LocalRepositoryConfig.java b/ide/localtasks/src/org/netbeans/modules/localtasks/LocalRepositoryConfig.java deleted file mode 100644 index f01fb158d056..000000000000 --- a/ide/localtasks/src/org/netbeans/modules/localtasks/LocalRepositoryConfig.java +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.netbeans.modules.localtasks; - -import java.util.prefs.BackingStoreException; -import java.util.prefs.Preferences; -import org.openide.util.NbPreferences; - -/** - * - * @author Ondrej Vrabec - */ -public class LocalRepositoryConfig { - private static LocalRepositoryConfig instance; - private static final String PREF_SECTION_COLLAPSED = "collapsedSection"; //NOI18N - private static final String PREF_TASK = "task."; //NOI18N - - public static synchronized LocalRepositoryConfig getInstance () { - if (instance == null) { - instance = new LocalRepositoryConfig(); - } - return instance; - } - - private LocalRepositoryConfig () { - - } - - public void setEditorSectionCollapsed (String taskId, String sectionName, boolean collapsed) { - String key = getTaskKey(taskId) + PREF_SECTION_COLLAPSED + sectionName; - getPreferences().putBoolean(key, collapsed); - } - - public void deleteTaskPreferences (String taskId) { - Preferences prefs = getPreferences(); - try { - String taskKey = getTaskKey(taskId); - for (String key : prefs.keys()) { - if (key.startsWith(taskKey)) { - prefs.remove(key); - } - } - } catch (BackingStoreException ex) { - } - } - - public boolean isEditorSectionCollapsed (String taskId, String sectionName, boolean defaultValue) { - String key = getTaskKey(taskId) + PREF_SECTION_COLLAPSED + sectionName; - return getPreferences().getBoolean(key, defaultValue); - } - - private Preferences getPreferences () { - return NbPreferences.forModule(LocalRepositoryConfig.class); - } - - private String getTaskKey (String taskId) { - return PREF_TASK + taskId + "."; - } - -} diff --git a/ide/localtasks/src/org/netbeans/modules/localtasks/LocalTaskConnector.java b/ide/localtasks/src/org/netbeans/modules/localtasks/LocalTaskConnector.java deleted file mode 100644 index fc95eb952148..000000000000 --- a/ide/localtasks/src/org/netbeans/modules/localtasks/LocalTaskConnector.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.netbeans.modules.localtasks; - -import org.netbeans.modules.bugtracking.api.Repository; -import org.netbeans.modules.bugtracking.spi.BugtrackingConnector; -import org.netbeans.modules.bugtracking.spi.RepositoryInfo; - -/** - * - * @author Ondrej Vrabec - */ -@BugtrackingConnector.Registration( - displayName = "#LBL_ConnectorName", - id = LocalTaskConnector.CONNECTOR_NAME, - tooltip = "#LBL_ConnectorTooltip", - providesRepositoryManagement = false -) -public class LocalTaskConnector implements BugtrackingConnector { - public static final String CONNECTOR_NAME = "NB_LOCAL_TASKS"; - - @Override - public Repository createRepository (RepositoryInfo info) { - return createRepository(); - } - - @Override - public Repository createRepository () { - return LocalRepository.getInstance().getRepository(); - } -} diff --git a/ide/localtasks/src/org/netbeans/modules/localtasks/QueryProviderImpl.java b/ide/localtasks/src/org/netbeans/modules/localtasks/QueryProviderImpl.java deleted file mode 100644 index 7ea5a51010af..000000000000 --- a/ide/localtasks/src/org/netbeans/modules/localtasks/QueryProviderImpl.java +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.netbeans.modules.localtasks; - -import org.netbeans.modules.localtasks.task.LocalTask; -import org.netbeans.modules.bugtracking.spi.QueryController; -import org.netbeans.modules.bugtracking.spi.QueryProvider; - -/** - * - * @author Ondrej Vrabec - */ -public class QueryProviderImpl implements QueryProvider { - - @Override - public String getDisplayName (LocalQuery q) { - return q.getDisplayName(); - } - - @Override - public String getTooltip (LocalQuery q) { - return q.getTooltip(); - } - - @Override - public QueryController getController (LocalQuery q) { - return null; - } - - @Override - public boolean canRemove(LocalQuery q) { - return false; - } - - @Override - public void remove (LocalQuery q) { - // NO OP - } - - @Override - public boolean canRename(LocalQuery q) { - return false; - } - - @Override - public void rename(LocalQuery q, String displayName) { - // NO OP - } - - @Override - public void refresh (LocalQuery query) { - query.refresh(); - } - - @Override - public void setIssueContainer(LocalQuery query, IssueContainer c) { - query.setIssueContainer(c); - } - -} diff --git a/ide/localtasks/src/org/netbeans/modules/localtasks/RepositoryProviderImpl.java b/ide/localtasks/src/org/netbeans/modules/localtasks/RepositoryProviderImpl.java deleted file mode 100644 index 71c32434dab6..000000000000 --- a/ide/localtasks/src/org/netbeans/modules/localtasks/RepositoryProviderImpl.java +++ /dev/null @@ -1,102 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.netbeans.modules.localtasks; - -import java.awt.Image; -import java.beans.PropertyChangeListener; -import java.util.Collection; -import java.util.Collections; -import org.netbeans.modules.localtasks.task.LocalTask; -import org.netbeans.modules.bugtracking.spi.RepositoryController; -import org.netbeans.modules.bugtracking.spi.RepositoryInfo; -import org.netbeans.modules.bugtracking.spi.RepositoryProvider; - -/** - * - * @author Ondrej Vrabec - */ -public class RepositoryProviderImpl implements RepositoryProvider { - - @Override - public RepositoryInfo getInfo (LocalRepository r) { - return new RepositoryInfo(r.getID(), LocalTaskConnector.CONNECTOR_NAME, r.getUrl(), r.getDisplayName(), r.getTooltip()); - } - - @Override - public Image getIcon (LocalRepository r) { - return r.getIcon(); - } - - @Override - public Collection getIssues (LocalRepository r, String... ids) { - return r.getTasks(ids); - } - - @Override - public void removed (LocalRepository r) { - throw new UnsupportedOperationException("Not supported for Local Tasks"); - } - - @Override - public RepositoryController getController (LocalRepository r) { - throw new UnsupportedOperationException("Not supported for Local Tasks"); - } - - @Override - public LocalQuery createQuery (LocalRepository r) { - return null; - } - - @Override - public LocalTask createIssue (LocalRepository r) { - return r.createTask(); - } - - @Override - public Collection getQueries (LocalRepository r) { - return r.getQueries(); - } - - @Override - public Collection simpleSearch (LocalRepository r, String criteria) { - return r.simpleSearch(criteria); - } - - @Override - public void removePropertyChangeListener (LocalRepository r, PropertyChangeListener listener) { - r.removePropertyChangeListener(listener); - } - - @Override - public void addPropertyChangeListener (LocalRepository r, PropertyChangeListener listener) { - r.addPropertyChangeListener(listener); - } - - @Override - public LocalTask createIssue(LocalRepository r, String summary, String description) { - throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. - } - - @Override - public boolean canAttachFiles(LocalRepository r) { - return true; - } - -} diff --git a/ide/localtasks/src/org/netbeans/modules/localtasks/resources/error.gif b/ide/localtasks/src/org/netbeans/modules/localtasks/resources/error.gif deleted file mode 100644 index e6bafc0fb33815e232ce1319ff86851257832efe..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 723 zcmV;^0xbQBP)004R=004l4008;_004mK004C`008P>0026d000+nm#LZ50007B zNkl*6RSkMLXB7A~?lot?N1Fs~a(Z5^YzVrdr^Z*Td2{Qm7fRJ5K z;;pG$;;v)Nz`(@F!0_h}1H;ds44kYS3_9Y{3|h==Oe-JXEjj+}Ge~VIOcOu=F~OXz zBOz7fu5ZG?AS%MZU}w+3@a-D|!Lw+zY1cfj#Nk}n-atkpiFtHRty$J>Y0mKBQ zy<8O4nHZRu85p#67#M_shPZh!Fns(3)EvyfAT72L^^8 zKY^|Q`a2<+fk9pYqFGUqfuXP%5~zRwFnsv;mjN2JU;q$6FawU>`S2R5IRT>i-aVkr zoj|2`fc60`tf*pO`1haT*8e{Y&~yO?009IuVB5YIPyhY>0(Ab$l|Y+;n%i3$7`_8z zpt+HO;r49?hIw-segkbk^6&RQkb0N_00D%Ykh(27c}hY#`50J!{suc2WFrGq{`dcX z49oxhU^w&dHz*;&(*ZyLAt$7s$TASS{}@B@GV0{~pV(E4hGkgWg!002ovPDHLk FV1h;|DI)*? diff --git a/ide/localtasks/src/org/netbeans/modules/localtasks/resources/error.svg b/ide/localtasks/src/org/netbeans/modules/localtasks/resources/error.svg deleted file mode 100644 index 57a6e4ba0602..000000000000 --- a/ide/localtasks/src/org/netbeans/modules/localtasks/resources/error.svg +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - - - - - - - - - - - - - diff --git a/ide/localtasks/src/org/netbeans/modules/localtasks/resources/info.png b/ide/localtasks/src/org/netbeans/modules/localtasks/resources/info.png deleted file mode 100644 index 6213c0cf8f22613611764df8cbe08d676b70ccf9..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 766 zcmVC<~1E~Zc4gq2fsPGLSUIWAn?rn^`i>w|XfEbZopy;R*`W4QJ3Biv;mHb@L42T}u43(^CU0|+2+82tP5Gg(_hhX2F2 z{|w*WeP#Ii^($CoVCgQnA>2Qi!88{K3xkG|DF5XfPm+P$Du4h28}R@C-%u_tE{4Z1 zzcT#z@q@wMP?Vt|%@nTLE^RZzk3W#`e*5t!0}oIwNDs&WfB=HUg39Ob3=H3X`~f>^ z^Wi59cbVOdbGf-0uHXNFGwwlZ zL3%&{Ab^-4VetLI&mZ53PCOvBAUz;9KmdUa`1}3+&L7`CFfcJOf${h6-x;)(gy0%L zY>*gC9;6ne2P6j&KwtxYe!R2r?W?DsfB*WI5RS_D1a^a_vgXipC9)Acztohw`V6#0QJ0q=>Z5JM)d3q w@(z#^24X=V=70+S0OI$cbOf^*1^@yK06O#`M#YtE_W%F@07*qoM6N<$f*NpEivR!s diff --git a/ide/localtasks/src/org/netbeans/modules/localtasks/resources/info.svg b/ide/localtasks/src/org/netbeans/modules/localtasks/resources/info.svg deleted file mode 100644 index db4c01180fbf..000000000000 --- a/ide/localtasks/src/org/netbeans/modules/localtasks/resources/info.svg +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - - - - - - - - - diff --git a/ide/localtasks/src/org/netbeans/modules/localtasks/resources/local_repo.png b/ide/localtasks/src/org/netbeans/modules/localtasks/resources/local_repo.png deleted file mode 100644 index 87ac7ab898c8201332f6801bd101bb420b37c5c7..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 669 zcmV;O0%HA%P)UKMNx252wnLrx{y++ zg+kSZJLw__1xslbDhi5-wLt>fkF+N3qHR7V%_Ny|5tDWjgJ*Lt=f3yhocA7qM{`cG zBC3YK00<8dP&pbV%V0heP2L%jvCPcf{L$-URE+SAOI@?~t_C_oXB6>Tz;1c}F#6ZqpOd?>c={m_wF1iJNPmytJJ=gUGz~Vhh6T{=u@P_w#k6L4W8XF-O#p{Y9P0A= zSX@ccclH$RZ6FE)0GeJQqv`zI$?7)$JVlVu@0| z2!LPlp?F=WJ?G$ULIUg!Ba{FLy6jx&4&ad`0QO7OQMUHWq_Y)LYiVlQ1``j98QsJq z!|c;1EX_xo#KQpL!LR2-p*PdhGq?VBpko3Dx`E-4FoC7{C=-)YD1N00lKP!uEHZlY zu!HJfV`5r_ieKT*{qZKi>z9ukMkwhRl`^@Kjh#Y;PKRI-T<;In&mZ0={_R0Fmq(Uu zIPDUeZtY}cLj%AiH5*v>Ae+;0I@`(HZR{1Si-Oc5J+l)mHPWg%;@R>0tlz=M`nor|M+z8|Noya{r~Z3&i~cj5&u8FdBTsb4j_QA zy5Q7O;}#}X9)?ek9x&`)HjUx+Q$_}9SxJVITc>8Cs|5%koPPiM>cs!meaZiAbw&P9 zs|^E(#j1`ljIaO*ASO(|`}PTmYcp{1iZcj_NrS~y6lB1(v=j%!k#(JIyUy)qgsBGz zAPfUOy*O2&$bH;zEL?0J9lgY+Wrrs@auI3Ww~Drhd0kG0dWBWh!K_-CY5^p&x`tl z5lj27Su;3k9mNozw2XxzuX_h0Kmf6z3u1zk3|B6&;LHjD0mMjYZUhJ*CI$)tK!5=N X1rz+?Z_i|w00000NkvXXu0mjfZEN(( diff --git a/ide/localtasks/src/org/netbeans/modules/localtasks/resources/warning.svg b/ide/localtasks/src/org/netbeans/modules/localtasks/resources/warning.svg deleted file mode 100644 index e5932382e489..000000000000 --- a/ide/localtasks/src/org/netbeans/modules/localtasks/resources/warning.svg +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - - - - - - - - - - - diff --git a/ide/localtasks/src/org/netbeans/modules/localtasks/task/AddSubtaskPanel.form b/ide/localtasks/src/org/netbeans/modules/localtasks/task/AddSubtaskPanel.form deleted file mode 100644 index 29d7027812f3..000000000000 --- a/ide/localtasks/src/org/netbeans/modules/localtasks/task/AddSubtaskPanel.form +++ /dev/null @@ -1,91 +0,0 @@ - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
diff --git a/ide/localtasks/src/org/netbeans/modules/localtasks/task/AddSubtaskPanel.java b/ide/localtasks/src/org/netbeans/modules/localtasks/task/AddSubtaskPanel.java deleted file mode 100644 index 7c5b3a934f2d..000000000000 --- a/ide/localtasks/src/org/netbeans/modules/localtasks/task/AddSubtaskPanel.java +++ /dev/null @@ -1,137 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -/* - * IzPanel.java - * - * Created on Nov 11, 2008, 3:32:39 PM - */ -package org.netbeans.modules.localtasks.task; - -import javax.swing.GroupLayout; -import javax.swing.JPanel; -import javax.swing.event.ChangeEvent; -import javax.swing.event.ChangeListener; -import org.netbeans.modules.bugtracking.api.Issue; -import org.netbeans.modules.bugtracking.api.IssueQuickSearch; -import org.netbeans.modules.bugtracking.api.Repository; -import org.openide.util.ChangeSupport; - -/** - * - * @author Tomas Stupka - * @author Marian Petras - */ -final class AddSubtaskPanel extends JPanel implements ChangeListener { - - private final IssueQuickSearch qs; - private Repository selectedRepository; - private final ChangeSupport support; - - AddSubtaskPanel () { - initComponents(); - - support = new ChangeSupport(this); - qs = IssueQuickSearch.create(); - qs.setChangeListener(this); - GroupLayout layout = (GroupLayout) getLayout(); - layout.replace(issuePanel, qs.getComponent()); - } - - Issue getIssue () { - return qs.getIssue(); - } - - Repository getSelectedRepository () { - return selectedRepository; - } - - /** - * This method is called from within the constructor to initialize the form. - * WARNING: Do NOT modify this code. The content of this method is always - * regenerated by the Form Editor. - */ - @SuppressWarnings("unchecked") - // //GEN-BEGIN:initComponents - private void initComponents() { - - buttonGroup1 = new javax.swing.ButtonGroup(); - issuePanel = new javax.swing.JPanel(); - - setFocusable(false); - - issuePanel.setLayout(new java.awt.BorderLayout()); - - errorLabel.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/netbeans/modules/localtasks/resources/error.gif"))); // NOI18N - org.openide.awt.Mnemonics.setLocalizedText(errorLabel, org.openide.util.NbBundle.getMessage(AddSubtaskPanel.class, "AddSubtaskPanel.errorLabel.text")); // NOI18N - - javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); - this.setLayout(layout); - layout.setHorizontalGroup( - layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(layout.createSequentialGroup() - .addContainerGap() - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(issuePanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addGroup(layout.createSequentialGroup() - .addComponent(errorLabel) - .addGap(0, 0, Short.MAX_VALUE))) - .addContainerGap()) - ); - layout.setVerticalGroup( - layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(layout.createSequentialGroup() - .addContainerGap() - .addComponent(issuePanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(errorLabel) - .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) - ); - }// //GEN-END:initComponents - - // Variables declaration - do not modify//GEN-BEGIN:variables - private javax.swing.ButtonGroup buttonGroup1; - final javax.swing.JLabel errorLabel = new javax.swing.JLabel(); - private javax.swing.JPanel issuePanel; - // End of variables declaration//GEN-END:variables - - @Override - public void addNotify () { - super.addNotify(); - } - - @Override - public void removeNotify () { - super.removeNotify(); - } - - @Override - public void stateChanged (ChangeEvent e) { - support.fireChange(); - } - - void addChangeListener (ChangeListener listener) { - support.addChangeListener(listener); - } - - void removeChangeListener (ChangeListener listener) { - support.removeChangeListener(listener); - } - -} diff --git a/ide/localtasks/src/org/netbeans/modules/localtasks/task/Bundle.properties b/ide/localtasks/src/org/netbeans/modules/localtasks/task/Bundle.properties deleted file mode 100644 index de8788f21c05..000000000000 --- a/ide/localtasks/src/org/netbeans/modules/localtasks/task/Bundle.properties +++ /dev/null @@ -1,45 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - -TaskPanel.refreshButton.text=linkButton1 -TaskPanel.btnDismiss.TTtext=Permanently deletes the task -TaskPanel.summaryLabel.text=Summary: -TaskPanel.summaryLabel.TTtext=Task's summary -TaskPanel.btnCancel.TTtext=Discards unsaved changes -TaskPanel.notesLabel.text=Notes: -TaskPanel.notesLabel.TTtext=Task's private notes -TaskPanel.btnFinish.TTtext=Finishes the task and marks it closed -TaskPanel.btnOpen.TTtext=Reopens this closed task -AddSubtaskPanel.repositoryLabel.TTtext=Repository to select a task from -AddSubtaskPanel.issueLabel.TTtext=Task to add as a subtask -TaskPanel.btnAddTaskReference.text=Add Task -AddSubtaskPanel.errorLabel.text=jLabel1 -TaskPanel.btnOpen.text=Reopen -TaskPanel.btnFinish.text=Finish -TaskPanel.btnDismiss.text=Delete -TaskPanel.btnCancel.text=Cancel -TaskPanel.btnOpen.text=Reopen -TaskPanel.dueDateLabel.toolTipText=Set task's due date -TaskPanel.dueDateLabel.text=Due Date: -TaskPanel.estimateLabel.text=Estimate: -TaskPanel.estimateLabel.TTtext=Set task's estimate in hours -TaskPanel.scheduleDateLabel.text=Schedule Date: -TaskPanel.scheduleDateLabel.TTtext=Set task's schedule date -TaskPanel.estimateField.text=0 -TaskPanel.attachmentsLabel.text=Attachments ({0}) -TaskPanel.attributesSection.label=My Private Task Details -TaskPanel.taskReferencesLabel.text=Related Tasks ({0}) diff --git a/ide/localtasks/src/org/netbeans/modules/localtasks/task/LocalTask.java b/ide/localtasks/src/org/netbeans/modules/localtasks/task/LocalTask.java deleted file mode 100644 index ea851ced64f1..000000000000 --- a/ide/localtasks/src/org/netbeans/modules/localtasks/task/LocalTask.java +++ /dev/null @@ -1,793 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.netbeans.modules.localtasks.task; - -import java.awt.event.ActionEvent; -import java.io.File; -import java.io.IOException; -import java.io.OutputStream; -import java.net.URI; -import java.net.URISyntaxException; -import java.util.ArrayList; -import java.util.Collections; -import java.util.Date; -import java.util.List; -import java.util.logging.Level; -import java.util.logging.Logger; -import javax.swing.AbstractAction; -import javax.swing.Action; -import javax.swing.JOptionPane; -import org.eclipse.mylyn.internal.tasks.core.data.FileTaskAttachmentSource; -import org.eclipse.mylyn.tasks.core.data.TaskAttachmentMapper; -import org.eclipse.mylyn.tasks.core.data.TaskAttribute; -import org.eclipse.mylyn.tasks.core.data.TaskData; -import org.netbeans.modules.bugtracking.api.Issue; -import org.netbeans.modules.bugtracking.spi.IssueController; -import org.netbeans.modules.localtasks.LocalRepository; -import org.netbeans.modules.localtasks.util.FileUtils; -import org.netbeans.modules.bugtracking.spi.IssueScheduleInfo; -import org.netbeans.modules.bugtracking.commons.AttachmentsPanel; -import org.netbeans.modules.bugtracking.commons.AttachmentsPanel.AttachmentInfo; -import org.netbeans.modules.mylyn.util.NbTask; -import org.netbeans.modules.mylyn.util.NbTaskDataModel; -import org.netbeans.modules.mylyn.util.localtasks.AbstractLocalTask; -import org.netbeans.modules.mylyn.util.localtasks.IssueField; -import org.openide.DialogDisplayer; -import org.openide.NotifyDescriptor; -import org.openide.filesystems.FileUtil; -import org.openide.modules.Places; -import org.openide.util.Exceptions; -import org.openide.util.NbBundle; -import org.openide.util.RequestProcessor; -import org.openide.util.Utilities; -import org.openide.windows.WindowManager; - -/** - * - * @author Ondrej Vrabec - */ -public final class LocalTask extends AbstractLocalTask { - - private final NbTask task; - private final LocalRepository repository; - private TaskController controller; - private static final RequestProcessor RP = LocalRepository.getInstance().getRequestProcessor(); - private static final String NB_ATTACHMENT = "nb.attachment."; //NOI18N - private static final String NB_TASK_REFERENCE = "nb.taskreference."; //NOI18N - private static final Object ATTACHMENT_STORAGE_LOCK = new Object(); - - private List unsavedAttachments; - private String tooltip = ""; - - public LocalTask (NbTask task) { - super(task); - this.task = task; - this.repository = LocalRepository.getInstance(); - updateTooltip(); - } - - @Override - protected void taskDeleted (NbTask task) { - repository.taskDeleted(getID()); - } - - @Override - protected void attributeChanged (NbTaskDataModel.NbTaskDataModelEvent event, NbTaskDataModel model) { - modelStateChanged(model.isDirty() || hasUnsavedAttributes()); - } - - @Override - protected void modelSaved (NbTaskDataModel model) { - modelStateChanged(model.isDirty() || hasUnsavedAttributes()); - } - - @Override - protected String getSummary (TaskData taskData) { - return getFieldValue(taskData, IssueField.SUMMARY); - } - - @Override - protected void taskDataUpdated () { - RP.post(new Runnable() { - @Override - public void run () { - dataChanged(); - } - }); - } - - private void dataChanged () { - updateTooltip(); - fireDataChanged(); - if (controller != null) { - controller.refreshViewData(); - } - } - - @NbBundle.Messages({ - "LBL_Task.tooltip.statusLabel=Status", - "LBL_Task.tooltip.status.open=Open", - "LBL_Task.tooltip.status.completed=Completed", - "CTL_Issue_Scheduled_Title=Scheduled", - "CTL_Issue_Due_Title=Due", - "CTL_Issue_Estimate_Title=Estimate" - }) - private boolean updateTooltip () { - String displayName = getDisplayName(); - if (displayName.startsWith("#")) { //NOI18N - displayName = displayName.replaceFirst("#", ""); //NOI18N - } - String oldTooltip = tooltip; - - String status = isFinished() ? Bundle.LBL_Task_tooltip_status_completed() : Bundle.LBL_Task_tooltip_status_open(); - - String scheduledLabel = Bundle.CTL_Issue_Scheduled_Title(); - String scheduled = getScheduleDisplayString(); - - String dueLabel = Bundle.CTL_Issue_Due_Title(); - String due = getDueDisplayString(); - - - String estimateLabel = Bundle.CTL_Issue_Estimate_Title(); - String estimate = getEstimateDisplayString(); - - String fieldTable = "" //NOI18N - + ""; //NOI18N - - if (!scheduled.isEmpty()) { - fieldTable += ""; //NOI18N - } - if (!due.isEmpty()) { - fieldTable += ""; //NOI18N - } - if (!estimate.isEmpty()) { - fieldTable += ""; //NOI18N - } - fieldTable += "
" + Bundle.LBL_Task_tooltip_statusLabel() + ":" + status + "
" + scheduledLabel + ":" + scheduled + "
" + dueLabel + ":" + due + "
" + estimateLabel + ":" + estimate + "
"; //NOI18N - - StringBuilder sb = new StringBuilder(""); //NOI18N - sb.append("").append(displayName).append(""); //NOI18N - sb.append("
"); //NOI18N - sb.append(fieldTable); - sb.append(""); //NOI18N - tooltip = sb.toString(); - return !oldTooltip.equals(tooltip); - } - - @Override - protected void taskModified (boolean syncStateChanged) { - updateTooltip(); - fireDataChanged(); - } - - @Override - protected void repositoryTaskDataLoaded (TaskData repositoryTaskData) { - // NO OP - } - - @Override - public boolean synchronizeTask () { - return true; - } - - @NbBundle.Messages({ - "# {0} - task id", "# {1} - task summary", "LBL_LocalTask.displayName=#{0} - {1}" - }) - public String getDisplayName () { - return Bundle.LBL_LocalTask_displayName(getID(task), task.getSummary()); - } - - public String getTooltip () { - return tooltip; - } - - public boolean searchFor (String[] keywords) { - String summary = getSummary().toLowerCase(); - for (String kw : keywords) { - kw = kw.toLowerCase(); - if (summary.contains(kw)) { - return true; - } - } - return false; - } - - public IssueController getController () { - return getTaskController(); - } - - TaskController getTaskController () { - if (controller == null) { - controller = new TaskController(this); - } - return controller; - } - - void opened () { - LocalRepository.getInstance().getRequestProcessor().post(new Runnable() { - @Override - public void run () { - if (editorOpened()) { - getTaskController().refreshViewData(); - } else { - // should close somehow - } - } - }); - } - - void closed () { - LocalRepository.getInstance().getRequestProcessor().post(new Runnable() { - @Override - public void run () { - editorClosed(); - } - }); - } - - public void delete () { - runWithModelLoaded(new Runnable() { - @Override - public void run () { - for (Attachment att : getAttachments()) { - if (att.isInCentral()) { - String uri = att.getUri(); - try { - File f = Utilities.toFile(new URI(uri)); - f.delete(); - } catch (URISyntaxException ex) { - // not interested - } - } - } - clearUnsavedChanges(); - } - }); - fireChanged(); - if (controller != null) { - controller.taskDeleted(); - } - deleteTask(); - } - - void markUserChange () { - markNewRead(); - } - - String getFieldValue (IssueField field) { - NbTaskDataModel model = getModel(); - return getFieldValue(model == null ? null : model.getLocalTaskData(), field); - } - - List getFieldValues (IssueField field) { - NbTaskDataModel model = getModel(); - return getFieldValues(model == null ? null : model.getLocalTaskData(), field); - } - - void setFieldValue (IssueField field, String value) { - NbTaskDataModel m = getModel(); - // should not happen, setFieldValue either runs with model lock - // or it is called from issue editor in AWT - the editor could not be closed by user in the meantime - assert m != null; - TaskData taskData = m.getLocalTaskData(); - TaskAttribute a = taskData.getRoot().getMappedAttribute(field.getKey()); - assert a != null : field.getKey(); - if (!value.equals(a.getValue())) { - setValue(m, a, value); - } - } - - private static String getFieldValue (TaskData taskData, IssueField field) { - if (taskData == null) { - return ""; - } - TaskAttribute a = taskData.getRoot().getAttribute(field.getKey()); - if (a == null) { - return ""; //NOI18N - } else if (a.getValues().size() > 1) { - return listValues(a); - } else { - return a.getValue(); - } - } - - private static List getFieldValues (TaskData taskData, IssueField field) { - if (taskData == null) { - return Collections.emptyList(); - } - TaskAttribute a = taskData.getRoot().getAttribute(field.getKey()); - if (a == null) { - return Collections.emptyList(); - } else { - return a.getValues(); - } - } - - private static String listValues (TaskAttribute a) { - if (a == null) { - return ""; //NOI18N - } - StringBuilder sb = new StringBuilder(); - for (String s : a.getValues()) { - sb.append(s); - sb.append(","); //NOI18N - } - if (sb.length() > 0) { - sb.delete(sb.length() - 1, sb.length()); - } - return sb.toString(); - } - - private void setValue (NbTaskDataModel model, TaskAttribute ta, String value) { - ta.setValue(value); - model.attributeChanged(ta); - } - - private boolean hasUnsavedAttributes () { - return hasUnsavedAttachments() || hasUnsavedPrivateTaskAttributes(); - } - - boolean hasUnsavedAttachments () { - return unsavedAttachments != null; - } - - public boolean save () { - NbTaskDataModel model = getModel(); - TaskData taskData = model == null ? null : model.getLocalTaskData(); - if (taskData != null) { - getNbTask().setSummary(taskData.getRoot().getAttribute(IssueField.SUMMARY.getKey()).getValue()); - persistAttachments(model, taskData); - fireDataChanged(); - } - return saveChanges(); - } - - void clearModifications () { - unsavedAttachments = null; - clearUnsavedChanges(); - } - - boolean hasSubtasks () { - return !getTaskReferences().isEmpty(); - } - - List getAttachments () { - NbTaskDataModel model = getModel(); - TaskData taskData = model == null ? null : model.getLocalTaskData(); - List attachments = new ArrayList<>(); - TaskAttribute parentTA = taskData == null ? null : taskData.getRoot().getAttribute(IssueField.ATTACHMENTS.getKey()); - if (parentTA != null) { - for (TaskAttribute ta : parentTA.getAttributes().values()) { - if (ta.getId().startsWith(NB_ATTACHMENT)) { - attachments.add(new Attachment(ta)); - } - } - } - return attachments; - } - - List getUnsubmittedAttachments () { - return unsavedAttachments == null - ? Collections.emptyList() - : Collections.unmodifiableList(unsavedAttachments); - } - - void setUnsubmittedAttachments (List attachments) { - unsavedAttachments = new ArrayList<>(attachments); - modelStateChanged(true); - } - - private void persistAttachments (NbTaskDataModel model, TaskData td) { - if (unsavedAttachments != null) { - TaskAttribute parentTA = td.getRoot().getAttribute(IssueField.ATTACHMENTS.getKey()); - if (parentTA == null) { - parentTA = td.getRoot().createAttribute(IssueField.ATTACHMENTS.getKey()); - } - if (!unsavedAttachments.isEmpty()) { - boolean copyToCentral = askCopyToCentralStorage(unsavedAttachments.size()); - for (AttachmentInfo att : unsavedAttachments) { - File file = att.getFile(); - if (file != null) { - String desc = att.getDescription(); - String contentType = att.getContentType(); - boolean isPatch = att.isPatch(); - addAttachment(model, parentTA, file, desc, contentType, isPatch, copyToCentral); - } - } - unsavedAttachments.clear(); - } - } - } - - private void addAttachment (NbTaskDataModel model, TaskAttribute parentTA, - File file, String desc, String contentType, boolean isPatch, - boolean copyToCentralStorage) { - if (desc == null) { - desc = ""; - } - if (contentType == null) { - file = FileUtil.normalizeFile(file); - String ct = FileUtil.getMIMEType(FileUtil.toFileObject(file)); - if ((ct != null) && (!"content/unknown".equals(ct))) { // NOI18N - contentType = ct; - } else { - contentType = FileTaskAttachmentSource.getContentTypeFromFilename(file.getName()); - } - } - int attachmentIndex = parentTA.getAttributes().size(); - TaskAttribute attachment = parentTA.createAttribute(NB_ATTACHMENT + attachmentIndex); - TaskAttachmentMapper mapper = new TaskAttachmentMapper(); - mapper.setAttachmentId(String.valueOf(attachmentIndex)); - mapper.setDescription(desc); - mapper.setFileName(file.getName()); - mapper.setPatch(isPatch); - mapper.setCreationDate(new Date()); - mapper.setContentType(contentType); - File realFile = copyToCentralStorage ? copyFileToCentral(file) : file; - mapper.setUrl(Utilities.toURI(realFile).toString()); - // abuse this attribute and mark the patch residing in the central storage - mapper.setReplaceExisting(copyToCentralStorage); - mapper.applyTo(attachment); - model.attributeChanged(parentTA); - } - - private void deleteAttachment (TaskAttribute ta) { - NbTaskDataModel model = getModel(); - TaskData taskData = model == null ? null : model.getLocalTaskData(); - TaskAttribute parentTA = taskData == null ? null : taskData.getRoot().getAttribute(IssueField.ATTACHMENTS.getKey()); - if (parentTA != null) { - if (parentTA.getAttribute(ta.getId()) != null) { - parentTA.removeAttribute(ta.getId()); - model.attributeChanged(parentTA); - getTaskController().attachmentDeleted(); - } - } - } - - void addTaskReference (Issue task) { - NbTaskDataModel model = getModel(); - TaskData taskData = model == null ? null : model.getLocalTaskData(); - if (taskData != null) { - TaskAttribute parentTA = taskData.getRoot().getAttribute(IssueField.REFERENCES.getKey()); - if (parentTA == null) { - parentTA = taskData.getRoot().createAttribute(IssueField.REFERENCES.getKey()); - } - int index = parentTA.getAttributes().size(); - TaskAttribute attr = parentTA.createAttribute(NB_TASK_REFERENCE + index); - TaskReference taskRef = new TaskReference(task); - taskRef.applyTo(attr); - model.attributeChanged(parentTA); - } - } - - List getTaskReferences () { - NbTaskDataModel model = getModel(); - TaskData taskData = model == null ? null : model.getLocalTaskData(); - List references = new ArrayList<>(); - TaskAttribute parentTA = taskData == null ? null : taskData.getRoot().getAttribute(IssueField.REFERENCES.getKey()); - if (parentTA != null) { - for (TaskAttribute ta : parentTA.getAttributes().values()) { - if (ta.getId().startsWith(NB_TASK_REFERENCE)) { - references.add(TaskReference.createFrom(ta)); - } - } - } - return references; - } - - void removeTaskReference (String repositoryId, String taskId) { - NbTaskDataModel model = getModel(); - TaskData taskData = model == null ? null : model.getLocalTaskData(); - if (taskData != null) { - TaskAttribute parentTA = taskData.getRoot().getAttribute(IssueField.REFERENCES.getKey()); - if (parentTA != null) { - for (TaskAttribute ta : parentTA.getAttributes().values()) { - if (ta.getId().startsWith(NB_TASK_REFERENCE)) { - TaskReference ref = TaskReference.createFrom(ta); - if (repositoryId.equals(ref.getRepositoryId()) && taskId.equals(ref.getTaskId())) { - parentTA.removeAttribute(ta.getId()); - break; - } - } - } - } - model.attributeChanged(parentTA); - } - } - - void setTaskPrivateNotes (String notes) { - super.setPrivateNotes(notes); - modelStateChanged(true); - } - - public void setTaskDueDate (Date date, boolean persistChange) { - super.setDueDate(date, persistChange); - modelStateChanged(hasUnsavedChanges()); - if (persistChange) { - dataChanged(); - } - } - - public void setTaskScheduleDate (IssueScheduleInfo date, boolean persistChange) { - super.setScheduleDate(date, persistChange); - modelStateChanged(hasUnsavedChanges()); - if (persistChange) { - dataChanged(); - } - } - - public void setTaskEstimate (int estimate, boolean persistChange) { - super.setEstimate(estimate, persistChange); - modelStateChanged(hasUnsavedChanges()); - if (persistChange) { - dataChanged(); - } - } - - public void addComment (String comment, boolean closeAsFixed) { - if (comment != null && !comment.isEmpty()) { - String notes = getPrivateNotes(); - notes += "\n\n" + comment; - setPrivateNotes(notes); - } - if (closeAsFixed) { - finish(); - } - save(); - modelStateChanged(false); - if (controller != null) { - controller.refreshViewData(); - } - } - - public void attachPatch (final File file, final String description) { - if (file != null) { - runWithModelLoaded(new Runnable() { - - @Override - public void run () { - NbTaskDataModel model = getModel(); - TaskData td = model == null ? null : model.getLocalTaskData(); - if (td != null) { - TaskAttribute parentTA = td.getRoot().getAttribute(IssueField.ATTACHMENTS.getKey()); - if (parentTA == null) { - parentTA = td.getRoot().createAttribute(IssueField.ATTACHMENTS.getKey()); - } - addAttachment(model, parentTA, file, description, null, true, true); - save(); - modelStateChanged(false); - if (controller != null) { - controller.refreshViewData(); - } - } - } - }); - } - } - - void fireChangeEvent () { - fireChanged(); - } - - private void modelStateChanged (boolean dirty) { - if (controller != null) { - controller.modelStateChanged(dirty); - } - } - - @NbBundle.Messages({ - "LBL_LocalTask.copyAttToCentralStorage.title=Copy Attachment", - "# {0} - number of attachments", - "MSG_LocalTask.copyAttToCentralStorage.text=You are trying to add {0} attachments to the local task.\n" - + "The attachments will be kept in their original locations and linked from the task\n\n" - + "Do you want to copy the files to a central storage to make sure they will be accessible " - + "even after their original location is deleted?" - }) - private boolean askCopyToCentralStorage (int attachmentCount) { - NotifyDescriptor nd = new NotifyDescriptor.Confirmation( - Bundle.MSG_LocalTask_copyAttToCentralStorage_text(attachmentCount), - Bundle.LBL_LocalTask_copyAttToCentralStorage_title(), - NotifyDescriptor.YES_NO_OPTION, NotifyDescriptor.QUESTION_MESSAGE); - return DialogDisplayer.getDefault().notify(nd) == NotifyDescriptor.YES_OPTION; - } - - private File copyFileToCentral (File file) { - File destFolder = new File(Places.getUserDirectory().getAbsolutePath() - + ("/var/tasks/mylyn/tasks/" + repository.getTaskRepository().getConnectorKind() //NOI18N - + "-" + repository.getTaskRepository().getUrl()+ "/offline/attachments").replace("/", File.separator)); //NOI18N - destFolder.mkdirs(); - synchronized (ATTACHMENT_STORAGE_LOCK) { - File destFile = new File(destFolder, file.getName()); - if (destFile.exists()) { - int i = 1; - while (destFile.exists()) { - destFile = new File(destFolder, i + "_" + file.getName()); - i = i + 1; - } - } - try { - FileUtils.copyFile(file, destFile); - } catch (IOException ex) { - Logger.getLogger(LocalTask.class.getName()).log(Level.INFO, "Cannot copy " + file //NOI18N - + " to " + destFile + ", will stick with the original", ex); //NOI18N - destFile = file; - } - return destFile; - } - } - - static final class TaskReference { - - private final String repositoryId; - private final String taskId; - - public TaskReference (String repositoryId, String taskId) { - this.repositoryId = repositoryId; - this.taskId = taskId; - } - - private TaskReference (Issue task) { - this.repositoryId = task.getRepository().getId(); - this.taskId = task.getID(); - } - - public String getTaskId () { - return taskId; - } - - public String getRepositoryId () { - return repositoryId; - } - - private void applyTo (TaskAttribute attr) { - attr.createAttribute("task.repository").setValue(repositoryId); - attr.createAttribute("task.id").setValue(taskId); - } - - private static TaskReference createFrom (TaskAttribute ta) { - String repositoryId = ""; - String taskId = ""; - TaskAttribute attr = ta.getAttribute("task.repository"); - if (attr != null) { - repositoryId = attr.getValue(); - } - attr = ta.getAttribute("task.id"); - if (attr != null) { - taskId = attr.getValue(); - } - return new TaskReference(repositoryId, taskId); - } - } - - class Attachment extends AttachmentsPanel.AbstractAttachment { - - private final TaskAttribute ta; - private final String desc; - private final String filename; - private final Date date; - private final String contentType; - private final boolean isPatch; - private final String uri; - private Action deleteAction; - private final boolean residesInCentral; - - public Attachment (TaskAttribute ta) { - TaskAttachmentMapper taskAttachment = TaskAttachmentMapper.createFrom(ta); - this.ta = ta; - this.desc = taskAttachment.getDescription(); - this.filename = taskAttachment.getFileName(); - this.date = taskAttachment.getCreationDate(); - this.contentType = taskAttachment.getContentType(); - this.isPatch = taskAttachment.isPatch(); - this.uri = taskAttachment.getUrl(); - Boolean inCentral = taskAttachment.getReplaceExisting(); - this.residesInCentral = Boolean.TRUE.equals(inCentral); - } - - @Override - public String getAuthorName () { - return ""; - } - - @Override - public String getAuthor () { - return ""; - } - - @Override - public Date getDate () { - return date; - } - - @Override - public String getDesc () { - return desc; - } - - @Override - public String getFilename () { - return filename; - } - - @Override - public String getContentType () { - return contentType; - } - - @Override - public boolean isPatch () { - return isPatch; - } - - @Override - public void getAttachementData (final OutputStream os) { - try { - File f = Utilities.toFile(new URI(uri)); - FileUtils.copyStreamsCloseAll(os, FileUtils.createInputStream(f)); - } catch (URISyntaxException | IOException ex) { - Exceptions.printStackTrace(ex); - } - } - - @Override - public boolean canBeDeleted () { - return true; - } - - @Override - public Action getDeleteAction () { - if (deleteAction == null) { - deleteAction = new DeleteAttachmentAction(); - } - return deleteAction; - } - - public String getUri () { - return uri; - } - - public boolean isInCentral () { - return residesInCentral; - } - - @NbBundle.Messages({ - "CTL_AttachmentAction.Remove=Remove", - "MSG_AttachmentAction.Remove.confirm.text=Do you want to permanently remove the attachment?", - "LBL_AttachmentAction.Remove.confirm.title=Remove Attachment" - }) - private class DeleteAttachmentAction extends AbstractAction { - - public DeleteAttachmentAction() { - putValue(NAME, Bundle.CTL_AttachmentAction_Remove()); - } - - @Override - public void actionPerformed(ActionEvent e) { - if (JOptionPane.YES_OPTION == JOptionPane.showConfirmDialog(WindowManager.getDefault().getMainWindow(), - Bundle.MSG_AttachmentAction_Remove_confirm_text(), - Bundle.LBL_AttachmentAction_Remove_confirm_title(), - JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE)) { - deleteAttachment(ta); - } - } - } - - } - -} diff --git a/ide/localtasks/src/org/netbeans/modules/localtasks/task/SubtaskTableModel.java b/ide/localtasks/src/org/netbeans/modules/localtasks/task/SubtaskTableModel.java deleted file mode 100644 index efa293601729..000000000000 --- a/ide/localtasks/src/org/netbeans/modules/localtasks/task/SubtaskTableModel.java +++ /dev/null @@ -1,114 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.netbeans.modules.localtasks.task; - -import java.util.List; -import javax.swing.table.DefaultTableModel; -import org.netbeans.modules.bugtracking.api.Issue; -import org.netbeans.modules.bugtracking.api.Repository; -import org.netbeans.modules.bugtracking.api.RepositoryManager; -import org.netbeans.modules.localtasks.task.LocalTask.TaskReference; -import org.openide.util.NbBundle; - -/** - * - * @author Jan Stola - */ -class SubtaskTableModel extends DefaultTableModel { - private final Object[][] data; - - public SubtaskTableModel (List subtasks) { - super(columnNames(), subtasks.size()); - this.data = data(subtasks); - } - - @NbBundle.Messages({ - "SubtaskTableModel.repository=Repository", - "SubtaskTableModel.summary=Summary" - }) - private static String[] columnNames () { - String summary = Bundle.SubtaskTableModel_summary(); - String repository = Bundle.SubtaskTableModel_repository(); - return new String[] { summary, repository }; - } - - @Override - public Class getColumnClass (int columnIndex) { - Class clazz = String.class; - return clazz; - } - - @NbBundle.Messages({ - "MSG_SubtaskPanel.repository.unknown=Unknown", - "# {0} - task id", "MSG_SubtaskPanel.task.unknown=#{0} - Unknown" - }) - private static Object[][] data (List subtasks) { - Object[][] data = new Object[subtasks.size()][]; - int count = 0; - for (TaskReference ref : subtasks) { - String repositoryId = ref.getRepositoryId(); - String taskId = ref.getTaskId(); - Repository repository = null; - for (Repository r : RepositoryManager.getInstance().getRepositories()) { - if (repositoryId.equals(r.getId())) { - repository = r; - break; - } - } - String repositoryName; - String taskName = null; - if (repository == null) { - repositoryName = Bundle.MSG_SubtaskPanel_repository_unknown(); - } else { - repositoryName = repository.getDisplayName(); - if (!taskId.isEmpty()) { - Issue[] tasks = repository.getIssues(taskId); - for (Issue t : tasks) { - if (taskId.equals(t.getID())) { - taskName = t.getDisplayName(); - } - } - } - } - if (taskName == null) { - taskName = Bundle.MSG_SubtaskPanel_task_unknown(taskId); - } - - data[count] = new Object[]{ - taskName, - repositoryName, - repositoryId, - taskId - }; - count++; - } - return data; - } - - @Override - public boolean isCellEditable (int row, int column) { - return false; - } - - @Override - public Object getValueAt (int row, int column) { - return data[row][column]; - } - -} diff --git a/ide/localtasks/src/org/netbeans/modules/localtasks/task/TaskController.java b/ide/localtasks/src/org/netbeans/modules/localtasks/task/TaskController.java deleted file mode 100644 index 5dbaba68717a..000000000000 --- a/ide/localtasks/src/org/netbeans/modules/localtasks/task/TaskController.java +++ /dev/null @@ -1,135 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.netbeans.modules.localtasks.task; - -import java.awt.Container; -import java.beans.PropertyChangeListener; -import javax.swing.JComponent; -import javax.swing.SwingUtilities; -import org.netbeans.modules.bugtracking.spi.IssueController; -import org.openide.util.HelpCtx; -import org.openide.util.Mutex; -import org.openide.windows.TopComponent; - -/** - * - * @author Ondrej Vrabec - */ -final class TaskController implements IssueController { - private final LocalTask task; - private final TaskPanel panel; - private boolean opened; - - public TaskController (LocalTask task) { - this.task = task; - this.panel = new TaskPanel(task); - } - - @Override - public JComponent getComponent () { - return panel; - } - - @Override - public HelpCtx getHelpCtx () { - return new HelpCtx("org.netbeans.modules.localtasks.editor.TaskPanel"); //NOI18N - } - - @Override - public void opened () { - if (!opened) { - opened = true; - panel.opened(); - task.opened(); - } - } - - @Override - public void closed () { - if (opened) { - task.closed(); - panel.closed(); - opened = false; - } - } - - void refreshViewData () { - Mutex.EVENT.readAccess(new Runnable() { - - @Override - public void run () { - panel.refreshViewData(); - } - }); - } - - void modelStateChanged (boolean dirty) { - panel.modelStateChanged(dirty); - } - - void attachmentDeleted () { - Mutex.EVENT.readAccess(new Runnable() { - - @Override - public void run () { - panel.attachmentDeleted(); - } - }); - } - - @Override - public boolean saveChanges() { - return panel.saveChanges(); - } - - @Override - public boolean discardUnsavedChanges() { - return panel.discardUnsavedChanges(); - } - - @Override - public void addPropertyChangeListener(PropertyChangeListener l) { - task.addPropertyChangeListener(l); - } - - @Override - public void removePropertyChangeListener(PropertyChangeListener l) { - task.removePropertyChangeListener(l); - } - - @Override - public boolean isChanged() { - return task.hasUnsavedChanges() || task.hasUnsavedAttachments(); - } - - void taskDeleted () { - Mutex.EVENT.readAccess(new Mutex.Action() { - - @Override - public Void run () { - Container tc = SwingUtilities.getAncestorOfClass(TopComponent.class, panel); - if (tc instanceof TopComponent) { - ((TopComponent) tc).close(); - } - return null; - } - }); - } -} diff --git a/ide/localtasks/src/org/netbeans/modules/localtasks/task/TaskPanel.form b/ide/localtasks/src/org/netbeans/modules/localtasks/task/TaskPanel.form deleted file mode 100644 index c90f14fce72d..000000000000 --- a/ide/localtasks/src/org/netbeans/modules/localtasks/task/TaskPanel.form +++ /dev/null @@ -1,590 +0,0 @@ - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
diff --git a/ide/localtasks/src/org/netbeans/modules/localtasks/task/TaskPanel.java b/ide/localtasks/src/org/netbeans/modules/localtasks/task/TaskPanel.java deleted file mode 100644 index e98d7a2c113e..000000000000 --- a/ide/localtasks/src/org/netbeans/modules/localtasks/task/TaskPanel.java +++ /dev/null @@ -1,1429 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.netbeans.modules.localtasks.task; - -import org.netbeans.modules.localtasks.LocalRepositoryConfig; -import java.awt.Color; -import java.awt.Component; -import java.awt.Container; -import java.awt.Dialog; -import java.awt.Dimension; -import java.awt.EventQueue; -import java.awt.Font; -import java.awt.Insets; -import java.awt.Point; -import java.awt.Rectangle; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.awt.event.MouseAdapter; -import java.awt.event.MouseEvent; -import java.text.ParseException; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.logging.Level; -import java.util.logging.Logger; -import javax.swing.AbstractAction; -import javax.swing.AbstractButton; -import javax.swing.Action; -import javax.swing.GroupLayout; -import javax.swing.ImageIcon; -import javax.swing.JButton; -import javax.swing.JCheckBox; -import javax.swing.JComboBox; -import javax.swing.JComponent; -import javax.swing.JLabel; -import javax.swing.JList; -import javax.swing.JOptionPane; -import javax.swing.JPopupMenu; -import javax.swing.JScrollPane; -import javax.swing.JTable; -import javax.swing.JTextArea; -import javax.swing.JTextField; -import javax.swing.ListModel; -import javax.swing.SwingUtilities; -import javax.swing.UIManager; -import javax.swing.event.CaretEvent; -import javax.swing.event.CaretListener; -import javax.swing.event.ChangeEvent; -import javax.swing.event.ChangeListener; -import javax.swing.event.DocumentEvent; -import javax.swing.event.DocumentListener; -import javax.swing.event.ListSelectionEvent; -import javax.swing.event.ListSelectionListener; -import javax.swing.plaf.basic.BasicTextFieldUI; -import javax.swing.table.TableModel; -import javax.swing.text.BadLocationException; -import javax.swing.text.Caret; -import javax.swing.text.DefaultCaret; -import javax.swing.text.JTextComponent; -import javax.swing.text.NumberFormatter; -import org.netbeans.modules.bugtracking.api.Issue; -import org.netbeans.modules.bugtracking.api.Repository; -import org.netbeans.modules.bugtracking.api.RepositoryManager; -import org.netbeans.modules.bugtracking.api.Util; -import org.netbeans.modules.bugtracking.issuetable.TableSorter; -import org.netbeans.modules.localtasks.LocalRepository; -import org.netbeans.modules.localtasks.task.LocalTask.Attachment; -import org.netbeans.modules.localtasks.task.LocalTask.TaskReference; -import org.netbeans.modules.bugtracking.commons.AttachmentsPanel; -import org.netbeans.modules.bugtracking.commons.UIUtils; -import org.netbeans.modules.bugtracking.spi.SchedulePicker; -import org.netbeans.modules.mylyn.util.NbDateRange; -import org.netbeans.modules.mylyn.util.localtasks.IssueField; -import org.netbeans.modules.spellchecker.api.Spellchecker; -import org.netbeans.modules.team.ide.spi.IDEServices; -import org.openide.DialogDescriptor; -import org.openide.DialogDisplayer; -import org.openide.awt.Mnemonics; -import org.openide.util.ImageUtilities; -import org.openide.util.Mutex; -import org.openide.util.NbBundle; -import org.openide.util.RequestProcessor; -import org.openide.windows.WindowManager; - -/** - * - * @author Ondrej Vrabec - */ -final class TaskPanel extends javax.swing.JPanel { - - private final LocalTask task; - private final Map enableMap = new HashMap<>(); - private static final RequestProcessor RP = LocalRepository.getInstance().getRequestProcessor(); - private boolean skipReload; - private final Set unsavedFields = new UnsavedFieldSet(); - private boolean reloading; - private boolean noSummary; - private static final String ATTRIBUTE_PRIVATE_NOTES = "nb.private.notes"; //NOI18N - private static final String ATTRIBUTE_ESTIMATE = "nb.estimate"; //NOI18N - private static final String ATTRIBUTE_DUE_DATE = "nb.due.date"; //NOI18N - private static final String ATTRIBUTE_SCHEDULE_DATE = "nb.schedule.date"; //NOI18N - private static final String ATTRIBUTE_ATTACHMENTS = "nb.unsaved.attachments"; //NOI18N - private static final String ATTRIBUTE_SUBTASKS = "nb.unsaved.subtasks"; //NOI18N - private static final String SECTION_ATTRIBUTES = ".attributes"; //NOI18N - private static final String SECTION_ATTACHMENTS = ".attachments"; //NOI18N - private static final String SECTION_REFERENCES = ".references"; //NOI18N - private JTable subTaskTable; - private JScrollPane subTaskScrollPane; - private final AttachmentsPanel attachmentsPanel; - private static final Logger LOG = LocalRepository.LOG; - private final IDEServices.DatePickerComponent dueDatePicker; - private final SchedulePicker scheduleDatePicker; - private static final NumberFormatter estimateFormatter = new NumberFormatter(new java.text.DecimalFormat("#0")) { - - @Override - public Object stringToValue (String text) throws ParseException { - Number value = (Number) super.stringToValue(text); - if (value == null) { - value = 0; - } - if (value.intValue() < 0) { - return 0; - } else { - return value.intValue(); - } - } - - }; - private Action[] referenceSectionActions; - private Action[] attachmentsSectionActions; - - /** - * Creates new form TaskPanel - */ - public TaskPanel (LocalTask task) { - this.task = task; - initComponents(); - updateReadOnlyField(headerField); - Font font = new JLabel().getFont(); - headerField.setFont(font.deriveFont((float) (font.getSize() * 1.7))); - - mainScrollPane.getVerticalScrollBar().setUnitIncrement(10); - - privateNotesField.addCaretListener(new CaretListener() { - @Override - public void caretUpdate (CaretEvent e) { - makeCaretVisible(privateNotesField); - } - }); - // A11Y - Issues 163597 and 163598 - UIUtils.fixFocusTraversalKeys(privateNotesField); - initSpellChecker(); - - attachmentsPanel = new AttachmentsPanel(this); - attachmentsSection.setContent(attachmentsPanel); - - GroupLayout layout = (GroupLayout) attributesPanel.getLayout(); - dueDatePicker = UIUtils.createDatePickerComponent(); - scheduleDatePicker = new SchedulePicker(); - layout.replace(dummyDueDateField, dueDatePicker.getComponent()); - dueDateLabel.setLabelFor(dueDatePicker.getComponent()); - layout.replace(dummyScheduleDateField, scheduleDatePicker.getComponent()); - scheduleDateLabel.setLabelFor(scheduleDatePicker.getComponent()); - attachListeners(); - } - - void opened () { - enableComponents(false); - restoreSections(); - } - - void closed () { - persistSections(); - } - - @NbBundle.Messages({ - "# {0} - task id", "# {1} - task summary", "LBL_TaskEditor.headerField.text=Task {0} - {1}" - }) - void refreshViewData () { - assert EventQueue.isDispatchThread(); - if (skipReload) { - return; - } - enableComponents(true); - reloading = true; - String headerTxt = Bundle.LBL_TaskEditor_headerField_text(task.getID(), task.getSummary()); - headerField.setText(headerTxt); - Dimension dim = headerField.getPreferredSize(); - headerField.setMinimumSize(new Dimension(0, dim.height)); - headerField.setPreferredSize(new Dimension(0, dim.height)); - - // fields - reloadField(summaryField, IssueField.SUMMARY); - privateNotesField.setText(task.getPrivateNotes()); - dueDatePicker.setDate(task.getDueDate()); - NbDateRange scheduleDate = task.getScheduleDate(); - scheduleDatePicker.setScheduleDate(scheduleDate == null ? null : scheduleDate.toSchedulingInfo()); - estimateField.setValue(task.getEstimate()); - - boolean finished = task.isFinished(); - btnOpen.setVisible(finished); - separatorOpenLabel.setVisible(finished); - btnFinish.setVisible(!finished); - separatorFinishLabel.setVisible(!finished); - - boolean hasSubtasks = task.hasSubtasks(); - btnAddTaskReference.setVisible(hasSubtasks); - if (hasSubtasks) { - if (subTaskTable == null) { - subTaskTable = new JTable(); - subTaskTable.addMouseListener(new SubTaskTableMouseListener()); - subTaskScrollPane = new JScrollPane(subTaskTable); - } - RP.post(new Runnable() { - @Override - public void run () { - final SubtaskTableModel tableModel = new SubtaskTableModel(task.getTaskReferences()); - EventQueue.invokeLater(new Runnable() { - @Override - public void run () { - TableSorter sorter = new TableSorter(tableModel); - subTaskTable.setModel(sorter); - sorter.setTableHeader(subTaskTable.getTableHeader()); - - // Table height tweaks - int height = 0; - for (int row = 0; row < tableModel.getRowCount(); row++) { - height += subTaskTable.getRowHeight(row); - } - subTaskTable.setPreferredScrollableViewportSize(new Dimension( - subTaskTable.getPreferredScrollableViewportSize().width, - height - )); - - if (subTaskScrollPane.getParent() == null) { - ((GroupLayout) referencesPanel.getLayout()).replace(emptyTaskReferencesPanel, subTaskScrollPane); - } - referencesSection.setLabel(NbBundle.getMessage(TaskPanel.class, "TaskPanel.taskReferencesLabel.text", tableModel.getRowCount())); //NOI18N - revalidate(); - } - }); - } - }); - } else { - referencesSection.setLabel(NbBundle.getMessage(TaskPanel.class, "TaskPanel.taskReferencesLabel.text", 0)); //NOI18N - } - List attachments = task.getAttachments(); - List unsaved = task.getUnsubmittedAttachments(); - attachmentsPanel.setAttachments(attachments, unsaved, null); - attachmentsSection.setLabel(NbBundle.getMessage(TaskPanel.class, "TaskPanel.attachmentsLabel.text", attachments.size())); //NOI18N - UIUtils.keepFocusedComponentVisible(attachmentsPanel, this); - - updateFieldStatuses(); - updateNoSummary(); - updateMessagePanel(); - btnCancel.setEnabled(task.hasUnsavedChanges()); - reloading = false; - repaint(); - } - - /** - * This method is called from within the constructor to initialize the form. - * WARNING: Do NOT modify this code. The content of this method is always - * regenerated by the Form Editor. - */ - @SuppressWarnings("unchecked") - // //GEN-BEGIN:initComponents - private void initComponents() { - - referencesPanel = new javax.swing.JPanel(); - emptyTaskReferencesPanel = new javax.swing.JPanel(); - btnAddTaskReference = new org.netbeans.modules.bugtracking.commons.LinkButton(); - attributesPanel = new javax.swing.JPanel(); - dueDateLabel = new javax.swing.JLabel(); - summaryLabel = new javax.swing.JLabel(); - summaryField = new javax.swing.JTextField(); - jScrollPane1 = new javax.swing.JScrollPane(); - privateNotesField = new javax.swing.JTextArea() { - @Override - public Dimension getPreferredScrollableViewportSize() { - Dimension dim = super.getPreferredScrollableViewportSize(); - JScrollPane scrollPane = (JScrollPane)SwingUtilities.getAncestorOfClass(JScrollPane.class, this); - int delta = 0; - if (scrollPane != null) { - Component comp = scrollPane.getHorizontalScrollBar(); - delta = comp.isVisible() ? comp.getHeight() : 0; - } - Insets insets = getInsets(); - int prefHeight = 5 * getRowHeight() + insets.top + insets.bottom; - dim = new Dimension(dim.width, delta + ((dim.height < prefHeight) ? prefHeight : dim.height)); - return dim; - } - }; - estimateField = new javax.swing.JFormattedTextField(); - estimateLabel = new javax.swing.JLabel(); - scheduleDateLabel = new javax.swing.JLabel(); - dummyScheduleDateField = new javax.swing.JTextField(); - notesLabel = new javax.swing.JLabel(); - dummyDueDateField = new javax.swing.JTextField(); - headerPanel = new javax.swing.JPanel(); - headerField = new javax.swing.JTextField(); - jPanel2 = new javax.swing.JPanel(); - btnCancel = new org.netbeans.modules.bugtracking.commons.LinkButton(); - separatorDismissLabel = new javax.swing.JLabel(); - btnDismiss = new org.netbeans.modules.bugtracking.commons.LinkButton(); - separatorFinishLabel = new javax.swing.JLabel(); - btnFinish = new org.netbeans.modules.bugtracking.commons.LinkButton(); - separatorOpenLabel = new javax.swing.JLabel(); - btnOpen = new org.netbeans.modules.bugtracking.commons.LinkButton(); - mainScrollPane = new javax.swing.JScrollPane(); - jPanel1 = new javax.swing.JPanel(); - messagePanel = new javax.swing.JPanel(); - attributesSection = new org.netbeans.modules.bugtracking.commons.CollapsibleSectionPanel(); - referencesSection = new org.netbeans.modules.bugtracking.commons.CollapsibleSectionPanel(); - attachmentsSection = new org.netbeans.modules.bugtracking.commons.CollapsibleSectionPanel(); - - referencesPanel.setBackground(javax.swing.UIManager.getDefaults().getColor("TextArea.background")); - - emptyTaskReferencesPanel.setBackground(javax.swing.UIManager.getDefaults().getColor("TextArea.background")); - - javax.swing.GroupLayout emptyTaskReferencesPanelLayout = new javax.swing.GroupLayout(emptyTaskReferencesPanel); - emptyTaskReferencesPanel.setLayout(emptyTaskReferencesPanelLayout); - emptyTaskReferencesPanelLayout.setHorizontalGroup( - emptyTaskReferencesPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGap(0, 0, Short.MAX_VALUE) - ); - emptyTaskReferencesPanelLayout.setVerticalGroup( - emptyTaskReferencesPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGap(0, 0, Short.MAX_VALUE) - ); - - org.openide.awt.Mnemonics.setLocalizedText(btnAddTaskReference, org.openide.util.NbBundle.getMessage(TaskPanel.class, "TaskPanel.btnAddTaskReference.text")); // NOI18N - btnAddTaskReference.addActionListener(new java.awt.event.ActionListener() { - public void actionPerformed(java.awt.event.ActionEvent evt) { - btnAddTaskReferenceActionPerformed(evt); - } - }); - - javax.swing.GroupLayout referencesPanelLayout = new javax.swing.GroupLayout(referencesPanel); - referencesPanel.setLayout(referencesPanelLayout); - referencesPanelLayout.setHorizontalGroup( - referencesPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(referencesPanelLayout.createSequentialGroup() - .addGap(0, 0, 0) - .addGroup(referencesPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(referencesPanelLayout.createSequentialGroup() - .addComponent(btnAddTaskReference, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addContainerGap(322, Short.MAX_VALUE)) - .addComponent(emptyTaskReferencesPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))) - ); - referencesPanelLayout.setVerticalGroup( - referencesPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(referencesPanelLayout.createSequentialGroup() - .addComponent(emptyTaskReferencesPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(btnAddTaskReference, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) - ); - - attributesPanel.setBackground(javax.swing.UIManager.getDefaults().getColor("TextArea.background")); - - dueDateLabel.setLabelFor(dummyDueDateField); - org.openide.awt.Mnemonics.setLocalizedText(dueDateLabel, org.openide.util.NbBundle.getMessage(TaskPanel.class, "TaskPanel.dueDateLabel.text")); // NOI18N - dueDateLabel.setToolTipText(org.openide.util.NbBundle.getMessage(TaskPanel.class, "TaskPanel.dueDateLabel.toolTipText")); // NOI18N - - summaryLabel.setLabelFor(summaryField); - org.openide.awt.Mnemonics.setLocalizedText(summaryLabel, org.openide.util.NbBundle.getMessage(TaskPanel.class, "TaskPanel.summaryLabel.text")); // NOI18N - summaryLabel.setToolTipText(org.openide.util.NbBundle.getMessage(TaskPanel.class, "TaskPanel.summaryLabel.TTtext")); // NOI18N - - jScrollPane1.setVerticalScrollBarPolicy(javax.swing.ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER); - - privateNotesField.setColumns(20); - privateNotesField.setLineWrap(true); - privateNotesField.setWrapStyleWord(true); - jScrollPane1.setViewportView(privateNotesField); - - estimateField.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(estimateFormatter)); - estimateField.setText(org.openide.util.NbBundle.getMessage(TaskPanel.class, "TaskPanel.estimateField.text")); // NOI18N - - estimateLabel.setLabelFor(estimateField); - org.openide.awt.Mnemonics.setLocalizedText(estimateLabel, org.openide.util.NbBundle.getMessage(TaskPanel.class, "TaskPanel.estimateLabel.text")); // NOI18N - estimateLabel.setToolTipText(org.openide.util.NbBundle.getMessage(TaskPanel.class, "TaskPanel.estimateLabel.TTtext")); // NOI18N - - scheduleDateLabel.setLabelFor(dummyScheduleDateField); - org.openide.awt.Mnemonics.setLocalizedText(scheduleDateLabel, org.openide.util.NbBundle.getMessage(TaskPanel.class, "TaskPanel.scheduleDateLabel.text")); // NOI18N - scheduleDateLabel.setToolTipText(org.openide.util.NbBundle.getMessage(TaskPanel.class, "TaskPanel.scheduleDateLabel.TTtext")); // NOI18N - - notesLabel.setLabelFor(privateNotesField); - org.openide.awt.Mnemonics.setLocalizedText(notesLabel, org.openide.util.NbBundle.getMessage(TaskPanel.class, "TaskPanel.notesLabel.text")); // NOI18N - notesLabel.setToolTipText(org.openide.util.NbBundle.getMessage(TaskPanel.class, "TaskPanel.notesLabel.TTtext")); // NOI18N - - javax.swing.GroupLayout attributesPanelLayout = new javax.swing.GroupLayout(attributesPanel); - attributesPanel.setLayout(attributesPanelLayout); - attributesPanelLayout.setHorizontalGroup( - attributesPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(attributesPanelLayout.createSequentialGroup() - .addGap(0, 0, 0) - .addGroup(attributesPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(attributesPanelLayout.createSequentialGroup() - .addGap(3, 3, 3) - .addComponent(dueDateLabel)) - .addGroup(attributesPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) - .addComponent(notesLabel) - .addComponent(summaryLabel))) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addGroup(attributesPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(summaryField) - .addComponent(jScrollPane1) - .addGroup(attributesPanelLayout.createSequentialGroup() - .addComponent(dummyDueDateField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(scheduleDateLabel) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(dummyScheduleDateField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) - .addComponent(estimateLabel) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(estimateField, javax.swing.GroupLayout.PREFERRED_SIZE, 65, javax.swing.GroupLayout.PREFERRED_SIZE) - .addGap(0, 38, Short.MAX_VALUE))) - .addGap(0, 0, 0)) - ); - attributesPanelLayout.setVerticalGroup( - attributesPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(attributesPanelLayout.createSequentialGroup() - .addGap(0, 0, 0) - .addGroup(attributesPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER) - .addComponent(summaryLabel) - .addComponent(summaryField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) - .addGroup(attributesPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) - .addComponent(scheduleDateLabel) - .addComponent(dueDateLabel) - .addComponent(estimateLabel) - .addComponent(dummyDueDateField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(estimateField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(dummyScheduleDateField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) - .addGroup(attributesPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(notesLabel) - .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addGap(0, 0, 0)) - ); - - setBackground(javax.swing.UIManager.getDefaults().getColor("TextArea.background")); - - headerPanel.setBackground(javax.swing.UIManager.getDefaults().getColor("TextArea.background")); - - headerField.setEditable(false); - headerField.setBorder(javax.swing.BorderFactory.createEmptyBorder(1, 1, 1, 1)); - - jPanel2.setBackground(javax.swing.UIManager.getDefaults().getColor("TextArea.background")); - - org.openide.awt.Mnemonics.setLocalizedText(btnCancel, org.openide.util.NbBundle.getMessage(TaskPanel.class, "TaskPanel.btnCancel.text")); // NOI18N - btnCancel.setToolTipText(org.openide.util.NbBundle.getMessage(TaskPanel.class, "TaskPanel.btnCancel.TTtext")); // NOI18N - btnCancel.addActionListener(new java.awt.event.ActionListener() { - public void actionPerformed(java.awt.event.ActionEvent evt) { - btnCancelActionPerformed(evt); - } - }); - - separatorDismissLabel.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0))); - separatorDismissLabel.setFocusable(false); - - org.openide.awt.Mnemonics.setLocalizedText(btnDismiss, org.openide.util.NbBundle.getMessage(TaskPanel.class, "TaskPanel.btnDismiss.text")); // NOI18N - btnDismiss.setToolTipText(org.openide.util.NbBundle.getMessage(TaskPanel.class, "TaskPanel.btnDismiss.TTtext")); // NOI18N - btnDismiss.addActionListener(new java.awt.event.ActionListener() { - public void actionPerformed(java.awt.event.ActionEvent evt) { - btnDismissActionPerformed(evt); - } - }); - - separatorFinishLabel.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0))); - separatorFinishLabel.setFocusable(false); - - org.openide.awt.Mnemonics.setLocalizedText(btnFinish, org.openide.util.NbBundle.getMessage(TaskPanel.class, "TaskPanel.btnFinish.text")); // NOI18N - btnFinish.setToolTipText(org.openide.util.NbBundle.getMessage(TaskPanel.class, "TaskPanel.btnFinish.TTtext")); // NOI18N - btnFinish.addActionListener(new java.awt.event.ActionListener() { - public void actionPerformed(java.awt.event.ActionEvent evt) { - btnFinishActionPerformed(evt); - } - }); - - separatorOpenLabel.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0))); - separatorOpenLabel.setFocusable(false); - - org.openide.awt.Mnemonics.setLocalizedText(btnOpen, org.openide.util.NbBundle.getMessage(TaskPanel.class, "TaskPanel.btnOpen.text")); // NOI18N - btnOpen.setToolTipText(org.openide.util.NbBundle.getMessage(TaskPanel.class, "TaskPanel.btnOpen.TTtext")); // NOI18N - btnOpen.addActionListener(new java.awt.event.ActionListener() { - public void actionPerformed(java.awt.event.ActionEvent evt) { - btnOpenActionPerformed(evt); - } - }); - - javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2); - jPanel2.setLayout(jPanel2Layout); - jPanel2Layout.setHorizontalGroup( - jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(jPanel2Layout.createSequentialGroup() - .addContainerGap() - .addComponent(btnCancel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(separatorDismissLabel) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(btnDismiss, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(separatorFinishLabel) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(btnFinish, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(separatorOpenLabel) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(btnOpen, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addGap(0, 0, 0)) - ); - jPanel2Layout.setVerticalGroup( - jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(jPanel2Layout.createSequentialGroup() - .addGap(0, 0, 0) - .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER) - .addComponent(btnCancel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(separatorDismissLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addComponent(btnDismiss, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(separatorFinishLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addComponent(btnFinish, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(separatorOpenLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addComponent(btnOpen, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))) - ); - - javax.swing.GroupLayout headerPanelLayout = new javax.swing.GroupLayout(headerPanel); - headerPanel.setLayout(headerPanelLayout); - headerPanelLayout.setHorizontalGroup( - headerPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(headerPanelLayout.createSequentialGroup() - .addContainerGap() - .addComponent(headerField) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addContainerGap()) - ); - headerPanelLayout.setVerticalGroup( - headerPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(headerPanelLayout.createSequentialGroup() - .addContainerGap() - .addGroup(headerPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER) - .addComponent(headerField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) - ); - - mainScrollPane.setBorder(null); - - jPanel1.setBackground(javax.swing.UIManager.getDefaults().getColor("TextArea.background")); - - messagePanel.setBackground(javax.swing.UIManager.getDefaults().getColor("TextArea.background")); - messagePanel.setLayout(new javax.swing.BoxLayout(messagePanel, javax.swing.BoxLayout.Y_AXIS)); - - attributesSection.setBackground(javax.swing.UIManager.getDefaults().getColor("TextArea.background")); - attributesSection.setContent(attributesPanel); - attributesSection.setLabel(org.openide.util.NbBundle.getMessage(TaskPanel.class, "TaskPanel.attributesSection.label")); // NOI18N - - referencesSection.setBackground(javax.swing.UIManager.getDefaults().getColor("TextArea.background")); - referencesSection.setActions(getReferencesSectionActions()); - referencesSection.setContent(referencesPanel); - referencesSection.setLabel(org.openide.util.NbBundle.getMessage(TaskPanel.class, "TaskPanel.taskReferencesLabel.text", 0)); // NOI18N - - attachmentsSection.setBackground(javax.swing.UIManager.getDefaults().getColor("TextArea.background")); - attachmentsSection.setActions(getAttachmentsSectionActions()); - attachmentsSection.setLabel(org.openide.util.NbBundle.getMessage(TaskPanel.class, "TaskPanel.attachmentsLabel.text", 0)); // NOI18N - - javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); - jPanel1.setLayout(jPanel1Layout); - jPanel1Layout.setHorizontalGroup( - jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup() - .addContainerGap() - .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) - .addComponent(messagePanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addComponent(attachmentsSection, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addComponent(referencesSection, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addComponent(attributesSection, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) - .addContainerGap()) - ); - jPanel1Layout.setVerticalGroup( - jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(jPanel1Layout.createSequentialGroup() - .addContainerGap() - .addComponent(attributesSection, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) - .addComponent(referencesSection, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) - .addComponent(attachmentsSection, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) - .addComponent(messagePanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) - ); - - mainScrollPane.setViewportView(jPanel1); - - javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); - this.setLayout(layout); - layout.setHorizontalGroup( - layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(layout.createSequentialGroup() - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(headerPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addComponent(mainScrollPane)) - .addGap(0, 0, 0)) - ); - layout.setVerticalGroup( - layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(layout.createSequentialGroup() - .addComponent(headerPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(mainScrollPane)) - ); - }// //GEN-END:initComponents - - private void btnCancelActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnCancelActionPerformed - discardUnsavedChanges(); - }//GEN-LAST:event_btnCancelActionPerformed - - @NbBundle.Messages({ - "LBL_IssuePanel.deleteTask.title=Delete New Task?", - "MSG_IssuePanel.deleteTask.message=Do you want to permanently delete the task?" - }) - private void btnDismissActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnDismissActionPerformed - if (JOptionPane.YES_OPTION != JOptionPane.showConfirmDialog(WindowManager.getDefault().getMainWindow(), - Bundle.MSG_IssuePanel_deleteTask_message(), - Bundle.LBL_IssuePanel_deleteTask_title(), JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE)) { - return; - } - RP.post(new Runnable() { - @Override - public void run () { - task.delete(); - } - }); - }//GEN-LAST:event_btnDismissActionPerformed - - private void btnFinishActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnFinishActionPerformed - skipReload = true; - enableComponents(false); - RP.post(new Runnable() { - @Override - public void run () { - boolean finished = false; - try { - finished = task.finish(); - } finally { - final boolean fFinished = finished; - EventQueue.invokeLater(new Runnable() { - @Override - public void run () { - enableComponents(true); - btnOpen.setVisible(fFinished); - separatorOpenLabel.setVisible(fFinished); - btnFinish.setVisible(!fFinished); - separatorFinishLabel.setVisible(!fFinished); - skipReload = false; - } - }); - } - } - }); - }//GEN-LAST:event_btnFinishActionPerformed - - private void btnOpenActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnOpenActionPerformed - skipReload = true; - enableComponents(false); - RP.post(new Runnable() { - @Override - public void run () { - boolean open = false; - try { - open = task.reopen(); - } finally { - final boolean fOpened = open; - EventQueue.invokeLater(new Runnable() { - @Override - public void run () { - enableComponents(true); - btnOpen.setVisible(!fOpened); - separatorOpenLabel.setVisible(!fOpened); - btnFinish.setVisible(fOpened); - separatorFinishLabel.setVisible(fOpened); - skipReload = false; - } - }); - } - } - }); - }//GEN-LAST:event_btnOpenActionPerformed - - @NbBundle.Messages({ - "CTL_SelectSubtask_ok=&Add Task", - "LBL_SelectSubtask_title=Select Task", - "MSG_SelectSubtask.error.alreadyreferenced=Selected task already referenced.", - "MSG_SelectSubtask.error.sametask=Cannot reference to the same task." - }) - private void btnAddTaskReferenceActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnAddTaskReferenceActionPerformed - referencesSection.setExpanded(true); - final JButton okButton = new JButton(); - Mnemonics.setLocalizedText(okButton, Bundle.CTL_SelectSubtask_ok()); - okButton.setEnabled(false); - final AddSubtaskPanel panel = new AddSubtaskPanel(); - panel.addChangeListener(new ChangeListener() { - @Override - public void stateChanged (ChangeEvent e) { - boolean enabled = panel.getIssue() != null; - panel.errorLabel.setVisible(false); - if (enabled) { - String repoId = panel.getIssue().getRepository().getId(); - String taskId = panel.getIssue().getID(); - if (repoId.equals(LocalRepository.getInstance().getRepository().getId()) - && taskId.equals(task.getID())) { - panel.errorLabel.setText(Bundle.MSG_SelectSubtask_error_sametask()); - panel.errorLabel.setVisible(true); - enabled = false; - } else { - for (TaskReference ref : task.getTaskReferences()) { - if (repoId.equals(ref.getRepositoryId()) && taskId.equals(ref.getTaskId())) { - panel.errorLabel.setText(Bundle.MSG_SelectSubtask_error_alreadyreferenced()); - panel.errorLabel.setVisible(true); - enabled = false; - } - } - } - } - okButton.setEnabled(enabled); - } - }); - DialogDescriptor dd = new DialogDescriptor(panel, Bundle.LBL_SelectSubtask_title(), true, - new Object[] { okButton, DialogDescriptor.CANCEL_OPTION }, okButton, DialogDescriptor.DEFAULT_ALIGN, - null, null); - Dialog dlg = DialogDisplayer.getDefault().createDialog(dd); - dlg.pack(); - panel.errorLabel.setVisible(false); - dlg.setVisible(true); - Issue issue = panel.getIssue(); - if (dd.getValue() == okButton && issue != null) { - unsavedFields.add(ATTRIBUTE_SUBTASKS); - updateFieldDecorations(ATTRIBUTE_SUBTASKS, referencesSection.getLabelComponent()); - task.addTaskReference(issue); - refreshViewData(); - } - }//GEN-LAST:event_btnAddTaskReferenceActionPerformed - - - // Variables declaration - do not modify//GEN-BEGIN:variables - private org.netbeans.modules.bugtracking.commons.CollapsibleSectionPanel attachmentsSection; - private javax.swing.JPanel attributesPanel; - private org.netbeans.modules.bugtracking.commons.CollapsibleSectionPanel attributesSection; - private org.netbeans.modules.bugtracking.commons.LinkButton btnAddTaskReference; - private org.netbeans.modules.bugtracking.commons.LinkButton btnCancel; - private org.netbeans.modules.bugtracking.commons.LinkButton btnDismiss; - private org.netbeans.modules.bugtracking.commons.LinkButton btnFinish; - private org.netbeans.modules.bugtracking.commons.LinkButton btnOpen; - private javax.swing.JLabel dueDateLabel; - private javax.swing.JTextField dummyDueDateField; - private javax.swing.JTextField dummyScheduleDateField; - private javax.swing.JPanel emptyTaskReferencesPanel; - private javax.swing.JFormattedTextField estimateField; - private javax.swing.JLabel estimateLabel; - private javax.swing.JTextField headerField; - private javax.swing.JPanel headerPanel; - private javax.swing.JPanel jPanel1; - private javax.swing.JPanel jPanel2; - private javax.swing.JScrollPane jScrollPane1; - private javax.swing.JScrollPane mainScrollPane; - private javax.swing.JPanel messagePanel; - private javax.swing.JLabel notesLabel; - private javax.swing.JTextArea privateNotesField; - private javax.swing.JPanel referencesPanel; - private org.netbeans.modules.bugtracking.commons.CollapsibleSectionPanel referencesSection; - private javax.swing.JLabel scheduleDateLabel; - private javax.swing.JLabel separatorDismissLabel; - private javax.swing.JLabel separatorFinishLabel; - private javax.swing.JLabel separatorOpenLabel; - private javax.swing.JTextField summaryField; - private javax.swing.JLabel summaryLabel; - // End of variables declaration//GEN-END:variables - - private void enableComponents (boolean enable) { - enableComponents(this, enable); - if (enable) { - enableMap.clear(); - } - } - - private void enableComponents (Component comp, boolean enable) { - if (comp instanceof Container) { - for (Component subComp : ((Container) comp).getComponents()) { - enableComponents(subComp, enable); - } - } - if ((comp instanceof JComboBox) - || ((comp instanceof JTextComponent) && ((JTextComponent) comp).isEditable()) - || (comp instanceof AbstractButton) || (comp instanceof JList)) { - if (enable) { - Boolean b = enableMap.get(comp); - if (b != null) { - comp.setEnabled(b); - } - } else { - enableMap.put(comp, comp.isEnabled()); - comp.setEnabled(false); - } - } - } - - private void updateReadOnlyField (JTextField field) { - if ("GTK".equals(UIManager.getLookAndFeel().getID())) { // NOI18N - field.setUI(new BasicTextFieldUI()); - } - Color bkColor = getBackground(); - if (null != bkColor) { - bkColor = new Color(bkColor.getRGB()); - } - field.setBackground(bkColor); - Caret caret = field.getCaret(); - if (caret instanceof DefaultCaret) { - ((DefaultCaret) caret).setUpdatePolicy(DefaultCaret.NEVER_UPDATE); - } - } - - private void updateFieldStatuses () { - updateFieldDecorations(IssueField.SUMMARY.getKey(), summaryLabel); - updateFieldDecorations(ATTRIBUTE_PRIVATE_NOTES, notesLabel); - updateFieldDecorations(ATTRIBUTE_ATTACHMENTS, attachmentsSection.getLabelComponent()); - updateFieldDecorations(ATTRIBUTE_SUBTASKS, referencesSection.getLabelComponent()); - updateFieldDecorations(ATTRIBUTE_DUE_DATE, dueDateLabel); - updateFieldDecorations(ATTRIBUTE_SCHEDULE_DATE, scheduleDateLabel); - updateFieldDecorations(ATTRIBUTE_ESTIMATE, estimateLabel); - } - - private void updateFieldDecorations (String key, JComponent fieldLabel) { - boolean fieldDirty = unsavedFields.contains(key); - if (fieldLabel != null) { - if (fieldDirty) { - fieldLabel.setFont(fieldLabel.getFont().deriveFont(fieldLabel.getFont().getStyle() | Font.BOLD)); - } else { - fieldLabel.setFont(fieldLabel.getFont().deriveFont(fieldLabel.getFont().getStyle() & ~Font.BOLD)); - } - } - } - - void modelStateChanged (final boolean dirty) { - Mutex.EVENT.readAccess(new Runnable() { - @Override - public void run () { - if (!reloading && dirty) { - task.markUserChange(); - } - if (!dirty) { - unsavedFields.clear(); - } - if (enableMap.isEmpty()) { - btnCancel.setEnabled(dirty); - } else { - enableMap.put(btnCancel, dirty); - } - - if (dirty) { - task.fireChangeEvent(); - } - } - }); - } - - private void reloadField (JComponent component, IssueField field) { - String newValue; - newValue = task.getFieldValue(field); - boolean fieldDirty = unsavedFields.contains(field.getKey()); - if (!fieldDirty) { - if (component instanceof JComboBox) { - throw new UnsupportedOperationException(); - } else if (component instanceof JTextComponent) { - ((JTextComponent) component).setText(newValue); - } else if (component instanceof JList) { - JList list = (JList) component; - list.clearSelection(); - ListModel model = list.getModel(); - for (String value : task.getFieldValues(field)) { - for (int i = 0; i < model.getSize(); i++) { - if (value.equals(model.getElementAt(i))) { - list.addSelectionInterval(i, i); - } - } - } - } else if (component instanceof JCheckBox) { - ((JCheckBox) component).setSelected("1".equals(newValue)); - } - } - } - - private void updateNoSummary () { - boolean oldSummary = noSummary; - noSummary = summaryField.getText().trim().isEmpty(); - if (noSummary != oldSummary) { - updateMessagePanel(); - } - } - - @NbBundle.Messages({ - "IssuePanel.noSummary=Missing summary." - }) - private void updateMessagePanel () { - messagePanel.removeAll(); - if (noSummary) { - JLabel noSummaryLabel = new JLabel(); - noSummaryLabel.setText(Bundle.IssuePanel_noSummary()); - String icon = "org/netbeans/modules/localtasks/resources/error.gif"; //NOI18N - noSummaryLabel.setIcon(ImageUtilities.loadIcon(icon)); - messagePanel.add(noSummaryLabel); - } - if (noSummary) { - messagePanel.setVisible(true); - messagePanel.revalidate(); - } else { - messagePanel.setVisible(false); - } - } - - private void attachListeners () { - summaryField.getDocument().addDocumentListener(new DocumentListener() { - @Override - public void insertUpdate (DocumentEvent e) { - changedUpdate(e); - } - - @Override - public void removeUpdate (DocumentEvent e) { - changedUpdate(e); - } - - @Override - public void changedUpdate (DocumentEvent e) { - updateNoSummary(); - } - }); - - // field listeners - summaryField.getDocument().addDocumentListener(new FieldChangeListener(summaryField, IssueField.SUMMARY, summaryLabel)); - privateNotesField.getDocument().addDocumentListener(new TaskAttributeListener(privateNotesField, ATTRIBUTE_PRIVATE_NOTES, notesLabel) { - - @Override - protected boolean storeValue () { - task.setTaskPrivateNotes(privateNotesField.getText()); - return true; - } - }); - dueDatePicker.addChangeListener(new DatePickerListener(dueDatePicker.getComponent(), - ATTRIBUTE_DUE_DATE, dueDateLabel) { - - @Override - protected boolean storeValue () { - task.setTaskDueDate(dueDatePicker.getDate(), false); - return true; - } - }); - scheduleDatePicker.addChangeListener(new DatePickerListener(scheduleDatePicker.getComponent(), - ATTRIBUTE_SCHEDULE_DATE, scheduleDateLabel) { - - @Override - protected boolean storeValue () { - task.setTaskScheduleDate(scheduleDatePicker.getScheduleDate(), false); - return true; - } - }); - estimateField.getDocument().addDocumentListener(new TaskAttributeListener(estimateField, - ATTRIBUTE_ESTIMATE, estimateLabel) { - - @Override - protected boolean storeValue () { - int value = ((Number) estimateField.getValue()).intValue(); - if (value != task.getEstimate()) { - task.setTaskEstimate(value, false); - return true; - } else { - return false; - } - } - - }); - attachmentsPanel.addChangeListener(new ChangeListener() { - @Override - public void stateChanged (ChangeEvent e) { - if (!reloading && attachmentsPanel.isVisible()) { - task.setUnsubmittedAttachments(attachmentsPanel.getNewAttachments()); - unsavedFields.add(ATTRIBUTE_ATTACHMENTS); - updateFieldDecorations(ATTRIBUTE_ATTACHMENTS, attachmentsSection.getLabelComponent()); - } - } - }); - } - - private void storeFieldValue (IssueField field, JTextComponent textComponent) { - storeFieldValue(field, textComponent.getText()); - } - - private void storeFieldValue (IssueField field, String value) { - boolean changed = false; - if (changed || !task.getFieldValue(field).equals(value)) { - unsavedFields.add(field.getKey()); - task.setFieldValue(field, value); - } - } - - void attachmentDeleted () { - unsavedFields.add(ATTRIBUTE_ATTACHMENTS); - refreshViewData(); - } - - private void makeCaretVisible (JTextArea textArea) { - int pos = textArea.getCaretPosition(); - try { - Rectangle rec = textArea.getUI().modelToView(textArea, pos); - if (rec != null) { - Point p = SwingUtilities.convertPoint(textArea, rec.x, rec.y, this); - scrollRectToVisible(new Rectangle(p.x, p.y, rec.width, rec.height)); - } - } catch (BadLocationException blex) { - LOG.log(Level.INFO, blex.getMessage(), blex); - } - } - - private void initSpellChecker () { - Spellchecker.register(summaryField); - Spellchecker.register(privateNotesField); - } - - private Action[] getReferencesSectionActions () { - if (referenceSectionActions == null) { - referenceSectionActions = new Action[] { - new AbstractAction(NbBundle.getMessage(TaskPanel.class, "TaskPanel.btnAddTaskReference.text")) { //NOI18N - - @Override - public void actionPerformed (ActionEvent e) { - btnAddTaskReferenceActionPerformed(e); - } - } - }; - } - return referenceSectionActions; - } - - @NbBundle.Messages({ - "CTL_Attachment.action.create=Add Attachment" - }) - private Action[] getAttachmentsSectionActions () { - if (attachmentsSectionActions == null) { - attachmentsSectionActions = new Action[] { - new AbstractAction(Bundle.CTL_Attachment_action_create()) { - - @Override - public void actionPerformed (ActionEvent e) { - attachmentsSection.setExpanded(true); - EventQueue.invokeLater(new Runnable() { - - @Override - public void run () { - attachmentsPanel.createAttachment(); - } - }); - } - } - }; - } - return attachmentsSectionActions; - } - - private void persistSections () { - LocalRepositoryConfig config = LocalRepositoryConfig.getInstance(); - config.setEditorSectionCollapsed(task.getID(), SECTION_ATTRIBUTES, !attributesSection.isExpanded()); - config.setEditorSectionCollapsed(task.getID(), SECTION_REFERENCES, !referencesSection.isExpanded()); - config.setEditorSectionCollapsed(task.getID(), SECTION_ATTACHMENTS, !attachmentsSection.isExpanded()); - } - - private void restoreSections () { - LocalRepositoryConfig config = LocalRepositoryConfig.getInstance(); - attributesSection.setExpanded(!config.isEditorSectionCollapsed(task.getID(), SECTION_ATTRIBUTES, false)); - attachmentsSection.setExpanded(!config.isEditorSectionCollapsed(task.getID(), SECTION_ATTACHMENTS, true)); - referencesSection.setExpanded(!config.isEditorSectionCollapsed(task.getID(), SECTION_REFERENCES, true)); - } - - boolean saveChanges () { - skipReload = true; - enableComponents(false); - final boolean retval[] = new boolean[] { true }; - Runnable outOfAWT = new Runnable() { - @Override - public void run () { - retval[0] = false; - try { - retval[0] = task.save(); - } finally { - EventQueue.invokeLater(new Runnable() { - @Override - public void run () { - unsavedFields.clear(); - enableComponents(true); - skipReload = false; - refreshViewData(); - } - }); - } - } - }; - if (EventQueue.isDispatchThread()) { - RP.post(outOfAWT); - return true; - } else { - outOfAWT.run(); - return retval[0]; - } - } - - boolean discardUnsavedChanges () { - skipReload = true; - enableComponents(false); - Runnable outOfAWT = new Runnable() { - @Override - public void run () { - try { - task.clearModifications(); - } finally { - EventQueue.invokeLater(new Runnable() { - @Override - public void run () { - unsavedFields.clear(); - enableComponents(true); - btnCancel.setEnabled(false); - skipReload = false; - refreshViewData(); - } - }); - } - } - }; - if (EventQueue.isDispatchThread()) { - RP.post(outOfAWT); - } else { - outOfAWT.run(); - } - return true; - } - - void addChangeListener(ChangeListener l) { - throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. - } - - void removeChangeListener(ChangeListener l) { - throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. - } - - private class SubTaskTableMouseListener extends MouseAdapter { - - @Override - public void mouseClicked (MouseEvent e) { - handleMouseEvent(e, false); - } - - @Override - public void mouseReleased (MouseEvent e) { - handleMouseEvent(e, true); - } - - @Override - public void mousePressed (MouseEvent e) { - handleMouseEvent(e, true); - } - - private void handleMouseEvent (MouseEvent e, boolean popup) { - final Point p = e.getPoint(); - int row = subTaskTable.rowAtPoint(p); - TableModel model = subTaskTable.getModel(); - final String repositoryId = (String) model.getValueAt(row, 2); - final String taskId = (String) model.getValueAt(row, 3); - if (!(repositoryId.isEmpty() || taskId.isEmpty())) { - if (!popup && e.getClickCount() == 2) { - RP.post(new Runnable() { - - @Override - public void run () { - for (Repository r : RepositoryManager.getInstance().getRepositories()) { - if (repositoryId.equals(r.getId())) { - Util.openIssue(r, taskId); - break; - } - } - } - }); - } else if (e.isPopupTrigger()) { - subTaskTable.getSelectionModel().setSelectionInterval(row, row); - EventQueue.invokeLater(new Runnable() { - - @Override - public void run () { - JPopupMenu menu = new JPopupMenu(); - menu.add(new RemoveTaskReferenceAction(repositoryId, taskId)); - menu.show(subTaskTable, p.x, p.y); - } - }); - } - } - } - } - - @NbBundle.Messages({ - "CTL_TaskPanel.RemoveTaskReferenceAction.name=Remove Reference" - }) - private class RemoveTaskReferenceAction extends AbstractAction { - - private final String repositoryId; - private final String taskId; - - public RemoveTaskReferenceAction (String repositoryId, String taskId) { - super(Bundle.CTL_TaskPanel_RemoveTaskReferenceAction_name()); - this.repositoryId = repositoryId; - this.taskId = taskId; - } - - @Override - public void actionPerformed (ActionEvent e) { - unsavedFields.add(ATTRIBUTE_SUBTASKS); - updateFieldDecorations(ATTRIBUTE_SUBTASKS, referencesSection.getLabelComponent()); - task.removeTaskReference(repositoryId, taskId); - refreshViewData(); - } - - } - - private class FieldChangeListener implements DocumentListener, ActionListener, ListSelectionListener { - - private final IssueField field; - private final JComponent component; - private final JComponent fieldLabel; - - public FieldChangeListener (JComponent component, IssueField field, JComponent fieldLabel) { - this.component = component; - this.field = field; - this.fieldLabel = fieldLabel; - } - - @Override - public final void insertUpdate (DocumentEvent e) { - fieldModified(); - } - - @Override - public final void removeUpdate (DocumentEvent e) { - fieldModified(); - } - - @Override - public final void changedUpdate (DocumentEvent e) { - fieldModified(); - } - - @Override - public void actionPerformed (ActionEvent e) { - if (e.getSource() == component) { - fieldModified(); - } - } - - @Override - public void valueChanged (ListSelectionEvent e) { - if (!e.getValueIsAdjusting() && e.getSource() == component) { - fieldModified(); - } - } - - void fieldModified () { - if (!reloading && isEnabled()) { - if (component instanceof JTextComponent) { - storeFieldValue(field, (JTextComponent) component); - updateDecorations(); - } else if (component instanceof JList) { -// storeFieldValue(field, (JList) component); -// updateDecorations(); - } else if (component instanceof JComboBox) { -// storeFieldValue(field, (JComboBox) component); -// updateDecorations(); - } else if (component instanceof JCheckBox) { - storeFieldValue(field, ((JCheckBox) component).isSelected() ? "1" : "0"); - updateDecorations(); - } - } - } - - public boolean isEnabled () { - return component.isVisible() && component.isEnabled(); - } - - protected final void updateDecorations () { - updateFieldDecorations(field.getKey(), fieldLabel); - } - } - - private abstract class TaskAttributeListener implements DocumentListener { - - private final String attributeName; - private final JComponent component; - private final JComponent fieldLabel; - - public TaskAttributeListener (JComponent component, String attributeName, JComponent fieldLabel) { - this.component = component; - this.attributeName = attributeName; - this.fieldLabel = fieldLabel; - } - - @Override - public final void insertUpdate (DocumentEvent e) { - fieldModified(); - } - - @Override - public final void removeUpdate (DocumentEvent e) { - fieldModified(); - } - - @Override - public final void changedUpdate (DocumentEvent e) { - fieldModified(); - } - - void fieldModified () { - if (!reloading && isEnabled() && storeValue()) { - unsavedFields.add(attributeName); - updateDecorations(); - } - } - - public boolean isEnabled () { - return component.isVisible() && component.isEnabled(); - } - - protected final void updateDecorations () { - updateFieldDecorations(attributeName, fieldLabel); - } - - protected abstract boolean storeValue (); - } - - private abstract class DatePickerListener implements ChangeListener { - - private final String attributeName; - private final JComponent component; - private final JComponent fieldLabel; - - public DatePickerListener (JComponent component, - String attributeName, JComponent fieldLabel) { - this.component = component; - this.attributeName = attributeName; - this.fieldLabel = fieldLabel; - } - - void fieldModified () { - if (!reloading && isEnabled() && storeValue()) { - unsavedFields.add(attributeName); - updateDecorations(); - } - } - - @Override - public void stateChanged (ChangeEvent e) { - fieldModified(); - } - - public boolean isEnabled () { - return component.isVisible() && component.isEnabled(); - } - - protected final void updateDecorations () { - updateFieldDecorations(attributeName, fieldLabel); - } - - protected abstract boolean storeValue (); - } - - private class UnsavedFieldSet extends HashSet { - - @Override - public boolean add (String value) { - boolean added = super.add(value); - if (added) { - task.fireChangeEvent(); - } - return added; - } - - @Override - public boolean remove (Object o) { - boolean removed = super.remove(o); - if (removed && isEmpty()) { - task.fireChangeEvent(); - } - return removed; - } - - @Override - public void clear () { - boolean fire = !isEmpty(); - super.clear(); - if (fire) { - task.fireChangeEvent(); - } - } - - } -} diff --git a/ide/localtasks/src/org/netbeans/modules/localtasks/util/FileUtils.java b/ide/localtasks/src/org/netbeans/modules/localtasks/util/FileUtils.java deleted file mode 100644 index 88c21e587a0f..000000000000 --- a/ide/localtasks/src/org/netbeans/modules/localtasks/util/FileUtils.java +++ /dev/null @@ -1,354 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.netbeans.modules.localtasks.util; - -import java.io.*; -import java.util.logging.Level; -import org.netbeans.modules.localtasks.LocalRepository; -import org.openide.filesystems.FileUtil; - -/** - * - * @author pkuzel - */ -public class FileUtils { - - /** - * Copies the specified sourceFile to the specified targetFile. - */ - public static void copyFile (File sourceFile, File targetFile) throws IOException { - if (sourceFile == null || targetFile == null) { - throw new NullPointerException("sourceFile and targetFile must not be null"); // NOI18N - } - - InputStream inputStream = null; - try { - inputStream = createInputStream(sourceFile); - copyStreamToFile(inputStream, targetFile); - } finally { - if (inputStream != null) { - try { - inputStream.close(); - } catch (IOException ex) { - // ignore - } - } - } - } - - public static void copyDirFiles (File sourceDir, File targetDir) { - copyDirFiles(sourceDir, targetDir, false); - } - - public static void copyDirFiles (File sourceDir, File targetDir, boolean preserveTimestamp) { - File[] files = sourceDir.listFiles(); - - if (files == null || files.length == 0) { - targetDir.mkdirs(); - if (preserveTimestamp) { - targetDir.setLastModified(sourceDir.lastModified()); - } - return; - } - if (preserveTimestamp) { - targetDir.setLastModified(sourceDir.lastModified()); - } - for (int i = 0; i < files.length; i++) { - try { - File target = FileUtil.normalizeFile(new File(targetDir.getAbsolutePath() + "/" + files[i].getName())); // NOI18N - if (files[i].isDirectory()) { - copyDirFiles(files[i], target, preserveTimestamp); - } else { - FileUtils.copyFile(files[i], target); - if (preserveTimestamp) { - target.setLastModified(files[i].lastModified()); - } - } - } catch (IOException ex) { - LocalRepository.LOG.log(Level.INFO, null, ex); // should not happen - } - } - } - - /** - * Copies the specified sourceFile to the specified targetFile. It - * closes the input stream. - */ - public static void copyStreamToFile (InputStream inputStream, File targetFile) throws IOException { - if (inputStream == null || targetFile == null) { - throw new NullPointerException("sourcStream and targetFile must not be null"); // NOI18N - } - - // ensure existing parent directories - File directory = targetFile.getParentFile(); - if (!directory.exists() && !directory.mkdirs()) { - throw new IOException("Could not create directory '" + directory + "'"); // NOI18N - } - - OutputStream outputStream = null; - try { - outputStream = createOutputStream(targetFile); - try { - byte[] buffer = new byte[32768]; - for (int readBytes = inputStream.read(buffer); - readBytes > 0; - readBytes = inputStream.read(buffer)) { - outputStream.write(buffer, 0, readBytes); - } - } catch (IOException ex) { - targetFile.delete(); - throw ex; - } - } finally { - if (inputStream != null) { - try { - inputStream.close(); - } catch (IOException ex) { - // ignore - } - } - if (outputStream != null) { - try { - outputStream.close(); - } catch (IOException ex) { - // ignore - } - } - } - } - - /** - * Reads the data from the file and returns it as an array of - * bytes. - * - * @param file file to be read - * @return file contents as a byte array - * @throws java.io.IOException - */ - public static byte[] getFileContentsAsByteArray (File file) throws IOException { - ByteArrayOutputStream baos = new ByteArrayOutputStream(1024 * 5); - BufferedInputStream bis = null; - try { - bis = createInputStream(file); - byte[] buffer = new byte[1024]; - for (int byteRead = bis.read(buffer); byteRead > 0; byteRead = bis.read(buffer)) { - baos.write(buffer, 0, byteRead); - } - } finally { - if (bis != null) { - bis.close(); - } - } - return baos.toByteArray(); - } - - /** - * Recursively deletes all files and directories under a given - * file/directory. - * - * @param file file/directory to delete - */ - public static void deleteRecursively (File file) { - if (file.isDirectory()) { - File[] files = file.listFiles(); - for (int i = 0; i < files.length; i++) { - deleteRecursively(files[i]); - } - } - file.delete(); - } - - /** - * Do the best to rename the file. - * - * @param orig regular file - * @param dest regular file (if exists it's rewritten) - */ - public static void renameFile (File orig, File dest) throws IOException { - boolean destExists = dest.exists(); - if (destExists) { - for (int i = 0; i < 3; i++) { - if (dest.delete()) { - destExists = false; - break; - } - try { - Thread.sleep(71); - } catch (InterruptedException e) { - } - } - } - - if (destExists == false) { - for (int i = 0; i < 3; i++) { - if (orig.renameTo(dest)) { - return; - } - try { - Thread.sleep(71); - } catch (InterruptedException e) { - } - } - } - - // requires less permisions than renameTo - FileUtils.copyFile(orig, dest); - - for (int i = 0; i < 3; i++) { - if (orig.delete()) { - return; - } - try { - Thread.sleep(71); - } catch (InterruptedException e) { - } - } - throw new IOException("Can not delete: " + orig.getAbsolutePath()); // NOI18N - } - - /** - * This utility class needs not to be instantiated anywhere. - */ - private FileUtils () { - } - - public static BufferedInputStream createInputStream (File file) throws IOException { - int retry = 0; - while (true) { - try { - return new BufferedInputStream(new FileInputStream(file)); - } catch (IOException ex) { - retry++; - if (retry > 7) { - throw ex; - } - try { - Thread.sleep(retry * 34); - } catch (InterruptedException iex) { - throw ex; - } - } - } - } - - public static BufferedOutputStream createOutputStream (File file) throws IOException { - int retry = 0; - while (true) { - try { - return new BufferedOutputStream(new FileOutputStream(file)); - } catch (IOException ex) { - retry++; - if (retry > 7) { - throw ex; - } - try { - Thread.sleep(retry * 34); - } catch (InterruptedException iex) { - throw ex; - } - } - } - } - - /** - * Creates new tmp dir in java.io.tmpdir - */ - public static File createTmpFolder (String prefix) { - String tmpDir = System.getProperty("java.io.tmpdir"); // NOI18N - File tmpFolder = new File(tmpDir); - File checkoutFolder = null; - try { - // generate unique name for tmp folder - File tmp = File.createTempFile(prefix, "", tmpFolder); // NOI18N - if (tmp.delete() == false) { - return checkoutFolder; - } - if (tmp.mkdirs() == false) { - return checkoutFolder; - } - checkoutFolder = FileUtil.normalizeFile(tmp); - } catch (IOException e) { - LocalRepository.LOG.log(Level.SEVERE, null, e); - } - return checkoutFolder; - } - - /** - * Returns the first found file whose filename is the same (in a case - * insensitive way) as given file's. - * - * @param file - * @return the first found file with the same name, but ignoring case, or - * null if no such file is found. - */ - public static String getExistingFilenameInParent (File file) { - String filename = null; - if (file == null) { - return filename; - } - File parent = file.getParentFile(); - if (parent == null) { - return filename; - } - File[] children = parent.listFiles(); - for (File child : children) { - if (file.getName().equalsIgnoreCase(child.getName())) { - filename = child.getName(); - break; - } - } - return filename; - } - - /** - * Copies all content from the supplied reader to the supplies writer and - * closes both streams when finished. - * - * @param writer where to write - * @param reader what to read - * @throws IOException if any I/O operation fails - */ - public static void copyStreamsCloseAll (OutputStream writer, InputStream reader) throws IOException { - byte[] buffer = new byte[4096]; - int n; - while ((n = reader.read(buffer)) != -1) { - writer.write(buffer, 0, n); - } - writer.close(); - reader.close(); - } - - /** - * Copies all content from the supplied reader to the supplies writer and - * closes both streams when finished. - * - * @param writer where to write - * @param reader what to read - * @throws IOException if any I/O operation fails - */ - public static void copyStreamsCloseAll (Writer writer, Reader reader) throws IOException { - char[] buffer = new char[4096]; - int n; - while ((n = reader.read(buffer)) != -1) { - writer.write(buffer, 0, n); - } - writer.close(); - reader.close(); - } -} diff --git a/ide/mylyn.util/build.xml b/ide/mylyn.util/build.xml deleted file mode 100644 index 0de04b8d5344..000000000000 --- a/ide/mylyn.util/build.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - Builds, tests, and runs the project org.netbeans.modules.mylyn.util - - diff --git a/ide/mylyn.util/licenseinfo.xml b/ide/mylyn.util/licenseinfo.xml deleted file mode 100644 index ea0b20145203..000000000000 --- a/ide/mylyn.util/licenseinfo.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - src/org/netbeans/modules/mylyn/util/resources/edit.png - src/org/netbeans/modules/mylyn/util/resources/preview.png - - - - diff --git a/ide/mylyn.util/manifest.mf b/ide/mylyn.util/manifest.mf deleted file mode 100644 index 27029ca32b95..000000000000 --- a/ide/mylyn.util/manifest.mf +++ /dev/null @@ -1,8 +0,0 @@ -Manifest-Version: 1.0 -AutoUpdate-Show-In-Client: false -OpenIDE-Module: org.netbeans.modules.mylyn.util -OpenIDE-Module-Layer: org/netbeans/modules/mylyn/util/resources/layer.xml -OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/mylyn/util/Bundle.properties -OpenIDE-Module-Specification-Version: 1.67 -OpenIDE-Module-Install: org/netbeans/modules/mylyn/util/internal/ModuleLifecycleManager.class - diff --git a/ide/mylyn.util/nbproject/org-netbeans-modules-mylyn-util.sig b/ide/mylyn.util/nbproject/org-netbeans-modules-mylyn-util.sig deleted file mode 100644 index c5a900619641..000000000000 --- a/ide/mylyn.util/nbproject/org-netbeans-modules-mylyn-util.sig +++ /dev/null @@ -1,1049 +0,0 @@ -#Signature file v4.1 -#Version 1.66 - -CLSS public abstract java.awt.Component -cons protected init() -fld protected javax.accessibility.AccessibleContext accessibleContext -fld public final static float BOTTOM_ALIGNMENT = 1.0 -fld public final static float CENTER_ALIGNMENT = 0.5 -fld public final static float LEFT_ALIGNMENT = 0.0 -fld public final static float RIGHT_ALIGNMENT = 1.0 -fld public final static float TOP_ALIGNMENT = 0.0 -innr protected BltBufferStrategy -innr protected FlipBufferStrategy -innr protected abstract AccessibleAWTComponent -innr public final static !enum BaselineResizeBehavior -intf java.awt.MenuContainer -intf java.awt.image.ImageObserver -intf java.io.Serializable -meth protected boolean requestFocus(boolean) -meth protected boolean requestFocusInWindow(boolean) -meth protected final void disableEvents(long) -meth protected final void enableEvents(long) -meth protected java.awt.AWTEvent coalesceEvents(java.awt.AWTEvent,java.awt.AWTEvent) -meth protected java.lang.String paramString() -meth protected void firePropertyChange(java.lang.String,boolean,boolean) -meth protected void firePropertyChange(java.lang.String,int,int) -meth protected void firePropertyChange(java.lang.String,java.lang.Object,java.lang.Object) -meth protected void processComponentEvent(java.awt.event.ComponentEvent) -meth protected void processEvent(java.awt.AWTEvent) -meth protected void processFocusEvent(java.awt.event.FocusEvent) -meth protected void processHierarchyBoundsEvent(java.awt.event.HierarchyEvent) -meth protected void processHierarchyEvent(java.awt.event.HierarchyEvent) -meth protected void processInputMethodEvent(java.awt.event.InputMethodEvent) -meth protected void processKeyEvent(java.awt.event.KeyEvent) -meth protected void processMouseEvent(java.awt.event.MouseEvent) -meth protected void processMouseMotionEvent(java.awt.event.MouseEvent) -meth protected void processMouseWheelEvent(java.awt.event.MouseWheelEvent) -meth public <%0 extends java.util.EventListener> {%%0}[] getListeners(java.lang.Class<{%%0}>) -meth public boolean action(java.awt.Event,java.lang.Object) - anno 0 java.lang.Deprecated() -meth public boolean areFocusTraversalKeysSet(int) -meth public boolean contains(int,int) -meth public boolean contains(java.awt.Point) -meth public boolean getFocusTraversalKeysEnabled() -meth public boolean getIgnoreRepaint() -meth public boolean gotFocus(java.awt.Event,java.lang.Object) - anno 0 java.lang.Deprecated() -meth public boolean handleEvent(java.awt.Event) - anno 0 java.lang.Deprecated() -meth public boolean hasFocus() -meth public boolean imageUpdate(java.awt.Image,int,int,int,int,int) -meth public boolean inside(int,int) - anno 0 java.lang.Deprecated() -meth public boolean isBackgroundSet() -meth public boolean isCursorSet() -meth public boolean isDisplayable() -meth public boolean isDoubleBuffered() -meth public boolean isEnabled() -meth public boolean isFocusCycleRoot(java.awt.Container) -meth public boolean isFocusOwner() -meth public boolean isFocusTraversable() - anno 0 java.lang.Deprecated() -meth public boolean isFocusable() -meth public boolean isFontSet() -meth public boolean isForegroundSet() -meth public boolean isLightweight() -meth public boolean isMaximumSizeSet() -meth public boolean isMinimumSizeSet() -meth public boolean isOpaque() -meth public boolean isPreferredSizeSet() -meth public boolean isShowing() -meth public boolean isValid() -meth public boolean isVisible() -meth public boolean keyDown(java.awt.Event,int) - anno 0 java.lang.Deprecated() -meth public boolean keyUp(java.awt.Event,int) - anno 0 java.lang.Deprecated() -meth public boolean lostFocus(java.awt.Event,java.lang.Object) - anno 0 java.lang.Deprecated() -meth public boolean mouseDown(java.awt.Event,int,int) - anno 0 java.lang.Deprecated() -meth public boolean mouseDrag(java.awt.Event,int,int) - anno 0 java.lang.Deprecated() -meth public boolean mouseEnter(java.awt.Event,int,int) - anno 0 java.lang.Deprecated() -meth public boolean mouseExit(java.awt.Event,int,int) - anno 0 java.lang.Deprecated() -meth public boolean mouseMove(java.awt.Event,int,int) - anno 0 java.lang.Deprecated() -meth public boolean mouseUp(java.awt.Event,int,int) - anno 0 java.lang.Deprecated() -meth public boolean postEvent(java.awt.Event) - anno 0 java.lang.Deprecated() -meth public boolean prepareImage(java.awt.Image,int,int,java.awt.image.ImageObserver) -meth public boolean prepareImage(java.awt.Image,java.awt.image.ImageObserver) -meth public boolean requestFocusInWindow() -meth public final java.lang.Object getTreeLock() -meth public final void dispatchEvent(java.awt.AWTEvent) -meth public float getAlignmentX() -meth public float getAlignmentY() -meth public int checkImage(java.awt.Image,int,int,java.awt.image.ImageObserver) -meth public int checkImage(java.awt.Image,java.awt.image.ImageObserver) -meth public int getBaseline(int,int) -meth public int getHeight() -meth public int getWidth() -meth public int getX() -meth public int getY() -meth public java.awt.Color getBackground() -meth public java.awt.Color getForeground() -meth public java.awt.Component getComponentAt(int,int) -meth public java.awt.Component getComponentAt(java.awt.Point) -meth public java.awt.Component locate(int,int) - anno 0 java.lang.Deprecated() -meth public java.awt.Component$BaselineResizeBehavior getBaselineResizeBehavior() -meth public java.awt.ComponentOrientation getComponentOrientation() -meth public java.awt.Container getFocusCycleRootAncestor() -meth public java.awt.Container getParent() -meth public java.awt.Cursor getCursor() -meth public java.awt.Dimension getMaximumSize() -meth public java.awt.Dimension getMinimumSize() -meth public java.awt.Dimension getPreferredSize() -meth public java.awt.Dimension getSize() -meth public java.awt.Dimension getSize(java.awt.Dimension) -meth public java.awt.Dimension minimumSize() - anno 0 java.lang.Deprecated() -meth public java.awt.Dimension preferredSize() - anno 0 java.lang.Deprecated() -meth public java.awt.Dimension size() - anno 0 java.lang.Deprecated() -meth public java.awt.Font getFont() -meth public java.awt.FontMetrics getFontMetrics(java.awt.Font) -meth public java.awt.Graphics getGraphics() -meth public java.awt.GraphicsConfiguration getGraphicsConfiguration() -meth public java.awt.Image createImage(int,int) -meth public java.awt.Image createImage(java.awt.image.ImageProducer) -meth public java.awt.Point getLocation() -meth public java.awt.Point getLocation(java.awt.Point) -meth public java.awt.Point getLocationOnScreen() -meth public java.awt.Point getMousePosition() -meth public java.awt.Point location() - anno 0 java.lang.Deprecated() -meth public java.awt.Rectangle bounds() - anno 0 java.lang.Deprecated() -meth public java.awt.Rectangle getBounds() -meth public java.awt.Rectangle getBounds(java.awt.Rectangle) -meth public java.awt.Toolkit getToolkit() -meth public java.awt.dnd.DropTarget getDropTarget() -meth public java.awt.event.ComponentListener[] getComponentListeners() -meth public java.awt.event.FocusListener[] getFocusListeners() -meth public java.awt.event.HierarchyBoundsListener[] getHierarchyBoundsListeners() -meth public java.awt.event.HierarchyListener[] getHierarchyListeners() -meth public java.awt.event.InputMethodListener[] getInputMethodListeners() -meth public java.awt.event.KeyListener[] getKeyListeners() -meth public java.awt.event.MouseListener[] getMouseListeners() -meth public java.awt.event.MouseMotionListener[] getMouseMotionListeners() -meth public java.awt.event.MouseWheelListener[] getMouseWheelListeners() -meth public java.awt.im.InputContext getInputContext() -meth public java.awt.im.InputMethodRequests getInputMethodRequests() -meth public java.awt.image.ColorModel getColorModel() -meth public java.awt.image.VolatileImage createVolatileImage(int,int) -meth public java.awt.image.VolatileImage createVolatileImage(int,int,java.awt.ImageCapabilities) throws java.awt.AWTException -meth public java.beans.PropertyChangeListener[] getPropertyChangeListeners() -meth public java.beans.PropertyChangeListener[] getPropertyChangeListeners(java.lang.String) -meth public java.lang.String getName() -meth public java.lang.String toString() -meth public java.util.Locale getLocale() -meth public java.util.Set getFocusTraversalKeys(int) -meth public javax.accessibility.AccessibleContext getAccessibleContext() -meth public void add(java.awt.PopupMenu) -meth public void addComponentListener(java.awt.event.ComponentListener) -meth public void addFocusListener(java.awt.event.FocusListener) -meth public void addHierarchyBoundsListener(java.awt.event.HierarchyBoundsListener) -meth public void addHierarchyListener(java.awt.event.HierarchyListener) -meth public void addInputMethodListener(java.awt.event.InputMethodListener) -meth public void addKeyListener(java.awt.event.KeyListener) -meth public void addMouseListener(java.awt.event.MouseListener) -meth public void addMouseMotionListener(java.awt.event.MouseMotionListener) -meth public void addMouseWheelListener(java.awt.event.MouseWheelListener) -meth public void addNotify() -meth public void addPropertyChangeListener(java.beans.PropertyChangeListener) -meth public void addPropertyChangeListener(java.lang.String,java.beans.PropertyChangeListener) -meth public void applyComponentOrientation(java.awt.ComponentOrientation) -meth public void deliverEvent(java.awt.Event) - anno 0 java.lang.Deprecated() -meth public void disable() - anno 0 java.lang.Deprecated() -meth public void doLayout() -meth public void enable() - anno 0 java.lang.Deprecated() -meth public void enable(boolean) - anno 0 java.lang.Deprecated() -meth public void enableInputMethods(boolean) -meth public void firePropertyChange(java.lang.String,byte,byte) -meth public void firePropertyChange(java.lang.String,char,char) -meth public void firePropertyChange(java.lang.String,double,double) -meth public void firePropertyChange(java.lang.String,float,float) -meth public void firePropertyChange(java.lang.String,long,long) -meth public void firePropertyChange(java.lang.String,short,short) -meth public void hide() - anno 0 java.lang.Deprecated() -meth public void invalidate() -meth public void layout() - anno 0 java.lang.Deprecated() -meth public void list() -meth public void list(java.io.PrintStream) -meth public void list(java.io.PrintStream,int) -meth public void list(java.io.PrintWriter) -meth public void list(java.io.PrintWriter,int) -meth public void move(int,int) - anno 0 java.lang.Deprecated() -meth public void nextFocus() - anno 0 java.lang.Deprecated() -meth public void paint(java.awt.Graphics) -meth public void paintAll(java.awt.Graphics) -meth public void print(java.awt.Graphics) -meth public void printAll(java.awt.Graphics) -meth public void remove(java.awt.MenuComponent) -meth public void removeComponentListener(java.awt.event.ComponentListener) -meth public void removeFocusListener(java.awt.event.FocusListener) -meth public void removeHierarchyBoundsListener(java.awt.event.HierarchyBoundsListener) -meth public void removeHierarchyListener(java.awt.event.HierarchyListener) -meth public void removeInputMethodListener(java.awt.event.InputMethodListener) -meth public void removeKeyListener(java.awt.event.KeyListener) -meth public void removeMouseListener(java.awt.event.MouseListener) -meth public void removeMouseMotionListener(java.awt.event.MouseMotionListener) -meth public void removeMouseWheelListener(java.awt.event.MouseWheelListener) -meth public void removeNotify() -meth public void removePropertyChangeListener(java.beans.PropertyChangeListener) -meth public void removePropertyChangeListener(java.lang.String,java.beans.PropertyChangeListener) -meth public void repaint() -meth public void repaint(int,int,int,int) -meth public void repaint(long) -meth public void repaint(long,int,int,int,int) -meth public void requestFocus() -meth public void reshape(int,int,int,int) - anno 0 java.lang.Deprecated() -meth public void resize(int,int) - anno 0 java.lang.Deprecated() -meth public void resize(java.awt.Dimension) - anno 0 java.lang.Deprecated() -meth public void revalidate() -meth public void setBackground(java.awt.Color) -meth public void setBounds(int,int,int,int) -meth public void setBounds(java.awt.Rectangle) -meth public void setComponentOrientation(java.awt.ComponentOrientation) -meth public void setCursor(java.awt.Cursor) -meth public void setDropTarget(java.awt.dnd.DropTarget) -meth public void setEnabled(boolean) -meth public void setFocusTraversalKeys(int,java.util.Set) -meth public void setFocusTraversalKeysEnabled(boolean) -meth public void setFocusable(boolean) -meth public void setFont(java.awt.Font) -meth public void setForeground(java.awt.Color) -meth public void setIgnoreRepaint(boolean) -meth public void setLocale(java.util.Locale) -meth public void setLocation(int,int) -meth public void setLocation(java.awt.Point) -meth public void setMaximumSize(java.awt.Dimension) -meth public void setMinimumSize(java.awt.Dimension) -meth public void setName(java.lang.String) -meth public void setPreferredSize(java.awt.Dimension) -meth public void setSize(int,int) -meth public void setSize(java.awt.Dimension) -meth public void setVisible(boolean) -meth public void show() - anno 0 java.lang.Deprecated() -meth public void show(boolean) - anno 0 java.lang.Deprecated() -meth public void transferFocus() -meth public void transferFocusBackward() -meth public void transferFocusUpCycle() -meth public void update(java.awt.Graphics) -meth public void validate() -supr java.lang.Object - -CLSS public java.awt.Container -cons public init() -innr protected AccessibleAWTContainer -meth protected java.lang.String paramString() -meth protected void addImpl(java.awt.Component,java.lang.Object,int) -meth protected void processContainerEvent(java.awt.event.ContainerEvent) -meth protected void processEvent(java.awt.AWTEvent) -meth protected void validateTree() -meth public <%0 extends java.util.EventListener> {%%0}[] getListeners(java.lang.Class<{%%0}>) -meth public boolean areFocusTraversalKeysSet(int) -meth public boolean isAncestorOf(java.awt.Component) -meth public boolean isFocusCycleRoot() -meth public boolean isFocusCycleRoot(java.awt.Container) -meth public boolean isFocusTraversalPolicySet() -meth public boolean isValidateRoot() -meth public final boolean isFocusTraversalPolicyProvider() -meth public final void setFocusTraversalPolicyProvider(boolean) -meth public float getAlignmentX() -meth public float getAlignmentY() -meth public int countComponents() - anno 0 java.lang.Deprecated() -meth public int getComponentCount() -meth public int getComponentZOrder(java.awt.Component) -meth public java.awt.Component add(java.awt.Component) -meth public java.awt.Component add(java.awt.Component,int) -meth public java.awt.Component add(java.lang.String,java.awt.Component) -meth public java.awt.Component findComponentAt(int,int) -meth public java.awt.Component findComponentAt(java.awt.Point) -meth public java.awt.Component getComponent(int) -meth public java.awt.Component getComponentAt(int,int) -meth public java.awt.Component getComponentAt(java.awt.Point) -meth public java.awt.Component locate(int,int) - anno 0 java.lang.Deprecated() -meth public java.awt.Component[] getComponents() -meth public java.awt.Dimension getMaximumSize() -meth public java.awt.Dimension getMinimumSize() -meth public java.awt.Dimension getPreferredSize() -meth public java.awt.Dimension minimumSize() - anno 0 java.lang.Deprecated() -meth public java.awt.Dimension preferredSize() - anno 0 java.lang.Deprecated() -meth public java.awt.FocusTraversalPolicy getFocusTraversalPolicy() -meth public java.awt.Insets getInsets() -meth public java.awt.Insets insets() - anno 0 java.lang.Deprecated() -meth public java.awt.LayoutManager getLayout() -meth public java.awt.Point getMousePosition(boolean) -meth public java.awt.event.ContainerListener[] getContainerListeners() -meth public java.util.Set getFocusTraversalKeys(int) -meth public void add(java.awt.Component,java.lang.Object) -meth public void add(java.awt.Component,java.lang.Object,int) -meth public void addContainerListener(java.awt.event.ContainerListener) -meth public void addNotify() -meth public void addPropertyChangeListener(java.beans.PropertyChangeListener) -meth public void addPropertyChangeListener(java.lang.String,java.beans.PropertyChangeListener) -meth public void applyComponentOrientation(java.awt.ComponentOrientation) -meth public void deliverEvent(java.awt.Event) - anno 0 java.lang.Deprecated() -meth public void doLayout() -meth public void invalidate() -meth public void layout() - anno 0 java.lang.Deprecated() -meth public void list(java.io.PrintStream,int) -meth public void list(java.io.PrintWriter,int) -meth public void paint(java.awt.Graphics) -meth public void paintComponents(java.awt.Graphics) -meth public void print(java.awt.Graphics) -meth public void printComponents(java.awt.Graphics) -meth public void remove(int) -meth public void remove(java.awt.Component) -meth public void removeAll() -meth public void removeContainerListener(java.awt.event.ContainerListener) -meth public void removeNotify() -meth public void setComponentZOrder(java.awt.Component,int) -meth public void setFocusCycleRoot(boolean) -meth public void setFocusTraversalKeys(int,java.util.Set) -meth public void setFocusTraversalPolicy(java.awt.FocusTraversalPolicy) -meth public void setFont(java.awt.Font) -meth public void setLayout(java.awt.LayoutManager) -meth public void transferFocusDownCycle() -meth public void update(java.awt.Graphics) -meth public void validate() -supr java.awt.Component - -CLSS public abstract interface java.awt.MenuContainer -meth public abstract boolean postEvent(java.awt.Event) - anno 0 java.lang.Deprecated() -meth public abstract java.awt.Font getFont() -meth public abstract void remove(java.awt.MenuComponent) - -CLSS public abstract interface java.awt.image.ImageObserver -fld public final static int ABORT = 128 -fld public final static int ALLBITS = 32 -fld public final static int ERROR = 64 -fld public final static int FRAMEBITS = 16 -fld public final static int HEIGHT = 2 -fld public final static int PROPERTIES = 4 -fld public final static int SOMEBITS = 8 -fld public final static int WIDTH = 1 -meth public abstract boolean imageUpdate(java.awt.Image,int,int,int,int,int) - -CLSS public abstract interface java.io.Serializable - -CLSS public abstract interface java.lang.Comparable<%0 extends java.lang.Object> -meth public abstract int compareTo({java.lang.Comparable%0}) - -CLSS public abstract java.lang.Enum<%0 extends java.lang.Enum<{java.lang.Enum%0}>> -cons protected init(java.lang.String,int) -intf java.io.Serializable -intf java.lang.Comparable<{java.lang.Enum%0}> -meth protected final java.lang.Object clone() throws java.lang.CloneNotSupportedException -meth protected final void finalize() -meth public final boolean equals(java.lang.Object) -meth public final int compareTo({java.lang.Enum%0}) -meth public final int hashCode() -meth public final int ordinal() -meth public final java.lang.Class<{java.lang.Enum%0}> getDeclaringClass() -meth public final java.lang.String name() -meth public java.lang.String toString() -meth public static <%0 extends java.lang.Enum<{%%0}>> {%%0} valueOf(java.lang.Class<{%%0}>,java.lang.String) -supr java.lang.Object - -CLSS public java.lang.Object -cons public init() -meth protected java.lang.Object clone() throws java.lang.CloneNotSupportedException -meth protected void finalize() throws java.lang.Throwable -meth public boolean equals(java.lang.Object) -meth public final java.lang.Class getClass() -meth public final void notify() -meth public final void notifyAll() -meth public final void wait() throws java.lang.InterruptedException -meth public final void wait(long) throws java.lang.InterruptedException -meth public final void wait(long,int) throws java.lang.InterruptedException -meth public int hashCode() -meth public java.lang.String toString() - -CLSS public abstract interface java.util.EventListener - -CLSS public java.util.EventObject -cons public init(java.lang.Object) -fld protected java.lang.Object source -intf java.io.Serializable -meth public java.lang.Object getSource() -meth public java.lang.String toString() -supr java.lang.Object - -CLSS public abstract interface javax.accessibility.Accessible -meth public abstract javax.accessibility.AccessibleContext getAccessibleContext() - -CLSS public abstract javax.swing.JComponent -cons public init() -fld protected javax.swing.event.EventListenerList listenerList -fld protected javax.swing.plaf.ComponentUI ui -fld public final static int UNDEFINED_CONDITION = -1 -fld public final static int WHEN_ANCESTOR_OF_FOCUSED_COMPONENT = 1 -fld public final static int WHEN_FOCUSED = 0 -fld public final static int WHEN_IN_FOCUSED_WINDOW = 2 -fld public final static java.lang.String TOOL_TIP_TEXT_KEY = "ToolTipText" -innr public abstract AccessibleJComponent -intf java.io.Serializable -meth protected boolean isPaintingOrigin() -meth protected boolean processKeyBinding(javax.swing.KeyStroke,java.awt.event.KeyEvent,int,boolean) -meth protected boolean requestFocusInWindow(boolean) -meth protected java.awt.Graphics getComponentGraphics(java.awt.Graphics) -meth protected java.lang.String paramString() -meth protected void fireVetoableChange(java.lang.String,java.lang.Object,java.lang.Object) throws java.beans.PropertyVetoException -meth protected void paintBorder(java.awt.Graphics) -meth protected void paintChildren(java.awt.Graphics) -meth protected void paintComponent(java.awt.Graphics) -meth protected void printBorder(java.awt.Graphics) -meth protected void printChildren(java.awt.Graphics) -meth protected void printComponent(java.awt.Graphics) -meth protected void processComponentKeyEvent(java.awt.event.KeyEvent) -meth protected void processKeyEvent(java.awt.event.KeyEvent) -meth protected void processMouseEvent(java.awt.event.MouseEvent) -meth protected void processMouseMotionEvent(java.awt.event.MouseEvent) -meth protected void setUI(javax.swing.plaf.ComponentUI) -meth public <%0 extends java.util.EventListener> {%%0}[] getListeners(java.lang.Class<{%%0}>) -meth public boolean contains(int,int) -meth public boolean getAutoscrolls() -meth public boolean getInheritsPopupMenu() -meth public boolean getVerifyInputWhenFocusTarget() -meth public boolean isDoubleBuffered() -meth public boolean isManagingFocus() - anno 0 java.lang.Deprecated() -meth public boolean isOpaque() -meth public boolean isOptimizedDrawingEnabled() -meth public boolean isPaintingTile() -meth public boolean isRequestFocusEnabled() -meth public boolean isValidateRoot() -meth public boolean requestDefaultFocus() - anno 0 java.lang.Deprecated() -meth public boolean requestFocus(boolean) -meth public boolean requestFocusInWindow() -meth public final boolean isPaintingForPrint() -meth public final java.lang.Object getClientProperty(java.lang.Object) -meth public final javax.swing.ActionMap getActionMap() -meth public final javax.swing.InputMap getInputMap() -meth public final javax.swing.InputMap getInputMap(int) -meth public final void putClientProperty(java.lang.Object,java.lang.Object) -meth public final void setActionMap(javax.swing.ActionMap) -meth public final void setInputMap(int,javax.swing.InputMap) -meth public float getAlignmentX() -meth public float getAlignmentY() -meth public int getBaseline(int,int) -meth public int getConditionForKeyStroke(javax.swing.KeyStroke) -meth public int getDebugGraphicsOptions() -meth public int getHeight() -meth public int getWidth() -meth public int getX() -meth public int getY() -meth public java.awt.Component getNextFocusableComponent() - anno 0 java.lang.Deprecated() -meth public java.awt.Component$BaselineResizeBehavior getBaselineResizeBehavior() -meth public java.awt.Container getTopLevelAncestor() -meth public java.awt.Dimension getMaximumSize() -meth public java.awt.Dimension getMinimumSize() -meth public java.awt.Dimension getPreferredSize() -meth public java.awt.Dimension getSize(java.awt.Dimension) -meth public java.awt.FontMetrics getFontMetrics(java.awt.Font) -meth public java.awt.Graphics getGraphics() -meth public java.awt.Insets getInsets() -meth public java.awt.Insets getInsets(java.awt.Insets) -meth public java.awt.Point getLocation(java.awt.Point) -meth public java.awt.Point getPopupLocation(java.awt.event.MouseEvent) -meth public java.awt.Point getToolTipLocation(java.awt.event.MouseEvent) -meth public java.awt.Rectangle getBounds(java.awt.Rectangle) -meth public java.awt.Rectangle getVisibleRect() -meth public java.awt.event.ActionListener getActionForKeyStroke(javax.swing.KeyStroke) -meth public java.beans.VetoableChangeListener[] getVetoableChangeListeners() -meth public java.lang.String getToolTipText() -meth public java.lang.String getToolTipText(java.awt.event.MouseEvent) -meth public java.lang.String getUIClassID() -meth public javax.swing.InputVerifier getInputVerifier() -meth public javax.swing.JPopupMenu getComponentPopupMenu() -meth public javax.swing.JRootPane getRootPane() -meth public javax.swing.JToolTip createToolTip() -meth public javax.swing.KeyStroke[] getRegisteredKeyStrokes() -meth public javax.swing.TransferHandler getTransferHandler() -meth public javax.swing.border.Border getBorder() -meth public javax.swing.event.AncestorListener[] getAncestorListeners() -meth public static boolean isLightweightComponent(java.awt.Component) -meth public static java.util.Locale getDefaultLocale() -meth public static void setDefaultLocale(java.util.Locale) -meth public void addAncestorListener(javax.swing.event.AncestorListener) -meth public void addNotify() -meth public void addVetoableChangeListener(java.beans.VetoableChangeListener) -meth public void computeVisibleRect(java.awt.Rectangle) -meth public void disable() - anno 0 java.lang.Deprecated() -meth public void enable() - anno 0 java.lang.Deprecated() -meth public void firePropertyChange(java.lang.String,boolean,boolean) -meth public void firePropertyChange(java.lang.String,char,char) -meth public void firePropertyChange(java.lang.String,int,int) -meth public void grabFocus() -meth public void hide() - anno 0 java.lang.Deprecated() -meth public void paint(java.awt.Graphics) -meth public void paintImmediately(int,int,int,int) -meth public void paintImmediately(java.awt.Rectangle) -meth public void print(java.awt.Graphics) -meth public void printAll(java.awt.Graphics) -meth public void registerKeyboardAction(java.awt.event.ActionListener,java.lang.String,javax.swing.KeyStroke,int) -meth public void registerKeyboardAction(java.awt.event.ActionListener,javax.swing.KeyStroke,int) -meth public void removeAncestorListener(javax.swing.event.AncestorListener) -meth public void removeNotify() -meth public void removeVetoableChangeListener(java.beans.VetoableChangeListener) -meth public void repaint(java.awt.Rectangle) -meth public void repaint(long,int,int,int,int) -meth public void requestFocus() -meth public void resetKeyboardActions() -meth public void reshape(int,int,int,int) - anno 0 java.lang.Deprecated() -meth public void revalidate() -meth public void scrollRectToVisible(java.awt.Rectangle) -meth public void setAlignmentX(float) -meth public void setAlignmentY(float) -meth public void setAutoscrolls(boolean) -meth public void setBackground(java.awt.Color) -meth public void setBorder(javax.swing.border.Border) -meth public void setComponentPopupMenu(javax.swing.JPopupMenu) -meth public void setDebugGraphicsOptions(int) -meth public void setDoubleBuffered(boolean) -meth public void setEnabled(boolean) -meth public void setFocusTraversalKeys(int,java.util.Set) -meth public void setFont(java.awt.Font) -meth public void setForeground(java.awt.Color) -meth public void setInheritsPopupMenu(boolean) -meth public void setInputVerifier(javax.swing.InputVerifier) -meth public void setMaximumSize(java.awt.Dimension) -meth public void setMinimumSize(java.awt.Dimension) -meth public void setNextFocusableComponent(java.awt.Component) - anno 0 java.lang.Deprecated() -meth public void setOpaque(boolean) -meth public void setPreferredSize(java.awt.Dimension) -meth public void setRequestFocusEnabled(boolean) -meth public void setToolTipText(java.lang.String) -meth public void setTransferHandler(javax.swing.TransferHandler) -meth public void setVerifyInputWhenFocusTarget(boolean) -meth public void setVisible(boolean) -meth public void unregisterKeyboardAction(javax.swing.KeyStroke) -meth public void update(java.awt.Graphics) -meth public void updateUI() -supr java.awt.Container - -CLSS public javax.swing.JPanel -cons public init() -cons public init(boolean) -cons public init(java.awt.LayoutManager) -cons public init(java.awt.LayoutManager,boolean) -innr protected AccessibleJPanel -intf javax.accessibility.Accessible -meth protected java.lang.String paramString() -meth public java.lang.String getUIClassID() -meth public javax.accessibility.AccessibleContext getAccessibleContext() -meth public javax.swing.plaf.PanelUI getUI() -meth public void setUI(javax.swing.plaf.PanelUI) -meth public void updateUI() -supr javax.swing.JComponent - -CLSS public abstract interface org.eclipse.core.runtime.IProgressMonitor -fld public final static int UNKNOWN = -1 -meth public abstract boolean isCanceled() -meth public abstract void beginTask(java.lang.String,int) -meth public abstract void done() -meth public abstract void internalWorked(double) -meth public abstract void setCanceled(boolean) -meth public abstract void setTaskName(java.lang.String) -meth public abstract void subTask(java.lang.String) -meth public abstract void worked(int) - -CLSS public abstract org.netbeans.modules.mylyn.util.AbstractNbTaskWrapper -cons public init(org.netbeans.modules.mylyn.util.NbTask) -fld public final static java.lang.String NEW_ATTACHMENT_ATTRIBUTE_ID = "nb.attachments.new" -meth protected abstract boolean synchronizeTask() -meth protected abstract java.lang.String getSummary(org.eclipse.mylyn.tasks.core.data.TaskData) -meth protected abstract void attributeChanged(org.netbeans.modules.mylyn.util.NbTaskDataModel$NbTaskDataModelEvent,org.netbeans.modules.mylyn.util.NbTaskDataModel) -meth protected abstract void modelSaved(org.netbeans.modules.mylyn.util.NbTaskDataModel) -meth protected abstract void repositoryTaskDataLoaded(org.eclipse.mylyn.tasks.core.data.TaskData) -meth protected abstract void taskDataUpdated() -meth protected abstract void taskDeleted(org.netbeans.modules.mylyn.util.NbTask) -meth protected abstract void taskModified(boolean) -meth protected final boolean editorOpened() -meth protected final boolean hasUnsavedPrivateTaskAttributes() -meth protected final boolean isSeen() -meth protected final boolean saveChanges() -meth protected final boolean setNewAttachments(java.util.List) -meth protected final boolean updateModel() -meth protected final java.lang.String getDueDisplayString() -meth protected final java.lang.String getEstimateDisplayString() -meth protected final java.lang.String getScheduleDisplayString() -meth protected final java.util.List getNewAttachments() -meth protected final org.eclipse.mylyn.tasks.core.data.TaskData getRepositoryTaskData() -meth protected final org.netbeans.modules.mylyn.util.NbTask getNbTask() -meth protected final org.netbeans.modules.mylyn.util.NbTask$SynchronizationState getSynchronizationState() -meth protected final org.netbeans.modules.mylyn.util.NbTaskDataModel getModel() -meth protected final void deleteTask() -meth protected final void editorClosed() -meth protected final void fireChanged() -meth protected final void fireDataChanged() -meth protected final void fireScheduleChanged() -meth protected final void fireStatusChanged() -meth protected final void markNewRead() -meth protected final void runWithModelLoaded(java.lang.Runnable) -meth protected final void setDueDate(java.util.Date,boolean) -meth protected final void setEstimate(int,boolean) -meth protected final void setPrivateNotes(java.lang.String) -meth protected final void setScheduleDate(org.netbeans.modules.bugtracking.spi.IssueScheduleInfo,boolean) -meth protected final void taskSubmitted(org.netbeans.modules.mylyn.util.NbTask) -meth protected static boolean attachmentAttributesDiffer(org.eclipse.mylyn.tasks.core.data.TaskAttribute,org.eclipse.mylyn.tasks.core.data.TaskAttribute) -meth public final boolean cancelChanges() -meth public final boolean hasLocalEdits() -meth public final boolean hasUnsavedChanges() -meth public final boolean isFinished() -meth public final boolean isMarkedNewUnread() -meth public final boolean isNew() -meth public final int getEstimate() -meth public final int getPersistentEstimate() -meth public final java.lang.String getID() -meth public final java.lang.String getPrivateNotes() -meth public final java.lang.String getSummary() -meth public final java.util.Date getCreatedDate() -meth public final java.util.Date getDueDate() -meth public final java.util.Date getLastModifyDate() -meth public final java.util.Date getPersistentDueDate() -meth public final long getCreated() -meth public final long getLastModify() -meth public final org.netbeans.modules.bugtracking.spi.IssueScheduleInfo getPersistentScheduleInfo() -meth public final org.netbeans.modules.bugtracking.spi.IssueStatusProvider$Status getStatus() -meth public final org.netbeans.modules.mylyn.util.NbDateRange getScheduleDate() -meth public final void addPropertyChangeListener(java.beans.PropertyChangeListener) -meth public final void clearUnsavedChanges() -meth public final void removePropertyChangeListener(java.beans.PropertyChangeListener) -meth public final void setUpToDate(boolean,boolean) -meth public static java.lang.String getID(org.netbeans.modules.mylyn.util.NbTask) -supr java.lang.Object -hfds ATTR_NEW_UNREAD,LOG,MODEL_LOCK,NB_NEW_ATTACHMENT_ATTR_ID,NB_NEW_ATTACHMENT_CONTENT_TYPE_ATTR_ID,NB_NEW_ATTACHMENT_DESC_ATTR_ID,NB_NEW_ATTACHMENT_FILE_ATTR_ID,NB_NEW_ATTACHMENT_PATCH_ATTR_ID,RP,dueDate,dueDateModified,estimate,list,model,privateNotes,readPending,repositoryDataRef,repositoryTaskDataLoaderTask,scheduleDate,scheduleDateModified,support,task,taskDataListener,taskListener -hcls TaskDataListenerImpl,TaskListenerImpl - -CLSS public abstract org.netbeans.modules.mylyn.util.BugtrackingCommand -cons public init() -meth public abstract void execute() throws java.io.IOException,org.eclipse.core.runtime.CoreException -meth public boolean hasFailed() -meth public java.lang.String getErrorMessage() -meth public void cancel() -meth public void setErrorMessage(java.lang.String) -meth public void setFailed(boolean) -supr java.lang.Object -hfds errorMessage,failed - -CLSS public org.netbeans.modules.mylyn.util.CancelableProgressMonitor -cons public init() -intf org.eclipse.core.runtime.IProgressMonitor -meth public boolean isCanceled() -meth public void beginTask(java.lang.String,int) -meth public void done() -meth public void internalWorked(double) -meth public void setCanceled(boolean) -meth public void setTaskName(java.lang.String) -meth public void subTask(java.lang.String) -meth public void worked(int) -supr java.lang.Object -hfds canceled - -CLSS public org.netbeans.modules.mylyn.util.GetAttachmentCommand -cons public init(org.eclipse.mylyn.tasks.core.AbstractRepositoryConnector,org.eclipse.mylyn.tasks.core.TaskRepository,org.eclipse.mylyn.tasks.core.ITask,org.eclipse.mylyn.tasks.core.data.TaskAttribute,java.io.OutputStream) -meth public java.lang.String toString() -meth public void execute() throws java.io.IOException,org.eclipse.core.runtime.CoreException -supr org.netbeans.modules.mylyn.util.BugtrackingCommand -hfds os,repositoryConnector,stringValue,ta,task,taskRepository - -CLSS public org.netbeans.modules.mylyn.util.GetMultiTaskDataCommand -cons public init(org.eclipse.mylyn.tasks.core.AbstractRepositoryConnector,org.eclipse.mylyn.tasks.core.TaskRepository,org.eclipse.mylyn.tasks.core.data.TaskDataCollector,java.util.Set) -meth public java.lang.String toString() -meth public void execute() throws org.eclipse.core.runtime.CoreException -supr org.netbeans.modules.mylyn.util.BugtrackingCommand -hfds collector,ids,repositoryConnector,taskRepository - -CLSS public org.netbeans.modules.mylyn.util.GetTaskDataCommand -cons public init(org.eclipse.mylyn.tasks.core.AbstractRepositoryConnector,org.eclipse.mylyn.tasks.core.TaskRepository,java.lang.String) -meth public java.lang.String toString() -meth public org.eclipse.mylyn.tasks.core.data.TaskData getTaskData() -meth public void execute() throws java.io.IOException,org.eclipse.core.runtime.CoreException -supr org.netbeans.modules.mylyn.util.BugtrackingCommand -hfds id,repositoryConnector,taskData,taskRepository - -CLSS public org.netbeans.modules.mylyn.util.MylynSupport -meth public java.util.Collection getTasks(org.eclipse.mylyn.tasks.core.IRepositoryQuery) throws org.eclipse.core.runtime.CoreException -meth public java.util.Collection getTasks(org.eclipse.mylyn.tasks.core.TaskRepository) throws org.eclipse.core.runtime.CoreException -meth public java.util.Set getRepositoryQueries(org.eclipse.mylyn.tasks.core.TaskRepository) throws org.eclipse.core.runtime.CoreException -meth public java.util.Set countDiff(org.eclipse.mylyn.tasks.core.data.TaskData,org.eclipse.mylyn.tasks.core.data.TaskData) -meth public org.eclipse.mylyn.tasks.core.IRepositoryQuery createNewQuery(org.eclipse.mylyn.tasks.core.TaskRepository,java.lang.String) throws org.eclipse.core.runtime.CoreException -meth public org.eclipse.mylyn.tasks.core.IRepositoryQuery getRepositoryQuery(org.eclipse.mylyn.tasks.core.TaskRepository,java.lang.String) throws org.eclipse.core.runtime.CoreException -meth public org.eclipse.mylyn.tasks.core.TaskRepository getLocalTaskRepository() -meth public org.eclipse.mylyn.tasks.core.TaskRepository getTaskRepository(org.eclipse.mylyn.tasks.core.AbstractRepositoryConnector,java.lang.String) -meth public org.netbeans.modules.mylyn.util.NbTask createSubtask(org.netbeans.modules.mylyn.util.NbTask) throws org.eclipse.core.runtime.CoreException -meth public org.netbeans.modules.mylyn.util.NbTask createTask(org.eclipse.mylyn.tasks.core.TaskRepository,org.eclipse.mylyn.tasks.core.ITaskMapping) throws org.eclipse.core.runtime.CoreException -meth public org.netbeans.modules.mylyn.util.NbTask getTask(java.lang.String,java.lang.String) throws org.eclipse.core.runtime.CoreException -meth public org.netbeans.modules.mylyn.util.UnsubmittedTasksContainer getUnsubmittedTasksContainer(org.eclipse.mylyn.tasks.core.TaskRepository) throws org.eclipse.core.runtime.CoreException -meth public org.netbeans.modules.mylyn.util.commands.CommandFactory getCommandFactory() throws org.eclipse.core.runtime.CoreException -meth public static org.netbeans.modules.mylyn.util.MylynSupport getInstance() -meth public void addQuery(org.eclipse.mylyn.tasks.core.TaskRepository,org.eclipse.mylyn.tasks.core.IRepositoryQuery) throws org.eclipse.core.runtime.CoreException -meth public void addRepositoryListener(org.eclipse.mylyn.tasks.core.IRepositoryListener) -meth public void addTaskDataListener(org.netbeans.modules.mylyn.util.TaskDataListener) -meth public void deleteQuery(org.eclipse.mylyn.tasks.core.IRepositoryQuery) -meth public void notifyCredentialsChanged(org.eclipse.mylyn.tasks.core.TaskRepository) -meth public void removeTaskDataListener(org.netbeans.modules.mylyn.util.TaskDataListener) -meth public void save() throws org.eclipse.core.runtime.CoreException -meth public void setRepositoryUrl(org.eclipse.mylyn.tasks.core.TaskRepository,java.lang.String) throws org.eclipse.core.runtime.CoreException -supr java.lang.Object -hfds ATTR_TASK_INCOMING_NEW,BACKUP_SUFFIX,LOG,PROP_REPOSITORY_CREATION_TIME,RP,dirty,factory,instance,localTaskRepository,repositoryModel,result,saveTask,synchronizationManager,taskActivityManager,taskDataListeners,taskDataManager,taskDataManagerListener,taskList,taskListInitialized,taskListListener,taskListStorageFile,taskListWriter,taskListeners,taskPerList,taskRepositoryManager,taskRepositoryManagerListener,tasks,unsubmittedTaskContainers - -CLSS public org.netbeans.modules.mylyn.util.MylynUtils -cons public init() -meth public static org.eclipse.mylyn.tasks.core.TaskRepository createTaskRepository(java.lang.String,java.lang.String,java.lang.String,java.lang.String,char[],java.lang.String,char[]) -meth public static void logCredentials(org.eclipse.mylyn.tasks.core.TaskRepository,java.lang.String,char[],java.lang.String) -meth public static void logCredentials(org.eclipse.mylyn.tasks.core.TaskRepository,java.lang.String,java.lang.String,java.lang.String) -meth public static void setCredentials(org.eclipse.mylyn.tasks.core.TaskRepository,java.lang.String,char[],java.lang.String,char[]) -supr java.lang.Object -hfds LOG - -CLSS public final org.netbeans.modules.mylyn.util.NbDateRange -cons public init(java.util.Calendar) -cons public init(java.util.Calendar,java.util.Calendar) -cons public init(org.netbeans.modules.bugtracking.spi.IssueScheduleInfo) -intf java.lang.Comparable -meth public boolean equals(java.lang.Object) -meth public int compareTo(org.netbeans.modules.mylyn.util.NbDateRange) -meth public int hashCode() -meth public java.util.Calendar getEndDate() -meth public java.util.Calendar getStartDate() -meth public org.netbeans.modules.bugtracking.spi.IssueScheduleInfo toSchedulingInfo() -supr java.lang.Object -hfds delegate - -CLSS public final org.netbeans.modules.mylyn.util.NbTask -innr public final static !enum SynchronizationState -meth public boolean equals(java.lang.Object) -meth public boolean isCompleted() -meth public boolean isOutgoing() -meth public final java.lang.String getPrivateNotes() -meth public final java.util.Date getDueDate() -meth public final org.netbeans.modules.mylyn.util.NbDateRange getScheduleDate() -meth public final void setDueDate(java.util.Date) -meth public final void setPrivateNotes(java.lang.String) -meth public final void setScheduleDate(org.netbeans.modules.mylyn.util.NbDateRange) -meth public int getEstimate() -meth public int hashCode() -meth public java.lang.String getAttribute(java.lang.String) -meth public java.lang.String getRepositoryUrl() -meth public java.lang.String getSummary() -meth public java.lang.String getTaskId() -meth public java.lang.String getTaskKey() -meth public java.lang.String toString() -meth public java.util.Date getCreationDate() -meth public java.util.Date getModificationDate() -meth public org.netbeans.modules.mylyn.util.NbTask$SynchronizationState getSynchronizationState() -meth public org.netbeans.modules.mylyn.util.NbTaskDataModel getTaskDataModel() -meth public org.netbeans.modules.mylyn.util.NbTaskDataState getTaskDataState() throws org.eclipse.core.runtime.CoreException -meth public void addNbTaskListener(org.netbeans.modules.mylyn.util.NbTaskListener) -meth public void delete() -meth public void discardLocalEdits() throws org.eclipse.core.runtime.CoreException -meth public void markSeen(boolean) -meth public void removeNbTaskListener(org.netbeans.modules.mylyn.util.NbTaskListener) -meth public void setAttribute(java.lang.String,java.lang.String) -meth public void setEstimate(int) -meth public void setSummary(java.lang.String) -supr java.lang.Object -hfds delegate,list,listeners,syncState -hcls TaskListenerImpl - -CLSS public final static !enum org.netbeans.modules.mylyn.util.NbTask$SynchronizationState - outer org.netbeans.modules.mylyn.util.NbTask -fld public final static org.netbeans.modules.mylyn.util.NbTask$SynchronizationState CONFLICT -fld public final static org.netbeans.modules.mylyn.util.NbTask$SynchronizationState INCOMING -fld public final static org.netbeans.modules.mylyn.util.NbTask$SynchronizationState INCOMING_NEW -fld public final static org.netbeans.modules.mylyn.util.NbTask$SynchronizationState OUTGOING -fld public final static org.netbeans.modules.mylyn.util.NbTask$SynchronizationState OUTGOING_NEW -fld public final static org.netbeans.modules.mylyn.util.NbTask$SynchronizationState SYNCHRONIZED -meth public static org.netbeans.modules.mylyn.util.NbTask$SynchronizationState valueOf(java.lang.String) -meth public static org.netbeans.modules.mylyn.util.NbTask$SynchronizationState[] values() -supr java.lang.Enum - -CLSS public final org.netbeans.modules.mylyn.util.NbTaskDataModel -innr public abstract interface static NbTaskDataModelListener -innr public final static NbTaskDataModelEvent -meth public boolean hasBeenRead() -meth public boolean hasIncomingChanges(org.eclipse.mylyn.tasks.core.data.TaskAttribute,boolean) -meth public boolean hasOutgoingChanged() -meth public boolean hasOutgoingChanges(org.eclipse.mylyn.tasks.core.data.TaskAttribute) -meth public boolean isDirty() -meth public java.util.Set getChangedAttributes() -meth public java.util.Set getChangedOldAttributes() -meth public org.eclipse.mylyn.tasks.core.TaskRepository getTaskRepository() -meth public org.eclipse.mylyn.tasks.core.data.TaskData getLastReadTaskData() -meth public org.eclipse.mylyn.tasks.core.data.TaskData getLocalTaskData() -meth public org.eclipse.mylyn.tasks.core.data.TaskData getRepositoryTaskData() -meth public org.netbeans.modules.mylyn.util.NbTask getTask() -meth public void addNbTaskDataModelListener(org.netbeans.modules.mylyn.util.NbTaskDataModel$NbTaskDataModelListener) -meth public void attributeChanged(org.eclipse.mylyn.tasks.core.data.TaskAttribute) -meth public void clearUnsavedChanges() -meth public void refresh() throws org.eclipse.core.runtime.CoreException -meth public void removeNbTaskDataModelListener(org.netbeans.modules.mylyn.util.NbTaskDataModel$NbTaskDataModelListener) -meth public void save() throws org.eclipse.core.runtime.CoreException -meth public void save(org.eclipse.core.runtime.IProgressMonitor) throws org.eclipse.core.runtime.CoreException -supr java.lang.Object -hfds delegateModel,listeners,task,unsavedChangedAttributes,workingCopy - -CLSS public final static org.netbeans.modules.mylyn.util.NbTaskDataModel$NbTaskDataModelEvent - outer org.netbeans.modules.mylyn.util.NbTaskDataModel -meth public org.eclipse.mylyn.tasks.core.data.TaskAttribute getTaskAttribute() -meth public org.netbeans.modules.mylyn.util.NbTaskDataModel getModel() -supr java.util.EventObject -hfds model,modelEvent - -CLSS public abstract interface static org.netbeans.modules.mylyn.util.NbTaskDataModel$NbTaskDataModelListener - outer org.netbeans.modules.mylyn.util.NbTaskDataModel -intf java.util.EventListener -meth public abstract void attributeChanged(org.netbeans.modules.mylyn.util.NbTaskDataModel$NbTaskDataModelEvent) - -CLSS public final org.netbeans.modules.mylyn.util.NbTaskDataState -meth public org.eclipse.mylyn.tasks.core.data.TaskData getLastReadData() -meth public org.eclipse.mylyn.tasks.core.data.TaskData getLocalData() -meth public org.eclipse.mylyn.tasks.core.data.TaskData getLocalEdits() -meth public org.eclipse.mylyn.tasks.core.data.TaskData getRepositoryData() -supr java.lang.Object -hfds state - -CLSS public abstract interface org.netbeans.modules.mylyn.util.NbTaskListener -innr public final static TaskEvent -intf java.util.EventListener -meth public abstract void taskModified(org.netbeans.modules.mylyn.util.NbTaskListener$TaskEvent) - -CLSS public final static org.netbeans.modules.mylyn.util.NbTaskListener$TaskEvent - outer org.netbeans.modules.mylyn.util.NbTaskListener -innr public final static !enum Kind -meth public boolean taskStateChanged() -meth public org.netbeans.modules.mylyn.util.NbTask getTask() -meth public org.netbeans.modules.mylyn.util.NbTaskListener$TaskEvent$Kind getKind() -supr java.util.EventObject -hfds kind,stateChanged,task - -CLSS public final static !enum org.netbeans.modules.mylyn.util.NbTaskListener$TaskEvent$Kind - outer org.netbeans.modules.mylyn.util.NbTaskListener$TaskEvent -fld public final static org.netbeans.modules.mylyn.util.NbTaskListener$TaskEvent$Kind DELETED -fld public final static org.netbeans.modules.mylyn.util.NbTaskListener$TaskEvent$Kind MODIFIED -meth public static org.netbeans.modules.mylyn.util.NbTaskListener$TaskEvent$Kind valueOf(java.lang.String) -meth public static org.netbeans.modules.mylyn.util.NbTaskListener$TaskEvent$Kind[] values() -supr java.lang.Enum - -CLSS public org.netbeans.modules.mylyn.util.PerformQueryCommand -cons public init(org.eclipse.mylyn.tasks.core.AbstractRepositoryConnector,org.eclipse.mylyn.tasks.core.TaskRepository,org.eclipse.mylyn.tasks.core.data.TaskDataCollector,org.eclipse.mylyn.tasks.core.IRepositoryQuery) -meth public java.lang.String toString() -meth public org.eclipse.core.runtime.IStatus getStatus() -meth public org.eclipse.mylyn.tasks.core.IRepositoryQuery getQuery() -meth public void execute() throws org.eclipse.core.runtime.CoreException -supr org.netbeans.modules.mylyn.util.BugtrackingCommand -hfds collector,query,repositoryConnector,status,taskRepository - -CLSS public org.netbeans.modules.mylyn.util.PostAttachmentCommand -cons public init(org.eclipse.mylyn.tasks.core.AbstractRepositoryConnector,org.eclipse.mylyn.tasks.core.TaskRepository,org.eclipse.mylyn.tasks.core.ITask,org.eclipse.mylyn.tasks.core.data.TaskAttribute,org.eclipse.mylyn.tasks.core.data.AbstractTaskAttachmentSource,java.lang.String) -meth public java.lang.String toString() -meth public void execute() throws java.io.IOException,org.eclipse.core.runtime.CoreException -supr org.netbeans.modules.mylyn.util.BugtrackingCommand -hfds attAttribute,comment,repositoryConnector,stringValue,task,taskAttachmentSource,taskRepository - -CLSS public abstract interface org.netbeans.modules.mylyn.util.RepositoryConnectorProvider -meth public abstract org.eclipse.mylyn.tasks.core.AbstractRepositoryConnector getConnector() - -CLSS public org.netbeans.modules.mylyn.util.SubmitCommand -cons public init(org.eclipse.mylyn.tasks.core.AbstractRepositoryConnector,org.eclipse.mylyn.tasks.core.TaskRepository,org.eclipse.mylyn.tasks.core.data.TaskData) -meth public java.lang.String toString() -meth public org.eclipse.mylyn.tasks.core.RepositoryResponse getRepositoryResponse() -meth public void execute() throws java.io.IOException,org.eclipse.core.runtime.CoreException -supr org.netbeans.modules.mylyn.util.BugtrackingCommand -hfds data,repositoryConnector,rr,stringValue,taskRepository,wasNew - -CLSS public abstract interface org.netbeans.modules.mylyn.util.TaskDataListener -innr public final static TaskDataEvent -intf java.util.EventListener -meth public abstract void taskDataUpdated(org.netbeans.modules.mylyn.util.TaskDataListener$TaskDataEvent) - -CLSS public final static org.netbeans.modules.mylyn.util.TaskDataListener$TaskDataEvent - outer org.netbeans.modules.mylyn.util.TaskDataListener -meth public boolean getTaskDataUpdated() -meth public org.eclipse.mylyn.tasks.core.data.TaskData getTaskData() -meth public org.netbeans.modules.mylyn.util.NbTask getTask() -supr java.util.EventObject -hfds event - -CLSS public final org.netbeans.modules.mylyn.util.UnsubmittedTasksContainer -fld public final static java.lang.String EVENT_ISSUES_CHANGED = "mylyn.unsubmitted_tasks.changed" -meth public java.util.List getTasks() -meth public void addPropertyChangeListener(java.beans.PropertyChangeListener) -meth public void removePropertyChangeListener(java.beans.PropertyChangeListener) -supr java.lang.Object -hfds LOG,list,repository,supp,support,taskList,tasks -hcls TaskListListener - -CLSS public abstract org.netbeans.modules.mylyn.util.WikiPanel -cons public init() -meth public abstract java.lang.String getWikiFormatText() -meth public abstract javax.swing.JLabel getWarningLabel() -meth public abstract javax.swing.JTextPane getCodePane() -meth public abstract javax.swing.JTextPane getPreviewPane() -meth public abstract void appendCodeText(java.lang.String) -meth public abstract void clear() -meth public abstract void registerHighlights(javax.swing.JTextPane) -meth public abstract void setWikiFormatText(java.lang.String) -supr javax.swing.JPanel - -CLSS public org.netbeans.modules.mylyn.util.WikiUtils -meth public static java.lang.String getHtmlFormatText(java.lang.String,java.lang.String) -meth public static org.netbeans.modules.mylyn.util.WikiPanel getWikiPanel(java.lang.String,boolean,boolean) -supr java.lang.Object -hfds LOG - -CLSS public final org.netbeans.modules.mylyn.util.commands.CommandFactory -meth public org.netbeans.modules.mylyn.util.commands.GetAttachmentCommand createGetAttachmentCommand(org.eclipse.mylyn.tasks.core.TaskRepository,org.netbeans.modules.mylyn.util.NbTask,org.eclipse.mylyn.tasks.core.data.TaskAttribute,java.io.OutputStream) -meth public org.netbeans.modules.mylyn.util.commands.GetRepositoryTasksCommand createGetRepositoryTasksCommand(org.eclipse.mylyn.tasks.core.TaskRepository,java.util.Set) throws org.eclipse.core.runtime.CoreException -meth public org.netbeans.modules.mylyn.util.commands.PostAttachmentCommand createPostAttachmentCommand(org.eclipse.mylyn.tasks.core.TaskRepository,org.netbeans.modules.mylyn.util.NbTask,org.eclipse.mylyn.tasks.core.data.TaskAttribute,org.eclipse.mylyn.internal.tasks.core.data.FileTaskAttachmentSource,java.lang.String) -meth public org.netbeans.modules.mylyn.util.commands.SimpleQueryCommand createSimpleQueryCommand(org.eclipse.mylyn.tasks.core.TaskRepository,org.eclipse.mylyn.tasks.core.IRepositoryQuery) throws org.eclipse.core.runtime.CoreException -meth public org.netbeans.modules.mylyn.util.commands.SubmitTaskCommand createSubmitTaskCommand(org.netbeans.modules.mylyn.util.NbTaskDataModel) throws org.eclipse.core.runtime.CoreException -meth public org.netbeans.modules.mylyn.util.commands.SynchronizeQueryCommand createSynchronizeQueriesCommand(org.eclipse.mylyn.tasks.core.TaskRepository,org.eclipse.mylyn.tasks.core.IRepositoryQuery) -meth public org.netbeans.modules.mylyn.util.commands.SynchronizeQueryCommand createSynchronizeQueriesCommand(org.eclipse.mylyn.tasks.core.TaskRepository,org.eclipse.mylyn.tasks.core.IRepositoryQuery,org.eclipse.core.runtime.IProgressMonitor) -meth public org.netbeans.modules.mylyn.util.commands.SynchronizeTasksCommand createSynchronizeTasksCommand(org.eclipse.mylyn.tasks.core.TaskRepository,java.util.Set) - anno 0 java.lang.Deprecated() -meth public org.netbeans.modules.mylyn.util.commands.SynchronizeTasksCommand createSynchronizeTasksCommand(org.eclipse.mylyn.tasks.core.TaskRepository,java.util.Set,boolean) -supr java.lang.Object -hfds LOG,repositoryModel,taskDataManager,taskList,taskRepositoryManager - -CLSS public org.netbeans.modules.mylyn.util.commands.GetAttachmentCommand -meth public java.lang.String toString() -meth public void execute() throws java.io.IOException,org.eclipse.core.runtime.CoreException -supr org.netbeans.modules.mylyn.util.BugtrackingCommand -hfds os,repositoryConnector,stringValue,ta,task,taskRepository - -CLSS public org.netbeans.modules.mylyn.util.commands.GetRepositoryTasksCommand -meth public java.lang.String toString() -meth public java.util.List getTasks() -meth public void cancel() -meth public void execute() throws java.io.IOException,org.eclipse.core.runtime.CoreException -supr org.netbeans.modules.mylyn.util.BugtrackingCommand -hfds connector,monitor,stringValue,taskDataManager,taskIds,taskRepository,tasks -hcls Collector - -CLSS public org.netbeans.modules.mylyn.util.commands.PostAttachmentCommand -meth public java.lang.String toString() -meth public void execute() throws java.io.IOException,org.eclipse.core.runtime.CoreException -supr org.netbeans.modules.mylyn.util.BugtrackingCommand -hfds attAttribute,comment,repositoryConnector,stringValue,task,taskAttachmentSource,taskRepository - -CLSS public org.netbeans.modules.mylyn.util.commands.SimpleQueryCommand -meth public java.lang.String toString() -meth public java.util.Collection getTasks() -meth public org.eclipse.core.runtime.IStatus getStatus() -meth public void cancel() -meth public void execute() throws org.eclipse.core.runtime.CoreException -supr org.netbeans.modules.mylyn.util.BugtrackingCommand -hfds monitor,query,repositoryConnector,status,taskDataManager,taskRepository,tasks - -CLSS public org.netbeans.modules.mylyn.util.commands.SubmitTaskCommand -meth public java.lang.String toString() -meth public org.eclipse.mylyn.tasks.core.RepositoryResponse getRepositoryResponse() -meth public org.netbeans.modules.mylyn.util.NbTask getSubmittedTask() -meth public void cancel() -meth public void execute() throws java.io.IOException,org.eclipse.core.runtime.CoreException -supr org.netbeans.modules.mylyn.util.BugtrackingCommand -hfds changedOldAttributes,monitor,repositoryConnector,rr,stringValue,submitJobListener,submittedTask,task,taskData,taskDataManager,taskRepository -hcls MylynSubmitTaskJob - -CLSS public org.netbeans.modules.mylyn.util.commands.SynchronizeQueryCommand -innr public abstract interface static CommandProgressListener -meth public java.lang.String toString() -meth public org.eclipse.core.runtime.IStatus getStatus() -meth public void addCommandProgressListener(org.netbeans.modules.mylyn.util.commands.SynchronizeQueryCommand$CommandProgressListener) -meth public void cancel() -meth public void execute() throws java.io.IOException,org.eclipse.core.runtime.CoreException -meth public void removeCommandProgressListener(org.netbeans.modules.mylyn.util.commands.SynchronizeQueryCommand$CommandProgressListener) -supr org.netbeans.modules.mylyn.util.BugtrackingCommand -hfds listeners,monitor,query,repositoryConnector,repositoryModel,status,stringValue,taskDataManager,taskList,taskRepository - -CLSS public abstract interface static org.netbeans.modules.mylyn.util.commands.SynchronizeQueryCommand$CommandProgressListener - outer org.netbeans.modules.mylyn.util.commands.SynchronizeQueryCommand -intf java.util.EventListener -meth public abstract void queryRefreshStarted(java.util.Collection) -meth public abstract void taskAdded(org.netbeans.modules.mylyn.util.NbTask) -meth public abstract void taskRemoved(org.netbeans.modules.mylyn.util.NbTask) -meth public abstract void taskSynchronized(org.netbeans.modules.mylyn.util.NbTask) -meth public abstract void tasksRefreshStarted(java.util.Collection) - -CLSS public org.netbeans.modules.mylyn.util.commands.SynchronizeTasksCommand -meth public java.lang.String toString() -meth public void cancel() -meth public void execute() throws java.io.IOException,org.eclipse.core.runtime.CoreException -supr org.netbeans.modules.mylyn.util.BugtrackingCommand -hfds monitor,repositoryConnector,repositoryModel,stringValue,taskDataManager,taskList,taskRepository,tasks,user - -CLSS public abstract org.netbeans.modules.mylyn.util.localtasks.AbstractLocalTask -cons public init(org.netbeans.modules.mylyn.util.NbTask) -meth public final boolean finish() -meth public final boolean reopen() -supr org.netbeans.modules.mylyn.util.AbstractNbTaskWrapper - -CLSS public final org.netbeans.modules.mylyn.util.localtasks.IssueField -fld public final static org.netbeans.modules.mylyn.util.localtasks.IssueField ATTACHMENTS -fld public final static org.netbeans.modules.mylyn.util.localtasks.IssueField REFERENCES -fld public final static org.netbeans.modules.mylyn.util.localtasks.IssueField SUMMARY -meth public java.lang.String getDisplayName() -meth public java.lang.String getKey() -supr java.lang.Object -hfds displayNameKey,key - diff --git a/ide/mylyn.util/nbproject/project.properties b/ide/mylyn.util/nbproject/project.properties deleted file mode 100644 index 0b6149608897..000000000000 --- a/ide/mylyn.util/nbproject/project.properties +++ /dev/null @@ -1,19 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - -javac.source=1.8 -javac.compilerargs=-Xlint -Xlint:-serial \ No newline at end of file diff --git a/ide/mylyn.util/nbproject/project.xml b/ide/mylyn.util/nbproject/project.xml deleted file mode 100644 index d093089d7786..000000000000 --- a/ide/mylyn.util/nbproject/project.xml +++ /dev/null @@ -1,162 +0,0 @@ - - - - org.netbeans.modules.apisupport.project - - - org.netbeans.modules.mylyn.util - - - org.eclipse.core.jobs - - - 3.5.1 - - - - org.eclipse.core.runtime - - - - 3.6.0 - - - - org.eclipse.equinox.common - - - - 3.6.0 - - - - org.eclipse.mylyn.commons.net - - - - 3.6.0 - - - - org.eclipse.mylyn.tasks.core - - - - 3.6.0 - - - - org.eclipse.mylyn.wikitext.core - - - - - - org.netbeans.modules.bugtracking - - - - 1.95 - - - - org.netbeans.modules.keyring - - - - 1.0 - - - - org.netbeans.modules.spellchecker.apimodule - - - - 1.13 - - - - org.netbeans.modules.team.commons - - - - 1.36 - - - - org.openide.awt - - - - 7.51 - - - - org.openide.modules - - - - 7.38 - - - - org.openide.util - - - - 9.3 - - - - org.openide.util.lookup - - - - 8.22 - - - - org.openide.util.ui - - - - 9.8 - - - - - - com.oracle.netbeans.bugdb - org.netbeans.modules.bugzilla - org.netbeans.modules.jira.rest - org.netbeans.modules.jira.xmlrpc - org.netbeans.modules.jira - org.netbeans.modules.localtasks - org.netbeans.modules.odcs.tasks - org.netbeans.modules.odcs.ui - org.netbeans.modules.mylyn.util - org.netbeans.modules.mylyn.util.commands - org.netbeans.modules.mylyn.util.localtasks - - - - diff --git a/ide/mylyn.util/src/org/netbeans/modules/mylyn/util/AbstractNbTaskWrapper.java b/ide/mylyn.util/src/org/netbeans/modules/mylyn/util/AbstractNbTaskWrapper.java deleted file mode 100644 index ff10818a0e14..000000000000 --- a/ide/mylyn.util/src/org/netbeans/modules/mylyn/util/AbstractNbTaskWrapper.java +++ /dev/null @@ -1,832 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.netbeans.modules.mylyn.util; - -import java.awt.EventQueue; -import java.beans.PropertyChangeListener; -import java.beans.PropertyChangeSupport; -import java.io.File; -import java.lang.ref.Reference; -import java.lang.ref.SoftReference; -import java.text.DateFormat; -import java.util.ArrayList; -import java.util.Calendar; -import java.util.Collections; -import java.util.Date; -import java.util.List; -import java.util.Map; -import java.util.logging.Level; -import java.util.logging.Logger; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.mylyn.internal.tasks.core.AbstractTask; -import org.eclipse.mylyn.tasks.core.data.TaskAttribute; -import org.eclipse.mylyn.tasks.core.data.TaskData; -import org.netbeans.modules.bugtracking.spi.IssueScheduleInfo; -import org.netbeans.modules.bugtracking.spi.IssueStatusProvider; -import org.netbeans.modules.bugtracking.commons.AttachmentsPanel; -import org.netbeans.modules.bugtracking.spi.IssueController; -import org.netbeans.modules.bugtracking.spi.IssueProvider; -import org.netbeans.modules.bugtracking.spi.IssueScheduleProvider; -import org.openide.util.RequestProcessor; -import org.openide.util.WeakListeners; - -/** - * - * @author Ondrej Vrabec - */ -public abstract class AbstractNbTaskWrapper { - - static final String ATTR_NEW_UNREAD = "NetBeans.task.markedNewUnread"; //NOI18N - private static final Object MODEL_LOCK = new Object(); - private static final Logger LOG = Logger.getLogger(AbstractNbTaskWrapper.class.getName()); - private static final RequestProcessor RP = new RequestProcessor("NBTasks"); //NOI18N - public static final String NEW_ATTACHMENT_ATTRIBUTE_ID = "nb.attachments.new"; //NOI18N - private static final String NB_NEW_ATTACHMENT_PATCH_ATTR_ID = "nb.newattachment.patch"; //NOI18N - private static final String NB_NEW_ATTACHMENT_FILE_ATTR_ID = "nb.newattachment.file"; //NOI18N - private static final String NB_NEW_ATTACHMENT_CONTENT_TYPE_ATTR_ID = "nb.newattachment.contentType"; //NOI18N - private static final String NB_NEW_ATTACHMENT_DESC_ATTR_ID = "nb.newattachment.desc"; //NOI18N - private static final String NB_NEW_ATTACHMENT_ATTR_ID = "nb.newattachment."; //NOI18N - - private NbTask task; - private NbTaskDataModel model; - private NbTaskDataModel.NbTaskDataModelListener list; - private boolean readPending; - private final TaskDataListenerImpl taskDataListener; - private final TaskListenerImpl taskListener; - private Reference repositoryDataRef; - private final RequestProcessor.Task repositoryTaskDataLoaderTask; - private final PropertyChangeSupport support; - - /** PRIVATE TASK ATTRIBUTES **/ - private String privateNotes; - private Date dueDate; - private boolean dueDateModified; - private NbDateRange scheduleDate; - private boolean scheduleDateModified; - private Integer estimate; - /** PRIVATE TASK ATTRIBUTES **/ - - public AbstractNbTaskWrapper (NbTask task) { - this.task = task; - this.repositoryDataRef = new SoftReference(null); - support = new PropertyChangeSupport(this); - repositoryTaskDataLoaderTask = RP.create(new Runnable() { - @Override - public void run () { - loadRepositoryTaskData(); - } - }); - MylynSupport mylynSupp = MylynSupport.getInstance(); - taskDataListener = new TaskDataListenerImpl(); - mylynSupp.addTaskDataListener(WeakListeners.create(TaskDataListener.class, taskDataListener, mylynSupp)); - taskListener = new TaskListenerImpl(); - task.addNbTaskListener(WeakListeners.create(NbTaskListener.class, taskListener, mylynSupp)); - } - - /** - * Returns the id of the given task or null if task is new - * @param task - * @return id or null - */ - public static String getID (NbTask task) { - if (task.isUnsubmittedRepositoryTask()) { - return "-" + task.getTaskId(); - } - return task.getTaskId(); - } - - protected static boolean attachmentAttributesDiffer (TaskAttribute ta1, TaskAttribute ta2) { - if (ta2 == null) { - return true; - } - String value1 = ta1.getValue(); - String value2 = ta2.getValue(); - boolean changes = !value1.equals(value2); - if (!changes) { - // is a child attribue changed?? - for (TaskAttribute childTA : ta1.getAttributes().values()) { - if (attachmentAttributesDiffer(childTA, ta2.getAttribute(childTA.getId()))) { - changes = true; - break; - } - } - } - return changes; - } - - public final void addPropertyChangeListener (PropertyChangeListener listener) { - support.addPropertyChangeListener(listener); - } - - public final void removePropertyChangeListener (PropertyChangeListener listener) { - support.removePropertyChangeListener(listener); - } - - protected final TaskData getRepositoryTaskData () { - TaskData taskData = repositoryDataRef.get(); - if (taskData == null) { - if (EventQueue.isDispatchThread()) { - repositoryTaskDataLoaderTask.schedule(100); - } else { - return loadRepositoryTaskData(); - } - } - return taskData; - } - - private TaskData loadRepositoryTaskData () { - // this method is time consuming - assert !EventQueue.isDispatchThread(); - TaskData td = repositoryDataRef.get(); - if (td != null) { - return td; - } - try { - NbTaskDataState taskDataState = task.getTaskDataState(); - if (taskDataState != null) { - td = taskDataState.getRepositoryData(); - repositoryDataRef = new SoftReference(td); - repositoryTaskDataLoaded(td); - } - } catch (CoreException ex) { - LOG.log(Level.WARNING, null, ex); - } - return td; - } - - protected final void deleteTask () { - assert task.isLocal() : "Only local tasks can be deleted: " + task.getDelegate().getConnectorKind(); - synchronized (MODEL_LOCK) { - if (list != null) { - model.removeNbTaskDataModelListener(list); - list = null; - } - model = null; - } - MylynSupport mylynSupp = MylynSupport.getInstance(); - mylynSupp.removeTaskDataListener(taskDataListener); - task.removeNbTaskListener(taskListener); - if (task.isLocal()) { - task.delete(); - taskDeleted(task); - fireDeleted(); - } - } - - protected abstract void taskDeleted (NbTask task); - - public final boolean isMarkedNewUnread () { - return task.isLocal() && Boolean.TRUE.toString().equals(task.getAttribute(ATTR_NEW_UNREAD)); - } - - public final boolean isNew () { - return task.isUnsubmittedRepositoryTask(); - } - - protected final void markNewRead () { - task.setAttribute(ATTR_NEW_UNREAD, null); - } - - public final void setUpToDate (boolean seen, boolean markReadPending) { - synchronized (MODEL_LOCK) { - if (markReadPending) { - // this is a workaround to keep incoming changes visible in editor - NbTask.SynchronizationState syncState = task.getSynchronizationState(); - readPending |= syncState == NbTask.SynchronizationState.INCOMING - || syncState == NbTask.SynchronizationState.CONFLICT; - } else { - readPending = false; - } - task.markSeen(seen); - } - } - - protected final boolean editorOpened () { - list = new NbTaskDataModel.NbTaskDataModelListener() { - @Override - public void attributeChanged (NbTaskDataModel.NbTaskDataModelEvent event) { - NbTaskDataModel m = model; - if (event.getModel() == m) { - AbstractNbTaskWrapper.this.attributeChanged(event, m); - } - } - }; - if (task.getSynchronizationState() == NbTask.SynchronizationState.INCOMING_NEW) { - // mark as seen so no fields are highlighted - setUpToDate(true, false); - } - synchronized (MODEL_LOCK) { - synchronized (getNbTask()) { - // clear upon close - if (readPending) { - // make sure remote changes are not lost and still highlighted in the editor - setUpToDate(false, false); - if (task.getDelegate() instanceof AbstractTask) { - ((AbstractTask) task.getDelegate()).setMarkReadPending(false); - } - } - model = task.getTaskDataModel(); - if (model == null) { - if (!synchronizeTask()) { - return false; - } - model = task.getTaskDataModel(); - } - if(model == null) { - // issue #247877 - // something went wrong, not much we can do about it at this place. - // lets avoid at least the NPE - LOG.log(Level.WARNING, "no model even after synchronizing {0}", task.getTaskId()); - return false; - } - model.addNbTaskDataModelListener(list); - } - try { - MylynSupport.getInstance().editorOpened(task.getDelegate()); - } catch (CoreException ex) { - LOG.log(Level.WARNING, null, ex); - } - } - return true; - } - - protected final void editorClosed () { - NbTaskDataModel m = model; - boolean markedAsNewUnread = isMarkedNewUnread(); - if (m != null) { - if (list != null) { - m.removeNbTaskDataModelListener(list); - list = null; - } - readPending = false; - if (markedAsNewUnread) { - // was not modified by user and not yet saved - deleteTask(); - } else { - if (m.isDirty()) { - try { - save(); - } catch (CoreException ex) { - LOG.log(Level.WARNING, null, ex); - } - } - try { - MylynSupport.getInstance().editorClosing(task.getDelegate(), m.getRepositoryTaskData()); - } catch (CoreException ex) { - LOG.log(Level.WARNING, null, ex); - } - synchronized (MODEL_LOCK) { - if (model == m) { - model = null; - } - } - } - } - } - - protected final void runWithModelLoaded (Runnable runnable) { - synchronized (MODEL_LOCK) { - boolean closeModel = false; - try { - if (model == null) { - closeModel = true; - model = task.getTaskDataModel(); - } - runnable.run(); - } finally { - if (closeModel) { - if (model != null && model.isDirty()) { - try { - // let's not loose edits - model.save(); - } catch (CoreException ex) { - LOG.log(Level.INFO, null, ex); - } - } - model = null; - } - } - } - } - - protected abstract void attributeChanged (NbTaskDataModel.NbTaskDataModelEvent event, NbTaskDataModel model); - - private void save () throws CoreException { - NbTaskDataModel m = this.model; - if(m == null) { - // haven't been opened yet so there is no model? - // might happen when e.g. closing a local task on commit (see issue #252222) - m = task.getTaskDataModel(); - } - markNewRead(); - boolean modified = persistPrivateTaskAttributes(); - if (m.isDirty()) { - if (isNew()) { - String summary = task.getSummary(); - String newSummary = getSummary(m.getLocalTaskData()); - if (newSummary != null && !(newSummary.isEmpty() || newSummary.equals(summary))) { - task.setSummary(newSummary); - taskModified(false); - } - } - m.save(); - modelSaved(m); - } - if (modified) { - taskModified(false); - } - } - - protected final void taskSubmitted (NbTask task) { - if (task != null && task != this.task) { - this.task.removeNbTaskListener(taskListener); - this.task = task; - task.addNbTaskListener(taskListener); - synchronized (MODEL_LOCK) { - if (list != null) { - model.removeNbTaskDataModelListener(list); - } - model = task.getTaskDataModel(); - repositoryDataRef.clear(); - if (list != null) { - model.addNbTaskDataModelListener(list); - } - } - } - } - - protected final boolean saveChanges () { - try { - save(); - return true; - } catch (CoreException ex) { - LOG.log(Level.WARNING, null, ex); - } - return false; - } - - public final boolean cancelChanges () { - try { - if (saveChanges()) { - task.discardLocalEdits(); - model.refresh(); - return true; - } - } catch (CoreException ex) { - LOG.log(Level.WARNING, null, ex); - } - return false; - } - - public final void clearUnsavedChanges () { - clearPrivateTaskAttributeChanges(); - model.clearUnsavedChanges(); - } - - public final boolean hasLocalEdits () { - NbTaskDataModel m = model; - return !(m == null || m.getChangedAttributes().isEmpty()); - } - - public final boolean hasUnsavedChanges () { - NbTaskDataModel m = model; - return m != null && m.isDirty() - || hasUnsavedPrivateTaskAttributes(); - } - - protected final boolean updateModel () { - try { - model.refresh(); - MylynSupport.getInstance().editorOpened(task.getDelegate()); - return true; - } catch (CoreException ex) { - LOG.log(Level.INFO, null, ex); - } - return false; - } - - protected abstract void modelSaved (NbTaskDataModel model); - - protected abstract String getSummary (TaskData taskData); - - protected abstract void taskDataUpdated (); - - protected final boolean isSeen () { - NbTask.SynchronizationState syncState = task.getSynchronizationState(); - return syncState == NbTask.SynchronizationState.OUTGOING - || syncState == NbTask.SynchronizationState.OUTGOING_NEW - || syncState == NbTask.SynchronizationState.SYNCHRONIZED; - } - - protected abstract void taskModified (boolean syncStateChanged); - - protected final NbTaskDataModel getModel () { - return model; - } - - protected abstract void repositoryTaskDataLoaded (TaskData repositoryTaskData); - - protected final NbTask getNbTask () { - return task; - } - - public final long getCreated () { - Date createdDate = getCreatedDate(); - if (createdDate != null) { - return createdDate.getTime(); - } else { - return -1; - } - } - - public final Date getCreatedDate () { - return task.getCreationDate(); - } - - public final long getLastModify () { - Date lastModifyDate = getLastModifyDate(); - if (lastModifyDate != null) { - return lastModifyDate.getTime(); - } else { - return -1; - } - } - - public final Date getLastModifyDate () { - return task.getModificationDate(); - } - - public final String getSummary () { - return task.getSummary(); - } - - public final String getID () { - return getID(task); - } - - public final boolean isFinished () { - return task.isCompleted(); - } - - protected final NbTask.SynchronizationState getSynchronizationState () { - return task.getSynchronizationState(); - } - - public final IssueStatusProvider.Status getStatus () { - switch (getSynchronizationState()) { - case CONFLICT: - return IssueStatusProvider.Status.CONFLICT; - case INCOMING: - return IssueStatusProvider.Status.INCOMING_MODIFIED; - case INCOMING_NEW: - return IssueStatusProvider.Status.INCOMING_NEW; - case OUTGOING: - return IssueStatusProvider.Status.OUTGOING_MODIFIED; - case OUTGOING_NEW: - return IssueStatusProvider.Status.OUTGOING_NEW; - case SYNCHRONIZED: - return IssueStatusProvider.Status.SEEN; - } - return null; - } - - /** - * Called when the task does not yet contain all needed data. Needs to re-sync to get full taskdata. - * @return false when the sync fails for some reason - */ - protected abstract boolean synchronizeTask (); - - protected final boolean setNewAttachments (List newAttachments) { - NbTaskDataModel m = getModel(); - TaskData td = m.getLocalTaskData(); - TaskAttribute ta = td.getRoot().getAttribute(AbstractNbTaskWrapper.NEW_ATTACHMENT_ATTRIBUTE_ID); - Map previousAttachments = Collections.emptyMap(); - if (ta != null) { - previousAttachments = ta.getAttributes(); - ta.clearAttributes(); - } - boolean retval = false; - if (newAttachments.isEmpty() && !previousAttachments.isEmpty()) { - m.attributeChanged(ta); - retval = true; - } else if (!newAttachments.isEmpty()) { - if (ta == null) { - ta = td.getRoot().createAttribute(AbstractNbTaskWrapper.NEW_ATTACHMENT_ATTRIBUTE_ID); - } - boolean present = true; - for (int i = 0; i < newAttachments.size(); ++i) { - AttachmentsPanel.AttachmentInfo att = newAttachments.get(i); - TaskAttribute attAttr = ta.createAttribute(NB_NEW_ATTACHMENT_ATTR_ID + i); - if (att.getDescription() != null) { - attAttr.createAttribute(NB_NEW_ATTACHMENT_DESC_ATTR_ID).setValue(att.getDescription()); - } - if (att.getContentType() != null) { - attAttr.createAttribute(NB_NEW_ATTACHMENT_CONTENT_TYPE_ATTR_ID).setValue(att.getContentType()); - } - if (att.getFile() != null) { - attAttr.createAttribute(NB_NEW_ATTACHMENT_FILE_ATTR_ID).setValue(att.getFile().getAbsolutePath()); - } - attAttr.createAttribute(NB_NEW_ATTACHMENT_PATCH_ATTR_ID).setValue(att.isPatch() ? "1" : "0"); - if (present) { - present = false; - for (TaskAttribute previousAttachment : previousAttachments.values()) { - if (!attachmentAttributesDiffer(previousAttachment, ta)) { - present = true; - break; - } - } - } - } - if (!present || previousAttachments.size() != newAttachments.size()) { - m.attributeChanged(ta); - retval = true; - } - } - return retval; - } - - protected final List getNewAttachments () { - NbTaskDataModel m = getModel(); - TaskData td = m == null ? null : m.getLocalTaskData(); - List attachments = Collections.emptyList(); - if (td != null) { - TaskAttribute ta = td.getRoot().getAttribute(AbstractNbTaskWrapper.NEW_ATTACHMENT_ATTRIBUTE_ID); - if (ta != null) { - Map attributes = ta.getAttributes(); - attachments = new ArrayList(attributes.size()); - for (TaskAttribute attAttr : attributes.values()) { - AttachmentsPanel.AttachmentInfo attInfo = new AttachmentsPanel.AttachmentInfo(); - attInfo.setDescription(""); - attInfo.setFile(null); - attInfo.setIsPatch(false); - for (Map.Entry attSubAttr : attAttr.getAttributes().entrySet()) { - if (NB_NEW_ATTACHMENT_DESC_ATTR_ID.equals(attSubAttr.getKey())) { - attInfo.setDescription(attSubAttr.getValue().getValue()); - } else if (NB_NEW_ATTACHMENT_CONTENT_TYPE_ATTR_ID.equals(attSubAttr.getKey())) { - attInfo.setContentType(attSubAttr.getValue().getValue()); - } else if (NB_NEW_ATTACHMENT_FILE_ATTR_ID.equals(attSubAttr.getKey())) { - attInfo.setFile(new File(attSubAttr.getValue().getValue())); - } else if (NB_NEW_ATTACHMENT_PATCH_ATTR_ID.equals(attSubAttr.getKey())) { - attInfo.setIsPatch("1".equals(attSubAttr.getValue().getValue())); - } - } - attachments.add(attInfo); - } - } - } - return attachments; - } - - protected final void setPrivateNotes (String text) { - privateNotes = text; - } - - public final String getPrivateNotes () { - if (privateNotes == null) { - return getNbTask().getPrivateNotes(); - } else { - return privateNotes; - } - } - - public final Date getDueDate () { - return dueDateModified ? dueDate : getNbTask().getDueDate(); - } - - protected final void setDueDate (Date date, boolean persistentChange) { - dueDate = date; - dueDateModified = true; - if (persistentChange) { - persistDueDate(); - } - } - - public final NbDateRange getScheduleDate () { - return scheduleDateModified ? scheduleDate : getNbTask().getScheduleDate(); - } - - protected final void setScheduleDate (IssueScheduleInfo info, boolean persistentChange) { - scheduleDate = info == null ? null : new NbDateRange(info); - scheduleDateModified = true; - if (persistentChange) { - persistScheduleDate(); - } - } - - public final int getEstimate () { - return estimate == null ? getNbTask().getEstimate() : estimate; - } - - protected final void setEstimate (int estimate, boolean persistentChange) { - this.estimate = estimate; - if (persistentChange) { - persistEstimate(); - } - } - - /** - * Returns only persistent value of due date, never the unsaved modification from the task editor - * @return current task's persistent due date value - */ - public final Date getPersistentDueDate () { - return getNbTask().getDueDate(); - } - - /** - * Returns only persistent value of estimate, never the unsaved modification from the task editor - * @return current task's persistent estimate value - */ - public final int getPersistentEstimate () { - return getNbTask().getEstimate(); - } - - /** - * Returns only persistent value of schedule date, never the unsaved modification from the task editor - * @return current task's persistent scheduled date value - */ - public final IssueScheduleInfo getPersistentScheduleInfo () { - NbDateRange scheduled = getNbTask().getScheduleDate(); - return scheduled == null ? null : scheduled.toSchedulingInfo(); - } - - protected final boolean hasUnsavedPrivateTaskAttributes () { - return privateNotes != null || dueDateModified || scheduleDateModified || estimate != null; - } - - private boolean persistPrivateTaskAttributes () { - boolean modified = false; - if (privateNotes != null) { - getNbTask().setPrivateNotes(privateNotes.isEmpty() ? null : privateNotes); - privateNotes = null; - modified = true; - } - boolean fireScheduleEvent = false; - if (persistEstimate()) { - modified = true; - fireScheduleEvent = true; - } - if (persistDueDate()) { - modified = true; - fireScheduleEvent = true; - } - if (persistScheduleDate()) { - modified = true; - fireScheduleEvent = true; - } - if (fireScheduleEvent) { - fireScheduleChanged(); - } - return modified; - } - - private boolean persistDueDate () { - boolean modified = false; - if (dueDateModified) { - getNbTask().setDueDate(dueDate); - dueDate = null; - dueDateModified = false; - modified = true; - } - return modified; - } - - private boolean persistEstimate () { - boolean modified = false; - if (estimate != null) { - getNbTask().setEstimate(estimate); - estimate = null; - modified = true; - } - return modified; - } - - private boolean persistScheduleDate () { - boolean modified = false; - if (scheduleDateModified) { - getNbTask().setScheduleDate(scheduleDate); - scheduleDate = null; - scheduleDateModified = false; - modified = true; - } - return modified; - } - - private void clearPrivateTaskAttributeChanges () { - privateNotes = null; - dueDate = null; - dueDateModified = false; - scheduleDate = null; - scheduleDateModified = false; - estimate = null; - } - - protected final String getDueDisplayString () { - Calendar cal = Calendar.getInstance(); - Date date = getPersistentDueDate(); - if (date == null) { - return ""; - } - cal.setTime(date); - return formatDate(cal); - } - - protected final String getEstimateDisplayString () { - int est = getPersistentEstimate(); - if (est == 0) { - return ""; - } - return "" + est; - } - - protected final String getScheduleDisplayString () { - NbDateRange schedule = getNbTask().getScheduleDate(); - if (schedule == null) { - return ""; - } - int interval = schedule.getEndDate().get(Calendar.DAY_OF_YEAR) - schedule.getStartDate().get(Calendar.DAY_OF_YEAR); - if (interval == 1) { - return formatDate(schedule.getStartDate()); - } - return formateDate(schedule.getStartDate(), schedule.getEndDate()); - } - - protected final void fireChanged () { - support.firePropertyChange(IssueController.PROP_CHANGED, null, null); - } - - protected final void fireDataChanged () { - support.firePropertyChange(IssueProvider.EVENT_ISSUE_DATA_CHANGED, null, null); - } - - protected final void fireScheduleChanged () { - support.firePropertyChange(IssueScheduleProvider.EVENT_ISSUE_SCHEDULE_CHANGED, null, null); - } - - protected final void fireStatusChanged () { - support.firePropertyChange(IssueStatusProvider.EVENT_STATUS_CHANGED, null, null); - } - - private void fireDeleted () { - support.firePropertyChange(IssueProvider.EVENT_ISSUE_DELETED, null, null); - } - - private String formatDate (Calendar date) { - return DateFormat.getDateInstance(DateFormat.DEFAULT).format(date.getTime()); - } - - private String formateDate (Calendar start, Calendar end) { - DateFormat format = DateFormat.getDateInstance(DateFormat.DEFAULT); - return format.format(start.getTime()) + " - " + format.format(end.getTime()); //NOI18N - } - - private class TaskDataListenerImpl implements TaskDataListener { - - @Override - public void taskDataUpdated (TaskDataListener.TaskDataEvent event) { - if (event.getTask() == task) { - if (event.getTaskData() != null && !event.getTaskData().isPartial()) { - repositoryDataRef = new SoftReference(event.getTaskData()); - } - if (event.getTaskDataUpdated()) { - NbTaskDataModel m = model; - if (m != null) { - try { - m.refresh(); - } catch (CoreException ex) { - LOG.log(Level.INFO, null, ex); - } - } - AbstractNbTaskWrapper.this.taskDataUpdated(); - } - } - } - } - - private class TaskListenerImpl implements NbTaskListener { - - @Override - public void taskModified (NbTaskListener.TaskEvent event) { - if (event.getTask() == task && event.getKind() == NbTaskListener.TaskEvent.Kind.MODIFIED) { - boolean syncStateChanged = event.taskStateChanged(); - AbstractNbTaskWrapper.this.taskModified(syncStateChanged); - } - } - - } -} diff --git a/ide/mylyn.util/src/org/netbeans/modules/mylyn/util/AccessorImpl.java b/ide/mylyn.util/src/org/netbeans/modules/mylyn/util/AccessorImpl.java deleted file mode 100644 index 3ada71450f18..000000000000 --- a/ide/mylyn.util/src/org/netbeans/modules/mylyn/util/AccessorImpl.java +++ /dev/null @@ -1,88 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.netbeans.modules.mylyn.util; - -import java.util.Collection; -import java.util.Set; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.mylyn.tasks.core.ITask; -import org.eclipse.mylyn.tasks.core.TaskRepository; -import org.netbeans.modules.mylyn.util.internal.Accessor; - -/** - * - * @author Ondrej Vrabec - */ -class AccessorImpl extends Accessor { - - private static AccessorImpl instance; - - public static AccessorImpl getInstance () { - if (instance == null) { - instance = new AccessorImpl(); - Accessor.setInstance(instance); - } - return instance; - } - - @Override - public void finishMylyn () throws CoreException { - MylynSupport.getInstance().finish(); - } - - @Override - public Collection toNbTasks (Set tasks) { - return MylynSupport.getInstance().toNbTasks(tasks); - } - - @Override - public NbTask toNbTask (ITask task) { - return MylynSupport.getInstance().toNbTask(task); - } - - @Override - public Set toMylynTasks (Set tasks) { - return MylynSupport.toMylynTasks(tasks); - } - - @Override - public ITask getITask (NbTaskDataModel model) { - return model.getDelegateTask(); - } - - @Override - public TaskRepository getTaskRepositoryFor (ITask task) { - return MylynSupport.getInstance().getTaskRepositoryFor(task); - } - - @Override - public ITask getDelegate (NbTask task) { - return task.getDelegate(); - } - - @Override - public NbTask getOrCreateTask (TaskRepository taskRepository, String taskId, boolean addToTasklist) throws CoreException { - return MylynSupport.getInstance().getOrCreateTask(taskRepository, taskId, addToTasklist); - } - - @Override - public void taskModified (NbTask nbTask) { - MylynSupport.getInstance().taskModified(getDelegate(nbTask)); - } -} diff --git a/ide/mylyn.util/src/org/netbeans/modules/mylyn/util/BugtrackingCommand.java b/ide/mylyn.util/src/org/netbeans/modules/mylyn/util/BugtrackingCommand.java deleted file mode 100644 index 622179d0871c..000000000000 --- a/ide/mylyn.util/src/org/netbeans/modules/mylyn/util/BugtrackingCommand.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.netbeans.modules.mylyn.util; - -import java.io.IOException; -import java.net.MalformedURLException; -import org.eclipse.core.runtime.CoreException; - -/** - * - * @author Tomas Stupka - */ -public abstract class BugtrackingCommand { - private boolean failed = false; - private String errorMessage; - - public abstract void execute() throws CoreException, IOException, MalformedURLException; - - public boolean hasFailed() { - return failed; - } - - public void setFailed(boolean failed) { - this.failed = failed; - } - - public void setErrorMessage(String msg) { - this.errorMessage = msg; - } - - public String getErrorMessage() { - return errorMessage; - } - - public void cancel () { - - } -} diff --git a/ide/mylyn.util/src/org/netbeans/modules/mylyn/util/Bundle.properties b/ide/mylyn.util/src/org/netbeans/modules/mylyn/util/Bundle.properties deleted file mode 100644 index 2f2b2444db7c..000000000000 --- a/ide/mylyn.util/src/org/netbeans/modules/mylyn/util/Bundle.properties +++ /dev/null @@ -1,23 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - -OpenIDE-Module-Long-Description=\ - Mylyn specific support for issue tracking modules -OpenIDE-Module-Name=Mylyn Support Utilities -OpenIDE-Module-Display-Category=Team -OpenIDE-Module-Short-Description=Mylyn support -TaskStorage_Import_Display_Name=Task Storage diff --git a/ide/mylyn.util/src/org/netbeans/modules/mylyn/util/CancelableProgressMonitor.java b/ide/mylyn.util/src/org/netbeans/modules/mylyn/util/CancelableProgressMonitor.java deleted file mode 100644 index 7a5763957d78..000000000000 --- a/ide/mylyn.util/src/org/netbeans/modules/mylyn/util/CancelableProgressMonitor.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.netbeans.modules.mylyn.util; - -import org.eclipse.core.runtime.IProgressMonitor; - -/** - * - * @author Ondrej Vrabec - */ -public class CancelableProgressMonitor implements IProgressMonitor { - - private volatile boolean canceled; - - @Override - public void beginTask (String string, int i) { - } - - @Override - public void done () { - } - - @Override - public void internalWorked (double d) { - } - - @Override - public synchronized boolean isCanceled () { - return canceled; - } - - @Override - public synchronized void setCanceled (boolean canceled) { - this.canceled = canceled; - } - - @Override - public void setTaskName (String string) { - } - - @Override - public void subTask (String string) { - } - - @Override - public void worked (int i) { - } - -} diff --git a/ide/mylyn.util/src/org/netbeans/modules/mylyn/util/GetAttachmentCommand.java b/ide/mylyn.util/src/org/netbeans/modules/mylyn/util/GetAttachmentCommand.java deleted file mode 100644 index 204de996d8f9..000000000000 --- a/ide/mylyn.util/src/org/netbeans/modules/mylyn/util/GetAttachmentCommand.java +++ /dev/null @@ -1,98 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.netbeans.modules.mylyn.util; - -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.net.MalformedURLException; -import java.util.logging.Level; -import java.util.logging.Logger; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.NullProgressMonitor; -import org.eclipse.mylyn.tasks.core.AbstractRepositoryConnector; -import org.eclipse.mylyn.tasks.core.ITask; -import org.eclipse.mylyn.tasks.core.TaskRepository; -import org.eclipse.mylyn.tasks.core.data.AbstractTaskAttachmentHandler; -import org.eclipse.mylyn.tasks.core.data.TaskAttribute; - -/** - * - * @author Tomas Stupka - */ -public class GetAttachmentCommand extends BugtrackingCommand { - - private final TaskAttribute ta; - private final TaskRepository taskRepository; - private final AbstractRepositoryConnector repositoryConnector; - private final OutputStream os; - private String stringValue; - private final ITask task; - - public GetAttachmentCommand(AbstractRepositoryConnector repositoryConnector, - TaskRepository taskRepository, - ITask task, - TaskAttribute ta, - OutputStream os) { - this.ta = ta; - this.task = task; - this.taskRepository = taskRepository; - this.repositoryConnector = repositoryConnector; - this.os = os; - } - - @Override - public void execute() throws CoreException, IOException, MalformedURLException { - Logger log = Logger.getLogger(this.getClass().getName()); - if(log.isLoggable(Level.FINE)) { - log.log(Level.FINE, "executing GetTaskDataCommand for attachment id: {0}", ta.getValue()); // NOI18N - } - AbstractTaskAttachmentHandler taskAttachmentHandler = repositoryConnector.getTaskAttachmentHandler(); - if (!taskAttachmentHandler.canGetContent(taskRepository, task)) { - throw new IOException("Cannot get content for attachment with id: " + ta.getValue()); - } - InputStream is = taskAttachmentHandler.getContent(taskRepository, task, ta, new NullProgressMonitor()); - try { - byte [] buffer = new byte[4096]; - int n; - while ((n = is.read(buffer)) != -1) { - os.write(buffer, 0, n); - } - } finally { - is.close(); - } - } - - @Override - public String toString() { - if (stringValue == null) { - StringBuilder sb = new StringBuilder(); - sb.append("GetAttachmentCommand [repository="); // NOI18N - sb.append(taskRepository.getUrl()); - sb.append(",attachmentID="); // NOI18N - sb.append(ta.getValue()); - sb.append("]"); // NOI18N - stringValue = sb.toString(); - } - return stringValue; - - } - -} diff --git a/ide/mylyn.util/src/org/netbeans/modules/mylyn/util/GetMultiTaskDataCommand.java b/ide/mylyn.util/src/org/netbeans/modules/mylyn/util/GetMultiTaskDataCommand.java deleted file mode 100644 index 7689d0b5b0af..000000000000 --- a/ide/mylyn.util/src/org/netbeans/modules/mylyn/util/GetMultiTaskDataCommand.java +++ /dev/null @@ -1,89 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.netbeans.modules.mylyn.util; - -import java.util.Set; -import java.util.logging.Level; -import java.util.logging.Logger; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.NullProgressMonitor; -import org.eclipse.mylyn.tasks.core.AbstractRepositoryConnector; -import org.eclipse.mylyn.tasks.core.TaskRepository; -import org.eclipse.mylyn.tasks.core.data.TaskDataCollector; - -/** - * Retrieves the TaskData for all given issue ids - * - * @author Tomas Stupka - */ -public class GetMultiTaskDataCommand extends BugtrackingCommand { - - private final AbstractRepositoryConnector repositoryConnector; - private final TaskRepository taskRepository; - private final Set ids; - private final TaskDataCollector collector; - - public GetMultiTaskDataCommand(AbstractRepositoryConnector repositoryConnector, TaskRepository taskRepository, TaskDataCollector collector, Set ids) { - this.taskRepository = taskRepository; - this.repositoryConnector = repositoryConnector; - this.ids = ids; - this.collector = collector; - } - - @Override - public void execute() throws CoreException { - - Logger log = Logger.getLogger(this.getClass().getName()); - if(log.isLoggable(Level.FINE)) { - log.log( - Level.FINE, - "executing GetMultiTaskDataCommand for tasks: {0}", // NOI18N - print(ids)); - } - - repositoryConnector.getTaskDataHandler().getMultiTaskData( - taskRepository, - ids, - collector, - new NullProgressMonitor()); - } - - private String print(Set ids) { - StringBuilder sb = new StringBuilder(); - int i = 0; - for (String string : ids) { - sb.append(string); - if(++i < ids.size()) { - sb.append(","); // NOI18N - } - } - return sb.toString(); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("GetMultiTaskDataCommand [repository="); // NOI18N - sb.append(taskRepository.getUrl()); - sb.append(",...]"); // NOI18N - return sb.toString(); - } - -} diff --git a/ide/mylyn.util/src/org/netbeans/modules/mylyn/util/GetTaskDataCommand.java b/ide/mylyn.util/src/org/netbeans/modules/mylyn/util/GetTaskDataCommand.java deleted file mode 100644 index 1ef69bbeac8e..000000000000 --- a/ide/mylyn.util/src/org/netbeans/modules/mylyn/util/GetTaskDataCommand.java +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.netbeans.modules.mylyn.util; - -import java.io.IOException; -import java.net.MalformedURLException; -import java.util.logging.Level; -import java.util.logging.Logger; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.NullProgressMonitor; -import org.eclipse.mylyn.tasks.core.AbstractRepositoryConnector; -import org.eclipse.mylyn.tasks.core.TaskRepository; -import org.eclipse.mylyn.tasks.core.data.TaskData; - -/** - * - * @author Tomas Stupka - */ -public class GetTaskDataCommand extends BugtrackingCommand { - - private final String id; - private final TaskRepository taskRepository; - private final AbstractRepositoryConnector repositoryConnector; - private TaskData taskData; - - public GetTaskDataCommand(AbstractRepositoryConnector repositoryConnector, TaskRepository taskRepository, String id) { - this.id = id; - this.taskRepository = taskRepository; - this.repositoryConnector = repositoryConnector; - } - - @Override - public void execute() throws CoreException, IOException, MalformedURLException { - - Logger log = Logger.getLogger(this.getClass().getName()); - if(log.isLoggable(Level.FINE)) { - log.log(Level.FINE, "executing GetTaskDataCommand for task: {0}", id); // NOI18N - } - - taskData = repositoryConnector.getTaskData(taskRepository, id, new NullProgressMonitor()); - } - - public TaskData getTaskData() { - return taskData; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("GetTaskDataCommand [repository="); // NOI18N - sb.append(taskRepository.getUrl()); - sb.append(",id="); // NOI18N - sb.append(id); - sb.append("]"); // NOI18N - return sb.toString(); - - } - -} diff --git a/ide/mylyn.util/src/org/netbeans/modules/mylyn/util/MylynSupport.java b/ide/mylyn.util/src/org/netbeans/modules/mylyn/util/MylynSupport.java deleted file mode 100644 index 783a5ca2e22e..000000000000 --- a/ide/mylyn.util/src/org/netbeans/modules/mylyn/util/MylynSupport.java +++ /dev/null @@ -1,861 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.netbeans.modules.mylyn.util; - -import java.io.File; -import java.lang.ref.Reference; -import java.lang.ref.SoftReference; -import java.util.Collection; -import java.util.Collections; -import java.util.HashMap; -import java.util.HashSet; -import java.util.LinkedHashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.WeakHashMap; -import java.util.concurrent.CopyOnWriteArrayList; -import java.util.logging.Level; -import java.util.logging.Logger; -import java.util.prefs.Preferences; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.NullProgressMonitor; -import org.eclipse.core.runtime.Status; -import org.eclipse.mylyn.internal.tasks.core.AbstractTask; -import org.eclipse.mylyn.internal.tasks.core.ITaskListChangeListener; -import org.eclipse.mylyn.internal.tasks.core.ITaskListRunnable; -import org.eclipse.mylyn.internal.tasks.core.ITasksCoreConstants; -import org.eclipse.mylyn.internal.tasks.core.LocalRepositoryConnector; -import org.eclipse.mylyn.internal.tasks.core.LocalTask; -import org.eclipse.mylyn.internal.tasks.core.RepositoryModel; -import org.eclipse.mylyn.internal.tasks.core.RepositoryQuery; -import org.eclipse.mylyn.internal.tasks.core.TaskActivityManager; -import org.eclipse.mylyn.internal.tasks.core.TaskContainerDelta; -import org.eclipse.mylyn.internal.tasks.core.TaskList; -import org.eclipse.mylyn.internal.tasks.core.TaskRepositoryDelta; -import org.eclipse.mylyn.internal.tasks.core.TaskRepositoryManager; -import org.eclipse.mylyn.internal.tasks.core.UnmatchedTaskContainer; -import org.eclipse.mylyn.internal.tasks.core.data.ITaskDataManagerListener; -import org.eclipse.mylyn.internal.tasks.core.data.SynchronizationManger; -import org.eclipse.mylyn.internal.tasks.core.data.TaskDataDiff; -import org.eclipse.mylyn.internal.tasks.core.data.TaskDataManager; -import org.eclipse.mylyn.internal.tasks.core.data.TaskDataManagerEvent; -import org.eclipse.mylyn.internal.tasks.core.data.TaskDataState; -import org.eclipse.mylyn.internal.tasks.core.data.TaskDataStore; -import org.eclipse.mylyn.internal.tasks.core.externalization.TaskListExternalizer; -import org.eclipse.mylyn.tasks.core.AbstractRepositoryConnector; -import org.eclipse.mylyn.tasks.core.IRepositoryListener; -import org.eclipse.mylyn.tasks.core.IRepositoryQuery; -import org.eclipse.mylyn.tasks.core.ITask; -import org.eclipse.mylyn.tasks.core.ITaskMapping; -import org.eclipse.mylyn.tasks.core.TaskRepository; -import org.eclipse.mylyn.tasks.core.data.AbstractTaskDataHandler; -import org.eclipse.mylyn.tasks.core.data.ITaskAttributeDiff; -import org.eclipse.mylyn.tasks.core.data.ITaskDataWorkingCopy; -import org.eclipse.mylyn.tasks.core.data.TaskAttribute; -import org.eclipse.mylyn.tasks.core.data.TaskAttributeMapper; -import org.eclipse.mylyn.tasks.core.data.TaskData; -import org.netbeans.modules.mylyn.util.commands.CommandFactory; -import org.netbeans.modules.mylyn.util.internal.CommandsAccessor; -import org.netbeans.modules.mylyn.util.internal.TaskListener; -import org.netbeans.modules.mylyn.util.localtasks.internal.LocalTaskDataHandler; -import org.openide.modules.Places; -import org.openide.util.Lookup; -import org.openide.util.LookupEvent; -import org.openide.util.LookupListener; -import org.openide.util.NbBundle; -import org.openide.util.NbPreferences; -import org.openide.util.RequestProcessor; -import org.openide.util.RequestProcessor.Task; - -/** - * - * @author Ondrej Vrabec - */ -@NbBundle.Messages({ - "MSG_NewTaskSummary=New Unsubmitted Task" -}) -public class MylynSupport { - - private static MylynSupport instance; - private static final String BACKUP_SUFFIX = ".backup"; //NOI18N - private final TaskRepositoryManager taskRepositoryManager; - private final TaskRepository localTaskRepository; - private final TaskList taskList; - private final RepositoryModel repositoryModel; - private final SynchronizationManger synchronizationManager; - private final TaskDataManager taskDataManager; - private final TaskActivityManager taskActivityManager; - private final TaskListExternalizer taskListWriter; - private final File taskListStorageFile; - private boolean taskListInitialized; - private CommandFactory factory; - private static final Logger LOG = Logger.getLogger(MylynSupport.class.getName()); - private ITaskListChangeListener taskListListener; - private static final String PROP_REPOSITORY_CREATION_TIME = "repository.creation.time_"; //NOI18N - private IRepositoryListener taskRepositoryManagerListener; - private static final String ATTR_TASK_INCOMING_NEW = "NetBeans.task.unseen"; //NOI18N - private static final RequestProcessor RP = new RequestProcessor("MylynSupport", 1, true); //NOI18N - private final Task saveTask; - private boolean dirty; - private final Map unsubmittedTaskContainers; - private ITaskDataManagerListener taskDataManagerListener; - private final List taskDataListeners; - private final Map> taskListeners; - private final Map> tasks = new WeakHashMap>(); - private final Map taskPerList = new HashMap(); - private Lookup.Result result; - - public static synchronized MylynSupport getInstance () { - if (instance == null) { - instance = new MylynSupport(); - } - return instance; - } - - @NbBundle.Messages({ - "LBL_LocalTaskRepository.displayName=Local Tasks" - }) - private MylynSupport () { - taskRepositoryManager = new TaskRepositoryManager(); - taskRepositoryManager.addRepositoryConnector(new LocalRepositoryConnector()); - localTaskRepository = new TaskRepository(LocalRepositoryConnector.CONNECTOR_KIND, LocalRepositoryConnector.REPOSITORY_URL); - localTaskRepository.setRepositoryLabel(Bundle.LBL_LocalTaskRepository_displayName()); - taskRepositoryManager.addRepository(localTaskRepository); - - taskList = new TaskList(); - repositoryModel = new RepositoryModel(taskList, taskRepositoryManager); - synchronizationManager = new SynchronizationManger(repositoryModel); - taskActivityManager = new TaskActivityManager(taskRepositoryManager, taskList); - TaskDataStore taskDataStore = new TaskDataStore(taskRepositoryManager); - taskDataManager = new TaskDataManager(taskDataStore, taskRepositoryManager, taskList, - taskActivityManager, synchronizationManager); - - String storagePath = Places.getUserDirectory().getAbsolutePath() - + "/var/tasks/mylyn".replace("/", File.separator); //NOI18N - taskListStorageFile = new File(storagePath, ITasksCoreConstants.DEFAULT_TASK_LIST_FILE); - taskDataManager.setDataPath(storagePath); - taskListWriter = new TaskListExternalizer(repositoryModel, taskRepositoryManager); - AccessorImpl.getInstance(); // initializes Accessor - saveTask = RP.create(new Runnable() { - @Override - public void run () { - try { - persist(false); - } catch (CoreException ex) { - LOG.log(Level.WARNING, null, ex); - } - } - }); - unsubmittedTaskContainers = new WeakHashMap(); - taskDataListeners = new CopyOnWriteArrayList(); - taskListeners = new WeakHashMap>(); - attachListeners(); - } - - /** - * Returns all known tasks from the given repository. - * - * @param taskRepository repository tasks are stored in - * @return tasks from the requested repository - * @throws CoreException when the tasklist is inaccessible. - */ - public Collection getTasks (TaskRepository taskRepository) throws CoreException { - ensureTaskListLoaded(); - assert taskRepositoryManager.getRepositoryConnector(taskRepository.getConnectorKind()) != null - : "Did you forget to implement RepositoryConnectorProvider?"; - return toNbTasks(taskList.getTasks(taskRepository.getUrl()), - !LocalRepositoryConnector.CONNECTOR_KIND.equals(taskRepository.getConnectorKind())); - } - - public Collection getTasks (IRepositoryQuery query) throws CoreException { - assert query instanceof RepositoryQuery; - if (query instanceof RepositoryQuery) { - ensureTaskListLoaded(); - assert taskRepositoryManager.getRepositoryConnector(query.getConnectorKind()) != null - : "Did you forget to implement RepositoryConnectorProvider?"; - return toNbTasks(((RepositoryQuery) query).getChildren()); - } else { - return Collections.emptyList(); - } - } - - public NbTask getTask (String repositoryUrl, String taskKeyOrId) throws CoreException { - ensureTaskListLoaded(); - ITask task = taskList.getTaskByKey(repositoryUrl, taskKeyOrId); - if (task == null) { - task = taskList.getTask(repositoryUrl, taskKeyOrId); - } - return toNbTask(task); - } - - public UnsubmittedTasksContainer getUnsubmittedTasksContainer (TaskRepository taskRepository) throws CoreException { - UnsubmittedTasksContainer cont; - synchronized (unsubmittedTaskContainers) { - cont = unsubmittedTaskContainers.get(taskRepository); - if (cont == null) { - ensureTaskListLoaded(); - assert taskRepositoryManager.getRepositoryConnector(taskRepository.getConnectorKind()) != null - : "Did you forget to implement RepositoryConnectorProvider?"; - cont = new UnsubmittedTasksContainer(taskRepository, taskList); - unsubmittedTaskContainers.put(taskRepository, cont); - } - } - return cont; - } - - public TaskRepository getLocalTaskRepository () { - return localTaskRepository; - } - - public void save () throws CoreException { - persist(false); - } - - /** - * Adds a listener notified when a task data is updated ad modified. - * - * @param listener - */ - public void addTaskDataListener (TaskDataListener listener) { - taskDataListeners.add(listener); - } - - public void removeTaskDataListener (TaskDataListener listener) { - taskDataListeners.remove(listener); - } - - public void addRepositoryListener (IRepositoryListener listener) { - taskRepositoryManager.addListener(listener); - } - - // for tests only - static synchronized void reset () { - instance = null; - } - - NbTaskDataState getTaskDataState (NbTask task) throws CoreException { - TaskDataState taskDataState = taskDataManager.getTaskDataState(task.getDelegate()); - if (taskDataState == null) { - return null; - } else { - if (taskDataState.getLastReadData() == null) { - taskDataState.setLastReadData(taskDataState.getRepositoryData()); - } - return new NbTaskDataState(taskDataState); - } - } - - public Set countDiff (TaskData newTaskData, TaskData oldTaskData) { - Set attributes = new LinkedHashSet(); - TaskDataDiff diff = new TaskDataDiff(repositoryModel, newTaskData, oldTaskData); - for (ITaskAttributeDiff diffAttr : diff.getChangedAttributes()) { - attributes.add(newTaskData.getRoot().getAttribute(diffAttr.getAttributeId())); - } - return attributes; - } - - public Set getRepositoryQueries (TaskRepository taskRepository) throws CoreException { - ensureTaskListLoaded(); - assert taskRepositoryManager.getRepositoryConnector(taskRepository.getConnectorKind()) != null - : "Did you forget to implement RepositoryConnectorProvider?"; - return new HashSet(taskList.getRepositoryQueries(taskRepository.getUrl())); - } - - public void addQuery (TaskRepository taskRepository, IRepositoryQuery query) throws CoreException { - if (!(query instanceof RepositoryQuery)) { - throw new IllegalArgumentException("Query must be instance of RepositoryQuery: " + query); - } - ensureTaskListLoaded(); - assert taskRepositoryManager.getRepositoryConnector(taskRepository.getConnectorKind()) != null - : "Did you forget to implement RepositoryConnectorProvider?"; - taskList.addQuery((RepositoryQuery) query); - } - - void discardLocalEdits (ITask task) throws CoreException { - taskDataManager.discardEdits(task); - } - - public IRepositoryQuery getRepositoryQuery (TaskRepository taskRepository, String queryName) throws CoreException { - for (IRepositoryQuery q : getRepositoryQueries(taskRepository)) { - if (queryName.equals(q.getSummary())) { - return q; - } - } - return null; - } - - void deleteTask (ITask task) { - assert taskListInitialized; - taskList.deleteTask(task); - tasks.remove(task); - } - - public void deleteQuery (IRepositoryQuery query) { - assert taskListInitialized; - if (query instanceof RepositoryQuery) { - taskList.deleteQuery((RepositoryQuery) query); - } - } - - /** - * Creates an unsubmitted task that's to be populated and submitted later. - * The task is local until submitted and kept in the tasklist under - * "Unsubmitted" category. - * - * @param taskRepository repository the task will be submitted to later. - * @param initializingData default data (such as product/component) to - * preset in the new task's data - * @return the newly created task. - * @throws CoreException tasklist or task data storage is inaccessible - */ - public NbTask createTask (TaskRepository taskRepository, ITaskMapping initializingData) throws CoreException { - ensureTaskListLoaded(); - AbstractTask task = createNewTask(taskRepository); - AbstractRepositoryConnector repositoryConnector = taskRepositoryManager.getRepositoryConnector(taskRepository.getConnectorKind()); - AbstractTaskDataHandler taskDataHandler = taskRepository == localTaskRepository - ? new LocalTaskDataHandler(taskRepository) - : repositoryConnector.getTaskDataHandler(); - TaskAttributeMapper attributeMapper = taskDataHandler.getAttributeMapper(taskRepository); - TaskData taskData = new TaskData(attributeMapper, repositoryConnector.getConnectorKind(), taskRepository.getRepositoryUrl(), ""); - taskDataHandler.initializeTaskData(taskRepository, taskData, initializingData, new NullProgressMonitor()); - initializeTask(repositoryConnector, taskData, task, taskRepository); - return MylynSupport.getInstance().toNbTask(task); - } - - public NbTask createSubtask (NbTask parentTask) throws CoreException { - ensureTaskListLoaded(); - TaskRepository taskRepository = taskRepositoryManager.getRepository(parentTask.getDelegate().getRepositoryUrl()); - if (taskRepository == null || parentTask.isUnsubmittedRepositoryTask()) { - throw new IllegalStateException("Task repository: " + parentTask.getDelegate().getRepositoryUrl() - + " - parent: " + parentTask.isUnsubmittedRepositoryTask()); - } - AbstractTask task = createNewTask(taskRepository); - AbstractRepositoryConnector repositoryConnector = taskRepositoryManager.getRepositoryConnector(taskRepository.getConnectorKind()); - AbstractTaskDataHandler taskDataHandler = repositoryConnector.getTaskDataHandler(); - - TaskAttributeMapper attributeMapper = repositoryConnector.getTaskDataHandler().getAttributeMapper(taskRepository); - TaskData taskData = new TaskData(attributeMapper, repositoryConnector.getConnectorKind(), taskRepository.getRepositoryUrl(), ""); - taskDataHandler.initializeSubTaskData(taskRepository, taskData, parentTask.getTaskDataState().getRepositoryData(), new NullProgressMonitor()); - initializeTask(repositoryConnector, taskData, task, taskRepository); - return MylynSupport.getInstance().toNbTask(task); - } - - private void initializeTask (AbstractRepositoryConnector repositoryConnector, TaskData taskData, AbstractTask task, TaskRepository taskRepository) throws CoreException { - ITaskMapping mapping = repositoryConnector.getTaskMapping(taskData); - String taskKind = mapping.getTaskKind(); - if (taskKind != null && taskKind.length() > 0) { - task.setTaskKind(taskKind); - } - ITaskDataWorkingCopy workingCopy = taskDataManager.createWorkingCopy(task, taskData); - workingCopy.save(null, null); - repositoryConnector.updateNewTaskFromTaskData(taskRepository, task, taskData); - String summary = mapping.getSummary(); - if (summary != null && summary.length() > 0) { - task.setSummary(summary); - } - if (taskRepository == localTaskRepository) { - taskList.addTask(task); - } else { - taskList.addTask(task, taskList.getUnsubmittedContainer(task.getAttribute(ITasksCoreConstants.ATTRIBUTE_OUTGOING_NEW_REPOSITORY_URL))); - } - task.setAttribute(AbstractNbTaskWrapper.ATTR_NEW_UNREAD, Boolean.TRUE.toString()); - } - - private AbstractTask createNewTask (TaskRepository taskRepository) { - AbstractTask task = new LocalTask(String.valueOf(taskList.getNextLocalTaskId()), Bundle.MSG_NewTaskSummary()); - if (taskRepository != localTaskRepository) { - task.setSynchronizationState(ITask.SynchronizationState.OUTGOING_NEW); - task.setAttribute(ITasksCoreConstants.ATTRIBUTE_OUTGOING_NEW_CONNECTOR_KIND, taskRepository.getConnectorKind()); - task.setAttribute(ITasksCoreConstants.ATTRIBUTE_OUTGOING_NEW_REPOSITORY_URL, taskRepository.getUrl()); - } - return task; - } - - public IRepositoryQuery createNewQuery (TaskRepository taskRepository, String queryName) throws CoreException { - ensureTaskListLoaded(); - assert taskRepositoryManager.getRepositoryConnector(taskRepository.getConnectorKind()) != null - : "Did you forget to implement RepositoryConnectorProvider?"; - IRepositoryQuery query = repositoryModel.createRepositoryQuery(taskRepository); - assert query instanceof RepositoryQuery; - query.setSummary(queryName); - return query; - } - - public CommandFactory getCommandFactory () throws CoreException { - if (factory == null) { - ensureTaskListLoaded(); - factory = CommandsAccessor.INSTANCE.getCommandFactory(taskList, taskDataManager, - taskRepositoryManager, repositoryModel); - } - return factory; - } - - void markTaskSeen (final ITask task, boolean seen) { - ITask.SynchronizationState syncState = task.getSynchronizationState(); - taskDataManager.setTaskRead(task, seen); - if (!seen && syncState == task.getSynchronizationState() - && syncState == ITask.SynchronizationState.OUTGOING - && task instanceof AbstractTask) { - // mylyn does not set to CONFLICT status - try { - taskList.run(new ITaskListRunnable() { - @Override - public void execute (IProgressMonitor monitor) throws CoreException { - ((AbstractTask) task).setSynchronizationState(ITask.SynchronizationState.CONFLICT); - } - }); - taskList.notifyElementChanged(task); - } catch (CoreException ex) { - LOG.log(Level.INFO, null, ex); - } - } - task.setAttribute(ATTR_TASK_INCOMING_NEW, null); - } - - /** - * Returns a repository for the given connector and URL. - * If such a repository does not yet exist, creates one and registers it in the mylyn infrastructure. - * - * @param repositoryConnector connector handling the given repository - * @param repositoryUrl task repository URL - * @return registered repository - */ - public TaskRepository getTaskRepository (AbstractRepositoryConnector repositoryConnector, String repositoryUrl) { - taskRepositoryManager.addRepositoryConnector(repositoryConnector); - TaskRepository repository = taskRepositoryManager.getRepository(repositoryConnector.getConnectorKind(), repositoryUrl); - if (repository == null) { - repository = new TaskRepository(repositoryConnector.getConnectorKind(), repositoryUrl); - addTaskRepository(repositoryConnector, repository); - } - return repository; - } - - public void setRepositoryUrl (TaskRepository repository, String url) throws CoreException { - String oldUrl = repository.getRepositoryUrl(); - if (!url.equals(oldUrl)) { - ensureTaskListLoaded(); - assert taskRepositoryManager.getRepositoryConnector(repository.getConnectorKind()) != null - : "Did you forget to implement RepositoryConnectorProvider?"; - try { - for (ITask task : taskList.getAllTasks()) { - if (url.equals(task.getAttribute(ITasksCoreConstants.ATTRIBUTE_OUTGOING_NEW_REPOSITORY_URL))) { - taskDataManager.refactorRepositoryUrl(task, task.getRepositoryUrl(), url); - } else if (oldUrl.equals(task.getRepositoryUrl())) { - taskDataManager.refactorRepositoryUrl(task, url, url); - } - } - } catch (Throwable t) { - // log, but set the rapository & co - LOG.log(Level.WARNING, null, t); - } - taskList.refactorRepositoryUrl(oldUrl, url); - repository.setRepositoryUrl(url); - taskRepositoryManager.notifyRepositoryUrlChanged(repository, oldUrl); - } - } - - NbTask getOrCreateTask (TaskRepository taskRepository, String taskId, boolean addToTaskList) throws CoreException { - ensureTaskListLoaded(); - ITask task = taskList.getTask(taskRepository.getUrl(), taskId); - if (task == null) { - task = repositoryModel.createTask(taskRepository, taskId); - ((AbstractTask) task).setSynchronizationState(ITask.SynchronizationState.INCOMING_NEW); - if (addToTaskList) { - // ensure the task is in the tasklist - taskList.addTask(task); - } - } - return toNbTask(task); - } - - TaskRepository getTaskRepositoryFor (ITask task) { - if (isUnsubmittedRepositoryTask(task)) { - return taskRepositoryManager.getRepository( - task.getAttribute(ITasksCoreConstants.ATTRIBUTE_OUTGOING_NEW_CONNECTOR_KIND), - task.getAttribute(ITasksCoreConstants.ATTRIBUTE_OUTGOING_NEW_REPOSITORY_URL)); - } else { - return taskRepositoryManager.getRepository(task.getConnectorKind(), task.getRepositoryUrl()); - } - } - - void finish () throws CoreException { - taskList.removeChangeListener(taskListListener); - synchronized (taskList) { - // make sure we save all changes - dirty = true; - } - persist(true); - } - - private void addTaskRepository (AbstractRepositoryConnector repositoryConnector, TaskRepository taskRepository) { - if (!taskRepository.getConnectorKind().equals(repositoryConnector.getConnectorKind())) { - throw new IllegalArgumentException("The given task repository is not managed by the given repository connector"); - } - taskRepositoryManager.addRepositoryConnector(repositoryConnector); - taskRepositoryManager.addRepository(taskRepository); - // assert, noone should add two repository instances with the same URL - assert taskRepository == taskRepositoryManager.getRepository(repositoryConnector.getConnectorKind(), taskRepository.getUrl()); - } -// TODO is this required? The task may be left in the storage indefinitely. -// /** -// * Removes the repository, its queries and tasks permanently from the mylyn -// * infrastructure. The action is irreversible, be careful. -// * -// * @param taskRepository repository to remove -// */ -// public void deleteTaskRepository (TaskRepository taskRepository) { -// // queries to delete -// Set queries = taskList.getRepositoryQueries(taskRepository.getUrl()); -// // tasks to delete -// Set tasks = taskList.getTasks(taskRepository.getUrl()); -// // unsubmitted tasks to delete -// tasks.addAll(taskList.getUnsubmittedContainer(taskRepository.getUrl()).getChildren()); -// for (RepositoryQuery query : queries) { -// taskList.deleteQuery(query); -// } -// for (ITask task : tasks) { -// taskList.deleteTask(task); -// } -// taskRepositoryManager.removeRepository(taskRepository); -// } - - private synchronized void ensureTaskListLoaded () throws CoreException { - if (!taskListInitialized) { - if (result == null) { - LookupListener lookupListener = new LookupListener() { - @Override - public void resultChanged (LookupEvent ev) { - registerConnectors(); - } - }; - result = Lookup.getDefault().lookupResult(RepositoryConnectorProvider.class); - result.addLookupListener(lookupListener); - } - registerConnectors(); - try { - if (taskListStorageFile.length() > 0) { - taskListWriter.readTaskList(taskList, taskListStorageFile); - } - } catch (CoreException ex) { - LOG.log(Level.INFO, null, ex); - throw new CoreException(new Status(ex.getStatus().getSeverity(), ex.getStatus().getPlugin(), "Cannot deserialize tasklist")); - } finally { - taskListInitialized = true; - } - } - } - - void persist (final boolean removeUnseenOrphanedTasks) throws CoreException { - if (taskListInitialized) { - taskList.run(new ITaskListRunnable() { - @Override - public void execute (IProgressMonitor monitor) throws CoreException { - boolean save; - synchronized (taskList) { - save = dirty; - dirty = false; - } - if (!save) { - return; - } - try { - if (removeUnseenOrphanedTasks) { - Set orphanedUnseenTasks = new LinkedHashSet(); - for (UnmatchedTaskContainer cont : taskList.getUnmatchedContainers()) { - for (ITask task : cont.getChildren()) { - if (task.getSynchronizationState() == ITask.SynchronizationState.INCOMING_NEW - || Boolean.TRUE.toString().equals(task.getAttribute(ATTR_TASK_INCOMING_NEW))) { - orphanedUnseenTasks.add(task); - } - } - } - for (ITask taskToDelete : orphanedUnseenTasks) { - deleteTask(taskToDelete); - } - } - taskListStorageFile.getParentFile().mkdirs(); - backupTaskList(taskListStorageFile); - taskListWriter.writeTaskList(taskList, taskListStorageFile); - } catch (CoreException ex) { - LOG.log(Level.INFO, null, ex); - throw new CoreException(new Status(ex.getStatus().getSeverity(), ex.getStatus().getPlugin(), "Cannot persist tasklist")); - } - } - }); - } - } - - private Preferences getPreferences() { - return NbPreferences.forModule(MylynSupport.class); - } - - private void attachListeners () { - taskRepositoryManager.addListener(taskRepositoryManagerListener = new IRepositoryListener() { - @Override - public void repositoryAdded (TaskRepository repository) { - getRepositoryCreationTime(repository.getRepositoryUrl()); - } - - @Override - public void repositoryRemoved (TaskRepository repository) { - setRepositoryCreationTime(repository.getRepositoryUrl(), -1); - } - - @Override - public void repositorySettingsChanged (TaskRepository repository) { - } - - @Override - public void repositoryUrlChanged (TaskRepository repository, String oldUrl) { - setRepositoryCreationTime(repository.getRepositoryUrl(), getRepositoryCreationTime(oldUrl)); - setRepositoryCreationTime(oldUrl, -1); - } - }); - taskList.addChangeListener(taskListListener = new ITaskListChangeListener() { - @Override - public void containersChanged (Set deltas) { - for (TaskContainerDelta delta : deltas) { - if (taskListInitialized && !delta.isTransient()) { - synchronized (taskList) { - dirty = true; - } - scheduleSave(); - } - if (delta.getElement() instanceof ITask) { - // task added to the tasklist - // new tasks (incoming_new) created long ago in the past - // should be marked as uptodate so when a repository is registener in the IDE - // it is not all green. Only fresh new tasks are relevant to the user - ITask task = (ITask) delta.getElement(); - if ( (task.getSynchronizationState() == ITask.SynchronizationState.INCOMING_NEW - || task.getSynchronizationState() == ITask.SynchronizationState.INCOMING ) - && task.getCreationDate() != null && task.getModificationDate() != null) { - TaskRepository repository = taskRepositoryManager.getRepository(task.getConnectorKind(), task.getRepositoryUrl()); - if (repository != null) { - long time = getRepositoryCreationTime(repository.getRepositoryUrl()); - if (task.getModificationDate().getTime() < time) { - markTaskSeen(task, true); - task.setAttribute(ATTR_TASK_INCOMING_NEW, Boolean.TRUE.toString()); - } - } - } - notifyListeners(task, delta); - } - } - } - - private void notifyListeners (ITask task, TaskContainerDelta delta) { - // notify listeners - List lists; - synchronized (taskListeners) { - lists = taskListeners.get(task); - } - if (lists != null) { - for (TaskListener list : lists.toArray(new TaskListener[0])) { - list.taskModified(task, delta); - } - } - } - }); - taskDataManager.addListener(taskDataManagerListener = new ITaskDataManagerListener() { - - @Override - public void taskDataUpdated (TaskDataManagerEvent event) { - TaskDataListener.TaskDataEvent e = new TaskDataListener.TaskDataEvent(event); - for (TaskDataListener l : taskDataListeners.toArray(new TaskDataListener[0])) { - l.taskDataUpdated(e); - } - } - - @Override - public void editsDiscarded (TaskDataManagerEvent event) { - taskDataUpdated(event); - } - }); - } - - private void setRepositoryCreationTime (String repositoryUrl, long time) { - if (time == -1) { - getPreferences().remove(PROP_REPOSITORY_CREATION_TIME + repositoryUrl); - } else { - getPreferences().putLong(PROP_REPOSITORY_CREATION_TIME + repositoryUrl, time); - } - } - - private long getRepositoryCreationTime (String repositoryUrl) { - long time = getPreferences().getLong(PROP_REPOSITORY_CREATION_TIME + repositoryUrl, -1); - if (time == -1) { - time = System.currentTimeMillis(); - setRepositoryCreationTime(repositoryUrl, time); - } - return time; - } - - private void scheduleSave () { - saveTask.schedule(5000); - } - - private void backupTaskList (File taskListStorageFile) { - if (taskListStorageFile.canWrite()) { - File backup = new File(taskListStorageFile.getParentFile(), taskListStorageFile.getName() + BACKUP_SUFFIX); - backup.delete(); - taskListStorageFile.renameTo(backup); - } - } - - Collection toNbTasks (Collection tasks) { - return toNbTasks(tasks, true); - } - - Collection toNbTasks (Collection tasks, boolean includeUnsubmittedNewTasks) { - Set nbTasks = new LinkedHashSet(tasks.size()); - for (ITask task : tasks) { - if (includeUnsubmittedNewTasks || task.getSynchronizationState() != ITask.SynchronizationState.OUTGOING_NEW) { - // remember that unsubmitted tasks are local tasks and should not be included - // in tasks for local task repository - nbTasks.add(toNbTask(task)); - } - } - return Collections.unmodifiableSet(nbTasks); - } - - NbTask toNbTask (ITask task) { - NbTask nbTask = null; - if (task != null) { - synchronized (tasks) { - Reference nbTaskRef = tasks.get(task); - if (nbTaskRef != null) { - nbTask = nbTaskRef.get(); - } - if (nbTask == null) { - nbTask = new NbTask(task); - tasks.put(task, new SoftReference(nbTask)); - } - } - } - return nbTask; - } - - static Set toMylynTasks (Set tasks) { - Set mylynTasks = new LinkedHashSet(tasks.size()); - for (NbTask task : tasks) { - mylynTasks.add(task.getDelegate()); - } - return mylynTasks; - } - - void addTaskListener (ITask task, TaskListener listener) { - List list; - synchronized (taskListeners) { - list = taskListeners.get(task); - if (list == null) { - list = new CopyOnWriteArrayList(); - taskListeners.put(task, list); - } - } - list.add(listener); - assert !taskPerList.containsKey(listener) : "One task per one listener"; - taskPerList.put(listener, task); - } - - void removeTaskListener (TaskListener listener) { - ITask task = taskPerList.get(listener); - if (task != null) { - - } - } - - void removeTaskListener (ITask task, TaskListener listener) { - synchronized (taskListeners) { - List list = taskListeners.get(task); - if (list != null) { - list.remove(listener); - } - } - taskPerList.remove(listener); - } - - NbTaskDataModel getTaskDataModel (NbTask task) { - assert taskListInitialized; - ITask mylynTask = task.getDelegate(); - mylynTask.setAttribute(MylynSupport.ATTR_TASK_INCOMING_NEW, null); - TaskRepository taskRepository = getTaskRepositoryFor(mylynTask); - try { - ITaskDataWorkingCopy workingCopy = taskDataManager.getWorkingCopy(mylynTask); - if (workingCopy instanceof TaskDataState && workingCopy.getLastReadData() == null) { - ((TaskDataState) workingCopy).setLastReadData(workingCopy.getRepositoryData()); - } - return new NbTaskDataModel(taskRepository, task, workingCopy); - } catch (CoreException ex) { - MylynSupport.LOG.log(Level.INFO, null, ex); - return null; - } - } - - private void registerConnectors () { - for (RepositoryConnectorProvider provider : result.allInstances()) { - AbstractRepositoryConnector connector = provider.getConnector(); - if (connector != null) { - taskRepositoryManager.addRepositoryConnector(connector); - } - } - } - - void editorOpened (final ITask task) throws CoreException { - // mark the task as not read pending to block incoming refreshes - // from rewriting last seen task data while the editor is open - // maybe we should follow the mylyn's way of handling incoming updates - if (task instanceof AbstractTask) { - taskList.run(new ITaskListRunnable() { - @Override - public void execute (IProgressMonitor monitor) throws CoreException { - ((AbstractTask) task).setMarkReadPending(false); - } - }, null, true); - } - } - - void editorClosing (final ITask task, final TaskData td) throws CoreException { - // copy repository task data into last seen data - if (task instanceof AbstractTask) { - taskList.run(new ITaskListRunnable() { - @Override - public void execute (IProgressMonitor monitor) throws CoreException { - ((AbstractTask) task).setMarkReadPending(true); - taskDataManager.putUpdatedTaskData(task, td, true); - } - }, null, true); - } - } - - boolean isUnsubmittedRepositoryTask (ITask task) { - return task.getSynchronizationState() == ITask.SynchronizationState.OUTGOING_NEW - && task.getAttribute(ITasksCoreConstants.ATTRIBUTE_OUTGOING_NEW_CONNECTOR_KIND) != null; - } - - void taskModified (ITask task) { - taskList.notifyElementChanged(task); - } - - public void notifyCredentialsChanged(TaskRepository repository) { - taskRepositoryManager.notifyRepositorySettingsChanged(repository, new TaskRepositoryDelta(TaskRepositoryDelta.Type.CREDENTIALS)); - } -} diff --git a/ide/mylyn.util/src/org/netbeans/modules/mylyn/util/MylynUtils.java b/ide/mylyn.util/src/org/netbeans/modules/mylyn/util/MylynUtils.java deleted file mode 100644 index 687e4c1028de..000000000000 --- a/ide/mylyn.util/src/org/netbeans/modules/mylyn/util/MylynUtils.java +++ /dev/null @@ -1,211 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.netbeans.modules.mylyn.util; - -import java.net.InetAddress; -import java.net.URI; -import java.net.URISyntaxException; -import java.net.UnknownHostException; -import java.util.StringTokenizer; -import java.util.logging.Level; -import java.util.logging.Logger; -import java.util.regex.Pattern; -import java.util.regex.PatternSyntaxException; -import org.eclipse.mylyn.commons.net.AuthenticationCredentials; -import org.eclipse.mylyn.commons.net.AuthenticationType; -import org.eclipse.mylyn.tasks.core.TaskRepository; -import org.netbeans.api.keyring.Keyring; -import org.openide.util.NetworkSettings; - -/** - * - * @author Tomas Stupka - */ -public class MylynUtils { - - private static final Logger LOG = Logger.getLogger("org.netbeans.libs.bugtracking.mylyn"); - - public static TaskRepository createTaskRepository(String connectorKind, String name, String url, String user, char[] password, String httpUser, char[] httpPassword) { - TaskRepository repository = new TaskRepository(connectorKind, url); - setCredentials(repository, user, password, httpUser, httpPassword); - return repository; - } - - public static void setCredentials (TaskRepository repository, String user, char[] password, String httpUser, char[] httpPassword) { - logCredentials(repository, user, password, "Setting credentials: "); // NOI18N - AuthenticationCredentials authenticationCredentials = new AuthenticationCredentials(user != null ? user : "", password != null ? new String(password) : ""); // NOI18N - repository.setCredentials(AuthenticationType.REPOSITORY, authenticationCredentials, false); - - if(httpUser != null || httpPassword != null) { - if(httpUser == null) { - httpUser = ""; // NOI18N - } - if(httpPassword == null) { - httpPassword = new char[0]; - } - logCredentials(repository, httpUser, httpPassword, "Setting http credentials: "); // NOI18N - authenticationCredentials = new AuthenticationCredentials(httpUser, new String(httpPassword)); - repository.setCredentials(AuthenticationType.HTTP, authenticationCredentials, false); - } else { - repository.setCredentials(AuthenticationType.HTTP, null, false); - } - - URI uri = null; - try { - uri = new URI(repository.getUrl()); - } catch (URISyntaxException ex) { - LOG.log(Level.INFO, null, ex); - } - - String proxyHost = NetworkSettings.getProxyHost(uri); - - // check DIRECT connection - if(proxyHost != null && proxyHost.length() > 0) { - String proxyPort = NetworkSettings.getProxyPort(uri); - assert proxyPort != null; - repository.setDefaultProxyEnabled(false); - - LOG.log(Level.FINEST, "Setting proxy: [{0}:{1},{2}]", new Object[]{proxyHost, proxyPort, repository.getUrl()}); - - repository.setProperty(TaskRepository.PROXY_HOSTNAME, proxyHost); - repository.setProperty(TaskRepository.PROXY_PORT, proxyPort); - - String proxyUser = NetworkSettings.getAuthenticationUsername(uri); - if(proxyUser != null) { - char[] pwd = NetworkSettings.getAuthenticationPassword(uri); - String proxyPassword = pwd == null ? "" : new String(pwd); //NOI18N - logCredentials(repository, proxyUser, proxyPassword, "Setting proxy credentials: "); - authenticationCredentials = new AuthenticationCredentials(proxyUser, proxyPassword); - repository.setCredentials(AuthenticationType.PROXY, authenticationCredentials, false); - } - } else { - repository.setProperty(TaskRepository.PROXY_HOSTNAME, null); - repository.setProperty(TaskRepository.PROXY_PORT, null); - repository.setCredentials(AuthenticationType.PROXY, null, false); - } - } - - public static void logCredentials(TaskRepository repository, String user, char[] psswd, String msg) { - logCredentials(repository, user, psswd != null ? new String(psswd) : null, msg); - } - - public static void logCredentials(TaskRepository repository, String user, String psswd, String msg) { - LOG.log( - Level.FINEST, - msg + "[{0}, user={1}, password={2}]", // NOI18N - new Object[]{ - repository.getUrl(), - user, - getPasswordLog(psswd) - } - ); - } - - private static boolean isNonProxyHost (String nonProxyHosts, String host) { - if(nonProxyHosts.equals("")) { // NOI18N - return false; - } - // try host name first - might be faster - return dontUseHostName (nonProxyHosts, host) || dontUseIp (nonProxyHosts, host); - } - - private static boolean dontUseHostName (String nonProxyHosts, String host) { - if (host == null) return false; - - boolean dontUseProxy = false; - StringTokenizer st = new StringTokenizer (nonProxyHosts, ",", false); // NOI18N - while (st.hasMoreTokens () && !dontUseProxy) { - String token = st.nextToken ().trim(); - int star = token.indexOf ("*"); // NOI18N - if (star == -1) { - dontUseProxy = token.equals (host); - if (dontUseProxy) { - LOG.log(Level.FINEST, "Host {0} found in nonProxyHosts: {1}", new Object[]{ host, nonProxyHosts}); // NOI18N - } - } else { - String start = token.substring (0, star - 1 < 0 ? 0 : star - 1); - String end = token.substring (star + 1 > token.length () ? token.length () : star + 1); - dontUseProxy = host.startsWith(start) && host.endsWith(end); - if(!dontUseProxy) { - if(end.length() > 1 && end.charAt(0) == '.') { // NOI18N - end = end.substring(1); - } - if(start.length() > 1 && start.charAt(start.length() - 1) == '.') { // NOI18N - start = start.substring(0, start.length() - 1); - } - dontUseProxy = host.startsWith(start) && host.endsWith(end); - } - if (dontUseProxy) { - LOG.log(Level.FINEST, "Host {0} found in nonProxyHosts: {1}", new Object[]{host, nonProxyHosts}); // NOI18N - } - } - } - return dontUseProxy; - } - - private static boolean dontUseIp (String nonProxyHosts, String host) { - if (host == null) return false; - - String ip = null; - try { - ip = InetAddress.getByName (host).getHostAddress (); - } catch (UnknownHostException ex) { - LOG.log (Level.FINE, ex.getLocalizedMessage (), ex); - } - - if (ip == null) { - return false; - } - - boolean dontUseProxy = false; - StringTokenizer st = new StringTokenizer (nonProxyHosts, ",", false); // NOI18N - while (st.hasMoreTokens () && !dontUseProxy) { - String nonProxyHost = st.nextToken (); - int star = nonProxyHost.indexOf ("*"); // NOI18N - if (star == -1) { - dontUseProxy = nonProxyHost.equals (ip); - if (dontUseProxy) { - LOG.log(Level.FINEST, "Host''s {0} IP {1} found in nonProxyHosts: {2}", new Object[]{host, ip, nonProxyHosts}); // NOI18N - } - } else { - // match with given dotted-quad IP - try { - dontUseProxy = Pattern.matches (nonProxyHost, ip); - if (dontUseProxy) { - LOG.log (Level.FINEST, "Host''s {0} IP{1} found in nonProxyHosts: {2}", new Object[]{host, ip, nonProxyHosts}); // NOI18N - } - } catch (PatternSyntaxException pse) { - // may ignore it here - } - } - } - return dontUseProxy; - } - - private static String getPasswordLog(String psswd) { - if(psswd == null) { - return ""; // NOI18N - } - if("true".equals(System.getProperty("org.netbeans.modules.bugtracking.logPasswords", "false"))) { // NOI18N - return psswd; - } - return "******"; // NOI18N - } -} diff --git a/ide/mylyn.util/src/org/netbeans/modules/mylyn/util/NbDateRange.java b/ide/mylyn.util/src/org/netbeans/modules/mylyn/util/NbDateRange.java deleted file mode 100644 index f96993dbe8f7..000000000000 --- a/ide/mylyn.util/src/org/netbeans/modules/mylyn/util/NbDateRange.java +++ /dev/null @@ -1,94 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.netbeans.modules.mylyn.util; - -import java.util.Calendar; -import java.util.Date; -import org.eclipse.mylyn.internal.tasks.core.DateRange; -import org.netbeans.modules.bugtracking.spi.IssueScheduleInfo; - -/** - * - * @author Ondrej Vrabec - */ -public final class NbDateRange implements Comparable { - private final DateRange delegate; - - NbDateRange (DateRange delegate) { - this.delegate = delegate; - } - - public NbDateRange (Calendar startDate, Calendar endDate) { - this(new DateRange(startDate, endDate)); - } - - public NbDateRange (Calendar time) { - this(new DateRange(time)); - } - - public NbDateRange (IssueScheduleInfo info) { - this(toDateRange(info)); - } - - @Override - public int compareTo (NbDateRange o) { - return getDelegate().compareTo(o.getDelegate()); - } - - public Calendar getStartDate () { - return delegate.getStartDate(); - } - - public Calendar getEndDate () { - return delegate.getEndDate(); - } - - DateRange getDelegate () { - return delegate; - } - - @Override - public boolean equals (Object obj) { - if (!(obj instanceof NbDateRange)) { - return false; - } - return delegate.equals(((NbDateRange) obj).getDelegate()); - } - - @Override - public int hashCode () { - return delegate.hashCode(); - } - - public IssueScheduleInfo toSchedulingInfo () { - Calendar startDate = getStartDate(); - Calendar endDate = getEndDate(); - int difference = (int) ((endDate.getTimeInMillis() - startDate.getTimeInMillis()) / 1000 / 3600 / 24) + 1; - return new IssueScheduleInfo(startDate.getTime(), difference); - } - - private static DateRange toDateRange (IssueScheduleInfo info) { - Calendar startDate = Calendar.getInstance(); - Calendar endDate = Calendar.getInstance(); - startDate.setTime(info.getDate()); - endDate.setTime(new Date(info.getDate().getTime() + (info.getInterval() * 24 * 3600 - 1) * 1000)); - return new DateRange(startDate, endDate); - } -} diff --git a/ide/mylyn.util/src/org/netbeans/modules/mylyn/util/NbTask.java b/ide/mylyn.util/src/org/netbeans/modules/mylyn/util/NbTask.java deleted file mode 100644 index ace54d03981b..000000000000 --- a/ide/mylyn.util/src/org/netbeans/modules/mylyn/util/NbTask.java +++ /dev/null @@ -1,278 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.netbeans.modules.mylyn.util; - -import java.util.Date; -import java.util.List; -import java.util.concurrent.CopyOnWriteArrayList; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.mylyn.internal.tasks.core.AbstractTask; -import org.eclipse.mylyn.internal.tasks.core.DateRange; -import org.eclipse.mylyn.internal.tasks.core.LocalRepositoryConnector; -import org.eclipse.mylyn.internal.tasks.core.TaskContainerDelta; -import org.eclipse.mylyn.tasks.core.ITask; -import org.netbeans.modules.mylyn.util.internal.TaskListener; -import org.openide.util.WeakListeners; - -/** - * - * @author Ondrej Vrabec - */ -public final class NbTask { - private final ITask delegate; - private final TaskListenerImpl list; - private final List listeners; - private SynchronizationState syncState; - - NbTask (ITask task) { - this.delegate = task; - this.listeners = new CopyOnWriteArrayList(); - updateSynchronizationState(); - list = new TaskListenerImpl(); - MylynSupport.getInstance().addTaskListener(task, WeakListeners.create(TaskListener.class, - list, - MylynSupport.getInstance())); - } - - public SynchronizationState getSynchronizationState () { - return syncState; - } - - public boolean isOutgoing () { - SynchronizationState state = getSynchronizationState(); - return state == SynchronizationState.CONFLICT - || state == SynchronizationState.OUTGOING - || state == SynchronizationState.OUTGOING_NEW; - } - - public String getTaskId () { - return delegate.getTaskId(); - } - - ITask getDelegate () { - return delegate; - } - - public void markSeen (boolean seen) { - MylynSupport.getInstance().markTaskSeen(getDelegate(), seen); - } - - public void delete () { - MylynSupport.getInstance().deleteTask(getDelegate()); - } - - public void discardLocalEdits () throws CoreException { - MylynSupport.getInstance().discardLocalEdits(delegate); - } - - public void setAttribute (String attributeName, String attributeValue) { - delegate.setAttribute(attributeName, attributeValue); - } - - public String getAttribute (String attributeName) { - return delegate.getAttribute(attributeName); - } - - @Override - public String toString () { - return delegate.toString(); - } - - @Override - public int hashCode () { - return delegate.hashCode(); - } - - @Override - public boolean equals (Object obj) { - if (obj instanceof NbTask) { - return delegate.equals(((NbTask) obj).delegate); - } else { - return false; - } - } - - public String getSummary () { - return delegate.getSummary(); - } - - public Date getModificationDate () { - return delegate.getModificationDate(); - } - - public Date getCreationDate () { - return delegate.getCreationDate(); - } - - public boolean isCompleted () { - return delegate.isCompleted(); - } - - public void setSummary (String summary) { - delegate.setSummary(summary); - } - - /** - * Adds a listener to the tasklist. The listener will be notified on a change - * in tasks's content (summary, description, etc.). - * - * @param listener listener - */ - public void addNbTaskListener (NbTaskListener listener) { - listeners.add(listener); - } - - public void removeNbTaskListener (NbTaskListener listener) { - listeners.remove(listener); - } - - public String getRepositoryUrl () { - return delegate.getRepositoryUrl(); - } - - private void updateSynchronizationState () { - switch (delegate.getSynchronizationState()) { - case CONFLICT: - syncState = SynchronizationState.CONFLICT; - break; - case INCOMING: - syncState = SynchronizationState.INCOMING; - break; - case INCOMING_NEW: - syncState = SynchronizationState.INCOMING_NEW; - break; - case OUTGOING: - syncState = SynchronizationState.OUTGOING; - break; - case OUTGOING_NEW: - syncState = SynchronizationState.OUTGOING_NEW; - break; - case SYNCHRONIZED: - default: - syncState = SynchronizationState.SYNCHRONIZED; - break; - } - } - - /** - * Returns task data model for editor page. - * - * @return task data model the editor page should access - read and edit - - * or null when no data for the task found - */ - public NbTaskDataModel getTaskDataModel () { - return MylynSupport.getInstance().getTaskDataModel(this); - } - - public NbTaskDataState getTaskDataState () throws CoreException { - return MylynSupport.getInstance().getTaskDataState(this); - } - - public String getTaskKey () { - return delegate.getTaskKey(); - } - - boolean isUnsubmittedRepositoryTask () { - return syncState == SynchronizationState.OUTGOING_NEW - && MylynSupport.getInstance().isUnsubmittedRepositoryTask(delegate); - } - - boolean isLocal () { - return LocalRepositoryConnector.CONNECTOR_KIND.equals(delegate.getConnectorKind()); - } - - public final String getPrivateNotes () { - if (delegate instanceof AbstractTask) { - return ((AbstractTask) delegate).getNotes(); - } else { - return null; - } - } - - public final void setPrivateNotes (String notes) { - if (delegate instanceof AbstractTask) { - ((AbstractTask) delegate).setNotes(notes); - } - } - - public final Date getDueDate () { - return delegate.getDueDate(); - } - - public final void setDueDate (Date dueDate) { - delegate.setDueDate(dueDate); - } - - public final NbDateRange getScheduleDate () { - if (delegate instanceof AbstractTask) { - DateRange date = ((AbstractTask) delegate).getScheduledForDate(); - return date == null ? null : new NbDateRange(date); - } else { - return null; - } - } - - public final void setScheduleDate (NbDateRange scheduledDate) { - if (delegate instanceof AbstractTask) { - ((AbstractTask) delegate).setScheduledForDate(scheduledDate == null ? null : scheduledDate.getDelegate()); - } - } - - public int getEstimate () { - if (delegate instanceof AbstractTask) { - return ((AbstractTask) delegate).getEstimatedTimeHours(); - } else { - return 0; - } - } - - public void setEstimate (int estimatedHours) { - if (delegate instanceof AbstractTask) { - ((AbstractTask) delegate).setEstimatedTimeHours(estimatedHours); - } - } - - public static enum SynchronizationState { - INCOMING_NEW, - INCOMING, - OUTGOING_NEW, - OUTGOING, - SYNCHRONIZED, - CONFLICT - } - - private class TaskListenerImpl implements TaskListener { - - public TaskListenerImpl () { - } - - @Override - public void taskModified (ITask task, TaskContainerDelta delta) { - assert task == NbTask.this.delegate; - SynchronizationState oldState = getSynchronizationState(); - updateSynchronizationState(); - NbTaskListener.TaskEvent ev = new NbTaskListener.TaskEvent(NbTask.this, delta, - oldState != getSynchronizationState()); - for (NbTaskListener list : listeners.toArray(new NbTaskListener[0])) { - list.taskModified(ev); - } - } - } - -} diff --git a/ide/mylyn.util/src/org/netbeans/modules/mylyn/util/NbTaskDataModel.java b/ide/mylyn.util/src/org/netbeans/modules/mylyn/util/NbTaskDataModel.java deleted file mode 100644 index acedaa230c18..000000000000 --- a/ide/mylyn.util/src/org/netbeans/modules/mylyn/util/NbTaskDataModel.java +++ /dev/null @@ -1,265 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.netbeans.modules.mylyn.util; - -import java.util.EventListener; -import java.util.EventObject; -import java.util.HashSet; -import java.util.Iterator; -import java.util.List; -import java.util.Set; -import java.util.concurrent.CopyOnWriteArrayList; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.mylyn.internal.tasks.core.data.TaskAttributeDiff; -import org.eclipse.mylyn.internal.tasks.core.data.TaskDataState; -import org.eclipse.mylyn.tasks.core.ITask; -import org.eclipse.mylyn.tasks.core.TaskRepository; -import org.eclipse.mylyn.tasks.core.data.ITaskDataWorkingCopy; -import org.eclipse.mylyn.tasks.core.data.TaskAttribute; -import org.eclipse.mylyn.tasks.core.data.TaskData; -import org.eclipse.mylyn.tasks.core.data.TaskDataModel; -import org.eclipse.mylyn.tasks.core.data.TaskDataModelEvent; -import org.eclipse.mylyn.tasks.core.data.TaskDataModelListener; - -/** - * - * @author Ondrej Vrabec - */ -public final class NbTaskDataModel { - - private final ITaskDataWorkingCopy workingCopy; - private final TaskDataModel delegateModel; - private final List listeners = new CopyOnWriteArrayList(); - private final NbTask task; - private final Set unsavedChangedAttributes = new HashSet(); - - NbTaskDataModel (TaskRepository taskRepository, NbTask task, ITaskDataWorkingCopy workingCopy) { - this.task = task; - this.delegateModel = new TaskDataModel(taskRepository, task.getDelegate(), workingCopy); - this.workingCopy = workingCopy; - delegateModel.addModelListener(new TaskDataModelListener() { - @Override - public void attributeChanged (TaskDataModelEvent modelEvent) { - NbTaskDataModelEvent event = new NbTaskDataModelEvent(NbTaskDataModel.this, modelEvent); - for (NbTaskDataModelListener list : listeners.toArray(new NbTaskDataModelListener[0])) { - list.attributeChanged(event); - } - } - }); - } - - public boolean hasIncomingChanges (TaskAttribute taskAttribute, boolean includeConflicts) { - TaskData repositoryData = workingCopy.getRepositoryData(); - if (repositoryData == null) { - return false; - } - taskAttribute = repositoryData.getRoot().getMappedAttribute(taskAttribute.getPath()); - if (taskAttribute == null) { - return false; - } - boolean incoming = delegateModel.hasIncomingChanges(taskAttribute); - if (includeConflicts && !incoming && delegateModel.hasOutgoingChanges(taskAttribute)) { - TaskData lastReadData = workingCopy.getLastReadData(); - if (lastReadData == null) { - return true; - } - TaskAttribute oldAttribute = lastReadData.getRoot().getMappedAttribute(taskAttribute.getPath()); - if (oldAttribute == null) { - return true; - } - return !repositoryData.getAttributeMapper().equals(taskAttribute, oldAttribute); - } - return incoming; - } - - public boolean hasOutgoingChanges (TaskAttribute ta) { - return delegateModel.hasOutgoingChanges(ta); - } - - public TaskData getLocalTaskData () { - return delegateModel.getTaskData(); - } - - public TaskData getLastReadTaskData () { - return workingCopy.getLastReadData(); - } - - public TaskData getRepositoryTaskData () { - return workingCopy.getRepositoryData(); - } - - public void addNbTaskDataModelListener (NbTaskDataModelListener listener) { - listeners.add(listener); - } - - public void removeNbTaskDataModelListener (NbTaskDataModelListener listener) { - listeners.remove(listener); - } - - public boolean isDirty () { - return delegateModel.isDirty(); - } - - public void attributeChanged (TaskAttribute a) { - synchronized (unsavedChangedAttributes) { - // replace the task attribute in unsaved changes - unsavedChangedAttributes.remove(a); - unsavedChangedAttributes.add(a); - delegateModel.attributeChanged(a); - } - } - - public Set getChangedAttributes () { - return delegateModel.getChangedAttributes(); - } - - public Set getChangedOldAttributes () { - return delegateModel.getChangedOldAttributes(); - } - - /** - * Updates the model and all taskdata to keep track with external taskdata - * changes (such as a task refresh) - * @throws CoreException - */ - public void refresh () throws CoreException { - // refresh reverts all taskdata to the state on disk - delegateModel.refresh(null); - // also clear unsaved changes in the mylyn model - // this is needed because after refresh() the unsaved changes no longer - // belong to the local taskdata (they're reinstantiated) - delegateModel.revert(); - if (workingCopy instanceof TaskDataState && workingCopy.getLastReadData() == null) { - ((TaskDataState) workingCopy).setLastReadData(workingCopy.getRepositoryData()); - } - Set changedAttributes; - synchronized (unsavedChangedAttributes) { - changedAttributes = new HashSet(unsavedChangedAttributes); - } - for (TaskAttribute ta : changedAttributes) { - // there are still local unsaved changes, keep them in local taskdata - TaskData td = getLocalTaskData(); - td.getRoot().deepAddCopy(ta); - TaskAttribute attribute = td.getRoot().getAttribute(ta.getId()); - // now refill the unsaved changes so they belong to the correct local TD - attributeChanged(attribute); - } - } - - public void save () throws CoreException { - save(null); - } - - public void save (IProgressMonitor monitor) throws CoreException { - // clear delegate model changes - delegateModel.save(monitor); - // now bit of hacking - // task attributes with same values as local changes must be reverted - TaskData editsData = workingCopy.getEditsData(); - TaskData repositoryData = workingCopy.getRepositoryData(); - synchronized (unsavedChangedAttributes) { - if (editsData != null && repositoryData != null) { - for (Iterator it = unsavedChangedAttributes.iterator(); it.hasNext(); ) { - TaskAttribute ta = it.next(); - if (!editsDiffer(ta, repositoryData)) { - editsData.getRoot().removeAttribute(ta.getId()); - it.remove(); - } - } - } - // are there any edits - boolean noChanges = unsavedChangedAttributes.isEmpty() && !hasOutgoingChanged(); - if (noChanges) { - task.discardLocalEdits(); - } - delegateModel.revert(); - unsavedChangedAttributes.clear(); - } - } - - public boolean hasBeenRead () { - return delegateModel.hasBeenRead(); - } - - public TaskRepository getTaskRepository () { - return delegateModel.getTaskRepository(); - } - - public NbTask getTask () { - return task; - } - - ITask getDelegateTask () { - return delegateModel.getTask(); - } - - public boolean hasOutgoingChanged () { - return isDirty() || !getChangedAttributes().isEmpty(); - } - - public void clearUnsavedChanges () { - if (isDirty()) { - delegateModel.revert(); - unsavedChangedAttributes.clear(); - } - } - - private boolean editsDiffer (TaskAttribute ta, TaskData repositoryData) { - TaskAttribute repositoryTA = repositoryData.getRoot().getMappedAttribute(ta.getPath()); - boolean changes = new TaskAttributeDiff(ta, repositoryTA).hasChanges(); - if (!changes) { - // is a child attribue changed?? - for (TaskAttribute childTA : ta.getAttributes().values()) { - if (editsDiffer(childTA, repositoryData)) { - changes = true; - break; - } - } - } - return changes; - } - - public static interface NbTaskDataModelListener extends EventListener { - - public void attributeChanged (NbTaskDataModelEvent event); - - } - - public static final class NbTaskDataModelEvent extends EventObject { - private final TaskDataModelEvent modelEvent; - private final NbTaskDataModel model; - - private NbTaskDataModelEvent (NbTaskDataModel source, TaskDataModelEvent modelEvent) { - super(source); - this.model = source; - this.modelEvent = modelEvent; - } - - public NbTaskDataModel getModel () { - return model; - } - - public TaskAttribute getTaskAttribute () { - return modelEvent.getTaskAttribute(); - } - - } -} diff --git a/ide/mylyn.util/src/org/netbeans/modules/mylyn/util/NbTaskDataState.java b/ide/mylyn.util/src/org/netbeans/modules/mylyn/util/NbTaskDataState.java deleted file mode 100644 index 3ddba859fbb1..000000000000 --- a/ide/mylyn.util/src/org/netbeans/modules/mylyn/util/NbTaskDataState.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.netbeans.modules.mylyn.util; - -import org.eclipse.mylyn.tasks.core.data.ITaskDataWorkingCopy; -import org.eclipse.mylyn.tasks.core.data.TaskData; - -/** - * - * @author Ondrej Vrabec - */ -public final class NbTaskDataState { - private final ITaskDataWorkingCopy state; - - NbTaskDataState (ITaskDataWorkingCopy state) { - this.state = state; - } - - public TaskData getLastReadData () { - return state.getLastReadData(); - } - - public TaskData getLocalData () { - return state.getLocalData(); - } - - public TaskData getRepositoryData () { - return state.getRepositoryData(); - } - - public TaskData getLocalEdits () { - return state.getEditsData(); - } - -} diff --git a/ide/mylyn.util/src/org/netbeans/modules/mylyn/util/NbTaskListener.java b/ide/mylyn.util/src/org/netbeans/modules/mylyn/util/NbTaskListener.java deleted file mode 100644 index 5e79732b59f2..000000000000 --- a/ide/mylyn.util/src/org/netbeans/modules/mylyn/util/NbTaskListener.java +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.netbeans.modules.mylyn.util; - -import java.util.EventListener; -import java.util.EventObject; -import org.eclipse.mylyn.internal.tasks.core.TaskContainerDelta; - -/** - * - * @author Ondrej Vrabec - */ -public interface NbTaskListener extends EventListener { - - public void taskModified (TaskEvent event); - - public static final class TaskEvent extends EventObject { - private final NbTask task; - private final Kind kind; - private boolean stateChanged; - - TaskEvent (NbTask task, TaskContainerDelta delta, boolean stateChanged) { - super(task); - this.task = task; - this.stateChanged = stateChanged; - switch (delta.getKind()) { - case DELETED: - this.kind = Kind.DELETED; - break; - default: - this.kind = Kind.MODIFIED; - } - } - - public NbTask getTask () { - return task; - } - - public Kind getKind () { - return kind; - } - - public boolean taskStateChanged () { - return stateChanged; - } - - public static enum Kind { - DELETED, - MODIFIED - } - } - -} diff --git a/ide/mylyn.util/src/org/netbeans/modules/mylyn/util/PerformQueryCommand.java b/ide/mylyn.util/src/org/netbeans/modules/mylyn/util/PerformQueryCommand.java deleted file mode 100644 index a026ccf41f63..000000000000 --- a/ide/mylyn.util/src/org/netbeans/modules/mylyn/util/PerformQueryCommand.java +++ /dev/null @@ -1,90 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.netbeans.modules.mylyn.util; - -import java.util.Map; -import java.util.logging.Level; -import java.util.logging.Logger; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.NullProgressMonitor; -import org.eclipse.mylyn.tasks.core.AbstractRepositoryConnector; -import org.eclipse.mylyn.tasks.core.IRepositoryQuery; -import org.eclipse.mylyn.tasks.core.TaskRepository; -import org.eclipse.mylyn.tasks.core.data.TaskDataCollector; - -/** - * Perfoms a repository query - * - * @author Tomas Stupka - */ -public class PerformQueryCommand extends BugtrackingCommand { - - private final AbstractRepositoryConnector repositoryConnector; - private final TaskRepository taskRepository; - private final IRepositoryQuery query; - private final TaskDataCollector collector; - private IStatus status; - - public PerformQueryCommand(AbstractRepositoryConnector repositoryConnector, TaskRepository taskRepository, TaskDataCollector collector, IRepositoryQuery query) { - this.taskRepository = taskRepository; - this.repositoryConnector = repositoryConnector; - this.query = query; - this.collector = collector; - } - - @Override - public void execute() throws CoreException { - - Logger log = Logger.getLogger(this.getClass().getName()); - if(log.isLoggable(Level.FINE)) { - Map attrs = query.getAttributes(); - log.log( - Level.FINE, - "executing PerformQueryCommand for query {0} on repository {1} with url \n\t{2} and parameters \n\t{3}", // NOI18N - new Object[] {query.getSummary(), taskRepository.getUrl(), query.getUrl(), attrs != null ? attrs : null}); - } - - status = repositoryConnector.performQuery(taskRepository, query, collector, null, new NullProgressMonitor()); - } - - public IStatus getStatus() { - return status; - } - - public IRepositoryQuery getQuery() { - return query; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("PerformQueryCommand [repository="); - sb.append(taskRepository.getUrl()); - sb.append(", summary="); - sb.append(query.getSummary()); - sb.append(", url="); - sb.append(query.getUrl()); // XXX won't work for all queries - sb.append("]"); - return super.toString(); - } - - -} diff --git a/ide/mylyn.util/src/org/netbeans/modules/mylyn/util/PostAttachmentCommand.java b/ide/mylyn.util/src/org/netbeans/modules/mylyn/util/PostAttachmentCommand.java deleted file mode 100644 index 0fa8e3800d7b..000000000000 --- a/ide/mylyn.util/src/org/netbeans/modules/mylyn/util/PostAttachmentCommand.java +++ /dev/null @@ -1,104 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.netbeans.modules.mylyn.util; - -import java.io.IOException; -import java.net.MalformedURLException; -import java.util.logging.Level; -import java.util.logging.Logger; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.NullProgressMonitor; -import org.eclipse.mylyn.tasks.core.AbstractRepositoryConnector; -import org.eclipse.mylyn.tasks.core.ITask; -import org.eclipse.mylyn.tasks.core.TaskRepository; -import org.eclipse.mylyn.tasks.core.data.AbstractTaskAttachmentHandler; -import org.eclipse.mylyn.tasks.core.data.AbstractTaskAttachmentSource; -import org.eclipse.mylyn.tasks.core.data.TaskAttribute; - -/** - * - * @author Tomas Stupka - */ -public class PostAttachmentCommand extends BugtrackingCommand { - - private final TaskAttribute attAttribute; - private final TaskRepository taskRepository; - private final AbstractRepositoryConnector repositoryConnector; - private String stringValue; - private final ITask task; - private final AbstractTaskAttachmentSource taskAttachmentSource; - private final String comment; - - public PostAttachmentCommand (AbstractRepositoryConnector repositoryConnector, - TaskRepository taskRepository, - ITask task, - TaskAttribute ta, - AbstractTaskAttachmentSource taskAttachmentSource, - String comment) { - this.attAttribute = ta; - this.task = task; - this.taskRepository = taskRepository; - this.repositoryConnector = repositoryConnector; - this.taskAttachmentSource = taskAttachmentSource; - this.comment = comment; - } - - @Override - public void execute() throws CoreException, IOException, MalformedURLException { - Logger log = Logger.getLogger(this.getClass().getName()); - if(log.isLoggable(Level.FINE)) { - log.log(Level.FINE, "executing PostTaskDataCommand for task: {0}", task.getTaskId()); // NOI18N - } - AbstractTaskAttachmentHandler taskAttachmentHandler = repositoryConnector.getTaskAttachmentHandler(); - if (!taskAttachmentHandler.canPostContent(taskRepository, task)) { - throw new IOException("Cannot post attachment for task with id: " + task.getTaskId()); - } - taskAttachmentHandler.postContent(taskRepository, task, taskAttachmentSource, comment, attAttribute, new NullProgressMonitor()); - } - - @Override - public String toString() { - if(stringValue == null) { - StringBuilder sb = new StringBuilder(); - sb.append("PostAttachmentCommand [repository="); // NOI18N - sb.append(taskRepository.getUrl()); - sb.append(",id="); // NOI18N - sb.append(task.getTaskId()); - sb.append(",comment="); // NOI18N - sb.append(comment); - sb.append(",attachment="); // NOI18N - sb.append(taskAttachmentSource.getName()); - sb.append(",desc="); // NOI18N - TaskAttribute ta = attAttribute.getMappedAttribute(TaskAttribute.ATTACHMENT_DESCRIPTION); - sb.append(ta != null ? ta.getValue() : ""); // NOI18N - sb.append(",filename="); // NOI18N - ta = attAttribute.getMappedAttribute(TaskAttribute.ATTACHMENT_FILENAME); - sb.append(ta != null ? ta.getValue() : ""); // NOI18N - sb.append(",contentType="); // NOI18N - ta = attAttribute.getMappedAttribute(TaskAttribute.ATTACHMENT_CONTENT_TYPE); - sb.append(ta != null ? ta.getValue() : ""); // NOI18N - sb.append("]"); // NOI18N - stringValue = sb.toString(); - } - return stringValue; - - } - -} diff --git a/ide/mylyn.util/src/org/netbeans/modules/mylyn/util/RepositoryConnectorProvider.java b/ide/mylyn.util/src/org/netbeans/modules/mylyn/util/RepositoryConnectorProvider.java deleted file mode 100644 index 30fea5198efb..000000000000 --- a/ide/mylyn.util/src/org/netbeans/modules/mylyn/util/RepositoryConnectorProvider.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.netbeans.modules.mylyn.util; - -import org.eclipse.mylyn.tasks.core.AbstractRepositoryConnector; - -/** - * Mylyn TaskList requires that when it's loading all the connectors ruling over - * the tasklist's element are already registered inside mylyn. Every NetBeans - * connector build upon mylyn must implement this. The implementation is queried - * right before the tasklist starts loading from disk. - * - * @author Ondrej Vrabec - */ -public interface RepositoryConnectorProvider { - - AbstractRepositoryConnector getConnector (); - -} diff --git a/ide/mylyn.util/src/org/netbeans/modules/mylyn/util/SubmitCommand.java b/ide/mylyn.util/src/org/netbeans/modules/mylyn/util/SubmitCommand.java deleted file mode 100644 index 58eca96c3019..000000000000 --- a/ide/mylyn.util/src/org/netbeans/modules/mylyn/util/SubmitCommand.java +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.netbeans.modules.mylyn.util; - -import java.io.IOException; -import java.net.MalformedURLException; -import java.util.logging.Level; -import java.util.logging.Logger; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.NullProgressMonitor; -import org.eclipse.mylyn.tasks.core.AbstractRepositoryConnector; -import org.eclipse.mylyn.tasks.core.RepositoryResponse; -import org.eclipse.mylyn.tasks.core.TaskRepository; -import org.eclipse.mylyn.tasks.core.data.TaskData; - -/** - * - * @author Tomas Stupka - */ -public class SubmitCommand extends BugtrackingCommand { - - private final AbstractRepositoryConnector repositoryConnector; - private final TaskRepository taskRepository; - private final TaskData data; - private RepositoryResponse rr; - private boolean wasNew; - private String stringValue; - - public SubmitCommand(AbstractRepositoryConnector repositoryConnector, TaskRepository taskRepository, TaskData data) { - this.taskRepository = taskRepository; - this.repositoryConnector = repositoryConnector; - this.data = data; - wasNew = data.isNew(); - } - - @Override - public void execute() throws CoreException, IOException, MalformedURLException { - - Logger log = Logger.getLogger(this.getClass().getName()); - if(log.isLoggable(Level.FINE)) { - log.log( - Level.FINE, - "executing SubmitCommand for taskData with id {0} ", // NOI18N - data.getTaskId()); - } - - rr = repositoryConnector.getTaskDataHandler().postTaskData(taskRepository, data, null, new NullProgressMonitor()); - // XXX evaluate rr - } - - public RepositoryResponse getRepositoryResponse() { - return rr; - } - - @Override - public String toString() { - if(stringValue == null) { - StringBuilder sb = new StringBuilder(); - if(wasNew) { - sb.append("SubmitCommand new issue [repository="); // NOI18N - sb.append(taskRepository.getUrl()); - sb.append("]"); // NOI18N - } else { - sb.append("SubmitCommand [issue #"); // NOI18N - sb.append(data.getTaskId()); - sb.append(",repository="); // NOI18N - sb.append(taskRepository.getUrl()); - sb.append("]"); // NOI18N - } - stringValue = sb.toString(); - } - return stringValue; - } -} diff --git a/ide/mylyn.util/src/org/netbeans/modules/mylyn/util/TaskDataListener.java b/ide/mylyn.util/src/org/netbeans/modules/mylyn/util/TaskDataListener.java deleted file mode 100644 index 59e0ee9bcd29..000000000000 --- a/ide/mylyn.util/src/org/netbeans/modules/mylyn/util/TaskDataListener.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.netbeans.modules.mylyn.util; - -import java.util.EventListener; -import java.util.EventObject; -import org.eclipse.mylyn.internal.tasks.core.data.TaskDataManagerEvent; -import org.eclipse.mylyn.tasks.core.data.TaskData; - -/** - * - * @author Ondrej Vrabec - */ -public interface TaskDataListener extends EventListener { - - public void taskDataUpdated (TaskDataEvent event); - - public static final class TaskDataEvent extends EventObject { - private final TaskDataManagerEvent event; - - TaskDataEvent (TaskDataManagerEvent event) { - super(event.getSource()); - this.event = event; - } - - public NbTask getTask () { - return MylynSupport.getInstance().toNbTask(event.getTask()); - } - - /** - * May be null - * @return - */ - public TaskData getTaskData () { - return event.getTaskData(); - } - - public boolean getTaskDataUpdated () { - return event.getTaskDataUpdated(); - } - - } -} diff --git a/ide/mylyn.util/src/org/netbeans/modules/mylyn/util/UnsubmittedTasksContainer.java b/ide/mylyn.util/src/org/netbeans/modules/mylyn/util/UnsubmittedTasksContainer.java deleted file mode 100644 index 6b70888e0557..000000000000 --- a/ide/mylyn.util/src/org/netbeans/modules/mylyn/util/UnsubmittedTasksContainer.java +++ /dev/null @@ -1,132 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.netbeans.modules.mylyn.util; - -import java.beans.PropertyChangeListener; -import java.beans.PropertyChangeSupport; -import java.util.ArrayList; -import java.util.Collections; -import java.util.LinkedHashSet; -import java.util.List; -import java.util.Set; -import java.util.logging.Level; -import java.util.logging.Logger; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.mylyn.internal.tasks.core.ITaskListChangeListener; -import org.eclipse.mylyn.internal.tasks.core.ITaskListRunnable; -import org.eclipse.mylyn.internal.tasks.core.TaskContainerDelta; -import org.eclipse.mylyn.internal.tasks.core.TaskList; -import org.eclipse.mylyn.tasks.core.ITask; -import org.eclipse.mylyn.tasks.core.TaskRepository; - -/** - * - * @author Ondrej Vrabec - */ -public final class UnsubmittedTasksContainer { - private final TaskRepository repository; - private final Set tasks = Collections.synchronizedSet(new LinkedHashSet()); - private final PropertyChangeSupport support; - /** - * List of unsubmitted tasks changed. - */ - public static final String EVENT_ISSUES_CHANGED = "mylyn.unsubmitted_tasks.changed"; //NOI18N - private static final Logger LOG = Logger.getLogger(UnsubmittedTasksContainer.class.getName()); - private final TaskList taskList; - private final MylynSupport supp = MylynSupport.getInstance(); - private TaskListListener list; - - UnsubmittedTasksContainer (TaskRepository repository, TaskList taskList) { - this.repository = repository; - this.taskList = taskList; - this.support = new PropertyChangeSupport(this); - initialize(); - } - - public List getTasks () { - return new ArrayList(tasks); - } - - public void addPropertyChangeListener (PropertyChangeListener listener) { - support.addPropertyChangeListener(listener); - } - - public void removePropertyChangeListener (PropertyChangeListener listener) { - support.removePropertyChangeListener(listener); - } - - private void fireIssuesChanged() { - support.firePropertyChange(EVENT_ISSUES_CHANGED, null, null); - } - - private void initialize () { - try { - taskList.run(new ITaskListRunnable() { - @Override - public void execute (IProgressMonitor monitor) throws CoreException { - taskList.addChangeListener(list = new TaskListListener()); - tasks.addAll(supp.toNbTasks(taskList.getUnsubmittedContainer( - repository.getRepositoryUrl()).getChildren())); - for (NbTask task : supp.getTasks(repository)) { - if (task.isOutgoing()) { - tasks.add(task); - } - } - } - }); - } catch (CoreException ex) { - LOG.log(Level.INFO, null, ex); - } - } - - private class TaskListListener implements ITaskListChangeListener { - - @Override - public void containersChanged (Set deltas) { - // listen on changes on all tasks - boolean change = false; - for (TaskContainerDelta delta : deltas) { - if (delta.getElement() instanceof ITask) { - ITask task = (ITask) delta.getElement(); - NbTask nbTask = supp.toNbTask(task); - if (delta.getKind() == TaskContainerDelta.Kind.CONTENT) { - if (repository.getRepositoryUrl().equals(task.getRepositoryUrl())) { - // the task may change its status - change |= nbTask.isOutgoing() ? tasks.add(nbTask) : tasks.remove(nbTask); - } - } else if (delta.getKind() == TaskContainerDelta.Kind.DELETED) { - // the task was deleted permanently - change |= tasks.remove(nbTask); - } else if (delta.getKind() == TaskContainerDelta.Kind.ADDED - && task.getSynchronizationState() == ITask.SynchronizationState.OUTGOING_NEW) { - // task may be added to the unsubmitted category - change |= taskList.getUnsubmittedContainer(repository.getRepositoryUrl()) - .getChildren().contains(task) && tasks.add(nbTask); - } - } - } - if (change) { - fireIssuesChanged(); - } - } - - } -} diff --git a/ide/mylyn.util/src/org/netbeans/modules/mylyn/util/WikiPanel.java b/ide/mylyn.util/src/org/netbeans/modules/mylyn/util/WikiPanel.java deleted file mode 100644 index 2a0016d03e0d..000000000000 --- a/ide/mylyn.util/src/org/netbeans/modules/mylyn/util/WikiPanel.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.netbeans.modules.mylyn.util; - -import javax.swing.JLabel; -import javax.swing.JPanel; -import javax.swing.JTextPane; - -/** - * - * @author jpeska - */ -public abstract class WikiPanel extends JPanel { - - public abstract String getWikiFormatText(); - - public abstract void setWikiFormatText(String wikiFormatText); - - public abstract void appendCodeText(String codeToAppend); - - public abstract void clear(); - - public abstract JLabel getWarningLabel(); - - public abstract void registerHighlights(JTextPane wikiPreviewPane); - - public abstract JTextPane getPreviewPane(); - - public abstract JTextPane getCodePane(); -} diff --git a/ide/mylyn.util/src/org/netbeans/modules/mylyn/util/WikiUtils.java b/ide/mylyn.util/src/org/netbeans/modules/mylyn/util/WikiUtils.java deleted file mode 100644 index 5c05e714b4aa..000000000000 --- a/ide/mylyn.util/src/org/netbeans/modules/mylyn/util/WikiUtils.java +++ /dev/null @@ -1,110 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.netbeans.modules.mylyn.util; - -import java.util.logging.Level; -import java.util.logging.Logger; -import org.eclipse.mylyn.wikitext.core.parser.MarkupParser; -import org.eclipse.mylyn.wikitext.core.parser.markup.MarkupLanguage; -import org.eclipse.mylyn.wikitext.core.util.ServiceLocator; -import org.netbeans.modules.mylyn.util.wiki.WikiEditPanel; -import org.openide.util.Lookup; - -/** - * - * @author jpeska - */ -public class WikiUtils { - - private static final Logger LOG = Logger.getLogger("org.netbeans.mylym.utils.WikiUtils"); //NOI18N - - private WikiUtils () { - } - - public static WikiPanel getWikiPanel(String wikiLanguage, boolean editing, boolean switchable) { - return new WikiEditPanel(wikiLanguage, editing, switchable); - } - - public static String getHtmlFormatText(String wikiFormatText, String language) { - if (language == null || language.isEmpty()) { - LOG.log(Level.FINE, "Wiki language name is empty"); //NOI18N - return null; - } - MarkupLanguage markupLanguage; - ClassLoader originalContextCL = null; - try { - originalContextCL = setupContextClassLoader(); - markupLanguage = ServiceLocator.getInstance().getMarkupLanguage(language); - } catch (IllegalArgumentException ex) { - // issue #258571 - String msg = ex.getMessage(); - if(msg.startsWith("Cannot load markup language")) { // NOI18N - LOG.log(Level.INFO, null, ex); - markupLanguage = null; - } else { - throw ex; - } - } finally { - restoreContextClassLoader(originalContextCL); - } - if (markupLanguage == null) { - LOG.log(Level.FINE, "Markup language for name {0} not found",language); //NOI18N - return null; - } - MarkupParser parser = new MarkupParser(markupLanguage); - String dirtyHtml = parser.parseToHtml(wikiFormatText); - return cleanHtmlTags(dirtyHtml); - } - - private static String cleanHtmlTags(String html) { - html = html.replaceFirst("<\\?xml.*?>", ""); //NOI18N - html = html.replaceAll("", ""); //NOI18N - html = html.replaceAll(".*", ""); //NOI18N - - boolean remove = html.contains("

"); //NOI18N - if (remove) { - // remove first

gap, looks ugly in the UI... - html = html.replaceFirst("

", ""); //NOI18N - html = html.replaceFirst("

", ""); //NOI18N - } - return html; - } - - // In JDeveloper we need the NetBeans system classloader as the thread context CL - // in order to find wikitext registrations. The Equinox' ContextFinder used by default - // is not usable. Unfortunatelly it's not possible to set the context classloader in - // JDeveloper explicitly (no entry point). In NetBeans this code effectively does nothing. - private static ClassLoader setupContextClassLoader() { - ClassLoader systemCL = Lookup.getDefault().lookup(ClassLoader.class); - if (systemCL != null) { - ClassLoader currentContextCL = Thread.currentThread().getContextClassLoader(); - if (currentContextCL != null && currentContextCL != systemCL) { - Thread.currentThread().setContextClassLoader(systemCL); - return currentContextCL; - } - } - return null; - } - - private static void restoreContextClassLoader(ClassLoader originalContextCL) { - if (originalContextCL != null) { - Thread.currentThread().setContextClassLoader(originalContextCL); - } - } -} diff --git a/ide/mylyn.util/src/org/netbeans/modules/mylyn/util/commands/CommandFactory.java b/ide/mylyn.util/src/org/netbeans/modules/mylyn/util/commands/CommandFactory.java deleted file mode 100644 index 6f6e9ea40cdd..000000000000 --- a/ide/mylyn.util/src/org/netbeans/modules/mylyn/util/commands/CommandFactory.java +++ /dev/null @@ -1,201 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.netbeans.modules.mylyn.util.commands; - -import java.io.OutputStream; -import java.util.Set; -import java.util.logging.Level; -import java.util.logging.Logger; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.mylyn.internal.tasks.core.ITasksCoreConstants; -import org.eclipse.mylyn.internal.tasks.core.RepositoryModel; -import org.eclipse.mylyn.internal.tasks.core.RepositoryQuery; -import org.eclipse.mylyn.internal.tasks.core.TaskList; -import org.eclipse.mylyn.internal.tasks.core.TaskRepositoryManager; -import org.eclipse.mylyn.internal.tasks.core.data.FileTaskAttachmentSource; -import org.eclipse.mylyn.internal.tasks.core.data.TaskDataManager; -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.TaskMigrationEvent; -import org.eclipse.mylyn.tasks.core.TaskRepository; -import org.eclipse.mylyn.tasks.core.data.TaskAttribute; -import org.eclipse.mylyn.tasks.core.sync.SubmitJob; -import org.eclipse.mylyn.tasks.core.sync.SubmitJobEvent; -import org.eclipse.mylyn.tasks.core.sync.SubmitJobListener; -import org.netbeans.modules.mylyn.util.CancelableProgressMonitor; -import org.netbeans.modules.mylyn.util.NbTask; -import org.netbeans.modules.mylyn.util.NbTaskDataModel; -import org.netbeans.modules.mylyn.util.internal.Accessor; -import org.netbeans.modules.mylyn.util.internal.CommandsAccessor; - -/** - * - * @author Ondrej Vrabec - */ -public final class CommandFactory { - - static { - // see static initializer of CommandAccessor - CommandsAccessor.INSTANCE = new CommandsAccessorImpl(); - } - - private static final Logger LOG = Logger.getLogger(CommandFactory.class.getName()); - private final TaskList taskList; - private final TaskDataManager taskDataManager; - private final TaskRepositoryManager taskRepositoryManager; - private final RepositoryModel repositoryModel; - - CommandFactory (TaskList taskList, - TaskDataManager taskDataManager, TaskRepositoryManager taskRepositoryManager, - RepositoryModel repositoryModel) { - this.taskList = taskList; - this.taskDataManager = taskDataManager; - this.taskRepositoryManager = taskRepositoryManager; - this.repositoryModel = repositoryModel; - } - - public SynchronizeQueryCommand createSynchronizeQueriesCommand (TaskRepository taskRepository, IRepositoryQuery iquery) { - return createSynchronizeQueriesCommand(taskRepository, iquery, new CancelableProgressMonitor()); - } - - public SynchronizeQueryCommand createSynchronizeQueriesCommand (TaskRepository taskRepository, IRepositoryQuery iquery, IProgressMonitor monitor) { - assert iquery instanceof RepositoryQuery; - RepositoryQuery repositoryQuery; - if (iquery instanceof RepositoryQuery) { - repositoryQuery = (RepositoryQuery) iquery; - } else { - return null; - } - AbstractRepositoryConnector repositoryConnector = taskRepositoryManager.getRepositoryConnector(taskRepository.getConnectorKind()); - return new SynchronizeQueryCommand(repositoryModel, repositoryConnector, - taskRepository, taskList, taskDataManager, repositoryQuery, monitor); - } - - /** - * Returns a bugtracking command submitting the given task to the remote - * repository. - * - * @param model task data to submit - * @return the command ready to be executed - * @throws CoreException problem while submitting - */ - public SubmitTaskCommand createSubmitTaskCommand (NbTaskDataModel model) throws CoreException { - final AbstractRepositoryConnector repositoryConnector; - final ITask task = Accessor.getInstance().getITask(model); - TaskRepository taskRepository = Accessor.getInstance().getTaskRepositoryFor(task); - if (task.getSynchronizationState() == ITask.SynchronizationState.OUTGOING_NEW) { - repositoryConnector = taskRepositoryManager.getRepositoryConnector( - task.getAttribute(ITasksCoreConstants.ATTRIBUTE_OUTGOING_NEW_CONNECTOR_KIND)); - } else { - repositoryConnector = taskRepositoryManager.getRepositoryConnector(task.getConnectorKind()); - } - - SubmitTaskCommand command = new SubmitTaskCommand(taskDataManager, - repositoryConnector, - taskRepository, - task, - model.getLocalTaskData(), model.getChangedOldAttributes() /*??? no idea what's this good for*/); - command.setSubmitJobListener(new SubmitJobListener() { - @Override - public void taskSubmitted (SubmitJobEvent event, IProgressMonitor monitor) throws CoreException { - } - - @Override - public void taskSynchronized (SubmitJobEvent event, IProgressMonitor monitor) throws CoreException { - } - - @Override - public void done (SubmitJobEvent event) { - // turn into full task - SubmitJob job = event.getJob(); - ITask newTask = job.getTask(); - if (newTask != null && newTask != task) { - // copy anything you want - taskList.deleteTask(task); - taskList.addTask(newTask); - repositoryConnector.migrateTask(new TaskMigrationEvent(task, newTask)); - try { - taskDataManager.deleteTaskData(task); - } catch (CoreException ex) { - LOG.log(Level.INFO, null, ex); - } - } - } - }); - - return command; - } - - /** - * - * @param taskRepository - * @param tasks - * @return - * @deprecated run {@link #createSynchronizeTasksCommand(org.eclipse.mylyn.tasks.core.TaskRepository, java.util.Set, boolean) } - */ - @Deprecated - public SynchronizeTasksCommand createSynchronizeTasksCommand (TaskRepository taskRepository, Set tasks) { - return createSynchronizeTasksCommand(taskRepository, tasks, true); - } - - /** - * Synchronizes given tasks with their state in a repository. - * - * @param taskRepository repository - * @param tasks tasks to synchronize - * @param isUserAction when set to true mylyn will force the - * refresh and may run certain additional tasks like fetching subtasks and - * parent tasks. - * @return - */ - public SynchronizeTasksCommand createSynchronizeTasksCommand (TaskRepository taskRepository, Set tasks, boolean isUserAction) { - AbstractRepositoryConnector repositoryConnector = taskRepositoryManager.getRepositoryConnector(taskRepository.getConnectorKind()); - return new SynchronizeTasksCommand(repositoryConnector, taskRepository, - repositoryModel, taskDataManager, taskList, tasks, isUserAction); - } - - public GetRepositoryTasksCommand createGetRepositoryTasksCommand (TaskRepository taskRepository, Set taskIds) throws CoreException { - AbstractRepositoryConnector repositoryConnector = taskRepositoryManager.getRepositoryConnector(taskRepository.getConnectorKind()); - GetRepositoryTasksCommand cmd = new GetRepositoryTasksCommand(repositoryConnector, - taskRepository, taskIds, taskDataManager); - return cmd; - } - - public SimpleQueryCommand createSimpleQueryCommand (TaskRepository taskRepository, IRepositoryQuery query) throws CoreException { - AbstractRepositoryConnector repositoryConnector = taskRepositoryManager.getRepositoryConnector(taskRepository.getConnectorKind()); - return new SimpleQueryCommand(repositoryConnector, taskRepository, taskDataManager, query); - } - - public PostAttachmentCommand createPostAttachmentCommand (TaskRepository taskRepository, NbTask task, - TaskAttribute attAttribute, FileTaskAttachmentSource attachmentSource, String comment) { - AbstractRepositoryConnector repositoryConnector = taskRepositoryManager.getRepositoryConnector(taskRepository.getConnectorKind()); - return new PostAttachmentCommand(repositoryConnector, taskRepository, - Accessor.getInstance().getDelegate(task), - attAttribute, attachmentSource, comment); - } - - public GetAttachmentCommand createGetAttachmentCommand (TaskRepository taskRepository, - NbTask nbTask, TaskAttribute ta, OutputStream os) { - AbstractRepositoryConnector repositoryConnector = taskRepositoryManager.getRepositoryConnector(taskRepository.getConnectorKind()); - return new GetAttachmentCommand(repositoryConnector, taskRepository, - Accessor.getInstance().getDelegate(nbTask), ta, os); - } -} diff --git a/ide/mylyn.util/src/org/netbeans/modules/mylyn/util/commands/CommandsAccessorImpl.java b/ide/mylyn.util/src/org/netbeans/modules/mylyn/util/commands/CommandsAccessorImpl.java deleted file mode 100644 index 081f7ab0698e..000000000000 --- a/ide/mylyn.util/src/org/netbeans/modules/mylyn/util/commands/CommandsAccessorImpl.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.netbeans.modules.mylyn.util.commands; - -import org.eclipse.mylyn.internal.tasks.core.RepositoryModel; -import org.eclipse.mylyn.internal.tasks.core.TaskList; -import org.eclipse.mylyn.internal.tasks.core.TaskRepositoryManager; -import org.eclipse.mylyn.internal.tasks.core.data.TaskDataManager; -import org.netbeans.modules.mylyn.util.internal.CommandsAccessor; - -/** - * - * @author Ondrej Vrabec - */ -class CommandsAccessorImpl extends CommandsAccessor { - - @Override - public CommandFactory getCommandFactory (TaskList taskList, TaskDataManager taskDataManager, - TaskRepositoryManager taskRepositoryManager, RepositoryModel repositoryModel) { - return new CommandFactory(taskList, taskDataManager, taskRepositoryManager, repositoryModel); - } - -} diff --git a/ide/mylyn.util/src/org/netbeans/modules/mylyn/util/commands/GetAttachmentCommand.java b/ide/mylyn.util/src/org/netbeans/modules/mylyn/util/commands/GetAttachmentCommand.java deleted file mode 100644 index abdfee4686b6..000000000000 --- a/ide/mylyn.util/src/org/netbeans/modules/mylyn/util/commands/GetAttachmentCommand.java +++ /dev/null @@ -1,99 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.netbeans.modules.mylyn.util.commands; - -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.net.MalformedURLException; -import java.util.logging.Level; -import java.util.logging.Logger; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.NullProgressMonitor; -import org.eclipse.mylyn.tasks.core.AbstractRepositoryConnector; -import org.eclipse.mylyn.tasks.core.ITask; -import org.eclipse.mylyn.tasks.core.TaskRepository; -import org.eclipse.mylyn.tasks.core.data.AbstractTaskAttachmentHandler; -import org.eclipse.mylyn.tasks.core.data.TaskAttribute; -import org.netbeans.modules.mylyn.util.BugtrackingCommand; - -/** - * - * @author Tomas Stupka - */ -public class GetAttachmentCommand extends BugtrackingCommand { - - private final TaskAttribute ta; - private final TaskRepository taskRepository; - private final AbstractRepositoryConnector repositoryConnector; - private final OutputStream os; - private String stringValue; - private final ITask task; - - GetAttachmentCommand(AbstractRepositoryConnector repositoryConnector, - TaskRepository taskRepository, - ITask task, - TaskAttribute ta, - OutputStream os) { - this.ta = ta; - this.task = task; - this.taskRepository = taskRepository; - this.repositoryConnector = repositoryConnector; - this.os = os; - } - - @Override - public void execute() throws CoreException, IOException, MalformedURLException { - Logger log = Logger.getLogger(this.getClass().getName()); - if(log.isLoggable(Level.FINE)) { - log.log(Level.FINE, "executing GetTaskDataCommand for attachment id: {0}", ta.getValue()); // NOI18N - } - AbstractTaskAttachmentHandler taskAttachmentHandler = repositoryConnector.getTaskAttachmentHandler(); - if (!taskAttachmentHandler.canGetContent(taskRepository, task)) { - throw new IOException("Cannot get content for attachment with id: " + ta.getValue()); - } - InputStream is = taskAttachmentHandler.getContent(taskRepository, task, ta, new NullProgressMonitor()); - try { - byte [] buffer = new byte[4096]; - int n; - while ((n = is.read(buffer)) != -1) { - os.write(buffer, 0, n); - } - } finally { - is.close(); - } - } - - @Override - public String toString() { - if (stringValue == null) { - StringBuilder sb = new StringBuilder(); - sb.append("GetAttachmentCommand [repository="); // NOI18N - sb.append(taskRepository.getUrl()); - sb.append(",attachmentID="); // NOI18N - sb.append(ta.getValue()); - sb.append("]"); // NOI18N - stringValue = sb.toString(); - } - return stringValue; - - } - -} diff --git a/ide/mylyn.util/src/org/netbeans/modules/mylyn/util/commands/GetRepositoryTasksCommand.java b/ide/mylyn.util/src/org/netbeans/modules/mylyn/util/commands/GetRepositoryTasksCommand.java deleted file mode 100644 index 9a4b135931e6..000000000000 --- a/ide/mylyn.util/src/org/netbeans/modules/mylyn/util/commands/GetRepositoryTasksCommand.java +++ /dev/null @@ -1,129 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.netbeans.modules.mylyn.util.commands; - -import java.io.IOException; -import java.net.MalformedURLException; -import java.util.ArrayList; -import java.util.List; -import java.util.Set; -import java.util.logging.Level; -import java.util.logging.Logger; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.mylyn.internal.tasks.core.data.TaskDataManager; -import org.eclipse.mylyn.tasks.core.AbstractRepositoryConnector; -import org.eclipse.mylyn.tasks.core.TaskRepository; -import org.eclipse.mylyn.tasks.core.data.TaskData; -import org.eclipse.mylyn.tasks.core.data.TaskDataCollector; -import org.netbeans.modules.mylyn.util.BugtrackingCommand; -import org.netbeans.modules.mylyn.util.CancelableProgressMonitor; -import org.netbeans.modules.mylyn.util.NbTask; -import org.netbeans.modules.mylyn.util.internal.Accessor; - -/** - * - * @author Ondrej Vrabec - */ -public class GetRepositoryTasksCommand extends BugtrackingCommand { - - private String stringValue; - private final TaskRepository taskRepository; - private final Set taskIds; - private final CancelableProgressMonitor monitor; - private final TaskDataManager taskDataManager; - private final AbstractRepositoryConnector connector; - private final List tasks = new ArrayList(); - - GetRepositoryTasksCommand (AbstractRepositoryConnector connector, - TaskRepository taskRepository, Set taskIds, - TaskDataManager taskDataManager) { - this.connector = connector; - this.taskRepository = taskRepository; - this.taskIds = taskIds; - this.taskDataManager = taskDataManager; - this.monitor = new CancelableProgressMonitor(); - } - - @Override - public void execute () throws CoreException, IOException, MalformedURLException { - Logger log = Logger.getLogger(this.getClass().getName()); - if (log.isLoggable(Level.FINE)) { - log.log( - Level.FINE, - "executing GetRepositoryTasksCommand for task ids {0}:{1}", //NOI18N - new Object[] { taskRepository.getUrl(), taskIds }); - } - if (taskIds.size() == 1 || !connector.getTaskDataHandler().canGetMultiTaskData(taskRepository)) { - for (String taskId : taskIds) { - TaskData taskData = connector.getTaskData(taskRepository, taskId, monitor); - if (monitor.isCanceled()) { - return; - } - if (taskData != null) { - Accessor acc = Accessor.getInstance(); - NbTask task = acc.getOrCreateTask(taskRepository, taskData.getTaskId(), true); - taskDataManager.putUpdatedTaskData(acc.getDelegate(task), taskData, true); - tasks.add(task); - } - } - } else { - connector.getTaskDataHandler().getMultiTaskData(taskRepository, taskIds, - new Collector(), monitor); - } - } - - @Override - public void cancel () { - monitor.setCanceled(true); - } - - @Override - public String toString () { - if (stringValue == null) { - StringBuilder sb = new StringBuilder() - .append("Getting tasks ") //NOI18N - .append(taskIds) - .append(",repository=") //NOI18N - .append(taskRepository.getUrl()) - .append("]"); //NOI18N - stringValue = sb.toString(); - } - return stringValue; - } - - public List getTasks () { - return tasks; - } - - private class Collector extends TaskDataCollector { - - @Override - public void accept (TaskData taskData) { - try { - Accessor acc = Accessor.getInstance(); - NbTask task = acc.getOrCreateTask(taskRepository, taskData.getTaskId(), true); - taskDataManager.putUpdatedTaskData(acc.getDelegate(task), taskData, true); - tasks.add(task); - } catch (CoreException ex) { - Logger.getLogger(this.getClass().getName()).log(Level.INFO, null, ex); - } - } - - } -} diff --git a/ide/mylyn.util/src/org/netbeans/modules/mylyn/util/commands/PostAttachmentCommand.java b/ide/mylyn.util/src/org/netbeans/modules/mylyn/util/commands/PostAttachmentCommand.java deleted file mode 100644 index 731eb805a1c6..000000000000 --- a/ide/mylyn.util/src/org/netbeans/modules/mylyn/util/commands/PostAttachmentCommand.java +++ /dev/null @@ -1,105 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.netbeans.modules.mylyn.util.commands; - -import java.io.IOException; -import java.net.MalformedURLException; -import java.util.logging.Level; -import java.util.logging.Logger; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.NullProgressMonitor; -import org.eclipse.mylyn.tasks.core.AbstractRepositoryConnector; -import org.eclipse.mylyn.tasks.core.ITask; -import org.eclipse.mylyn.tasks.core.TaskRepository; -import org.eclipse.mylyn.tasks.core.data.AbstractTaskAttachmentHandler; -import org.eclipse.mylyn.tasks.core.data.AbstractTaskAttachmentSource; -import org.eclipse.mylyn.tasks.core.data.TaskAttribute; -import org.netbeans.modules.mylyn.util.BugtrackingCommand; - -/** - * - * @author Tomas Stupka - */ -public class PostAttachmentCommand extends BugtrackingCommand { - - private final TaskAttribute attAttribute; - private final TaskRepository taskRepository; - private final AbstractRepositoryConnector repositoryConnector; - private String stringValue; - private final ITask task; - private final AbstractTaskAttachmentSource taskAttachmentSource; - private final String comment; - - PostAttachmentCommand (AbstractRepositoryConnector repositoryConnector, - TaskRepository taskRepository, - ITask task, - TaskAttribute ta, - AbstractTaskAttachmentSource taskAttachmentSource, - String comment) { - this.attAttribute = ta; - this.task = task; - this.taskRepository = taskRepository; - this.repositoryConnector = repositoryConnector; - this.taskAttachmentSource = taskAttachmentSource; - this.comment = comment; - } - - @Override - public void execute() throws CoreException, IOException, MalformedURLException { - Logger log = Logger.getLogger(this.getClass().getName()); - if(log.isLoggable(Level.FINE)) { - log.log(Level.FINE, "executing PostTaskDataCommand for task: {0}", task.getTaskId()); // NOI18N - } - AbstractTaskAttachmentHandler taskAttachmentHandler = repositoryConnector.getTaskAttachmentHandler(); - if (!taskAttachmentHandler.canPostContent(taskRepository, task)) { - throw new IOException("Cannot post attachment for task with id: " + task.getTaskId()); - } - taskAttachmentHandler.postContent(taskRepository, task, taskAttachmentSource, comment, attAttribute, new NullProgressMonitor()); - } - - @Override - public String toString() { - if(stringValue == null) { - StringBuilder sb = new StringBuilder(); - sb.append("PostAttachmentCommand [repository="); // NOI18N - sb.append(taskRepository.getUrl()); - sb.append(",id="); // NOI18N - sb.append(task.getTaskId()); - sb.append(",comment="); // NOI18N - sb.append(comment); - sb.append(",attachment="); // NOI18N - sb.append(taskAttachmentSource.getName()); - sb.append(",desc="); // NOI18N - TaskAttribute ta = attAttribute.getMappedAttribute(TaskAttribute.ATTACHMENT_DESCRIPTION); - sb.append(ta != null ? ta.getValue() : ""); // NOI18N - sb.append(",filename="); // NOI18N - ta = attAttribute.getMappedAttribute(TaskAttribute.ATTACHMENT_FILENAME); - sb.append(ta != null ? ta.getValue() : ""); // NOI18N - sb.append(",contentType="); // NOI18N - ta = attAttribute.getMappedAttribute(TaskAttribute.ATTACHMENT_CONTENT_TYPE); - sb.append(ta != null ? ta.getValue() : ""); // NOI18N - sb.append("]"); // NOI18N - stringValue = sb.toString(); - } - return stringValue; - - } - -} diff --git a/ide/mylyn.util/src/org/netbeans/modules/mylyn/util/commands/SimpleQueryCommand.java b/ide/mylyn.util/src/org/netbeans/modules/mylyn/util/commands/SimpleQueryCommand.java deleted file mode 100644 index 6fd0a21eb8c3..000000000000 --- a/ide/mylyn.util/src/org/netbeans/modules/mylyn/util/commands/SimpleQueryCommand.java +++ /dev/null @@ -1,127 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.netbeans.modules.mylyn.util.commands; - -import java.util.Collection; -import java.util.HashSet; -import java.util.Map; -import java.util.Set; -import java.util.logging.Level; -import java.util.logging.Logger; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.mylyn.internal.tasks.core.data.TaskDataManager; -import org.eclipse.mylyn.internal.tasks.core.sync.SynchronizationSession; -import org.eclipse.mylyn.tasks.core.AbstractRepositoryConnector; -import org.eclipse.mylyn.tasks.core.IRepositoryQuery; -import org.eclipse.mylyn.tasks.core.TaskRepository; -import org.eclipse.mylyn.tasks.core.data.TaskData; -import org.eclipse.mylyn.tasks.core.data.TaskDataCollector; -import org.netbeans.modules.mylyn.util.BugtrackingCommand; -import org.netbeans.modules.mylyn.util.CancelableProgressMonitor; -import org.netbeans.modules.mylyn.util.NbTask; -import org.netbeans.modules.mylyn.util.internal.Accessor; - -/** - * Performs a repository query. Finishes as soon as possible and does not - * refresh tasks. - * - * @author Ondra Vrabec - */ -public class SimpleQueryCommand extends BugtrackingCommand { - - private final AbstractRepositoryConnector repositoryConnector; - private final TaskRepository taskRepository; - private final IRepositoryQuery query; - private IStatus status; - private final IProgressMonitor monitor; - private final Set tasks; - private final TaskDataManager taskDataManager; - - SimpleQueryCommand (AbstractRepositoryConnector repositoryConnector, - TaskRepository taskRepository, TaskDataManager taskDataManager, - IRepositoryQuery query) { - this.taskRepository = taskRepository; - this.repositoryConnector = repositoryConnector; - this.query = query; - this.taskDataManager = taskDataManager; - this.monitor = new CancelableProgressMonitor(); - tasks = new HashSet(); - } - - @Override - public void execute () throws CoreException { - final Logger log = Logger.getLogger(this.getClass().getName()); - if (log.isLoggable(Level.FINE)) { - Map attrs = query.getAttributes(); - log.log( - Level.FINE, - "executing SimpleQueryCommand for query {0} on repository {1} with url \n\t{2} and parameters \n\t{3}", // NOI18N - new Object[]{query.getSummary(), taskRepository.getUrl(), query.getUrl(), attrs != null ? attrs : null}); - } - TaskDataCollector collector = new TaskDataCollector() { - @Override - public void accept (TaskData taskData) { - try { - Accessor acc = Accessor.getInstance(); - NbTask task = acc.getOrCreateTask(taskRepository, taskData.getTaskId(), true); - taskDataManager.putUpdatedTaskData(acc.getDelegate(task), taskData, true); - tasks.add(task); - } catch (CoreException ex) { - log.log(Level.INFO, "Cannot save task data " + taskData.getTaskId(), ex); - } - } - }; - status = repositoryConnector.performQuery(taskRepository, query, collector, new SynchronizationSession(), monitor); - if (status != null && status.getSeverity() == IStatus.ERROR) { - if (status.getException() instanceof CoreException) { - throw (CoreException) status.getException(); - } else { - throw new CoreException(status); - } - } - } - - public IStatus getStatus () { - return status; - } - - @Override - public void cancel () { - monitor.setCanceled(true); - } - - @Override - public String toString () { - StringBuilder sb = new StringBuilder(); - sb.append("SimpleQueryCommand [repository="); - sb.append(taskRepository.getUrl()); - sb.append(", summary="); - sb.append(query.getSummary()); - sb.append(", url="); - sb.append(query.getUrl()); - sb.append("]"); - return super.toString(); - } - - public Collection getTasks () { - return tasks; - } -} diff --git a/ide/mylyn.util/src/org/netbeans/modules/mylyn/util/commands/SubmitTaskCommand.java b/ide/mylyn.util/src/org/netbeans/modules/mylyn/util/commands/SubmitTaskCommand.java deleted file mode 100644 index 1c39eded2533..000000000000 --- a/ide/mylyn.util/src/org/netbeans/modules/mylyn/util/commands/SubmitTaskCommand.java +++ /dev/null @@ -1,163 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.netbeans.modules.mylyn.util.commands; - -import java.io.IOException; -import java.net.MalformedURLException; -import java.util.Set; -import java.util.logging.Level; -import java.util.logging.Logger; -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.mylyn.internal.tasks.core.data.TaskDataManager; -import org.eclipse.mylyn.internal.tasks.core.sync.SubmitTaskJob; -import org.eclipse.mylyn.tasks.core.AbstractRepositoryConnector; -import org.eclipse.mylyn.tasks.core.ITask; -import org.eclipse.mylyn.tasks.core.RepositoryResponse; -import org.eclipse.mylyn.tasks.core.TaskRepository; -import org.eclipse.mylyn.tasks.core.data.TaskAttribute; -import org.eclipse.mylyn.tasks.core.data.TaskData; -import org.eclipse.mylyn.tasks.core.sync.SubmitJobListener; -import org.netbeans.modules.team.commons.LogUtils; -import org.netbeans.modules.mylyn.util.BugtrackingCommand; -import org.netbeans.modules.mylyn.util.CancelableProgressMonitor; -import org.netbeans.modules.mylyn.util.NbTask; -import org.netbeans.modules.mylyn.util.internal.Accessor; - -/** - * - * @author Ondra Vrabec - */ -public class SubmitTaskCommand extends BugtrackingCommand { - - private final CancelableProgressMonitor monitor; - private RepositoryResponse rr; - private NbTask submittedTask; - private final Set changedOldAttributes; - private final TaskData taskData; - private final ITask task; - private final TaskRepository taskRepository; - private final AbstractRepositoryConnector repositoryConnector; - private final TaskDataManager taskDataManager; - private String stringValue; - private SubmitJobListener submitJobListener; - - SubmitTaskCommand (TaskDataManager taskDataManager, - AbstractRepositoryConnector repositoryConnector, - TaskRepository taskRepository, ITask task, TaskData taskData, - Set changedOldAttributes) { - this.taskDataManager = taskDataManager; - this.repositoryConnector = repositoryConnector; - this.taskRepository = taskRepository; - this.task = task; - this.taskData = taskData; - this.changedOldAttributes = changedOldAttributes; - this.monitor = new CancelableProgressMonitor(); - } - - @Override - public void execute() throws CoreException, IOException, MalformedURLException { - - LogUtils.logBugtrackingUsage(repositoryConnector.getConnectorKind(), "ISSUE_EDIT"); - - MylynSubmitTaskJob job = new MylynSubmitTaskJob(taskDataManager, repositoryConnector, taskRepository, - task, taskData, changedOldAttributes); - if (submitJobListener != null) { - job.addSubmitJobListener(submitJobListener); - } - - Logger log = Logger.getLogger(this.getClass().getName()); - if(log.isLoggable(Level.FINE)) { - log.log( - Level.FINE, - "executing SubmitJobCommand for task with id {0}:{1} ", //NOI18N - new Object[] { task.getTaskId(), taskRepository.getUrl() }); - } - - job.startJob(monitor); - IStatus status = job.getStatus(); - rr = job.getResponse(); - submittedTask = Accessor.getInstance().toNbTask(job.getTask()); - if (status != null && status != Status.OK_STATUS) { - log.log(Level.INFO, "Command failed with status: {0}", status); //NOI18N - if (status.getException() instanceof CoreException) { - throw (CoreException) status.getException(); - } else { - throw new CoreException(status); - } - } - } - - @Override - public String toString() { - if(stringValue == null) { - StringBuilder sb = new StringBuilder(); - if (task.getSynchronizationState() == ITask.SynchronizationState.OUTGOING_NEW) { - sb.append("SubmitTaskCommand new issue [repository="); //NOI18N - sb.append(taskRepository.getUrl()); - sb.append("]"); //NOI18N - } else { - sb.append("SubmitTaskCommand [task #"); //NOI18N - sb.append(taskData.getTaskId()); - sb.append(",repository="); //NOI18N - sb.append(taskRepository.getUrl()); - sb.append("]"); //NOI18N - } - stringValue = sb.toString(); - } - return stringValue; - } - - @Override - public void cancel () { - monitor.setCanceled(true); - } - - /** - * Returns the persistent task if the task to submit was a fresh new task, - * otherwise the same task. - * - */ - public NbTask getSubmittedTask () { - return submittedTask; - } - - public RepositoryResponse getRepositoryResponse () { - return rr; - } - - void setSubmitJobListener (SubmitJobListener submitJobListener) { - this.submitJobListener = submitJobListener; - } - - private static class MylynSubmitTaskJob extends SubmitTaskJob { - - public MylynSubmitTaskJob (TaskDataManager taskDataManager, AbstractRepositoryConnector connector, - TaskRepository taskRepository, ITask task, TaskData taskData, Set oldAttributes) { - super(taskDataManager, connector, taskRepository, task, taskData, oldAttributes); - } - - public IStatus startJob (IProgressMonitor jobMonitor) { - return run(jobMonitor); - } - }; -} diff --git a/ide/mylyn.util/src/org/netbeans/modules/mylyn/util/commands/SynchronizeQueryCommand.java b/ide/mylyn.util/src/org/netbeans/modules/mylyn/util/commands/SynchronizeQueryCommand.java deleted file mode 100644 index 5ece9e5fd1ed..000000000000 --- a/ide/mylyn.util/src/org/netbeans/modules/mylyn/util/commands/SynchronizeQueryCommand.java +++ /dev/null @@ -1,242 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.netbeans.modules.mylyn.util.commands; - -import java.io.IOException; -import java.net.MalformedURLException; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.EventListener; -import java.util.HashSet; -import java.util.List; -import java.util.Set; -import java.util.concurrent.CopyOnWriteArrayList; -import java.util.logging.Level; -import java.util.logging.Logger; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.mylyn.internal.tasks.core.AbstractTask; -import org.eclipse.mylyn.internal.tasks.core.ITaskListChangeListener; -import org.eclipse.mylyn.internal.tasks.core.RepositoryModel; -import org.eclipse.mylyn.internal.tasks.core.RepositoryQuery; -import org.eclipse.mylyn.internal.tasks.core.TaskContainerDelta; -import org.eclipse.mylyn.internal.tasks.core.TaskList; -import org.eclipse.mylyn.internal.tasks.core.data.TaskDataManager; -import org.eclipse.mylyn.internal.tasks.core.sync.SynchronizeQueriesJob; -import org.eclipse.mylyn.internal.tasks.core.sync.SynchronizeTasksJob; -import org.eclipse.mylyn.tasks.core.AbstractRepositoryConnector; -import org.eclipse.mylyn.tasks.core.ITask; -import org.eclipse.mylyn.tasks.core.TaskRepository; -import org.netbeans.modules.team.commons.LogUtils; -import org.netbeans.modules.mylyn.util.BugtrackingCommand; -import org.netbeans.modules.mylyn.util.NbTask; -import org.netbeans.modules.mylyn.util.internal.Accessor; - -/** - * - * @author Ondrej Vrabec - */ -public class SynchronizeQueryCommand extends BugtrackingCommand { - private String stringValue; - private final TaskRepository taskRepository; - private final RepositoryQuery query; - private final IProgressMonitor monitor; - private final List listeners = new CopyOnWriteArrayList(); - private final TaskList taskList; - private final AbstractRepositoryConnector repositoryConnector; - private final RepositoryModel repositoryModel; - private final TaskDataManager taskDataManager; - private IStatus status; - - SynchronizeQueryCommand (RepositoryModel repositoryModel, - AbstractRepositoryConnector repositoryConnector, TaskRepository taskRepository, - TaskList taskList, TaskDataManager taskDataManager, RepositoryQuery query, IProgressMonitor monitor) - { - this.repositoryModel = repositoryModel; - this.repositoryConnector = repositoryConnector; - this.taskRepository = taskRepository; - this.taskList = taskList; - this.taskDataManager = taskDataManager; - this.query = query; - this.monitor = monitor; - } - - @Override - public void execute () throws CoreException, IOException, MalformedURLException { - LogUtils.logBugtrackingUsage(repositoryConnector.getConnectorKind(), "ISSUE_QUERY"); - final Accessor accessor = Accessor.getInstance(); - Logger log = Logger.getLogger(this.getClass().getName()); - if(log.isLoggable(Level.FINE)) { - log.log( - Level.FINE, - "executing SynchronizeQueryCommand for query {0}:{1}", //NOI18N - new Object[] { taskRepository.getUrl(), query.getSummary() }); - } - - SynchronizeQueriesJob job = new SynchronizeQueriesJob(taskList, taskDataManager, repositoryModel, - repositoryConnector, taskRepository, Collections.singleton(query)); - - final Set tasksToSynchronize = Collections.synchronizedSet(new HashSet()); - // in the end this will contain tasks removed from the query - final Set pendingToRefreshTasks = Collections.synchronizedSet(new HashSet()); - final Set toSync = new HashSet(); - ITaskListChangeListener list = new ITaskListChangeListener() { - @Override - public void containersChanged (Set deltas) { - for (TaskContainerDelta delta : deltas) { - if (query == delta.getElement() && delta.getKind() == TaskContainerDelta.Kind.CONTENT) { - if (!query.isSynchronizing()) { - // if sync ended -> fire event, and collect tasks to refresh - tasksToSynchronize.addAll(query.getChildren()); - // tasks newly added to the query - Set addedTasks = new HashSet(tasksToSynchronize); - addedTasks.removeAll(pendingToRefreshTasks); - // split tasks into tasks already present in the query -> tasksToSynchronize - // and tasks either removed or added to the query - tasksToSynchronize.removeAll(addedTasks); - pendingToRefreshTasks.removeAll(tasksToSynchronize); - pendingToRefreshTasks.addAll(addedTasks); - - toSync.addAll(tasksToSynchronize); - toSync.addAll(pendingToRefreshTasks); - Collection nbTasks = accessor.toNbTasks(toSync); - for (CommandProgressListener cmdList : listeners.toArray(new CommandProgressListener[0])) { - cmdList.tasksRefreshStarted(nbTasks); - } - } - } else if (delta.getElement() instanceof ITask) { - ITask task = (ITask) delta.getElement(); - if (delta.getKind() == TaskContainerDelta.Kind.CONTENT && task instanceof AbstractTask - && !((AbstractTask) task).isSynchronizing()) { - pendingToRefreshTasks.remove(task); - tasksToSynchronize.remove(task); - if (toSync.remove(task) && !monitor.isCanceled()) { - // task finished synchronize - for (CommandProgressListener cmdList : listeners.toArray(new CommandProgressListener[0])) { - cmdList.taskSynchronized(accessor.toNbTask(task)); - } - } - } else if (!delta.isTransient() && delta.getParent() == query) { - if (delta.getKind() == TaskContainerDelta.Kind.REMOVED) { - for (CommandProgressListener cmdList : listeners.toArray(new CommandProgressListener[0])) { - cmdList.taskRemoved(accessor.toNbTask(task)); - } - } else if (delta.getKind() == TaskContainerDelta.Kind.ADDED) { - for (CommandProgressListener cmdList : listeners.toArray(new CommandProgressListener[0])) { - cmdList.taskAdded(accessor.toNbTask(task)); - } - } - } - } - } - } - }; - taskList.addChangeListener(list); - try { - query.setSynchronizing(true); - pendingToRefreshTasks.addAll(query.getChildren()); - for (CommandProgressListener cmdList : listeners.toArray(new CommandProgressListener[0])) { - cmdList.queryRefreshStarted(accessor.toNbTasks(pendingToRefreshTasks)); - } - job.run(monitor); - status = query.getStatus(); - if (status != null && status.getSeverity() == IStatus.ERROR) { - if (status.getException() instanceof CoreException) { - throw (CoreException) status.getException(); - } else { - throw new CoreException(status); - } - } - if (monitor.isCanceled()) { - return; - } - // at this point caller was notified about modified tasks - // but not about unchanged tasks - for (ITask task : new ArrayList(tasksToSynchronize)) { - for (CommandProgressListener cmdList : listeners.toArray(new CommandProgressListener[0])) { - cmdList.taskSynchronized(accessor.toNbTask(task)); - } - } - // now refresh also tasks not yet refreshed but either removed or added to the query - if (!monitor.isCanceled() && !pendingToRefreshTasks.isEmpty()) { - HashSet tasks = new HashSet(pendingToRefreshTasks); - SynchronizeTasksJob syncTasksJob = new SynchronizeTasksJob(taskList, - taskDataManager, - repositoryModel, - repositoryConnector, - taskRepository, - tasks); - for (ITask t : tasks) { - if (t instanceof AbstractTask) { - ((AbstractTask) t).setSynchronizing(true); - } - } - syncTasksJob.run(monitor); - } - } finally { - taskList.removeChangeListener(list); - } - } - - @Override - public void cancel () { - monitor.setCanceled(true); - } - - @Override - public String toString () { - if(stringValue == null) { - StringBuilder sb = new StringBuilder() - .append("Synchronizing tasks ") //NOI18N - .append(query) - .append(",repository=") //NOI18N - .append(taskRepository.getUrl()) - .append("]"); //NOI18N - stringValue = sb.toString(); - } - return stringValue; - } - - public void addCommandProgressListener (CommandProgressListener list) { - listeners.add(list); - } - - public void removeCommandProgressListener (CommandProgressListener list) { - listeners.remove(list); - } - - public IStatus getStatus () { - return status; - } - - public static interface CommandProgressListener extends EventListener { - - public void queryRefreshStarted (Collection tasks); - - public void tasksRefreshStarted (Collection tasks); - - public void taskAdded (NbTask task); - - public void taskRemoved (NbTask task); - - public void taskSynchronized (NbTask task); - } -} diff --git a/ide/mylyn.util/src/org/netbeans/modules/mylyn/util/commands/SynchronizeTasksCommand.java b/ide/mylyn.util/src/org/netbeans/modules/mylyn/util/commands/SynchronizeTasksCommand.java deleted file mode 100644 index c30fee1963d4..000000000000 --- a/ide/mylyn.util/src/org/netbeans/modules/mylyn/util/commands/SynchronizeTasksCommand.java +++ /dev/null @@ -1,106 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.netbeans.modules.mylyn.util.commands; - -import java.io.IOException; -import java.net.MalformedURLException; -import java.util.Set; -import java.util.logging.Level; -import java.util.logging.Logger; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.mylyn.internal.tasks.core.RepositoryModel; -import org.eclipse.mylyn.internal.tasks.core.TaskList; -import org.eclipse.mylyn.internal.tasks.core.data.TaskDataManager; -import org.eclipse.mylyn.internal.tasks.core.sync.SynchronizeTasksJob; -import org.eclipse.mylyn.tasks.core.AbstractRepositoryConnector; -import org.eclipse.mylyn.tasks.core.ITask; -import org.eclipse.mylyn.tasks.core.TaskRepository; -import org.netbeans.modules.mylyn.util.BugtrackingCommand; -import org.netbeans.modules.mylyn.util.CancelableProgressMonitor; -import org.netbeans.modules.mylyn.util.NbTask; -import org.netbeans.modules.mylyn.util.internal.Accessor; - -/** - * - * @author Ondrej Vrabec - */ -public class SynchronizeTasksCommand extends BugtrackingCommand { - private String stringValue; - private final TaskRepository taskRepository; - private final Set tasks; - private final CancelableProgressMonitor monitor; - private final AbstractRepositoryConnector repositoryConnector; - private final TaskList taskList; - private final TaskDataManager taskDataManager; - private final RepositoryModel repositoryModel; - private final boolean user; - - SynchronizeTasksCommand (AbstractRepositoryConnector repositoryConnector, TaskRepository taskRepository, - RepositoryModel repositoryModel, TaskDataManager taskDataManager, TaskList taskList, - Set tasks, boolean isUserAction) { - this.repositoryConnector = repositoryConnector; - this.taskRepository = taskRepository; - this.repositoryModel = repositoryModel; - this.taskDataManager = taskDataManager; - this.taskList = taskList; - this.tasks = tasks; - this.monitor = new CancelableProgressMonitor(); - this.user = isUserAction; - } - - @Override - public void execute () throws CoreException, IOException, MalformedURLException { - Logger log = Logger.getLogger(this.getClass().getName()); - if(log.isLoggable(Level.FINE)) { - log.log( - Level.FINE, - "executing SynchronizeTasksCommand for tasks {0}:{1}", //NOI18N - new Object[] { taskRepository.getUrl(), tasks }); - } - Set mylynTasks = Accessor.getInstance().toMylynTasks(tasks); - SynchronizeTasksJob job = new SynchronizeTasksJob(taskList, - taskDataManager, - repositoryModel, - repositoryConnector, - taskRepository, - mylynTasks); - job.setUser(user); - job.run(monitor); - } - - @Override - public void cancel () { - monitor.setCanceled(true); - } - - @Override - public String toString () { - if(stringValue == null) { - StringBuilder sb = new StringBuilder() - .append("Synchronizing tasks ") //NOI18N - .append(tasks) - .append(",repository=") //NOI18N - .append(taskRepository.getUrl()) - .append("]"); //NOI18N - stringValue = sb.toString(); - } - return stringValue; - } - -} diff --git a/ide/mylyn.util/src/org/netbeans/modules/mylyn/util/internal/Accessor.java b/ide/mylyn.util/src/org/netbeans/modules/mylyn/util/internal/Accessor.java deleted file mode 100644 index 110d54ae898e..000000000000 --- a/ide/mylyn.util/src/org/netbeans/modules/mylyn/util/internal/Accessor.java +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.netbeans.modules.mylyn.util.internal; - -import java.util.Collection; -import java.util.Set; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.mylyn.tasks.core.ITask; -import org.eclipse.mylyn.tasks.core.TaskRepository; -import org.netbeans.modules.mylyn.util.MylynSupport; -import org.netbeans.modules.mylyn.util.NbTask; -import org.netbeans.modules.mylyn.util.NbTaskDataModel; - -/** - * - * @author Ondrej Vrabec - */ -public abstract class Accessor { - private static Accessor instance; - - public static boolean isInitialized () { - return instance != null; - } - - public static Accessor getInstance () { - MylynSupport.getInstance(); - return instance; - } - - public static void setInstance (Accessor instance) { - Accessor.instance = instance; - } - - public abstract void finishMylyn () throws CoreException; - - public abstract Collection toNbTasks (Set tasks); - - public abstract NbTask toNbTask (ITask task); - - public abstract Set toMylynTasks (Set tasks); - - public abstract ITask getITask (NbTaskDataModel model); - - public abstract TaskRepository getTaskRepositoryFor (ITask task); - - public abstract ITask getDelegate (NbTask task); - - public abstract NbTask getOrCreateTask (TaskRepository taskRepository, String taskId, boolean addToTasklist) throws CoreException; - - public abstract void taskModified (NbTask nbTask); - -} diff --git a/ide/mylyn.util/src/org/netbeans/modules/mylyn/util/internal/CommandsAccessor.java b/ide/mylyn.util/src/org/netbeans/modules/mylyn/util/internal/CommandsAccessor.java deleted file mode 100644 index 97a4ecd2badd..000000000000 --- a/ide/mylyn.util/src/org/netbeans/modules/mylyn/util/internal/CommandsAccessor.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.netbeans.modules.mylyn.util.internal; - -import org.eclipse.mylyn.internal.tasks.core.RepositoryModel; -import org.eclipse.mylyn.internal.tasks.core.TaskList; -import org.eclipse.mylyn.internal.tasks.core.TaskRepositoryManager; -import org.eclipse.mylyn.internal.tasks.core.data.TaskDataManager; -import org.netbeans.modules.mylyn.util.commands.CommandFactory; - -/** - * - * @author Ondrej Vrabec - */ -public abstract class CommandsAccessor { - - public static CommandsAccessor INSTANCE; - - static { - // invokes static initializer of CommandFactory.class - // that will assign value to the DEFAULT field above - Class c = CommandFactory.class; - try { - Class.forName(c.getName(), true, c.getClassLoader()); - } catch (ClassNotFoundException e) { - throw new IllegalStateException(e); - } - } - - public abstract CommandFactory getCommandFactory ( - TaskList taskList, - TaskDataManager taskDataManager, - TaskRepositoryManager taskRepositoryManager, - RepositoryModel repositoryModel); -} diff --git a/ide/mylyn.util/src/org/netbeans/modules/mylyn/util/internal/ModuleLifecycleManager.java b/ide/mylyn.util/src/org/netbeans/modules/mylyn/util/internal/ModuleLifecycleManager.java deleted file mode 100644 index dc388f92098c..000000000000 --- a/ide/mylyn.util/src/org/netbeans/modules/mylyn/util/internal/ModuleLifecycleManager.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.netbeans.modules.mylyn.util.internal; - -import org.openide.modules.ModuleInstall; - -/** - * - * @author Tomas Stupka - */ -public class ModuleLifecycleManager extends ModuleInstall { - - @Override - public boolean closing() { - if(!Accessor.isInitialized()) { - // haven't been initialized -> don't bother - return true; - } - try { - Accessor.getInstance().finishMylyn(); - } catch (Exception ex) { - - } - return true; - } - -} diff --git a/ide/mylyn.util/src/org/netbeans/modules/mylyn/util/internal/TaskListener.java b/ide/mylyn.util/src/org/netbeans/modules/mylyn/util/internal/TaskListener.java deleted file mode 100644 index e2cee139f096..000000000000 --- a/ide/mylyn.util/src/org/netbeans/modules/mylyn/util/internal/TaskListener.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.netbeans.modules.mylyn.util.internal; - -import java.util.EventListener; -import org.eclipse.mylyn.internal.tasks.core.TaskContainerDelta; -import org.eclipse.mylyn.tasks.core.ITask; - -/** - * - * @author Ondrej Vrabec - */ -public interface TaskListener extends EventListener { - - public void taskModified (ITask task, TaskContainerDelta delta); - -} diff --git a/ide/mylyn.util/src/org/netbeans/modules/mylyn/util/localtasks/AbstractLocalTask.java b/ide/mylyn.util/src/org/netbeans/modules/mylyn/util/localtasks/AbstractLocalTask.java deleted file mode 100644 index 87ca85b0dc9b..000000000000 --- a/ide/mylyn.util/src/org/netbeans/modules/mylyn/util/localtasks/AbstractLocalTask.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.netbeans.modules.mylyn.util.localtasks; - -import java.util.Date; -import org.netbeans.modules.mylyn.util.AbstractNbTaskWrapper; -import org.netbeans.modules.mylyn.util.NbTask; -import org.netbeans.modules.mylyn.util.internal.Accessor; - -/** - * - * @author Ondrej Vrabec - */ -public abstract class AbstractLocalTask extends AbstractNbTaskWrapper { - - public AbstractLocalTask (NbTask task) { - super(task); - } - - public final boolean finish () { - Accessor.getInstance().getDelegate(getNbTask()).setCompletionDate(new Date()); - Accessor.getInstance().taskModified(getNbTask()); - return true; - } - - public final boolean reopen () { - Accessor.getInstance().getDelegate(getNbTask()).setCompletionDate(null); - Accessor.getInstance().taskModified(getNbTask()); - return true; - } -} diff --git a/ide/mylyn.util/src/org/netbeans/modules/mylyn/util/localtasks/IssueField.java b/ide/mylyn.util/src/org/netbeans/modules/mylyn/util/localtasks/IssueField.java deleted file mode 100644 index b07435e35068..000000000000 --- a/ide/mylyn.util/src/org/netbeans/modules/mylyn/util/localtasks/IssueField.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.netbeans.modules.mylyn.util.localtasks; - -import org.netbeans.modules.mylyn.util.localtasks.internal.LocalTaskDataHandler; -import org.openide.util.NbBundle; - -/** - * - * @author Ondrej Vrabec - */ -@NbBundle.Messages({ - "LBL_IssueField.summary=Summary", - "LBL_IssueField.references=References", - "LBL_IssueField.attachments=Attachments" -}) -public final class IssueField { - - public static final IssueField SUMMARY = new IssueField(LocalTaskDataHandler.ATTRIBUTE_KEY_SUMMARY, Bundle.LBL_IssueField_summary()); - public static final IssueField ATTACHMENTS = new IssueField(LocalTaskDataHandler.ATTRIBUTE_KEY_NB_ATTACHMENTS, Bundle.LBL_IssueField_attachments()); - public static final IssueField REFERENCES = new IssueField(LocalTaskDataHandler.ATTRIBUTE_KEY_NB_REFERENCES, Bundle.LBL_IssueField_references()); - - private final String key; - private final String displayNameKey; - - IssueField (String key, String displayNameKey) { - this.key = key; - this.displayNameKey = displayNameKey; - } - - public String getKey () { - return key; - } - - public String getDisplayName () { - return displayNameKey; - } - -} diff --git a/ide/mylyn.util/src/org/netbeans/modules/mylyn/util/localtasks/internal/LocalTaskDataHandler.java b/ide/mylyn.util/src/org/netbeans/modules/mylyn/util/localtasks/internal/LocalTaskDataHandler.java deleted file mode 100644 index f1bd9a2e60f0..000000000000 --- a/ide/mylyn.util/src/org/netbeans/modules/mylyn/util/localtasks/internal/LocalTaskDataHandler.java +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.netbeans.modules.mylyn.util.localtasks.internal; - -import java.util.Set; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.mylyn.tasks.core.ITaskMapping; -import org.eclipse.mylyn.tasks.core.RepositoryResponse; -import org.eclipse.mylyn.tasks.core.TaskRepository; -import org.eclipse.mylyn.tasks.core.data.AbstractTaskDataHandler; -import org.eclipse.mylyn.tasks.core.data.TaskAttribute; -import org.eclipse.mylyn.tasks.core.data.TaskAttributeMapper; -import org.eclipse.mylyn.tasks.core.data.TaskData; - -/** - * - * @author Ondrej Vrabec - */ -public final class LocalTaskDataHandler extends AbstractTaskDataHandler { - public static final String ATTRIBUTE_KEY_SUMMARY = TaskAttribute.SUMMARY; - public static final String ATTRIBUTE_KEY_NB_ATTACHMENTS = "nb.attachments"; //NOI18N - public static final String ATTRIBUTE_KEY_NB_REFERENCES = "nb.taskreferences"; //NOI18N - private final TaskAttributeMapper mapper; - - public LocalTaskDataHandler (TaskRepository taskRepository) { - this.mapper = new TaskAttributeMapper(taskRepository); - } - - @Override - public RepositoryResponse postTaskData (TaskRepository repository, TaskData taskData, Set oldAttributes, IProgressMonitor monitor) throws CoreException { - return null; - } - - @Override - public boolean initializeTaskData (TaskRepository repository, TaskData data, ITaskMapping initializationData, IProgressMonitor monitor) throws CoreException { - TaskAttribute ta = data.getRoot().createAttribute(ATTRIBUTE_KEY_SUMMARY); - String value = initializationData.getSummary(); - if (value != null) { - ta.setValue(value); - } - data.getRoot().createAttribute(ATTRIBUTE_KEY_NB_ATTACHMENTS); - data.getRoot().createAttribute(ATTRIBUTE_KEY_NB_REFERENCES); - return true; - } - - @Override - public TaskAttributeMapper getAttributeMapper (TaskRepository repository) { - return mapper; - } - -} diff --git a/ide/mylyn.util/src/org/netbeans/modules/mylyn/util/resources/edit.png b/ide/mylyn.util/src/org/netbeans/modules/mylyn/util/resources/edit.png deleted file mode 100644 index 0fb0439ed495c47d075e5aaa397dec31902d5ed7..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 658 zcmV;D0&V??P)Z-2m=X&)D`LwNXP0@U^h=@&>=+H&LXWr zbSWYsYgZu%OFD)5kw_SHSY0p^C6sF2Houwa@a@{Fy92`v%=`a%|2OX`fS!8;jvC8Z zixMfH7yG(9Guwi?`}$pWVWsMx$$oc_pO3h}Soi2z+I9E!U#Qe-0BbEvtNE%KtmS|6 z=kGept9cUVn^_u2rmx4tw?Q8j0*pbFstORLC>GcG@v}f~>Mhxqy`ASPoyef z?!z$t(>tUlC&5?veh0B^D4tqmR5k#f!V^J@;7NF&pC0GkgRYXe0e=u;*&%Y#Q%o%~ z3SR09 zydUP{0yJHMqr0H~%ry?5Zl$HIov`uD7J#*AFZ>0CFg6QUPC#_;aiaShIMSG)wJotB zGG+_F8WRE(C=?U90} - - - - - - - - - - - - - - diff --git a/ide/mylyn.util/src/org/netbeans/modules/mylyn/util/resources/preview.png b/ide/mylyn.util/src/org/netbeans/modules/mylyn/util/resources/preview.png deleted file mode 100644 index 49bcfa4dc6d4dac7aa98399c531d59b67ea650f8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 788 zcmV+v1MB>WP)pa;Gj_?_SR z@IAl7SBVJ6Ph1dISQ14jtqXfg&(Y4|;sz1Ad(X*}r~fRg@h3CVe`7>K8_AV{A?fZt zcThwqNCQMs#Pg)TtY#DQWP%)C(x++9PBw0+96H)__F%z49$+n6sTGyY=1450Ni3w< zv3)x>mm4Yo8~__xv{uW`Kx>7cPSe+awWzL?G9qI0fN*7i>$=p})so3%05C=~JUj|u zfF*zpFb}Uz81%EUOICehw}0= zVx@+*L#<^&HhU`%u$Gu(h&cw&d(PIzEtHfhf*?gpdo?u;71T6T(9&K_5Tqz6RcvkC zLJ(wMcM1+-t^r`}>NUild3@b@htqvcl&x7u_o+qz9^L<)NB8n)@n;^XfBnh4gDAo^ z8rNu=oA%OwxsNy2*YbJCD4XjKGyZsv@yBy)u0PBd9k;1k_a-NMd;LGACc6<4+CJ`* zc|Rlbenw`!Ir;A9kR18uTlwLqF?pIy6>0G1i0s;XV50i1+7E$MN<{eJqtA-cXu}ZS zUnDi3oQlL6*Ksy2{Z>4*(ey84KYjvCi%3d|2ui7jmD0SF7q`F$k|Hu$Xm|lUcWUbd Saro;10000 - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/ide/mylyn.util/src/org/netbeans/modules/mylyn/util/wiki/WikiEditPanel.java b/ide/mylyn.util/src/org/netbeans/modules/mylyn/util/wiki/WikiEditPanel.java deleted file mode 100644 index 12d422443190..000000000000 --- a/ide/mylyn.util/src/org/netbeans/modules/mylyn/util/wiki/WikiEditPanel.java +++ /dev/null @@ -1,365 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.netbeans.modules.mylyn.util.wiki; - -import java.awt.EventQueue; -import java.awt.Point; -import java.awt.Rectangle; -import java.util.logging.Level; -import java.util.logging.Logger; -import javax.swing.ImageIcon; -import javax.swing.JLabel; -import javax.swing.JTextPane; -import javax.swing.SwingUtilities; -import javax.swing.event.CaretEvent; -import javax.swing.event.CaretListener; -import javax.swing.event.DocumentEvent; -import javax.swing.event.DocumentListener; -import javax.swing.text.BadLocationException; -import javax.swing.text.JTextComponent; -import org.netbeans.modules.bugtracking.commons.UIUtils; -import org.netbeans.modules.mylyn.util.WikiPanel; -import org.netbeans.modules.mylyn.util.WikiUtils; -import org.netbeans.modules.spellchecker.api.Spellchecker; -import org.openide.util.ImageUtilities; -import org.openide.util.NbBundle; - -/** - * - * @author jpeska - */ -public class WikiEditPanel extends WikiPanel { - - private String wikiFormatText; - private String wikiLanguage; - private String htmlFormatText; - private final boolean switchable; - private boolean editing; - private static final ImageIcon ICON_EDIT = ImageUtilities.loadImageIcon("org/netbeans/modules/mylyn/util/resources/edit.png", true); //NOI18N - private static final ImageIcon ICON_PREVIEW = ImageUtilities.loadImageIcon("org/netbeans/modules/mylyn/util/resources/preview.png", true); //NOI18N - private static final Logger LOG = Logger.getLogger("org.netbeans.mylyn.utils.WikiEditPanel"); //NOI18N - private static final String CONTENT_HTML = "text/html"; //NOI18N - private static final String CONTENT_PLAIN = "text/plain"; //NOI18N - - /** - * Creates new form WikiEditPanel - */ - public WikiEditPanel(String wikiLanguage, boolean editing, boolean switchable) { - this.wikiLanguage = wikiLanguage; - this.switchable = switchable; - this.wikiFormatText = ""; - this.htmlFormatText = ""; - initComponents(); - pnlButtons.setVisible(switchable); - textCode.getDocument().addDocumentListener(new RevalidatingListener()); - textPreview.getDocument().addDocumentListener(new RevalidatingListener()); - textCode.addCaretListener(new CaretListener() { - @Override - public void caretUpdate(CaretEvent e) { - makeCaretVisible(textCode); - } - }); - textCode.getDocument().addDocumentListener(new EnablingListener()); - // A11Y - Issues 163597 and 163598 - UIUtils.fixFocusTraversalKeys(textCode); - UIUtils.issue163946Hack(scrollCode); - - Spellchecker.register(textCode); - textPreview.putClientProperty(JTextPane.HONOR_DISPLAY_PROPERTIES, Boolean.TRUE); - - setEditing(editing); - } - - @Override - public String getWikiFormatText() { - return textCode.getText(); - } - - @Override - public void setWikiFormatText(String wikiFormatText) { - this.wikiFormatText = wikiFormatText; - String htmlText = - Boolean.getBoolean("bugtracking.noWikiStyle") - ? null - : WikiUtils.getHtmlFormatText(wikiFormatText, wikiLanguage); - - if (htmlText != null) { - this.htmlFormatText = htmlText; - textPreview.setContentType(CONTENT_HTML); - } else { - this.htmlFormatText = wikiFormatText; - textPreview.setContentType(CONTENT_PLAIN); - } - textCode.setText(wikiFormatText); - textPreview.setText(htmlFormatText); - this.repaint(); - } - - @Override - public JLabel getWarningLabel() { - return lblWarning; - } - - @Override - public void appendCodeText(String codeToAppend) { - setWikiFormatText(getWikiFormatText() + codeToAppend); - setEditing(true); - } - - @Override - public void clear() { - this.wikiFormatText = ""; - this.htmlFormatText = ""; - textCode.setText(wikiFormatText); - textPreview.setText(htmlFormatText); - this.repaint(); - } - - @Override - public void registerHighlights(JTextPane wikiPreviewPane) { } - - @Override - public JTextPane getPreviewPane() { - return textPreview; - } - - @Override - public JTextPane getCodePane() { - return textCode; - } - - /** - * This method is called from within the constructor to initialize the form. - * WARNING: Do NOT modify this code. The content of this method is always - * regenerated by the Form Editor. - */ - @SuppressWarnings("unchecked") - // //GEN-BEGIN:initComponents - private void initComponents() { - java.awt.GridBagConstraints gridBagConstraints; - - pnlButtons = new javax.swing.JPanel(); - btnEditPreview = new javax.swing.JButton(); - lblWarning = new javax.swing.JLabel(); - jPanel1 = new javax.swing.JPanel(); - scrollPreview = new javax.swing.JScrollPane(); - textPreview = new javax.swing.JTextPane(); - scrollCode = new javax.swing.JScrollPane(); - textCode = new javax.swing.JTextPane(); - - setOpaque(false); - setLayout(new java.awt.GridBagLayout()); - - pnlButtons.setOpaque(false); - - btnEditPreview.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/netbeans/modules/mylyn/util/resources/edit.png"))); // NOI18N - btnEditPreview.setVerticalAlignment(javax.swing.SwingConstants.BOTTOM); - btnEditPreview.addActionListener(new java.awt.event.ActionListener() { - public void actionPerformed(java.awt.event.ActionEvent evt) { - btnEditPreviewActionPerformed(evt); - } - }); - - lblWarning.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); - org.openide.awt.Mnemonics.setLocalizedText(lblWarning, NbBundle.getMessage(WikiEditPanel.class, "WikiEditPanel.lblWarning.text")); // NOI18N - - javax.swing.GroupLayout pnlButtonsLayout = new javax.swing.GroupLayout(pnlButtons); - pnlButtons.setLayout(pnlButtonsLayout); - pnlButtonsLayout.setHorizontalGroup( - pnlButtonsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) - .addGroup(javax.swing.GroupLayout.Alignment.LEADING, pnlButtonsLayout.createSequentialGroup() - .addComponent(btnEditPreview, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE) - .addGap(0, 0, Short.MAX_VALUE)) - .addComponent(lblWarning, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - ); - pnlButtonsLayout.setVerticalGroup( - pnlButtonsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(pnlButtonsLayout.createSequentialGroup() - .addComponent(btnEditPreview) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addComponent(lblWarning)) - ); - - gridBagConstraints = new java.awt.GridBagConstraints(); - gridBagConstraints.gridx = 1; - gridBagConstraints.gridy = 0; - gridBagConstraints.gridheight = java.awt.GridBagConstraints.REMAINDER; - gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; - gridBagConstraints.insets = new java.awt.Insets(0, 5, 0, 0); - add(pnlButtons, gridBagConstraints); - - jPanel1.setOpaque(false); - jPanel1.setLayout(new java.awt.GridBagLayout()); - - scrollPreview.setBorder(null); - scrollPreview.setVerticalScrollBarPolicy(javax.swing.ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER); - - textPreview.setEditable(false); - textPreview.setBorder(javax.swing.BorderFactory.createEmptyBorder() - ); - textPreview.setContentType("text/html"); // NOI18N - textPreview.setText(htmlFormatText); - textPreview.setMargin(new java.awt.Insets(0, 3, 3, 3)); - scrollPreview.setViewportView(textPreview); - - gridBagConstraints = new java.awt.GridBagConstraints(); - gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER; - gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; - gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTH; - gridBagConstraints.weightx = 1.0; - gridBagConstraints.weighty = 1.0; - gridBagConstraints.insets = new java.awt.Insets(1, 0, 11, 0); - jPanel1.add(scrollPreview, gridBagConstraints); - - scrollCode.setVerticalScrollBarPolicy(javax.swing.ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER); - - textCode.setText(wikiFormatText); - scrollCode.setViewportView(textCode); - - gridBagConstraints = new java.awt.GridBagConstraints(); - gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; - gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTH; - gridBagConstraints.weightx = 1.0; - gridBagConstraints.weighty = 1.0; - gridBagConstraints.insets = new java.awt.Insets(0, 0, 6, 0); - jPanel1.add(scrollCode, gridBagConstraints); - - gridBagConstraints = new java.awt.GridBagConstraints(); - gridBagConstraints.gridx = 0; - gridBagConstraints.gridy = 0; - gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; - gridBagConstraints.weightx = 0.1; - gridBagConstraints.weighty = 0.1; - add(jPanel1, gridBagConstraints); - }// //GEN-END:initComponents - - private void btnEditPreviewActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnEditPreviewActionPerformed - setEditing(!editing); - }//GEN-LAST:event_btnEditPreviewActionPerformed - // Variables declaration - do not modify//GEN-BEGIN:variables - private javax.swing.JButton btnEditPreview; - private javax.swing.JPanel jPanel1; - private javax.swing.JLabel lblWarning; - private javax.swing.JPanel pnlButtons; - private javax.swing.JScrollPane scrollCode; - private javax.swing.JScrollPane scrollPreview; - private javax.swing.JTextPane textCode; - private javax.swing.JTextPane textPreview; - // End of variables declaration//GEN-END:variables - - private void setEditing(boolean editing) { - - if (editing) { - btnEditPreview.setEnabled(textCode.getDocument().getLength() != 0); - btnEditPreview.setIcon(ICON_PREVIEW); - btnEditPreview.setToolTipText(NbBundle.getMessage(WikiEditPanel.class, "TOOL_Preview")); - textCode.setVisible(true); - scrollCode.setVisible(true); - - textPreview.setVisible(false); - scrollPreview.setVisible(false); - - textCode.requestFocus(); - } else { - btnEditPreview.setEnabled(true); - btnEditPreview.setIcon(ICON_EDIT); - btnEditPreview.setToolTipText(NbBundle.getMessage(WikiEditPanel.class, "TOOL_Edit")); - textPreview.setVisible(true); - scrollPreview.setVisible(true); - - textCode.setVisible(false); - scrollCode.setVisible(false); - if (this.editing != editing) { - setWikiFormatText(textCode.getText()); - } - } - this.editing = editing; - this.revalidate(); - this.repaint(); - } - - private void makeCaretVisible(JTextComponent textComponent) { - int pos = textComponent.getCaretPosition(); - try { - Rectangle rec = textComponent.getUI().modelToView(textComponent, pos); - if (rec != null) { - Point p = SwingUtilities.convertPoint(textComponent, rec.x, rec.y, this); - scrollRectToVisible(new Rectangle(p.x, p.y, rec.width, rec.height)); - } - } catch (BadLocationException blex) { - LOG.log(Level.INFO, blex.getMessage(), blex); - } - } - - private class EnablingListener implements DocumentListener { - - public EnablingListener() { - } - - @Override - public void insertUpdate(DocumentEvent e) { - checkButtonEnabled(e); - } - - @Override - public void removeUpdate(DocumentEvent e) { - checkButtonEnabled(e); - } - - @Override - public void changedUpdate(DocumentEvent e) { - checkButtonEnabled(e); - } - - private void checkButtonEnabled(DocumentEvent e) { - btnEditPreview.setEnabled(e.getDocument().getLength() != 0); - } - } - - private class RevalidatingListener implements DocumentListener, Runnable { - - private boolean ignoreUpdate; - - @Override - public void insertUpdate(DocumentEvent e) { - changedUpdate(e); - } - - @Override - public void removeUpdate(DocumentEvent e) { - changedUpdate(e); - } - - @Override - public void changedUpdate(DocumentEvent e) { - if (ignoreUpdate) { - return; - } - ignoreUpdate = true; - EventQueue.invokeLater(this); - } - - @Override - public void run() { - revalidate(); - repaint(); - ignoreUpdate = false; - } - } -} diff --git a/ide/o.apache.commons.httpclient/build.xml b/ide/o.apache.commons.httpclient/build.xml deleted file mode 100644 index 1e8e95ef869f..000000000000 --- a/ide/o.apache.commons.httpclient/build.xml +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - - - - - - - - - - - - - - diff --git a/ide/o.apache.commons.httpclient/external/binaries-list b/ide/o.apache.commons.httpclient/external/binaries-list deleted file mode 100644 index b96c89ace2df..000000000000 --- a/ide/o.apache.commons.httpclient/external/binaries-list +++ /dev/null @@ -1,17 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -964CD74171F427720480EFDEC40A7C7F6E58426A commons-httpclient:commons-httpclient:3.1 diff --git a/ide/o.apache.commons.httpclient/external/commons-httpclient-3.1-license.txt b/ide/o.apache.commons.httpclient/external/commons-httpclient-3.1-license.txt deleted file mode 100644 index a6e169567721..000000000000 --- a/ide/o.apache.commons.httpclient/external/commons-httpclient-3.1-license.txt +++ /dev/null @@ -1,208 +0,0 @@ -Name: Apache Commons HttpClient -Origin: Apache Software Foundation -Version: 3.1 -License: Apache-2.0 -Description: HTTP client -Origin: http://hc.apache.org/ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/ide/o.apache.commons.httpclient/external/commons-httpclient-3.1-notice.txt b/ide/o.apache.commons.httpclient/external/commons-httpclient-3.1-notice.txt deleted file mode 100644 index 152a7800c416..000000000000 --- a/ide/o.apache.commons.httpclient/external/commons-httpclient-3.1-notice.txt +++ /dev/null @@ -1,5 +0,0 @@ -Apache Jakarta HttpClient -Copyright 1999-2007 The Apache Software Foundation - -This product includes software developed by -The Apache Software Foundation (http://www.apache.org/). diff --git a/ide/o.apache.commons.httpclient/manifest.mf b/ide/o.apache.commons.httpclient/manifest.mf deleted file mode 100644 index 27a9844a5d85..000000000000 --- a/ide/o.apache.commons.httpclient/manifest.mf +++ /dev/null @@ -1,2 +0,0 @@ -OpenIDE-Module: org.apache.commons.httpclient -OpenIDE-Module-Specification-Version: 3.36 diff --git a/ide/o.apache.commons.httpclient/nbproject/project.properties b/ide/o.apache.commons.httpclient/nbproject/project.properties deleted file mode 100644 index 8788807f5c21..000000000000 --- a/ide/o.apache.commons.httpclient/nbproject/project.properties +++ /dev/null @@ -1,18 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -is.autoload=true -nbm.module.author=Tomas Stupka diff --git a/ide/o.apache.commons.httpclient/nbproject/project.xml b/ide/o.apache.commons.httpclient/nbproject/project.xml deleted file mode 100644 index 99e5932d5d86..000000000000 --- a/ide/o.apache.commons.httpclient/nbproject/project.xml +++ /dev/null @@ -1,51 +0,0 @@ - - - - org.netbeans.modules.apisupport.project - - - org.apache.commons.httpclient - - - org.apache.commons.codec - - - - - - org.apache.commons.logging - - - - - - - org-apache-commons-httpclient.jar - external/commons-httpclient-3.1.jar - - - - diff --git a/ide/o.apache.commons.lang/build.xml b/ide/o.apache.commons.lang/build.xml deleted file mode 100644 index e42b8ec180a2..000000000000 --- a/ide/o.apache.commons.lang/build.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/ide/o.apache.commons.lang/external/binaries-list b/ide/o.apache.commons.lang/external/binaries-list deleted file mode 100644 index dd6121416160..000000000000 --- a/ide/o.apache.commons.lang/external/binaries-list +++ /dev/null @@ -1,17 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -0CE1EDB914C94EBC388F086C6827E8BDEEC71AC2 commons-lang:commons-lang:2.6 diff --git a/ide/o.apache.commons.lang/external/commons-lang-2.6-license.txt b/ide/o.apache.commons.lang/external/commons-lang-2.6-license.txt deleted file mode 100644 index ac849e18dc89..000000000000 --- a/ide/o.apache.commons.lang/external/commons-lang-2.6-license.txt +++ /dev/null @@ -1,208 +0,0 @@ -Name: Apache Jakarta Commons Lang -Description: Provides a host of helper utilities for the java.lang API -Origin: Apache Software Foundation -Version: 2.6 -License: Apache-2.0 -URL: http://commons.apache.org/lang/ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/ide/o.apache.commons.lang/external/commons-lang-2.6-notice.txt b/ide/o.apache.commons.lang/external/commons-lang-2.6-notice.txt deleted file mode 100644 index aca5f7235322..000000000000 --- a/ide/o.apache.commons.lang/external/commons-lang-2.6-notice.txt +++ /dev/null @@ -1,6 +0,0 @@ -Apache Commons Lang -Copyright 2001-2011 The Apache Software Foundation - -This product includes software developed by -The Apache Software Foundation (http://www.apache.org/). - diff --git a/ide/o.apache.commons.lang/manifest.mf b/ide/o.apache.commons.lang/manifest.mf deleted file mode 100644 index 8dd4d3845ca8..000000000000 --- a/ide/o.apache.commons.lang/manifest.mf +++ /dev/null @@ -1 +0,0 @@ -OpenIDE-Module: org.apache.commons.lang diff --git a/ide/o.apache.commons.lang/nbproject/project.properties b/ide/o.apache.commons.lang/nbproject/project.properties deleted file mode 100644 index 44cae7fb453e..000000000000 --- a/ide/o.apache.commons.lang/nbproject/project.properties +++ /dev/null @@ -1,19 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -release.external/commons-lang-2.6.jar=modules/org-apache-commons-lang.jar -is.autoload=true -nbm.module.author=Tomas Stupka \ No newline at end of file diff --git a/ide/o.apache.commons.lang/nbproject/project.xml b/ide/o.apache.commons.lang/nbproject/project.xml deleted file mode 100644 index f85a08494fbb..000000000000 --- a/ide/o.apache.commons.lang/nbproject/project.xml +++ /dev/null @@ -1,35 +0,0 @@ - - - - org.netbeans.modules.apisupport.project - - - org.apache.commons.lang - - - - org-apache-commons-lang.jar - external/commons-lang-2.6.jar - - - - \ No newline at end of file diff --git a/ide/o.apache.ws.commons.util/build.xml b/ide/o.apache.ws.commons.util/build.xml deleted file mode 100644 index 287c05f18a0a..000000000000 --- a/ide/o.apache.ws.commons.util/build.xml +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - - - - - - - - - - - diff --git a/ide/o.apache.ws.commons.util/external/binaries-list b/ide/o.apache.ws.commons.util/external/binaries-list deleted file mode 100644 index 5ec47d82893a..000000000000 --- a/ide/o.apache.ws.commons.util/external/binaries-list +++ /dev/null @@ -1,17 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -126E80FF798FECE634BC94E61F8BE8A8DA00BE60 org.apache.ws.commons:ws-commons-util:1.0.1 diff --git a/ide/o.apache.ws.commons.util/external/ws-commons-util-1.0.1-license.txt b/ide/o.apache.ws.commons.util/external/ws-commons-util-1.0.1-license.txt deleted file mode 100644 index e7735d53ce2c..000000000000 --- a/ide/o.apache.ws.commons.util/external/ws-commons-util-1.0.1-license.txt +++ /dev/null @@ -1,208 +0,0 @@ -Name: Apache WS Common Utilities -Description: High performance XML processing based on SAX -Origin: Apache Software Foundation -Version: 1.0.1 -License: Apache-2.0 -URL: http://ws.apache.org/commons/util/ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/ide/o.apache.ws.commons.util/manifest.mf b/ide/o.apache.ws.commons.util/manifest.mf deleted file mode 100644 index 4212fc1d930f..000000000000 --- a/ide/o.apache.ws.commons.util/manifest.mf +++ /dev/null @@ -1 +0,0 @@ -OpenIDE-Module: org.apache.ws.commons.util diff --git a/ide/o.apache.ws.commons.util/nbproject/project.properties b/ide/o.apache.ws.commons.util/nbproject/project.properties deleted file mode 100644 index 8788807f5c21..000000000000 --- a/ide/o.apache.ws.commons.util/nbproject/project.properties +++ /dev/null @@ -1,18 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -is.autoload=true -nbm.module.author=Tomas Stupka diff --git a/ide/o.apache.ws.commons.util/nbproject/project.xml b/ide/o.apache.ws.commons.util/nbproject/project.xml deleted file mode 100644 index a69d46da79da..000000000000 --- a/ide/o.apache.ws.commons.util/nbproject/project.xml +++ /dev/null @@ -1,35 +0,0 @@ - - - - org.netbeans.modules.apisupport.project - - - org.apache.ws.commons.util - - - - org-apache-ws-commons-util.jar - external/ws-commons-util-1.0.1.jar - - - - diff --git a/ide/o.apache.xmlrpc/build.xml b/ide/o.apache.xmlrpc/build.xml deleted file mode 100644 index 8babd8b448c7..000000000000 --- a/ide/o.apache.xmlrpc/build.xml +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - - - - - - - - - - - - - - - diff --git a/ide/o.apache.xmlrpc/external/binaries-list b/ide/o.apache.xmlrpc/external/binaries-list deleted file mode 100644 index 116a9f5a1d01..000000000000 --- a/ide/o.apache.xmlrpc/external/binaries-list +++ /dev/null @@ -1,19 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -E486AD917028B52265610206FB5A1E2B5914B94B org.apache.xmlrpc:xmlrpc-client:3.1.3 -415DAF1F1473A947452588906DC9F5B3575FB44D org.apache.xmlrpc:xmlrpc-common:3.1.3 -E4DDF1852CB162139230EF733223633E362CF301 org.apache.xmlrpc:xmlrpc-server:3.1.3 diff --git a/ide/o.apache.xmlrpc/external/xmlrpc-3.1.3-license.txt b/ide/o.apache.xmlrpc/external/xmlrpc-3.1.3-license.txt deleted file mode 100644 index b40f16abd200..000000000000 --- a/ide/o.apache.xmlrpc/external/xmlrpc-3.1.3-license.txt +++ /dev/null @@ -1,209 +0,0 @@ -Name: Apache XMLRPC -Description: Java implementation of XML-RPC -Origin: Apache Software Foundation -Version: 3.1.3 -License: Apache-2.0 -URL: https://ws.apache.org/xmlrpc/index.html -Files: xmlrpc-client-3.1.3.jar, xmlrpc-common-3.1.3.jar, xmlrpc-server-3.1.3.jar - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/ide/o.apache.xmlrpc/manifest.mf b/ide/o.apache.xmlrpc/manifest.mf deleted file mode 100644 index 27ed188b68cf..000000000000 --- a/ide/o.apache.xmlrpc/manifest.mf +++ /dev/null @@ -1 +0,0 @@ -OpenIDE-Module: org.apache.xmlrpc diff --git a/ide/o.apache.xmlrpc/nbproject/project.properties b/ide/o.apache.xmlrpc/nbproject/project.properties deleted file mode 100644 index bcbd9b136cae..000000000000 --- a/ide/o.apache.xmlrpc/nbproject/project.properties +++ /dev/null @@ -1,20 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -is.autoload=true -javac.source=1.8 -javac.compilerargs=-Xlint -Xlint:-serial -nbm.module.author=Tomas Stupka diff --git a/ide/o.apache.xmlrpc/nbproject/project.xml b/ide/o.apache.xmlrpc/nbproject/project.xml deleted file mode 100644 index cac15c6c04ef..000000000000 --- a/ide/o.apache.xmlrpc/nbproject/project.xml +++ /dev/null @@ -1,50 +0,0 @@ - - - - org.netbeans.modules.apisupport.project - - - org.apache.xmlrpc - - - org.apache.commons.httpclient - - - - - org.apache.ws.commons.util - - - - - org.apache.commons.logging - - - - - - - org-apache-xmlrpc.jar - - - - diff --git a/ide/o.eclipse.mylyn.bugzilla.core/build.xml b/ide/o.eclipse.mylyn.bugzilla.core/build.xml deleted file mode 100644 index 7541104adabd..000000000000 --- a/ide/o.eclipse.mylyn.bugzilla.core/build.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/ide/o.eclipse.mylyn.bugzilla.core/external/binaries-list b/ide/o.eclipse.mylyn.bugzilla.core/external/binaries-list deleted file mode 100644 index be40d27a66cb..000000000000 --- a/ide/o.eclipse.mylyn.bugzilla.core/external/binaries-list +++ /dev/null @@ -1,17 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -8E2776DE17446EC7450285F19F2C6366117748A8 org.eclipse.mylyn.bugzilla.core_3.17.0.v20150828-2026.jar diff --git a/ide/o.eclipse.mylyn.bugzilla.core/external/org.eclipse.mylyn.bugzilla.core_3.17.0.v20150828-2026-license.txt b/ide/o.eclipse.mylyn.bugzilla.core/external/org.eclipse.mylyn.bugzilla.core_3.17.0.v20150828-2026-license.txt deleted file mode 100644 index e69c340b87a4..000000000000 --- a/ide/o.eclipse.mylyn.bugzilla.core/external/org.eclipse.mylyn.bugzilla.core_3.17.0.v20150828-2026-license.txt +++ /dev/null @@ -1,72 +0,0 @@ -Name: Mylyn Bugzilla Connector -Origin: Eclipse -Version: 3.17 -License: EPL-v10 -URL: http://www.eclipse.org/mylyn -Description: Mylyn Bugzilla Connector library - -Eclipse Public License - v 1.0 - -THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT. - -1. DEFINITIONS - -"Contribution" means: - -a) in the case of the initial Contributor, the initial code and documentation distributed under this Agreement, and -b) in the case of each subsequent Contributor: - -i) changes to the Program, and -ii) additions to the Program; - -where such changes and/or additions to the Program originate from and are distributed by that particular Contributor. A Contribution 'originates' from a Contributor if it was added to the Program by such Contributor itself or anyone acting on such Contributor's behalf. Contributions do not include additions to the Program which: (i) are separate modules of software distributed in conjunction with the Program under their own license agreement, and (ii) are not derivative works of the Program. -"Contributor" means any person or entity that distributes the Program. -"Licensed Patents" mean patent claims licensable by a Contributor which are necessarily infringed by the use or sale of its Contribution alone or when combined with the Program. -"Program" means the Contributions distributed in accordance with this Agreement. -"Recipient" means anyone who receives the Program under this Agreement, including all Contributors. - -2. GRANT OF RIGHTS - -a) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free copyright license to reproduce, prepare derivative works of, publicly display, publicly perform, distribute and sublicense the Contribution of such Contributor, if any, and such derivative works, in source code and object code form. -b) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free patent license under Licensed Patents to make, use, sell, offer to sell, import and otherwise transfer the Contribution of such Contributor, if any, in source code and object code form. This patent license shall apply to the combination of the Contribution and the Program if, at the time the Contribution is added by the Contributor, such addition of the Contribution causes such combination to be covered by the Licensed Patents. The patent license shall not apply to any other combinations which include the Contribution. No hardware per se is licensed hereunder. -c) Recipient understands that although each Contributor grants the licenses to its Contributions set forth herein, no assurances are provided by any Contributor that the Program does not infringe the patent or other intellectual property rights of any other entity. Each Contributor disclaims any liability to Recipient for claims brought by any other entity based on infringement of intellectual property rights or otherwise. As a condition to exercising the rights and licenses granted hereunder, each Recipient hereby assumes sole responsibility to secure any other intellectual property rights needed, if any. For example, if a third party patent license is required to allow Recipient to distribute the Program, it is Recipient's responsibility to acquire that license before distributing the Program. -d) Each Contributor represents that to its knowledge it has sufficient copyright rights in its Contribution, if any, to grant the copyright license set forth in this Agreement. - -3. REQUIREMENTS - -A Contributor may choose to distribute the Program in object code form under its own license agreement, provided that: -a) it complies with the terms and conditions of this Agreement; and -b) its license agreement: -i) effectively disclaims on behalf of all Contributors all warranties and conditions, express and implied, including warranties or conditions of title and non-infringement, and implied warranties or conditions of merchantability and fitness for a particular purpose; -ii) effectively excludes on behalf of all Contributors all liability for damages, including direct, indirect, special, incidental and consequential damages, such as lost profits; -iii) states that any provisions which differ from this Agreement are offered by that Contributor alone and not by any other party; and -iv) states that source code for the Program is available from such Contributor, and informs licensees how to obtain it in a reasonable manner on or through a medium customarily used for software exchange. - -When the Program is made available in source code form: -a) it must be made available under this Agreement; and -b) a copy of this Agreement must be included with each copy of the Program. - -Contributors may not remove or alter any copyright notices contained within the Program. -Each Contributor must identify itself as the originator of its Contribution, if any, in a manner that reasonably allows subsequent Recipients to identify the originator of the Contribution. - -4. COMMERCIAL DISTRIBUTION - -Commercial distributors of software may accept certain responsibilities with respect to end users, business partners and the like. While this license is intended to facilitate the commercial use of the Program, the Contributor who includes the Program in a commercial product offering should do so in a manner which does not create potential liability for other Contributors. Therefore, if a Contributor includes the Program in a commercial product offering, such Contributor ("Commercial Contributor") hereby agrees to defend and indemnify every other Contributor ("Indemnified Contributor") against any losses, damages and costs (collectively "Losses") arising from claims, lawsuits and other legal actions brought by a third party against the Indemnified Contributor to the extent caused by the acts or omissions of such Commercial Contributor in connection with its distribution of the Program in a commercial product offering. The obligations in this section do not apply to any claims or Losses relating to any actual or alleged intellectual property infringement. In order to qualify, an Indemnified Contributor must: a) promptly notify the Commercial Contributor in writing of such claim, and b) allow the Commercial Contributor to control, and cooperate with the Commercial Contributor in, the defense and any related settlement negotiations. The Indemnified Contributor may participate in any such claim at its own expense. - -For example, a Contributor might include the Program in a commercial product offering, Product X. That Contributor is then a Commercial Contributor. If that Commercial Contributor then makes performance claims, or offers warranties related to Product X, those performance claims and warranties are such Commercial Contributor's responsibility alone. Under this section, the Commercial Contributor would have to defend claims against the other Contributors related to those performance claims and warranties, and if a court requires any other Contributor to pay any damages as a result, the Commercial Contributor must pay those damages. - -5. NO WARRANTY - -EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely responsible for determining the appropriateness of using and distributing the Program and assumes all risks associated with its exercise of rights under this Agreement , including but not limited to the risks and costs of program errors, compliance with applicable laws, damage to or loss of data, programs or equipment, and unavailability or interruption of operations. - -6. DISCLAIMER OF LIABILITY - -EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - -7. GENERAL - -If any provision of this Agreement is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this Agreement, and without further action by the parties hereto, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable. -If Recipient institutes patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Program itself (excluding combinations of the Program with other software or hardware) infringes such Recipient's patent(s), then such Recipient's rights granted under Section 2(b) shall terminate as of the date such litigation is filed. -All Recipient's rights under this Agreement shall terminate if it fails to comply with any of the material terms or conditions of this Agreement and does not cure such failure in a reasonable period of time after becoming aware of such noncompliance. If all Recipient's rights under this Agreement terminate, Recipient agrees to cease use and distribution of the Program as soon as reasonably practicable. However, Recipient's obligations under this Agreement and any licenses granted by Recipient relating to the Program shall continue and survive. -Everyone is permitted to copy and distribute copies of this Agreement, but in order to avoid inconsistency the Agreement is copyrighted and may only be modified in the following manner. The Agreement Steward reserves the right to publish new versions (including revisions) of this Agreement from time to time. No one other than the Agreement Steward has the right to modify this Agreement. The Eclipse Foundation is the initial Agreement Steward. The Eclipse Foundation may assign the responsibility to serve as the Agreement Steward to a suitable separate entity. Each new version of the Agreement will be given a distinguishing version number. The Program (including Contributions) may always be distributed subject to the version of the Agreement under which it was received. In addition, after a new version of the Agreement is published, Contributor may elect to distribute the Program (including its Contributions) under the new version. Except as expressly stated in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to the intellectual property of any Contributor under this Agreement, whether expressly, by implication, estoppel or otherwise. All rights in the Program not expressly granted under this Agreement are reserved. -This Agreement is governed by the laws of the State of New York and the intellectual property laws of the United States of America. No party to this Agreement will bring a legal action under this Agreement more than one year after the cause of action arose. Each party waives its rights to a jury trial in any resulting litigation. diff --git a/ide/o.eclipse.mylyn.bugzilla.core/manifest.mf b/ide/o.eclipse.mylyn.bugzilla.core/manifest.mf deleted file mode 100644 index 93dbc394d9a1..000000000000 --- a/ide/o.eclipse.mylyn.bugzilla.core/manifest.mf +++ /dev/null @@ -1 +0,0 @@ -OpenIDE-Module: org.eclipse.mylyn.bugzilla.core \ No newline at end of file diff --git a/ide/o.eclipse.mylyn.bugzilla.core/nbproject/project.properties b/ide/o.eclipse.mylyn.bugzilla.core/nbproject/project.properties deleted file mode 100644 index be6d527895c5..000000000000 --- a/ide/o.eclipse.mylyn.bugzilla.core/nbproject/project.properties +++ /dev/null @@ -1,19 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -release.external/org.eclipse.mylyn.bugzilla.core_3.17.0.v20150828-2026.jar=modules/org-eclipse-mylyn-bugzilla-core.jar -is.autoload=true -nbm.module.author=Tomas Stupka \ No newline at end of file diff --git a/ide/o.eclipse.mylyn.bugzilla.core/nbproject/project.xml b/ide/o.eclipse.mylyn.bugzilla.core/nbproject/project.xml deleted file mode 100644 index 7b396f48f448..000000000000 --- a/ide/o.eclipse.mylyn.bugzilla.core/nbproject/project.xml +++ /dev/null @@ -1,35 +0,0 @@ - - - - org.netbeans.modules.apisupport.project - - - org.eclipse.mylyn.bugzilla.core - - - - org-eclipse-mylyn-bugzilla-core.jar - external/org.eclipse.mylyn.bugzilla.core_3.17.0.v20150828-2026.jar - - - - \ No newline at end of file diff --git a/ide/o.eclipse.mylyn.commons.core/build.xml b/ide/o.eclipse.mylyn.commons.core/build.xml deleted file mode 100644 index 513baed0cc26..000000000000 --- a/ide/o.eclipse.mylyn.commons.core/build.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/ide/o.eclipse.mylyn.commons.core/external/binaries-list b/ide/o.eclipse.mylyn.commons.core/external/binaries-list deleted file mode 100644 index 7fde2f2557d5..000000000000 --- a/ide/o.eclipse.mylyn.commons.core/external/binaries-list +++ /dev/null @@ -1,17 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -D4F2BE52B5C048158B5C046C0ACAC3965027FE12 org.eclipse.mylyn.commons.core_3.17.0.v20150625-2042.jar diff --git a/ide/o.eclipse.mylyn.commons.core/external/org.eclipse.mylyn.commons.core_3.17.0.v20150625-2042-license.txt b/ide/o.eclipse.mylyn.commons.core/external/org.eclipse.mylyn.commons.core_3.17.0.v20150625-2042-license.txt deleted file mode 100644 index 54a3278d1668..000000000000 --- a/ide/o.eclipse.mylyn.commons.core/external/org.eclipse.mylyn.commons.core_3.17.0.v20150625-2042-license.txt +++ /dev/null @@ -1,72 +0,0 @@ -Name: Eclipse Mylyn Commons Core library -Origin: Eclipse -Version: 3.17 -License: EPL-v10 -URL: http://www.eclipse.org/mylyn/ -Description: Eclipse Mylyn Commons Core library - -Eclipse Public License - v 1.0 - -THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT. - -1. DEFINITIONS - -"Contribution" means: - -a) in the case of the initial Contributor, the initial code and documentation distributed under this Agreement, and -b) in the case of each subsequent Contributor: - -i) changes to the Program, and -ii) additions to the Program; - -where such changes and/or additions to the Program originate from and are distributed by that particular Contributor. A Contribution 'originates' from a Contributor if it was added to the Program by such Contributor itself or anyone acting on such Contributor's behalf. Contributions do not include additions to the Program which: (i) are separate modules of software distributed in conjunction with the Program under their own license agreement, and (ii) are not derivative works of the Program. -"Contributor" means any person or entity that distributes the Program. -"Licensed Patents" mean patent claims licensable by a Contributor which are necessarily infringed by the use or sale of its Contribution alone or when combined with the Program. -"Program" means the Contributions distributed in accordance with this Agreement. -"Recipient" means anyone who receives the Program under this Agreement, including all Contributors. - -2. GRANT OF RIGHTS - -a) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free copyright license to reproduce, prepare derivative works of, publicly display, publicly perform, distribute and sublicense the Contribution of such Contributor, if any, and such derivative works, in source code and object code form. -b) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free patent license under Licensed Patents to make, use, sell, offer to sell, import and otherwise transfer the Contribution of such Contributor, if any, in source code and object code form. This patent license shall apply to the combination of the Contribution and the Program if, at the time the Contribution is added by the Contributor, such addition of the Contribution causes such combination to be covered by the Licensed Patents. The patent license shall not apply to any other combinations which include the Contribution. No hardware per se is licensed hereunder. -c) Recipient understands that although each Contributor grants the licenses to its Contributions set forth herein, no assurances are provided by any Contributor that the Program does not infringe the patent or other intellectual property rights of any other entity. Each Contributor disclaims any liability to Recipient for claims brought by any other entity based on infringement of intellectual property rights or otherwise. As a condition to exercising the rights and licenses granted hereunder, each Recipient hereby assumes sole responsibility to secure any other intellectual property rights needed, if any. For example, if a third party patent license is required to allow Recipient to distribute the Program, it is Recipient's responsibility to acquire that license before distributing the Program. -d) Each Contributor represents that to its knowledge it has sufficient copyright rights in its Contribution, if any, to grant the copyright license set forth in this Agreement. - -3. REQUIREMENTS - -A Contributor may choose to distribute the Program in object code form under its own license agreement, provided that: -a) it complies with the terms and conditions of this Agreement; and -b) its license agreement: -i) effectively disclaims on behalf of all Contributors all warranties and conditions, express and implied, including warranties or conditions of title and non-infringement, and implied warranties or conditions of merchantability and fitness for a particular purpose; -ii) effectively excludes on behalf of all Contributors all liability for damages, including direct, indirect, special, incidental and consequential damages, such as lost profits; -iii) states that any provisions which differ from this Agreement are offered by that Contributor alone and not by any other party; and -iv) states that source code for the Program is available from such Contributor, and informs licensees how to obtain it in a reasonable manner on or through a medium customarily used for software exchange. - -When the Program is made available in source code form: -a) it must be made available under this Agreement; and -b) a copy of this Agreement must be included with each copy of the Program. - -Contributors may not remove or alter any copyright notices contained within the Program. -Each Contributor must identify itself as the originator of its Contribution, if any, in a manner that reasonably allows subsequent Recipients to identify the originator of the Contribution. - -4. COMMERCIAL DISTRIBUTION - -Commercial distributors of software may accept certain responsibilities with respect to end users, business partners and the like. While this license is intended to facilitate the commercial use of the Program, the Contributor who includes the Program in a commercial product offering should do so in a manner which does not create potential liability for other Contributors. Therefore, if a Contributor includes the Program in a commercial product offering, such Contributor ("Commercial Contributor") hereby agrees to defend and indemnify every other Contributor ("Indemnified Contributor") against any losses, damages and costs (collectively "Losses") arising from claims, lawsuits and other legal actions brought by a third party against the Indemnified Contributor to the extent caused by the acts or omissions of such Commercial Contributor in connection with its distribution of the Program in a commercial product offering. The obligations in this section do not apply to any claims or Losses relating to any actual or alleged intellectual property infringement. In order to qualify, an Indemnified Contributor must: a) promptly notify the Commercial Contributor in writing of such claim, and b) allow the Commercial Contributor to control, and cooperate with the Commercial Contributor in, the defense and any related settlement negotiations. The Indemnified Contributor may participate in any such claim at its own expense. - -For example, a Contributor might include the Program in a commercial product offering, Product X. That Contributor is then a Commercial Contributor. If that Commercial Contributor then makes performance claims, or offers warranties related to Product X, those performance claims and warranties are such Commercial Contributor's responsibility alone. Under this section, the Commercial Contributor would have to defend claims against the other Contributors related to those performance claims and warranties, and if a court requires any other Contributor to pay any damages as a result, the Commercial Contributor must pay those damages. - -5. NO WARRANTY - -EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely responsible for determining the appropriateness of using and distributing the Program and assumes all risks associated with its exercise of rights under this Agreement , including but not limited to the risks and costs of program errors, compliance with applicable laws, damage to or loss of data, programs or equipment, and unavailability or interruption of operations. - -6. DISCLAIMER OF LIABILITY - -EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - -7. GENERAL - -If any provision of this Agreement is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this Agreement, and without further action by the parties hereto, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable. -If Recipient institutes patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Program itself (excluding combinations of the Program with other software or hardware) infringes such Recipient's patent(s), then such Recipient's rights granted under Section 2(b) shall terminate as of the date such litigation is filed. -All Recipient's rights under this Agreement shall terminate if it fails to comply with any of the material terms or conditions of this Agreement and does not cure such failure in a reasonable period of time after becoming aware of such noncompliance. If all Recipient's rights under this Agreement terminate, Recipient agrees to cease use and distribution of the Program as soon as reasonably practicable. However, Recipient's obligations under this Agreement and any licenses granted by Recipient relating to the Program shall continue and survive. -Everyone is permitted to copy and distribute copies of this Agreement, but in order to avoid inconsistency the Agreement is copyrighted and may only be modified in the following manner. The Agreement Steward reserves the right to publish new versions (including revisions) of this Agreement from time to time. No one other than the Agreement Steward has the right to modify this Agreement. The Eclipse Foundation is the initial Agreement Steward. The Eclipse Foundation may assign the responsibility to serve as the Agreement Steward to a suitable separate entity. Each new version of the Agreement will be given a distinguishing version number. The Program (including Contributions) may always be distributed subject to the version of the Agreement under which it was received. In addition, after a new version of the Agreement is published, Contributor may elect to distribute the Program (including its Contributions) under the new version. Except as expressly stated in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to the intellectual property of any Contributor under this Agreement, whether expressly, by implication, estoppel or otherwise. All rights in the Program not expressly granted under this Agreement are reserved. -This Agreement is governed by the laws of the State of New York and the intellectual property laws of the United States of America. No party to this Agreement will bring a legal action under this Agreement more than one year after the cause of action arose. Each party waives its rights to a jury trial in any resulting litigation. diff --git a/ide/o.eclipse.mylyn.commons.core/manifest.mf b/ide/o.eclipse.mylyn.commons.core/manifest.mf deleted file mode 100644 index 2d65da68ae86..000000000000 --- a/ide/o.eclipse.mylyn.commons.core/manifest.mf +++ /dev/null @@ -1 +0,0 @@ -OpenIDE-Module: org.eclipse.mylyn.commons.core \ No newline at end of file diff --git a/ide/o.eclipse.mylyn.commons.core/nbproject/project.properties b/ide/o.eclipse.mylyn.commons.core/nbproject/project.properties deleted file mode 100644 index b5198b262cc5..000000000000 --- a/ide/o.eclipse.mylyn.commons.core/nbproject/project.properties +++ /dev/null @@ -1,19 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -release.external/org.eclipse.mylyn.commons.core_3.17.0.v20150625-2042.jar=modules/org-eclipse-mylyn-commons-core.jar -is.autoload=true -nbm.module.author=Tomas Stupka \ No newline at end of file diff --git a/ide/o.eclipse.mylyn.commons.core/nbproject/project.xml b/ide/o.eclipse.mylyn.commons.core/nbproject/project.xml deleted file mode 100644 index 05bb66c90549..000000000000 --- a/ide/o.eclipse.mylyn.commons.core/nbproject/project.xml +++ /dev/null @@ -1,35 +0,0 @@ - - - - org.netbeans.modules.apisupport.project - - - org.eclipse.mylyn.commons.core - - - - org-eclipse-mylyn-commons-core.jar - external/org.eclipse.mylyn.commons.core_3.17.0.v20150625-2042.jar - - - - \ No newline at end of file diff --git a/ide/o.eclipse.mylyn.commons.net/build.xml b/ide/o.eclipse.mylyn.commons.net/build.xml deleted file mode 100644 index 883a1aafa10d..000000000000 --- a/ide/o.eclipse.mylyn.commons.net/build.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/ide/o.eclipse.mylyn.commons.net/external/binaries-list b/ide/o.eclipse.mylyn.commons.net/external/binaries-list deleted file mode 100644 index 5cf013a344a5..000000000000 --- a/ide/o.eclipse.mylyn.commons.net/external/binaries-list +++ /dev/null @@ -1,17 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -4C753A9D8AB768A55EC99A377A0D22EDA67BAE25 org.eclipse.mylyn.commons.net_3.17.0.v20150706-2057.jar diff --git a/ide/o.eclipse.mylyn.commons.net/external/org.eclipse.mylyn.commons.net_3.17.0.v20150706-2057-license.txt b/ide/o.eclipse.mylyn.commons.net/external/org.eclipse.mylyn.commons.net_3.17.0.v20150706-2057-license.txt deleted file mode 100644 index 7786b0eb5098..000000000000 --- a/ide/o.eclipse.mylyn.commons.net/external/org.eclipse.mylyn.commons.net_3.17.0.v20150706-2057-license.txt +++ /dev/null @@ -1,72 +0,0 @@ -Name: Mylyn Commons NET library -Origin: Eclipse -Version: 3.17 -License: EPL-v10 -URL: http://www.eclipse.org/mylyn/ -Description: Mylyn Commons NET library - -Eclipse Public License - v 1.0 - -THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT. - -1. DEFINITIONS - -"Contribution" means: - -a) in the case of the initial Contributor, the initial code and documentation distributed under this Agreement, and -b) in the case of each subsequent Contributor: - -i) changes to the Program, and -ii) additions to the Program; - -where such changes and/or additions to the Program originate from and are distributed by that particular Contributor. A Contribution 'originates' from a Contributor if it was added to the Program by such Contributor itself or anyone acting on such Contributor's behalf. Contributions do not include additions to the Program which: (i) are separate modules of software distributed in conjunction with the Program under their own license agreement, and (ii) are not derivative works of the Program. -"Contributor" means any person or entity that distributes the Program. -"Licensed Patents" mean patent claims licensable by a Contributor which are necessarily infringed by the use or sale of its Contribution alone or when combined with the Program. -"Program" means the Contributions distributed in accordance with this Agreement. -"Recipient" means anyone who receives the Program under this Agreement, including all Contributors. - -2. GRANT OF RIGHTS - -a) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free copyright license to reproduce, prepare derivative works of, publicly display, publicly perform, distribute and sublicense the Contribution of such Contributor, if any, and such derivative works, in source code and object code form. -b) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free patent license under Licensed Patents to make, use, sell, offer to sell, import and otherwise transfer the Contribution of such Contributor, if any, in source code and object code form. This patent license shall apply to the combination of the Contribution and the Program if, at the time the Contribution is added by the Contributor, such addition of the Contribution causes such combination to be covered by the Licensed Patents. The patent license shall not apply to any other combinations which include the Contribution. No hardware per se is licensed hereunder. -c) Recipient understands that although each Contributor grants the licenses to its Contributions set forth herein, no assurances are provided by any Contributor that the Program does not infringe the patent or other intellectual property rights of any other entity. Each Contributor disclaims any liability to Recipient for claims brought by any other entity based on infringement of intellectual property rights or otherwise. As a condition to exercising the rights and licenses granted hereunder, each Recipient hereby assumes sole responsibility to secure any other intellectual property rights needed, if any. For example, if a third party patent license is required to allow Recipient to distribute the Program, it is Recipient's responsibility to acquire that license before distributing the Program. -d) Each Contributor represents that to its knowledge it has sufficient copyright rights in its Contribution, if any, to grant the copyright license set forth in this Agreement. - -3. REQUIREMENTS - -A Contributor may choose to distribute the Program in object code form under its own license agreement, provided that: -a) it complies with the terms and conditions of this Agreement; and -b) its license agreement: -i) effectively disclaims on behalf of all Contributors all warranties and conditions, express and implied, including warranties or conditions of title and non-infringement, and implied warranties or conditions of merchantability and fitness for a particular purpose; -ii) effectively excludes on behalf of all Contributors all liability for damages, including direct, indirect, special, incidental and consequential damages, such as lost profits; -iii) states that any provisions which differ from this Agreement are offered by that Contributor alone and not by any other party; and -iv) states that source code for the Program is available from such Contributor, and informs licensees how to obtain it in a reasonable manner on or through a medium customarily used for software exchange. - -When the Program is made available in source code form: -a) it must be made available under this Agreement; and -b) a copy of this Agreement must be included with each copy of the Program. - -Contributors may not remove or alter any copyright notices contained within the Program. -Each Contributor must identify itself as the originator of its Contribution, if any, in a manner that reasonably allows subsequent Recipients to identify the originator of the Contribution. - -4. COMMERCIAL DISTRIBUTION - -Commercial distributors of software may accept certain responsibilities with respect to end users, business partners and the like. While this license is intended to facilitate the commercial use of the Program, the Contributor who includes the Program in a commercial product offering should do so in a manner which does not create potential liability for other Contributors. Therefore, if a Contributor includes the Program in a commercial product offering, such Contributor ("Commercial Contributor") hereby agrees to defend and indemnify every other Contributor ("Indemnified Contributor") against any losses, damages and costs (collectively "Losses") arising from claims, lawsuits and other legal actions brought by a third party against the Indemnified Contributor to the extent caused by the acts or omissions of such Commercial Contributor in connection with its distribution of the Program in a commercial product offering. The obligations in this section do not apply to any claims or Losses relating to any actual or alleged intellectual property infringement. In order to qualify, an Indemnified Contributor must: a) promptly notify the Commercial Contributor in writing of such claim, and b) allow the Commercial Contributor to control, and cooperate with the Commercial Contributor in, the defense and any related settlement negotiations. The Indemnified Contributor may participate in any such claim at its own expense. - -For example, a Contributor might include the Program in a commercial product offering, Product X. That Contributor is then a Commercial Contributor. If that Commercial Contributor then makes performance claims, or offers warranties related to Product X, those performance claims and warranties are such Commercial Contributor's responsibility alone. Under this section, the Commercial Contributor would have to defend claims against the other Contributors related to those performance claims and warranties, and if a court requires any other Contributor to pay any damages as a result, the Commercial Contributor must pay those damages. - -5. NO WARRANTY - -EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely responsible for determining the appropriateness of using and distributing the Program and assumes all risks associated with its exercise of rights under this Agreement , including but not limited to the risks and costs of program errors, compliance with applicable laws, damage to or loss of data, programs or equipment, and unavailability or interruption of operations. - -6. DISCLAIMER OF LIABILITY - -EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - -7. GENERAL - -If any provision of this Agreement is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this Agreement, and without further action by the parties hereto, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable. -If Recipient institutes patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Program itself (excluding combinations of the Program with other software or hardware) infringes such Recipient's patent(s), then such Recipient's rights granted under Section 2(b) shall terminate as of the date such litigation is filed. -All Recipient's rights under this Agreement shall terminate if it fails to comply with any of the material terms or conditions of this Agreement and does not cure such failure in a reasonable period of time after becoming aware of such noncompliance. If all Recipient's rights under this Agreement terminate, Recipient agrees to cease use and distribution of the Program as soon as reasonably practicable. However, Recipient's obligations under this Agreement and any licenses granted by Recipient relating to the Program shall continue and survive. -Everyone is permitted to copy and distribute copies of this Agreement, but in order to avoid inconsistency the Agreement is copyrighted and may only be modified in the following manner. The Agreement Steward reserves the right to publish new versions (including revisions) of this Agreement from time to time. No one other than the Agreement Steward has the right to modify this Agreement. The Eclipse Foundation is the initial Agreement Steward. The Eclipse Foundation may assign the responsibility to serve as the Agreement Steward to a suitable separate entity. Each new version of the Agreement will be given a distinguishing version number. The Program (including Contributions) may always be distributed subject to the version of the Agreement under which it was received. In addition, after a new version of the Agreement is published, Contributor may elect to distribute the Program (including its Contributions) under the new version. Except as expressly stated in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to the intellectual property of any Contributor under this Agreement, whether expressly, by implication, estoppel or otherwise. All rights in the Program not expressly granted under this Agreement are reserved. -This Agreement is governed by the laws of the State of New York and the intellectual property laws of the United States of America. No party to this Agreement will bring a legal action under this Agreement more than one year after the cause of action arose. Each party waives its rights to a jury trial in any resulting litigation. diff --git a/ide/o.eclipse.mylyn.commons.net/manifest.mf b/ide/o.eclipse.mylyn.commons.net/manifest.mf deleted file mode 100644 index 3c4aab04cfb1..000000000000 --- a/ide/o.eclipse.mylyn.commons.net/manifest.mf +++ /dev/null @@ -1 +0,0 @@ -OpenIDE-Module: org.eclipse.mylyn.commons.net \ No newline at end of file diff --git a/ide/o.eclipse.mylyn.commons.net/nbproject/project.properties b/ide/o.eclipse.mylyn.commons.net/nbproject/project.properties deleted file mode 100644 index 910abb84cee2..000000000000 --- a/ide/o.eclipse.mylyn.commons.net/nbproject/project.properties +++ /dev/null @@ -1,19 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -release.external/org.eclipse.mylyn.commons.net_3.17.0.v20150706-2057.jar=modules/org-eclipse-mylyn-commons-net.jar -is.autoload=true -nbm.module.author=Tomas Stupka \ No newline at end of file diff --git a/ide/o.eclipse.mylyn.commons.net/nbproject/project.xml b/ide/o.eclipse.mylyn.commons.net/nbproject/project.xml deleted file mode 100644 index cb43ab49b6b7..000000000000 --- a/ide/o.eclipse.mylyn.commons.net/nbproject/project.xml +++ /dev/null @@ -1,35 +0,0 @@ - - - - org.netbeans.modules.apisupport.project - - - org.eclipse.mylyn.commons.net - - - - org-eclipse-mylyn-commons-net.jar - external/org.eclipse.mylyn.commons.net_3.17.0.v20150706-2057.jar - - - - \ No newline at end of file diff --git a/ide/o.eclipse.mylyn.commons.repositories.core/build.xml b/ide/o.eclipse.mylyn.commons.repositories.core/build.xml deleted file mode 100644 index 62456a911280..000000000000 --- a/ide/o.eclipse.mylyn.commons.repositories.core/build.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/ide/o.eclipse.mylyn.commons.repositories.core/external/binaries-list b/ide/o.eclipse.mylyn.commons.repositories.core/external/binaries-list deleted file mode 100644 index 19b21608cc92..000000000000 --- a/ide/o.eclipse.mylyn.commons.repositories.core/external/binaries-list +++ /dev/null @@ -1,17 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -8E52A783A3700FE2F3AED720CBEF6D895C0D5DBC org.eclipse.mylyn.commons.repositories.core_1.9.0.v20150625-2042.jar diff --git a/ide/o.eclipse.mylyn.commons.repositories.core/external/org.eclipse.mylyn.commons.repositories.core_1.9.0.v20150625-2042-license.txt b/ide/o.eclipse.mylyn.commons.repositories.core/external/org.eclipse.mylyn.commons.repositories.core_1.9.0.v20150625-2042-license.txt deleted file mode 100644 index e4826a6b7902..000000000000 --- a/ide/o.eclipse.mylyn.commons.repositories.core/external/org.eclipse.mylyn.commons.repositories.core_1.9.0.v20150625-2042-license.txt +++ /dev/null @@ -1,72 +0,0 @@ -Name: Mylyn Commons Repositories library -Origin: Eclipse -Version: 1.9.0 -License: EPL-v10 -URL: http://www.eclipse.org/mylyn/ -Description: Mylyn Commons SOAP library - -Eclipse Public License - v 1.0 - -THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT. - -1. DEFINITIONS - -"Contribution" means: - -a) in the case of the initial Contributor, the initial code and documentation distributed under this Agreement, and -b) in the case of each subsequent Contributor: - -i) changes to the Program, and -ii) additions to the Program; - -where such changes and/or additions to the Program originate from and are distributed by that particular Contributor. A Contribution 'originates' from a Contributor if it was added to the Program by such Contributor itself or anyone acting on such Contributor's behalf. Contributions do not include additions to the Program which: (i) are separate modules of software distributed in conjunction with the Program under their own license agreement, and (ii) are not derivative works of the Program. -"Contributor" means any person or entity that distributes the Program. -"Licensed Patents" mean patent claims licensable by a Contributor which are necessarily infringed by the use or sale of its Contribution alone or when combined with the Program. -"Program" means the Contributions distributed in accordance with this Agreement. -"Recipient" means anyone who receives the Program under this Agreement, including all Contributors. - -2. GRANT OF RIGHTS - -a) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free copyright license to reproduce, prepare derivative works of, publicly display, publicly perform, distribute and sublicense the Contribution of such Contributor, if any, and such derivative works, in source code and object code form. -b) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free patent license under Licensed Patents to make, use, sell, offer to sell, import and otherwise transfer the Contribution of such Contributor, if any, in source code and object code form. This patent license shall apply to the combination of the Contribution and the Program if, at the time the Contribution is added by the Contributor, such addition of the Contribution causes such combination to be covered by the Licensed Patents. The patent license shall not apply to any other combinations which include the Contribution. No hardware per se is licensed hereunder. -c) Recipient understands that although each Contributor grants the licenses to its Contributions set forth herein, no assurances are provided by any Contributor that the Program does not infringe the patent or other intellectual property rights of any other entity. Each Contributor disclaims any liability to Recipient for claims brought by any other entity based on infringement of intellectual property rights or otherwise. As a condition to exercising the rights and licenses granted hereunder, each Recipient hereby assumes sole responsibility to secure any other intellectual property rights needed, if any. For example, if a third party patent license is required to allow Recipient to distribute the Program, it is Recipient's responsibility to acquire that license before distributing the Program. -d) Each Contributor represents that to its knowledge it has sufficient copyright rights in its Contribution, if any, to grant the copyright license set forth in this Agreement. - -3. REQUIREMENTS - -A Contributor may choose to distribute the Program in object code form under its own license agreement, provided that: -a) it complies with the terms and conditions of this Agreement; and -b) its license agreement: -i) effectively disclaims on behalf of all Contributors all warranties and conditions, express and implied, including warranties or conditions of title and non-infringement, and implied warranties or conditions of merchantability and fitness for a particular purpose; -ii) effectively excludes on behalf of all Contributors all liability for damages, including direct, indirect, special, incidental and consequential damages, such as lost profits; -iii) states that any provisions which differ from this Agreement are offered by that Contributor alone and not by any other party; and -iv) states that source code for the Program is available from such Contributor, and informs licensees how to obtain it in a reasonable manner on or through a medium customarily used for software exchange. - -When the Program is made available in source code form: -a) it must be made available under this Agreement; and -b) a copy of this Agreement must be included with each copy of the Program. - -Contributors may not remove or alter any copyright notices contained within the Program. -Each Contributor must identify itself as the originator of its Contribution, if any, in a manner that reasonably allows subsequent Recipients to identify the originator of the Contribution. - -4. COMMERCIAL DISTRIBUTION - -Commercial distributors of software may accept certain responsibilities with respect to end users, business partners and the like. While this license is intended to facilitate the commercial use of the Program, the Contributor who includes the Program in a commercial product offering should do so in a manner which does not create potential liability for other Contributors. Therefore, if a Contributor includes the Program in a commercial product offering, such Contributor ("Commercial Contributor") hereby agrees to defend and indemnify every other Contributor ("Indemnified Contributor") against any losses, damages and costs (collectively "Losses") arising from claims, lawsuits and other legal actions brought by a third party against the Indemnified Contributor to the extent caused by the acts or omissions of such Commercial Contributor in connection with its distribution of the Program in a commercial product offering. The obligations in this section do not apply to any claims or Losses relating to any actual or alleged intellectual property infringement. In order to qualify, an Indemnified Contributor must: a) promptly notify the Commercial Contributor in writing of such claim, and b) allow the Commercial Contributor to control, and cooperate with the Commercial Contributor in, the defense and any related settlement negotiations. The Indemnified Contributor may participate in any such claim at its own expense. - -For example, a Contributor might include the Program in a commercial product offering, Product X. That Contributor is then a Commercial Contributor. If that Commercial Contributor then makes performance claims, or offers warranties related to Product X, those performance claims and warranties are such Commercial Contributor's responsibility alone. Under this section, the Commercial Contributor would have to defend claims against the other Contributors related to those performance claims and warranties, and if a court requires any other Contributor to pay any damages as a result, the Commercial Contributor must pay those damages. - -5. NO WARRANTY - -EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely responsible for determining the appropriateness of using and distributing the Program and assumes all risks associated with its exercise of rights under this Agreement , including but not limited to the risks and costs of program errors, compliance with applicable laws, damage to or loss of data, programs or equipment, and unavailability or interruption of operations. - -6. DISCLAIMER OF LIABILITY - -EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - -7. GENERAL - -If any provision of this Agreement is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this Agreement, and without further action by the parties hereto, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable. -If Recipient institutes patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Program itself (excluding combinations of the Program with other software or hardware) infringes such Recipient's patent(s), then such Recipient's rights granted under Section 2(b) shall terminate as of the date such litigation is filed. -All Recipient's rights under this Agreement shall terminate if it fails to comply with any of the material terms or conditions of this Agreement and does not cure such failure in a reasonable period of time after becoming aware of such noncompliance. If all Recipient's rights under this Agreement terminate, Recipient agrees to cease use and distribution of the Program as soon as reasonably practicable. However, Recipient's obligations under this Agreement and any licenses granted by Recipient relating to the Program shall continue and survive. -Everyone is permitted to copy and distribute copies of this Agreement, but in order to avoid inconsistency the Agreement is copyrighted and may only be modified in the following manner. The Agreement Steward reserves the right to publish new versions (including revisions) of this Agreement from time to time. No one other than the Agreement Steward has the right to modify this Agreement. The Eclipse Foundation is the initial Agreement Steward. The Eclipse Foundation may assign the responsibility to serve as the Agreement Steward to a suitable separate entity. Each new version of the Agreement will be given a distinguishing version number. The Program (including Contributions) may always be distributed subject to the version of the Agreement under which it was received. In addition, after a new version of the Agreement is published, Contributor may elect to distribute the Program (including its Contributions) under the new version. Except as expressly stated in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to the intellectual property of any Contributor under this Agreement, whether expressly, by implication, estoppel or otherwise. All rights in the Program not expressly granted under this Agreement are reserved. -This Agreement is governed by the laws of the State of New York and the intellectual property laws of the United States of America. No party to this Agreement will bring a legal action under this Agreement more than one year after the cause of action arose. Each party waives its rights to a jury trial in any resulting litigation. diff --git a/ide/o.eclipse.mylyn.commons.repositories.core/manifest.mf b/ide/o.eclipse.mylyn.commons.repositories.core/manifest.mf deleted file mode 100644 index d178310e4519..000000000000 --- a/ide/o.eclipse.mylyn.commons.repositories.core/manifest.mf +++ /dev/null @@ -1 +0,0 @@ -OpenIDE-Module: org.eclipse.mylyn.commons.repositories.core \ No newline at end of file diff --git a/ide/o.eclipse.mylyn.commons.repositories.core/nbproject/project.properties b/ide/o.eclipse.mylyn.commons.repositories.core/nbproject/project.properties deleted file mode 100644 index e58dc010d016..000000000000 --- a/ide/o.eclipse.mylyn.commons.repositories.core/nbproject/project.properties +++ /dev/null @@ -1,19 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -release.external/org.eclipse.mylyn.commons.repositories.core_1.9.0.v20150625-2042.jar=modules/org-eclipse-mylyn-commons-repositories-core.jar -is.autoload=true -nbm.module.author=Tomas Stupka \ No newline at end of file diff --git a/ide/o.eclipse.mylyn.commons.repositories.core/nbproject/project.xml b/ide/o.eclipse.mylyn.commons.repositories.core/nbproject/project.xml deleted file mode 100644 index 2b6478852080..000000000000 --- a/ide/o.eclipse.mylyn.commons.repositories.core/nbproject/project.xml +++ /dev/null @@ -1,35 +0,0 @@ - - - - org.netbeans.modules.apisupport.project - - - org.eclipse.mylyn.commons.repositories.core - - - - org-eclipse-mylyn-commons-repositories-core.jar - external/org.eclipse.mylyn.commons.repositories.core_1.9.0.v20150625-2042.jar - - - - \ No newline at end of file diff --git a/ide/o.eclipse.mylyn.commons.xmlrpc/build.xml b/ide/o.eclipse.mylyn.commons.xmlrpc/build.xml deleted file mode 100644 index d2ab288f6edd..000000000000 --- a/ide/o.eclipse.mylyn.commons.xmlrpc/build.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/ide/o.eclipse.mylyn.commons.xmlrpc/external/binaries-list b/ide/o.eclipse.mylyn.commons.xmlrpc/external/binaries-list deleted file mode 100644 index b36683e86373..000000000000 --- a/ide/o.eclipse.mylyn.commons.xmlrpc/external/binaries-list +++ /dev/null @@ -1,17 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -50F0A49BDF7C5610E3E602609926065D47A16C6E org.eclipse.mylyn.commons.xmlrpc_3.17.0.v20150625-2042.jar diff --git a/ide/o.eclipse.mylyn.commons.xmlrpc/external/org.eclipse.mylyn.commons.xmlrpc_3.17.0.v20150625-2042-license.txt b/ide/o.eclipse.mylyn.commons.xmlrpc/external/org.eclipse.mylyn.commons.xmlrpc_3.17.0.v20150625-2042-license.txt deleted file mode 100644 index 78ec90143df4..000000000000 --- a/ide/o.eclipse.mylyn.commons.xmlrpc/external/org.eclipse.mylyn.commons.xmlrpc_3.17.0.v20150625-2042-license.txt +++ /dev/null @@ -1,72 +0,0 @@ -Name: Mylyn Commons XMLRPC library -Origin: Eclipse -Version: 3.17.0 -License: EPL-v10 -URL: http://www.eclipse.org/mylyn/ -Description: Mylyn Commons XMLRPC library - -Eclipse Public License - v 1.0 - -THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT. - -1. DEFINITIONS - -"Contribution" means: - -a) in the case of the initial Contributor, the initial code and documentation distributed under this Agreement, and -b) in the case of each subsequent Contributor: - -i) changes to the Program, and -ii) additions to the Program; - -where such changes and/or additions to the Program originate from and are distributed by that particular Contributor. A Contribution 'originates' from a Contributor if it was added to the Program by such Contributor itself or anyone acting on such Contributor's behalf. Contributions do not include additions to the Program which: (i) are separate modules of software distributed in conjunction with the Program under their own license agreement, and (ii) are not derivative works of the Program. -"Contributor" means any person or entity that distributes the Program. -"Licensed Patents" mean patent claims licensable by a Contributor which are necessarily infringed by the use or sale of its Contribution alone or when combined with the Program. -"Program" means the Contributions distributed in accordance with this Agreement. -"Recipient" means anyone who receives the Program under this Agreement, including all Contributors. - -2. GRANT OF RIGHTS - -a) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free copyright license to reproduce, prepare derivative works of, publicly display, publicly perform, distribute and sublicense the Contribution of such Contributor, if any, and such derivative works, in source code and object code form. -b) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free patent license under Licensed Patents to make, use, sell, offer to sell, import and otherwise transfer the Contribution of such Contributor, if any, in source code and object code form. This patent license shall apply to the combination of the Contribution and the Program if, at the time the Contribution is added by the Contributor, such addition of the Contribution causes such combination to be covered by the Licensed Patents. The patent license shall not apply to any other combinations which include the Contribution. No hardware per se is licensed hereunder. -c) Recipient understands that although each Contributor grants the licenses to its Contributions set forth herein, no assurances are provided by any Contributor that the Program does not infringe the patent or other intellectual property rights of any other entity. Each Contributor disclaims any liability to Recipient for claims brought by any other entity based on infringement of intellectual property rights or otherwise. As a condition to exercising the rights and licenses granted hereunder, each Recipient hereby assumes sole responsibility to secure any other intellectual property rights needed, if any. For example, if a third party patent license is required to allow Recipient to distribute the Program, it is Recipient's responsibility to acquire that license before distributing the Program. -d) Each Contributor represents that to its knowledge it has sufficient copyright rights in its Contribution, if any, to grant the copyright license set forth in this Agreement. - -3. REQUIREMENTS - -A Contributor may choose to distribute the Program in object code form under its own license agreement, provided that: -a) it complies with the terms and conditions of this Agreement; and -b) its license agreement: -i) effectively disclaims on behalf of all Contributors all warranties and conditions, express and implied, including warranties or conditions of title and non-infringement, and implied warranties or conditions of merchantability and fitness for a particular purpose; -ii) effectively excludes on behalf of all Contributors all liability for damages, including direct, indirect, special, incidental and consequential damages, such as lost profits; -iii) states that any provisions which differ from this Agreement are offered by that Contributor alone and not by any other party; and -iv) states that source code for the Program is available from such Contributor, and informs licensees how to obtain it in a reasonable manner on or through a medium customarily used for software exchange. - -When the Program is made available in source code form: -a) it must be made available under this Agreement; and -b) a copy of this Agreement must be included with each copy of the Program. - -Contributors may not remove or alter any copyright notices contained within the Program. -Each Contributor must identify itself as the originator of its Contribution, if any, in a manner that reasonably allows subsequent Recipients to identify the originator of the Contribution. - -4. COMMERCIAL DISTRIBUTION - -Commercial distributors of software may accept certain responsibilities with respect to end users, business partners and the like. While this license is intended to facilitate the commercial use of the Program, the Contributor who includes the Program in a commercial product offering should do so in a manner which does not create potential liability for other Contributors. Therefore, if a Contributor includes the Program in a commercial product offering, such Contributor ("Commercial Contributor") hereby agrees to defend and indemnify every other Contributor ("Indemnified Contributor") against any losses, damages and costs (collectively "Losses") arising from claims, lawsuits and other legal actions brought by a third party against the Indemnified Contributor to the extent caused by the acts or omissions of such Commercial Contributor in connection with its distribution of the Program in a commercial product offering. The obligations in this section do not apply to any claims or Losses relating to any actual or alleged intellectual property infringement. In order to qualify, an Indemnified Contributor must: a) promptly notify the Commercial Contributor in writing of such claim, and b) allow the Commercial Contributor to control, and cooperate with the Commercial Contributor in, the defense and any related settlement negotiations. The Indemnified Contributor may participate in any such claim at its own expense. - -For example, a Contributor might include the Program in a commercial product offering, Product X. That Contributor is then a Commercial Contributor. If that Commercial Contributor then makes performance claims, or offers warranties related to Product X, those performance claims and warranties are such Commercial Contributor's responsibility alone. Under this section, the Commercial Contributor would have to defend claims against the other Contributors related to those performance claims and warranties, and if a court requires any other Contributor to pay any damages as a result, the Commercial Contributor must pay those damages. - -5. NO WARRANTY - -EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely responsible for determining the appropriateness of using and distributing the Program and assumes all risks associated with its exercise of rights under this Agreement , including but not limited to the risks and costs of program errors, compliance with applicable laws, damage to or loss of data, programs or equipment, and unavailability or interruption of operations. - -6. DISCLAIMER OF LIABILITY - -EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - -7. GENERAL - -If any provision of this Agreement is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this Agreement, and without further action by the parties hereto, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable. -If Recipient institutes patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Program itself (excluding combinations of the Program with other software or hardware) infringes such Recipient's patent(s), then such Recipient's rights granted under Section 2(b) shall terminate as of the date such litigation is filed. -All Recipient's rights under this Agreement shall terminate if it fails to comply with any of the material terms or conditions of this Agreement and does not cure such failure in a reasonable period of time after becoming aware of such noncompliance. If all Recipient's rights under this Agreement terminate, Recipient agrees to cease use and distribution of the Program as soon as reasonably practicable. However, Recipient's obligations under this Agreement and any licenses granted by Recipient relating to the Program shall continue and survive. -Everyone is permitted to copy and distribute copies of this Agreement, but in order to avoid inconsistency the Agreement is copyrighted and may only be modified in the following manner. The Agreement Steward reserves the right to publish new versions (including revisions) of this Agreement from time to time. No one other than the Agreement Steward has the right to modify this Agreement. The Eclipse Foundation is the initial Agreement Steward. The Eclipse Foundation may assign the responsibility to serve as the Agreement Steward to a suitable separate entity. Each new version of the Agreement will be given a distinguishing version number. The Program (including Contributions) may always be distributed subject to the version of the Agreement under which it was received. In addition, after a new version of the Agreement is published, Contributor may elect to distribute the Program (including its Contributions) under the new version. Except as expressly stated in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to the intellectual property of any Contributor under this Agreement, whether expressly, by implication, estoppel or otherwise. All rights in the Program not expressly granted under this Agreement are reserved. -This Agreement is governed by the laws of the State of New York and the intellectual property laws of the United States of America. No party to this Agreement will bring a legal action under this Agreement more than one year after the cause of action arose. Each party waives its rights to a jury trial in any resulting litigation. diff --git a/ide/o.eclipse.mylyn.commons.xmlrpc/manifest.mf b/ide/o.eclipse.mylyn.commons.xmlrpc/manifest.mf deleted file mode 100644 index bd7702e987e3..000000000000 --- a/ide/o.eclipse.mylyn.commons.xmlrpc/manifest.mf +++ /dev/null @@ -1 +0,0 @@ -OpenIDE-Module: org.eclipse.mylyn.commons.xmlrpc \ No newline at end of file diff --git a/ide/o.eclipse.mylyn.commons.xmlrpc/nbproject/project.properties b/ide/o.eclipse.mylyn.commons.xmlrpc/nbproject/project.properties deleted file mode 100644 index 91c005517a01..000000000000 --- a/ide/o.eclipse.mylyn.commons.xmlrpc/nbproject/project.properties +++ /dev/null @@ -1,19 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -release.external/org.eclipse.mylyn.commons.xmlrpc_3.17.0.v20150625-2042.jar=modules/org-eclipse-mylyn-commons-xmlrpc.jar -is.autoload=true -nbm.module.author=Tomas Stupka \ No newline at end of file diff --git a/ide/o.eclipse.mylyn.commons.xmlrpc/nbproject/project.xml b/ide/o.eclipse.mylyn.commons.xmlrpc/nbproject/project.xml deleted file mode 100644 index 1ede9dbeb297..000000000000 --- a/ide/o.eclipse.mylyn.commons.xmlrpc/nbproject/project.xml +++ /dev/null @@ -1,35 +0,0 @@ - - - - org.netbeans.modules.apisupport.project - - - org.eclipse.mylyn.commons.xmlrpc - - - - org-eclipse-mylyn-commons-xmlrpc.jar - external/org.eclipse.mylyn.commons.xmlrpc_3.17.0.v20150625-2042.jar - - - - \ No newline at end of file diff --git a/ide/o.eclipse.mylyn.tasks.core/build.xml b/ide/o.eclipse.mylyn.tasks.core/build.xml deleted file mode 100644 index 3c15bbbc6451..000000000000 --- a/ide/o.eclipse.mylyn.tasks.core/build.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/ide/o.eclipse.mylyn.tasks.core/external/binaries-list b/ide/o.eclipse.mylyn.tasks.core/external/binaries-list deleted file mode 100644 index 6dd5886062a6..000000000000 --- a/ide/o.eclipse.mylyn.tasks.core/external/binaries-list +++ /dev/null @@ -1,17 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -4F2E28BDB091E2DD215FB9B16C8708513288F16A org.eclipse.mylyn.tasks.core_3.17.0.v20150828-2026.jar diff --git a/ide/o.eclipse.mylyn.tasks.core/external/org.eclipse.mylyn.tasks.core_3.17.0.v20150828-2026-license.txt b/ide/o.eclipse.mylyn.tasks.core/external/org.eclipse.mylyn.tasks.core_3.17.0.v20150828-2026-license.txt deleted file mode 100644 index d9cd384c9c86..000000000000 --- a/ide/o.eclipse.mylyn.tasks.core/external/org.eclipse.mylyn.tasks.core_3.17.0.v20150828-2026-license.txt +++ /dev/null @@ -1,72 +0,0 @@ -Name: Mylyn Tasks Core library -Origin: Eclipse -Version: 3.17.0.v20150828-2026 -License: EPL-v10 -URL: http://www.eclipse.org/mylyn/ -Description: Mylyn Tasks Core library - -Eclipse Public License - v 1.0 - -THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT. - -1. DEFINITIONS - -"Contribution" means: - -a) in the case of the initial Contributor, the initial code and documentation distributed under this Agreement, and -b) in the case of each subsequent Contributor: - -i) changes to the Program, and -ii) additions to the Program; - -where such changes and/or additions to the Program originate from and are distributed by that particular Contributor. A Contribution 'originates' from a Contributor if it was added to the Program by such Contributor itself or anyone acting on such Contributor's behalf. Contributions do not include additions to the Program which: (i) are separate modules of software distributed in conjunction with the Program under their own license agreement, and (ii) are not derivative works of the Program. -"Contributor" means any person or entity that distributes the Program. -"Licensed Patents" mean patent claims licensable by a Contributor which are necessarily infringed by the use or sale of its Contribution alone or when combined with the Program. -"Program" means the Contributions distributed in accordance with this Agreement. -"Recipient" means anyone who receives the Program under this Agreement, including all Contributors. - -2. GRANT OF RIGHTS - -a) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free copyright license to reproduce, prepare derivative works of, publicly display, publicly perform, distribute and sublicense the Contribution of such Contributor, if any, and such derivative works, in source code and object code form. -b) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free patent license under Licensed Patents to make, use, sell, offer to sell, import and otherwise transfer the Contribution of such Contributor, if any, in source code and object code form. This patent license shall apply to the combination of the Contribution and the Program if, at the time the Contribution is added by the Contributor, such addition of the Contribution causes such combination to be covered by the Licensed Patents. The patent license shall not apply to any other combinations which include the Contribution. No hardware per se is licensed hereunder. -c) Recipient understands that although each Contributor grants the licenses to its Contributions set forth herein, no assurances are provided by any Contributor that the Program does not infringe the patent or other intellectual property rights of any other entity. Each Contributor disclaims any liability to Recipient for claims brought by any other entity based on infringement of intellectual property rights or otherwise. As a condition to exercising the rights and licenses granted hereunder, each Recipient hereby assumes sole responsibility to secure any other intellectual property rights needed, if any. For example, if a third party patent license is required to allow Recipient to distribute the Program, it is Recipient's responsibility to acquire that license before distributing the Program. -d) Each Contributor represents that to its knowledge it has sufficient copyright rights in its Contribution, if any, to grant the copyright license set forth in this Agreement. - -3. REQUIREMENTS - -A Contributor may choose to distribute the Program in object code form under its own license agreement, provided that: -a) it complies with the terms and conditions of this Agreement; and -b) its license agreement: -i) effectively disclaims on behalf of all Contributors all warranties and conditions, express and implied, including warranties or conditions of title and non-infringement, and implied warranties or conditions of merchantability and fitness for a particular purpose; -ii) effectively excludes on behalf of all Contributors all liability for damages, including direct, indirect, special, incidental and consequential damages, such as lost profits; -iii) states that any provisions which differ from this Agreement are offered by that Contributor alone and not by any other party; and -iv) states that source code for the Program is available from such Contributor, and informs licensees how to obtain it in a reasonable manner on or through a medium customarily used for software exchange. - -When the Program is made available in source code form: -a) it must be made available under this Agreement; and -b) a copy of this Agreement must be included with each copy of the Program. - -Contributors may not remove or alter any copyright notices contained within the Program. -Each Contributor must identify itself as the originator of its Contribution, if any, in a manner that reasonably allows subsequent Recipients to identify the originator of the Contribution. - -4. COMMERCIAL DISTRIBUTION - -Commercial distributors of software may accept certain responsibilities with respect to end users, business partners and the like. While this license is intended to facilitate the commercial use of the Program, the Contributor who includes the Program in a commercial product offering should do so in a manner which does not create potential liability for other Contributors. Therefore, if a Contributor includes the Program in a commercial product offering, such Contributor ("Commercial Contributor") hereby agrees to defend and indemnify every other Contributor ("Indemnified Contributor") against any losses, damages and costs (collectively "Losses") arising from claims, lawsuits and other legal actions brought by a third party against the Indemnified Contributor to the extent caused by the acts or omissions of such Commercial Contributor in connection with its distribution of the Program in a commercial product offering. The obligations in this section do not apply to any claims or Losses relating to any actual or alleged intellectual property infringement. In order to qualify, an Indemnified Contributor must: a) promptly notify the Commercial Contributor in writing of such claim, and b) allow the Commercial Contributor to control, and cooperate with the Commercial Contributor in, the defense and any related settlement negotiations. The Indemnified Contributor may participate in any such claim at its own expense. - -For example, a Contributor might include the Program in a commercial product offering, Product X. That Contributor is then a Commercial Contributor. If that Commercial Contributor then makes performance claims, or offers warranties related to Product X, those performance claims and warranties are such Commercial Contributor's responsibility alone. Under this section, the Commercial Contributor would have to defend claims against the other Contributors related to those performance claims and warranties, and if a court requires any other Contributor to pay any damages as a result, the Commercial Contributor must pay those damages. - -5. NO WARRANTY - -EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely responsible for determining the appropriateness of using and distributing the Program and assumes all risks associated with its exercise of rights under this Agreement , including but not limited to the risks and costs of program errors, compliance with applicable laws, damage to or loss of data, programs or equipment, and unavailability or interruption of operations. - -6. DISCLAIMER OF LIABILITY - -EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - -7. GENERAL - -If any provision of this Agreement is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this Agreement, and without further action by the parties hereto, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable. -If Recipient institutes patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Program itself (excluding combinations of the Program with other software or hardware) infringes such Recipient's patent(s), then such Recipient's rights granted under Section 2(b) shall terminate as of the date such litigation is filed. -All Recipient's rights under this Agreement shall terminate if it fails to comply with any of the material terms or conditions of this Agreement and does not cure such failure in a reasonable period of time after becoming aware of such noncompliance. If all Recipient's rights under this Agreement terminate, Recipient agrees to cease use and distribution of the Program as soon as reasonably practicable. However, Recipient's obligations under this Agreement and any licenses granted by Recipient relating to the Program shall continue and survive. -Everyone is permitted to copy and distribute copies of this Agreement, but in order to avoid inconsistency the Agreement is copyrighted and may only be modified in the following manner. The Agreement Steward reserves the right to publish new versions (including revisions) of this Agreement from time to time. No one other than the Agreement Steward has the right to modify this Agreement. The Eclipse Foundation is the initial Agreement Steward. The Eclipse Foundation may assign the responsibility to serve as the Agreement Steward to a suitable separate entity. Each new version of the Agreement will be given a distinguishing version number. The Program (including Contributions) may always be distributed subject to the version of the Agreement under which it was received. In addition, after a new version of the Agreement is published, Contributor may elect to distribute the Program (including its Contributions) under the new version. Except as expressly stated in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to the intellectual property of any Contributor under this Agreement, whether expressly, by implication, estoppel or otherwise. All rights in the Program not expressly granted under this Agreement are reserved. -This Agreement is governed by the laws of the State of New York and the intellectual property laws of the United States of America. No party to this Agreement will bring a legal action under this Agreement more than one year after the cause of action arose. Each party waives its rights to a jury trial in any resulting litigation. diff --git a/ide/o.eclipse.mylyn.tasks.core/manifest.mf b/ide/o.eclipse.mylyn.tasks.core/manifest.mf deleted file mode 100644 index 738c6cde815f..000000000000 --- a/ide/o.eclipse.mylyn.tasks.core/manifest.mf +++ /dev/null @@ -1 +0,0 @@ -OpenIDE-Module: org.eclipse.mylyn.tasks.core \ No newline at end of file diff --git a/ide/o.eclipse.mylyn.tasks.core/nbproject/project.properties b/ide/o.eclipse.mylyn.tasks.core/nbproject/project.properties deleted file mode 100644 index c4f779f1fb68..000000000000 --- a/ide/o.eclipse.mylyn.tasks.core/nbproject/project.properties +++ /dev/null @@ -1,19 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -release.external/org.eclipse.mylyn.tasks.core_3.17.0.v20150828-2026.jar=modules/org-eclipse-mylyn-tasks-core.jar -is.autoload=true -nbm.module.author=Tomas Stupka \ No newline at end of file diff --git a/ide/o.eclipse.mylyn.tasks.core/nbproject/project.xml b/ide/o.eclipse.mylyn.tasks.core/nbproject/project.xml deleted file mode 100644 index aefda57792a2..000000000000 --- a/ide/o.eclipse.mylyn.tasks.core/nbproject/project.xml +++ /dev/null @@ -1,35 +0,0 @@ - - - - org.netbeans.modules.apisupport.project - - - org.eclipse.mylyn.tasks.core - - - - org-eclipse-mylyn-tasks-core.jar - external/org.eclipse.mylyn.tasks.core_3.17.0.v20150828-2026.jar - - - - \ No newline at end of file diff --git a/ide/o.eclipse.mylyn.wikitext.confluence.core/build.xml b/ide/o.eclipse.mylyn.wikitext.confluence.core/build.xml deleted file mode 100644 index 61ae8c230f37..000000000000 --- a/ide/o.eclipse.mylyn.wikitext.confluence.core/build.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/ide/o.eclipse.mylyn.wikitext.confluence.core/external/binaries-list b/ide/o.eclipse.mylyn.wikitext.confluence.core/external/binaries-list deleted file mode 100644 index abbbed2726eb..000000000000 --- a/ide/o.eclipse.mylyn.wikitext.confluence.core/external/binaries-list +++ /dev/null @@ -1,17 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -11D1982BE23B06B2721240F424DBEF9F5FDE7F45 org.eclipse.mylyn.wikitext.confluence.core_2.6.0.v20150901-2143.jar diff --git a/ide/o.eclipse.mylyn.wikitext.confluence.core/external/org.eclipse.mylyn.wikitext.confluence.core_2.6.0.v20150901-2143-license.txt b/ide/o.eclipse.mylyn.wikitext.confluence.core/external/org.eclipse.mylyn.wikitext.confluence.core_2.6.0.v20150901-2143-license.txt deleted file mode 100644 index 3c4a8219e234..000000000000 --- a/ide/o.eclipse.mylyn.wikitext.confluence.core/external/org.eclipse.mylyn.wikitext.confluence.core_2.6.0.v20150901-2143-license.txt +++ /dev/null @@ -1,94 +0,0 @@ -Name: Mylyn Wikitest Confluence Core -Origin: Eclipse -Version: 2.6.0 -License: EPL-v10 -Description: TBD - -Eclipse Public License - v 1.0 - -THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT. - -1. DEFINITIONS - -"Contribution" means: - -a) in the case of the initial Contributor, the initial code and documentation distributed under this Agreement, and - -b) in the case of each subsequent Contributor: - -i) changes to the Program, and - -ii) additions to the Program; - -where such changes and/or additions to the Program originate from and are distributed by that particular Contributor. A Contribution 'originates' from a Contributor if it was added to the Program by such Contributor itself or anyone acting on such Contributor's behalf. Contributions do not include additions to the Program which: (i) are separate modules of software distributed in conjunction with the Program under their own license agreement, and (ii) are not derivative works of the Program. - -"Contributor" means any person or entity that distributes the Program. - -"Licensed Patents" mean patent claims licensable by a Contributor which are necessarily infringed by the use or sale of its Contribution alone or when combined with the Program. - -"Program" means the Contributions distributed in accordance with this Agreement. - -"Recipient" means anyone who receives the Program under this Agreement, including all Contributors. - -2. GRANT OF RIGHTS - -a) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free copyright license to reproduce, prepare derivative works of, publicly display, publicly perform, distribute and sublicense the Contribution of such Contributor, if any, and such derivative works, in source code and object code form. - -b) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free patent license under Licensed Patents to make, use, sell, offer to sell, import and otherwise transfer the Contribution of such Contributor, if any, in source code and object code form. This patent license shall apply to the combination of the Contribution and the Program if, at the time the Contribution is added by the Contributor, such addition of the Contribution causes such combination to be covered by the Licensed Patents. The patent license shall not apply to any other combinations which include the Contribution. No hardware per se is licensed hereunder. - -c) Recipient understands that although each Contributor grants the licenses to its Contributions set forth herein, no assurances are provided by any Contributor that the Program does not infringe the patent or other intellectual property rights of any other entity. Each Contributor disclaims any liability to Recipient for claims brought by any other entity based on infringement of intellectual property rights or otherwise. As a condition to exercising the rights and licenses granted hereunder, each Recipient hereby assumes sole responsibility to secure any other intellectual property rights needed, if any. For example, if a third party patent license is required to allow Recipient to distribute the Program, it is Recipient's responsibility to acquire that license before distributing the Program. - -d) Each Contributor represents that to its knowledge it has sufficient copyright rights in its Contribution, if any, to grant the copyright license set forth in this Agreement. - -3. REQUIREMENTS - -A Contributor may choose to distribute the Program in object code form under its own license agreement, provided that: - -a) it complies with the terms and conditions of this Agreement; and - -b) its license agreement: - -i) effectively disclaims on behalf of all Contributors all warranties and conditions, express and implied, including warranties or conditions of title and non-infringement, and implied warranties or conditions of merchantability and fitness for a particular purpose; - -ii) effectively excludes on behalf of all Contributors all liability for damages, including direct, indirect, special, incidental and consequential damages, such as lost profits; - -iii) states that any provisions which differ from this Agreement are offered by that Contributor alone and not by any other party; and - -iv) states that source code for the Program is available from such Contributor, and informs licensees how to obtain it in a reasonable manner on or through a medium customarily used for software exchange. - -When the Program is made available in source code form: - -a) it must be made available under this Agreement; and - -b) a copy of this Agreement must be included with each copy of the Program. - -Contributors may not remove or alter any copyright notices contained within the Program. - -Each Contributor must identify itself as the originator of its Contribution, if any, in a manner that reasonably allows subsequent Recipients to identify the originator of the Contribution. - -4. COMMERCIAL DISTRIBUTION - -Commercial distributors of software may accept certain responsibilities with respect to end users, business partners and the like. While this license is intended to facilitate the commercial use of the Program, the Contributor who includes the Program in a commercial product offering should do so in a manner which does not create potential liability for other Contributors. Therefore, if a Contributor includes the Program in a commercial product offering, such Contributor ("Commercial Contributor") hereby agrees to defend and indemnify every other Contributor ("Indemnified Contributor") against any losses, damages and costs (collectively "Losses") arising from claims, lawsuits and other legal actions brought by a third party against the Indemnified Contributor to the extent caused by the acts or omissions of such Commercial Contributor in connection with its distribution of the Program in a commercial product offering. The obligations in this section do not apply to any claims or Losses relating to any actual or alleged intellectual property infringement. In order to qualify, an Indemnified Contributor must: a) promptly notify the Commercial Contributor in writing of such claim, and b) allow the Commercial Contributor to control, and cooperate with the Commercial Contributor in, the defense and any related settlement negotiations. The Indemnified Contributor may participate in any such claim at its own expense. - -For example, a Contributor might include the Program in a commercial product offering, Product X. That Contributor is then a Commercial Contributor. If that Commercial Contributor then makes performance claims, or offers warranties related to Product X, those performance claims and warranties are such Commercial Contributor's responsibility alone. Under this section, the Commercial Contributor would have to defend claims against the other Contributors related to those performance claims and warranties, and if a court requires any other Contributor to pay any damages as a result, the Commercial Contributor must pay those damages. - -5. NO WARRANTY - -EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely responsible for determining the appropriateness of using and distributing the Program and assumes all risks associated with its exercise of rights under this Agreement , including but not limited to the risks and costs of program errors, compliance with applicable laws, damage to or loss of data, programs or equipment, and unavailability or interruption of operations. - -6. DISCLAIMER OF LIABILITY - -EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - -7. GENERAL - -If any provision of this Agreement is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this Agreement, and without further action by the parties hereto, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable. - -If Recipient institutes patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Program itself (excluding combinations of the Program with other software or hardware) infringes such Recipient's patent(s), then such Recipient's rights granted under Section 2(b) shall terminate as of the date such litigation is filed. - -All Recipient's rights under this Agreement shall terminate if it fails to comply with any of the material terms or conditions of this Agreement and does not cure such failure in a reasonable period of time after becoming aware of such noncompliance. If all Recipient's rights under this Agreement terminate, Recipient agrees to cease use and distribution of the Program as soon as reasonably practicable. However, Recipient's obligations under this Agreement and any licenses granted by Recipient relating to the Program shall continue and survive. - -Everyone is permitted to copy and distribute copies of this Agreement, but in order to avoid inconsistency the Agreement is copyrighted and may only be modified in the following manner. The Agreement Steward reserves the right to publish new versions (including revisions) of this Agreement from time to time. No one other than the Agreement Steward has the right to modify this Agreement. The Eclipse Foundation is the initial Agreement Steward. The Eclipse Foundation may assign the responsibility to serve as the Agreement Steward to a suitable separate entity. Each new version of the Agreement will be given a distinguishing version number. The Program (including Contributions) may always be distributed subject to the version of the Agreement under which it was received. In addition, after a new version of the Agreement is published, Contributor may elect to distribute the Program (including its Contributions) under the new version. Except as expressly stated in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to the intellectual property of any Contributor under this Agreement, whether expressly, by implication, estoppel or otherwise. All rights in the Program not expressly granted under this Agreement are reserved. - -This Agreement is governed by the laws of the State of New York and the intellectual property laws of the United States of America. No party to this Agreement will bring a legal action under this Agreement more than one year after the cause of action arose. Each party waives its rights to a jury trial in any resulting litigation. - diff --git a/ide/o.eclipse.mylyn.wikitext.confluence.core/manifest.mf b/ide/o.eclipse.mylyn.wikitext.confluence.core/manifest.mf deleted file mode 100644 index 490637547033..000000000000 --- a/ide/o.eclipse.mylyn.wikitext.confluence.core/manifest.mf +++ /dev/null @@ -1 +0,0 @@ -OpenIDE-Module: org.eclipse.mylyn.wikitext.confluence.core \ No newline at end of file diff --git a/ide/o.eclipse.mylyn.wikitext.confluence.core/nbproject/project.properties b/ide/o.eclipse.mylyn.wikitext.confluence.core/nbproject/project.properties deleted file mode 100644 index 51ba4bff3720..000000000000 --- a/ide/o.eclipse.mylyn.wikitext.confluence.core/nbproject/project.properties +++ /dev/null @@ -1,19 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -release.external/org.eclipse.mylyn.wikitext.confluence.core_2.6.0.v20150901-2143.jar=modules/org-eclipse-mylyn-wikitext-confluence-core.jar -is.autoload=true -nbm.module.author=Tomas Stupka \ No newline at end of file diff --git a/ide/o.eclipse.mylyn.wikitext.confluence.core/nbproject/project.xml b/ide/o.eclipse.mylyn.wikitext.confluence.core/nbproject/project.xml deleted file mode 100644 index d7b12c6d6f4f..000000000000 --- a/ide/o.eclipse.mylyn.wikitext.confluence.core/nbproject/project.xml +++ /dev/null @@ -1,35 +0,0 @@ - - - - org.netbeans.modules.apisupport.project - - - org.eclipse.mylyn.wikitext.confluence.core - - - - org-eclipse-mylyn-wikitext-confluence-core.jar - external/org.eclipse.mylyn.wikitext.confluence.core_2.6.0.v20150901-2143.jar - - - - \ No newline at end of file diff --git a/ide/o.eclipse.mylyn.wikitext.core/build.xml b/ide/o.eclipse.mylyn.wikitext.core/build.xml deleted file mode 100644 index 8a3bd3e7c88a..000000000000 --- a/ide/o.eclipse.mylyn.wikitext.core/build.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/ide/o.eclipse.mylyn.wikitext.core/external/binaries-list b/ide/o.eclipse.mylyn.wikitext.core/external/binaries-list deleted file mode 100644 index 699bd4121ed2..000000000000 --- a/ide/o.eclipse.mylyn.wikitext.core/external/binaries-list +++ /dev/null @@ -1,17 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -A3FEF6144ED1622E4CDD506B9D745527CC675D8D org.eclipse.mylyn.wikitext.core_2.6.0.v20150901-2143-patched-nosignature.jar diff --git a/ide/o.eclipse.mylyn.wikitext.core/external/org.eclipse.mylyn.wikitext.core_2.6.0.v20150901-2143-patched-nosignature-license.txt b/ide/o.eclipse.mylyn.wikitext.core/external/org.eclipse.mylyn.wikitext.core_2.6.0.v20150901-2143-patched-nosignature-license.txt deleted file mode 100644 index 96111cde3e66..000000000000 --- a/ide/o.eclipse.mylyn.wikitext.core/external/org.eclipse.mylyn.wikitext.core_2.6.0.v20150901-2143-patched-nosignature-license.txt +++ /dev/null @@ -1,94 +0,0 @@ -Name: Mylyn Wikitext Core -Origin: Eclipse -Version: 2.6.0 -License: EPL-v10 -Description: TBD - -Eclipse Public License - v 1.0 - -THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT. - -1. DEFINITIONS - -"Contribution" means: - -a) in the case of the initial Contributor, the initial code and documentation distributed under this Agreement, and - -b) in the case of each subsequent Contributor: - -i) changes to the Program, and - -ii) additions to the Program; - -where such changes and/or additions to the Program originate from and are distributed by that particular Contributor. A Contribution 'originates' from a Contributor if it was added to the Program by such Contributor itself or anyone acting on such Contributor's behalf. Contributions do not include additions to the Program which: (i) are separate modules of software distributed in conjunction with the Program under their own license agreement, and (ii) are not derivative works of the Program. - -"Contributor" means any person or entity that distributes the Program. - -"Licensed Patents" mean patent claims licensable by a Contributor which are necessarily infringed by the use or sale of its Contribution alone or when combined with the Program. - -"Program" means the Contributions distributed in accordance with this Agreement. - -"Recipient" means anyone who receives the Program under this Agreement, including all Contributors. - -2. GRANT OF RIGHTS - -a) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free copyright license to reproduce, prepare derivative works of, publicly display, publicly perform, distribute and sublicense the Contribution of such Contributor, if any, and such derivative works, in source code and object code form. - -b) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free patent license under Licensed Patents to make, use, sell, offer to sell, import and otherwise transfer the Contribution of such Contributor, if any, in source code and object code form. This patent license shall apply to the combination of the Contribution and the Program if, at the time the Contribution is added by the Contributor, such addition of the Contribution causes such combination to be covered by the Licensed Patents. The patent license shall not apply to any other combinations which include the Contribution. No hardware per se is licensed hereunder. - -c) Recipient understands that although each Contributor grants the licenses to its Contributions set forth herein, no assurances are provided by any Contributor that the Program does not infringe the patent or other intellectual property rights of any other entity. Each Contributor disclaims any liability to Recipient for claims brought by any other entity based on infringement of intellectual property rights or otherwise. As a condition to exercising the rights and licenses granted hereunder, each Recipient hereby assumes sole responsibility to secure any other intellectual property rights needed, if any. For example, if a third party patent license is required to allow Recipient to distribute the Program, it is Recipient's responsibility to acquire that license before distributing the Program. - -d) Each Contributor represents that to its knowledge it has sufficient copyright rights in its Contribution, if any, to grant the copyright license set forth in this Agreement. - -3. REQUIREMENTS - -A Contributor may choose to distribute the Program in object code form under its own license agreement, provided that: - -a) it complies with the terms and conditions of this Agreement; and - -b) its license agreement: - -i) effectively disclaims on behalf of all Contributors all warranties and conditions, express and implied, including warranties or conditions of title and non-infringement, and implied warranties or conditions of merchantability and fitness for a particular purpose; - -ii) effectively excludes on behalf of all Contributors all liability for damages, including direct, indirect, special, incidental and consequential damages, such as lost profits; - -iii) states that any provisions which differ from this Agreement are offered by that Contributor alone and not by any other party; and - -iv) states that source code for the Program is available from such Contributor, and informs licensees how to obtain it in a reasonable manner on or through a medium customarily used for software exchange. - -When the Program is made available in source code form: - -a) it must be made available under this Agreement; and - -b) a copy of this Agreement must be included with each copy of the Program. - -Contributors may not remove or alter any copyright notices contained within the Program. - -Each Contributor must identify itself as the originator of its Contribution, if any, in a manner that reasonably allows subsequent Recipients to identify the originator of the Contribution. - -4. COMMERCIAL DISTRIBUTION - -Commercial distributors of software may accept certain responsibilities with respect to end users, business partners and the like. While this license is intended to facilitate the commercial use of the Program, the Contributor who includes the Program in a commercial product offering should do so in a manner which does not create potential liability for other Contributors. Therefore, if a Contributor includes the Program in a commercial product offering, such Contributor ("Commercial Contributor") hereby agrees to defend and indemnify every other Contributor ("Indemnified Contributor") against any losses, damages and costs (collectively "Losses") arising from claims, lawsuits and other legal actions brought by a third party against the Indemnified Contributor to the extent caused by the acts or omissions of such Commercial Contributor in connection with its distribution of the Program in a commercial product offering. The obligations in this section do not apply to any claims or Losses relating to any actual or alleged intellectual property infringement. In order to qualify, an Indemnified Contributor must: a) promptly notify the Commercial Contributor in writing of such claim, and b) allow the Commercial Contributor to control, and cooperate with the Commercial Contributor in, the defense and any related settlement negotiations. The Indemnified Contributor may participate in any such claim at its own expense. - -For example, a Contributor might include the Program in a commercial product offering, Product X. That Contributor is then a Commercial Contributor. If that Commercial Contributor then makes performance claims, or offers warranties related to Product X, those performance claims and warranties are such Commercial Contributor's responsibility alone. Under this section, the Commercial Contributor would have to defend claims against the other Contributors related to those performance claims and warranties, and if a court requires any other Contributor to pay any damages as a result, the Commercial Contributor must pay those damages. - -5. NO WARRANTY - -EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely responsible for determining the appropriateness of using and distributing the Program and assumes all risks associated with its exercise of rights under this Agreement , including but not limited to the risks and costs of program errors, compliance with applicable laws, damage to or loss of data, programs or equipment, and unavailability or interruption of operations. - -6. DISCLAIMER OF LIABILITY - -EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - -7. GENERAL - -If any provision of this Agreement is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this Agreement, and without further action by the parties hereto, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable. - -If Recipient institutes patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Program itself (excluding combinations of the Program with other software or hardware) infringes such Recipient's patent(s), then such Recipient's rights granted under Section 2(b) shall terminate as of the date such litigation is filed. - -All Recipient's rights under this Agreement shall terminate if it fails to comply with any of the material terms or conditions of this Agreement and does not cure such failure in a reasonable period of time after becoming aware of such noncompliance. If all Recipient's rights under this Agreement terminate, Recipient agrees to cease use and distribution of the Program as soon as reasonably practicable. However, Recipient's obligations under this Agreement and any licenses granted by Recipient relating to the Program shall continue and survive. - -Everyone is permitted to copy and distribute copies of this Agreement, but in order to avoid inconsistency the Agreement is copyrighted and may only be modified in the following manner. The Agreement Steward reserves the right to publish new versions (including revisions) of this Agreement from time to time. No one other than the Agreement Steward has the right to modify this Agreement. The Eclipse Foundation is the initial Agreement Steward. The Eclipse Foundation may assign the responsibility to serve as the Agreement Steward to a suitable separate entity. Each new version of the Agreement will be given a distinguishing version number. The Program (including Contributions) may always be distributed subject to the version of the Agreement under which it was received. In addition, after a new version of the Agreement is published, Contributor may elect to distribute the Program (including its Contributions) under the new version. Except as expressly stated in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to the intellectual property of any Contributor under this Agreement, whether expressly, by implication, estoppel or otherwise. All rights in the Program not expressly granted under this Agreement are reserved. - -This Agreement is governed by the laws of the State of New York and the intellectual property laws of the United States of America. No party to this Agreement will bring a legal action under this Agreement more than one year after the cause of action arose. Each party waives its rights to a jury trial in any resulting litigation. - diff --git a/ide/o.eclipse.mylyn.wikitext.core/manifest.mf b/ide/o.eclipse.mylyn.wikitext.core/manifest.mf deleted file mode 100644 index 954a4c050e5b..000000000000 --- a/ide/o.eclipse.mylyn.wikitext.core/manifest.mf +++ /dev/null @@ -1 +0,0 @@ -OpenIDE-Module: org.eclipse.mylyn.wikitext.core diff --git a/ide/o.eclipse.mylyn.wikitext.core/nbproject/project.properties b/ide/o.eclipse.mylyn.wikitext.core/nbproject/project.properties deleted file mode 100644 index c82c296b4fed..000000000000 --- a/ide/o.eclipse.mylyn.wikitext.core/nbproject/project.properties +++ /dev/null @@ -1,19 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -release.external/org.eclipse.mylyn.wikitext.core_2.6.0.v20150901-2143-patched-nosignature.jar=modules/org-eclipse-mylyn-wikitext-core.jar -is.autoload=true -nbm.module.author=Tomas Stupka \ No newline at end of file diff --git a/ide/o.eclipse.mylyn.wikitext.core/nbproject/project.xml b/ide/o.eclipse.mylyn.wikitext.core/nbproject/project.xml deleted file mode 100644 index afee5ff7bb14..000000000000 --- a/ide/o.eclipse.mylyn.wikitext.core/nbproject/project.xml +++ /dev/null @@ -1,35 +0,0 @@ - - - - org.netbeans.modules.apisupport.project - - - org.eclipse.mylyn.wikitext.core - - - - org-eclipse-mylyn-wikitext-core.jar - external/org.eclipse.mylyn.wikitext.core_2.6.0.v20150901-2143-patched-nosignature.jar - - - - \ No newline at end of file diff --git a/ide/o.eclipse.mylyn.wikitext.markdown.core/build.xml b/ide/o.eclipse.mylyn.wikitext.markdown.core/build.xml deleted file mode 100644 index 4191cf2975f8..000000000000 --- a/ide/o.eclipse.mylyn.wikitext.markdown.core/build.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/ide/o.eclipse.mylyn.wikitext.markdown.core/external/binaries-list b/ide/o.eclipse.mylyn.wikitext.markdown.core/external/binaries-list deleted file mode 100644 index a8c98a48fc98..000000000000 --- a/ide/o.eclipse.mylyn.wikitext.markdown.core/external/binaries-list +++ /dev/null @@ -1,17 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -825DC870D1D423E347F4F8229A211A2C297BB15D org.eclipse.mylyn.wikitext.markdown.core_2.6.0.v20150901-2143.jar diff --git a/ide/o.eclipse.mylyn.wikitext.markdown.core/external/org.eclipse.mylyn.wikitext.markdown.core_2.6.0.v20150901-2143-license.txt b/ide/o.eclipse.mylyn.wikitext.markdown.core/external/org.eclipse.mylyn.wikitext.markdown.core_2.6.0.v20150901-2143-license.txt deleted file mode 100644 index b1c2af5d8579..000000000000 --- a/ide/o.eclipse.mylyn.wikitext.markdown.core/external/org.eclipse.mylyn.wikitext.markdown.core_2.6.0.v20150901-2143-license.txt +++ /dev/null @@ -1,95 +0,0 @@ -Name: org.eclipse.mylyn.wikitext.markdown.core -Origin: Eclipse -Version: 2.6.0 -License: EPL-v10 -URL: http://www.eclipse.org/mylyn/ -Description: Support for the Markdown wiki style - -Eclipse Public License - v 1.0 - -THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT. - -1. DEFINITIONS - -"Contribution" means: - -a) in the case of the initial Contributor, the initial code and documentation distributed under this Agreement, and - -b) in the case of each subsequent Contributor: - -i) changes to the Program, and - -ii) additions to the Program; - -where such changes and/or additions to the Program originate from and are distributed by that particular Contributor. A Contribution 'originates' from a Contributor if it was added to the Program by such Contributor itself or anyone acting on such Contributor's behalf. Contributions do not include additions to the Program which: (i) are separate modules of software distributed in conjunction with the Program under their own license agreement, and (ii) are not derivative works of the Program. - -"Contributor" means any person or entity that distributes the Program. - -"Licensed Patents" mean patent claims licensable by a Contributor which are necessarily infringed by the use or sale of its Contribution alone or when combined with the Program. - -"Program" means the Contributions distributed in accordance with this Agreement. - -"Recipient" means anyone who receives the Program under this Agreement, including all Contributors. - -2. GRANT OF RIGHTS - -a) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free copyright license to reproduce, prepare derivative works of, publicly display, publicly perform, distribute and sublicense the Contribution of such Contributor, if any, and such derivative works, in source code and object code form. - -b) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free patent license under Licensed Patents to make, use, sell, offer to sell, import and otherwise transfer the Contribution of such Contributor, if any, in source code and object code form. This patent license shall apply to the combination of the Contribution and the Program if, at the time the Contribution is added by the Contributor, such addition of the Contribution causes such combination to be covered by the Licensed Patents. The patent license shall not apply to any other combinations which include the Contribution. No hardware per se is licensed hereunder. - -c) Recipient understands that although each Contributor grants the licenses to its Contributions set forth herein, no assurances are provided by any Contributor that the Program does not infringe the patent or other intellectual property rights of any other entity. Each Contributor disclaims any liability to Recipient for claims brought by any other entity based on infringement of intellectual property rights or otherwise. As a condition to exercising the rights and licenses granted hereunder, each Recipient hereby assumes sole responsibility to secure any other intellectual property rights needed, if any. For example, if a third party patent license is required to allow Recipient to distribute the Program, it is Recipient's responsibility to acquire that license before distributing the Program. - -d) Each Contributor represents that to its knowledge it has sufficient copyright rights in its Contribution, if any, to grant the copyright license set forth in this Agreement. - -3. REQUIREMENTS - -A Contributor may choose to distribute the Program in object code form under its own license agreement, provided that: - -a) it complies with the terms and conditions of this Agreement; and - -b) its license agreement: - -i) effectively disclaims on behalf of all Contributors all warranties and conditions, express and implied, including warranties or conditions of title and non-infringement, and implied warranties or conditions of merchantability and fitness for a particular purpose; - -ii) effectively excludes on behalf of all Contributors all liability for damages, including direct, indirect, special, incidental and consequential damages, such as lost profits; - -iii) states that any provisions which differ from this Agreement are offered by that Contributor alone and not by any other party; and - -iv) states that source code for the Program is available from such Contributor, and informs licensees how to obtain it in a reasonable manner on or through a medium customarily used for software exchange. - -When the Program is made available in source code form: - -a) it must be made available under this Agreement; and - -b) a copy of this Agreement must be included with each copy of the Program. - -Contributors may not remove or alter any copyright notices contained within the Program. - -Each Contributor must identify itself as the originator of its Contribution, if any, in a manner that reasonably allows subsequent Recipients to identify the originator of the Contribution. - -4. COMMERCIAL DISTRIBUTION - -Commercial distributors of software may accept certain responsibilities with respect to end users, business partners and the like. While this license is intended to facilitate the commercial use of the Program, the Contributor who includes the Program in a commercial product offering should do so in a manner which does not create potential liability for other Contributors. Therefore, if a Contributor includes the Program in a commercial product offering, such Contributor ("Commercial Contributor") hereby agrees to defend and indemnify every other Contributor ("Indemnified Contributor") against any losses, damages and costs (collectively "Losses") arising from claims, lawsuits and other legal actions brought by a third party against the Indemnified Contributor to the extent caused by the acts or omissions of such Commercial Contributor in connection with its distribution of the Program in a commercial product offering. The obligations in this section do not apply to any claims or Losses relating to any actual or alleged intellectual property infringement. In order to qualify, an Indemnified Contributor must: a) promptly notify the Commercial Contributor in writing of such claim, and b) allow the Commercial Contributor to control, and cooperate with the Commercial Contributor in, the defense and any related settlement negotiations. The Indemnified Contributor may participate in any such claim at its own expense. - -For example, a Contributor might include the Program in a commercial product offering, Product X. That Contributor is then a Commercial Contributor. If that Commercial Contributor then makes performance claims, or offers warranties related to Product X, those performance claims and warranties are such Commercial Contributor's responsibility alone. Under this section, the Commercial Contributor would have to defend claims against the other Contributors related to those performance claims and warranties, and if a court requires any other Contributor to pay any damages as a result, the Commercial Contributor must pay those damages. - -5. NO WARRANTY - -EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely responsible for determining the appropriateness of using and distributing the Program and assumes all risks associated with its exercise of rights under this Agreement , including but not limited to the risks and costs of program errors, compliance with applicable laws, damage to or loss of data, programs or equipment, and unavailability or interruption of operations. - -6. DISCLAIMER OF LIABILITY - -EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - -7. GENERAL - -If any provision of this Agreement is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this Agreement, and without further action by the parties hereto, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable. - -If Recipient institutes patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Program itself (excluding combinations of the Program with other software or hardware) infringes such Recipient's patent(s), then such Recipient's rights granted under Section 2(b) shall terminate as of the date such litigation is filed. - -All Recipient's rights under this Agreement shall terminate if it fails to comply with any of the material terms or conditions of this Agreement and does not cure such failure in a reasonable period of time after becoming aware of such noncompliance. If all Recipient's rights under this Agreement terminate, Recipient agrees to cease use and distribution of the Program as soon as reasonably practicable. However, Recipient's obligations under this Agreement and any licenses granted by Recipient relating to the Program shall continue and survive. - -Everyone is permitted to copy and distribute copies of this Agreement, but in order to avoid inconsistency the Agreement is copyrighted and may only be modified in the following manner. The Agreement Steward reserves the right to publish new versions (including revisions) of this Agreement from time to time. No one other than the Agreement Steward has the right to modify this Agreement. The Eclipse Foundation is the initial Agreement Steward. The Eclipse Foundation may assign the responsibility to serve as the Agreement Steward to a suitable separate entity. Each new version of the Agreement will be given a distinguishing version number. The Program (including Contributions) may always be distributed subject to the version of the Agreement under which it was received. In addition, after a new version of the Agreement is published, Contributor may elect to distribute the Program (including its Contributions) under the new version. Except as expressly stated in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to the intellectual property of any Contributor under this Agreement, whether expressly, by implication, estoppel or otherwise. All rights in the Program not expressly granted under this Agreement are reserved. - -This Agreement is governed by the laws of the State of New York and the intellectual property laws of the United States of America. No party to this Agreement will bring a legal action under this Agreement more than one year after the cause of action arose. Each party waives its rights to a jury trial in any resulting litigation. - diff --git a/ide/o.eclipse.mylyn.wikitext.markdown.core/manifest.mf b/ide/o.eclipse.mylyn.wikitext.markdown.core/manifest.mf deleted file mode 100644 index bcd18048594d..000000000000 --- a/ide/o.eclipse.mylyn.wikitext.markdown.core/manifest.mf +++ /dev/null @@ -1 +0,0 @@ -OpenIDE-Module: org.eclipse.mylyn.wikitext.markdown.core \ No newline at end of file diff --git a/ide/o.eclipse.mylyn.wikitext.markdown.core/nbproject/project.properties b/ide/o.eclipse.mylyn.wikitext.markdown.core/nbproject/project.properties deleted file mode 100644 index 9bfecebdd3b5..000000000000 --- a/ide/o.eclipse.mylyn.wikitext.markdown.core/nbproject/project.properties +++ /dev/null @@ -1,19 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -release.external/org.eclipse.mylyn.wikitext.markdown.core_2.6.0.v20150901-2143.jar=modules/org-eclipse-mylyn-wikitext-markdown-core.jar -is.autoload=true -nbm.module.author=Tomas Stupka \ No newline at end of file diff --git a/ide/o.eclipse.mylyn.wikitext.markdown.core/nbproject/project.xml b/ide/o.eclipse.mylyn.wikitext.markdown.core/nbproject/project.xml deleted file mode 100644 index 22fc08840c1b..000000000000 --- a/ide/o.eclipse.mylyn.wikitext.markdown.core/nbproject/project.xml +++ /dev/null @@ -1,35 +0,0 @@ - - - - org.netbeans.modules.apisupport.project - - - org.eclipse.mylyn.wikitext.markdown.core - - - - org-eclipse-mylyn-wikitext-markdown-core.jar - external/org.eclipse.mylyn.wikitext.markdown.core_2.6.0.v20150901-2143.jar - - - - \ No newline at end of file diff --git a/ide/o.eclipse.mylyn.wikitext.textile.core/build.xml b/ide/o.eclipse.mylyn.wikitext.textile.core/build.xml deleted file mode 100644 index aa8147cab66a..000000000000 --- a/ide/o.eclipse.mylyn.wikitext.textile.core/build.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/ide/o.eclipse.mylyn.wikitext.textile.core/external/binaries-list b/ide/o.eclipse.mylyn.wikitext.textile.core/external/binaries-list deleted file mode 100644 index 083850cced49..000000000000 --- a/ide/o.eclipse.mylyn.wikitext.textile.core/external/binaries-list +++ /dev/null @@ -1,17 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -C3024631DD14008D2FF35A576C3D82AC6FCB2E10 org.eclipse.mylyn.wikitext.textile.core_2.6.0.v20150901-2143.jar diff --git a/ide/o.eclipse.mylyn.wikitext.textile.core/external/org.eclipse.mylyn.wikitext.textile.core_2.6.0.v20150901-2143-license.txt b/ide/o.eclipse.mylyn.wikitext.textile.core/external/org.eclipse.mylyn.wikitext.textile.core_2.6.0.v20150901-2143-license.txt deleted file mode 100644 index c0f0a8d98a59..000000000000 --- a/ide/o.eclipse.mylyn.wikitext.textile.core/external/org.eclipse.mylyn.wikitext.textile.core_2.6.0.v20150901-2143-license.txt +++ /dev/null @@ -1,94 +0,0 @@ -Name: Mylyn Wikitext Textile Core -Origin: Eclipse -Version: 2.6.0 -License: EPL-v10 -Description: TBD - -Eclipse Public License - v 1.0 - -THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT. - -1. DEFINITIONS - -"Contribution" means: - -a) in the case of the initial Contributor, the initial code and documentation distributed under this Agreement, and - -b) in the case of each subsequent Contributor: - -i) changes to the Program, and - -ii) additions to the Program; - -where such changes and/or additions to the Program originate from and are distributed by that particular Contributor. A Contribution 'originates' from a Contributor if it was added to the Program by such Contributor itself or anyone acting on such Contributor's behalf. Contributions do not include additions to the Program which: (i) are separate modules of software distributed in conjunction with the Program under their own license agreement, and (ii) are not derivative works of the Program. - -"Contributor" means any person or entity that distributes the Program. - -"Licensed Patents" mean patent claims licensable by a Contributor which are necessarily infringed by the use or sale of its Contribution alone or when combined with the Program. - -"Program" means the Contributions distributed in accordance with this Agreement. - -"Recipient" means anyone who receives the Program under this Agreement, including all Contributors. - -2. GRANT OF RIGHTS - -a) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free copyright license to reproduce, prepare derivative works of, publicly display, publicly perform, distribute and sublicense the Contribution of such Contributor, if any, and such derivative works, in source code and object code form. - -b) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free patent license under Licensed Patents to make, use, sell, offer to sell, import and otherwise transfer the Contribution of such Contributor, if any, in source code and object code form. This patent license shall apply to the combination of the Contribution and the Program if, at the time the Contribution is added by the Contributor, such addition of the Contribution causes such combination to be covered by the Licensed Patents. The patent license shall not apply to any other combinations which include the Contribution. No hardware per se is licensed hereunder. - -c) Recipient understands that although each Contributor grants the licenses to its Contributions set forth herein, no assurances are provided by any Contributor that the Program does not infringe the patent or other intellectual property rights of any other entity. Each Contributor disclaims any liability to Recipient for claims brought by any other entity based on infringement of intellectual property rights or otherwise. As a condition to exercising the rights and licenses granted hereunder, each Recipient hereby assumes sole responsibility to secure any other intellectual property rights needed, if any. For example, if a third party patent license is required to allow Recipient to distribute the Program, it is Recipient's responsibility to acquire that license before distributing the Program. - -d) Each Contributor represents that to its knowledge it has sufficient copyright rights in its Contribution, if any, to grant the copyright license set forth in this Agreement. - -3. REQUIREMENTS - -A Contributor may choose to distribute the Program in object code form under its own license agreement, provided that: - -a) it complies with the terms and conditions of this Agreement; and - -b) its license agreement: - -i) effectively disclaims on behalf of all Contributors all warranties and conditions, express and implied, including warranties or conditions of title and non-infringement, and implied warranties or conditions of merchantability and fitness for a particular purpose; - -ii) effectively excludes on behalf of all Contributors all liability for damages, including direct, indirect, special, incidental and consequential damages, such as lost profits; - -iii) states that any provisions which differ from this Agreement are offered by that Contributor alone and not by any other party; and - -iv) states that source code for the Program is available from such Contributor, and informs licensees how to obtain it in a reasonable manner on or through a medium customarily used for software exchange. - -When the Program is made available in source code form: - -a) it must be made available under this Agreement; and - -b) a copy of this Agreement must be included with each copy of the Program. - -Contributors may not remove or alter any copyright notices contained within the Program. - -Each Contributor must identify itself as the originator of its Contribution, if any, in a manner that reasonably allows subsequent Recipients to identify the originator of the Contribution. - -4. COMMERCIAL DISTRIBUTION - -Commercial distributors of software may accept certain responsibilities with respect to end users, business partners and the like. While this license is intended to facilitate the commercial use of the Program, the Contributor who includes the Program in a commercial product offering should do so in a manner which does not create potential liability for other Contributors. Therefore, if a Contributor includes the Program in a commercial product offering, such Contributor ("Commercial Contributor") hereby agrees to defend and indemnify every other Contributor ("Indemnified Contributor") against any losses, damages and costs (collectively "Losses") arising from claims, lawsuits and other legal actions brought by a third party against the Indemnified Contributor to the extent caused by the acts or omissions of such Commercial Contributor in connection with its distribution of the Program in a commercial product offering. The obligations in this section do not apply to any claims or Losses relating to any actual or alleged intellectual property infringement. In order to qualify, an Indemnified Contributor must: a) promptly notify the Commercial Contributor in writing of such claim, and b) allow the Commercial Contributor to control, and cooperate with the Commercial Contributor in, the defense and any related settlement negotiations. The Indemnified Contributor may participate in any such claim at its own expense. - -For example, a Contributor might include the Program in a commercial product offering, Product X. That Contributor is then a Commercial Contributor. If that Commercial Contributor then makes performance claims, or offers warranties related to Product X, those performance claims and warranties are such Commercial Contributor's responsibility alone. Under this section, the Commercial Contributor would have to defend claims against the other Contributors related to those performance claims and warranties, and if a court requires any other Contributor to pay any damages as a result, the Commercial Contributor must pay those damages. - -5. NO WARRANTY - -EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely responsible for determining the appropriateness of using and distributing the Program and assumes all risks associated with its exercise of rights under this Agreement , including but not limited to the risks and costs of program errors, compliance with applicable laws, damage to or loss of data, programs or equipment, and unavailability or interruption of operations. - -6. DISCLAIMER OF LIABILITY - -EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - -7. GENERAL - -If any provision of this Agreement is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this Agreement, and without further action by the parties hereto, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable. - -If Recipient institutes patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Program itself (excluding combinations of the Program with other software or hardware) infringes such Recipient's patent(s), then such Recipient's rights granted under Section 2(b) shall terminate as of the date such litigation is filed. - -All Recipient's rights under this Agreement shall terminate if it fails to comply with any of the material terms or conditions of this Agreement and does not cure such failure in a reasonable period of time after becoming aware of such noncompliance. If all Recipient's rights under this Agreement terminate, Recipient agrees to cease use and distribution of the Program as soon as reasonably practicable. However, Recipient's obligations under this Agreement and any licenses granted by Recipient relating to the Program shall continue and survive. - -Everyone is permitted to copy and distribute copies of this Agreement, but in order to avoid inconsistency the Agreement is copyrighted and may only be modified in the following manner. The Agreement Steward reserves the right to publish new versions (including revisions) of this Agreement from time to time. No one other than the Agreement Steward has the right to modify this Agreement. The Eclipse Foundation is the initial Agreement Steward. The Eclipse Foundation may assign the responsibility to serve as the Agreement Steward to a suitable separate entity. Each new version of the Agreement will be given a distinguishing version number. The Program (including Contributions) may always be distributed subject to the version of the Agreement under which it was received. In addition, after a new version of the Agreement is published, Contributor may elect to distribute the Program (including its Contributions) under the new version. Except as expressly stated in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to the intellectual property of any Contributor under this Agreement, whether expressly, by implication, estoppel or otherwise. All rights in the Program not expressly granted under this Agreement are reserved. - -This Agreement is governed by the laws of the State of New York and the intellectual property laws of the United States of America. No party to this Agreement will bring a legal action under this Agreement more than one year after the cause of action arose. Each party waives its rights to a jury trial in any resulting litigation. - diff --git a/ide/o.eclipse.mylyn.wikitext.textile.core/manifest.mf b/ide/o.eclipse.mylyn.wikitext.textile.core/manifest.mf deleted file mode 100644 index 81cd21ea77a8..000000000000 --- a/ide/o.eclipse.mylyn.wikitext.textile.core/manifest.mf +++ /dev/null @@ -1 +0,0 @@ -OpenIDE-Module: org.eclipse.mylyn.wikitext.textile.core \ No newline at end of file diff --git a/ide/o.eclipse.mylyn.wikitext.textile.core/nbproject/project.properties b/ide/o.eclipse.mylyn.wikitext.textile.core/nbproject/project.properties deleted file mode 100644 index e96e5abe8819..000000000000 --- a/ide/o.eclipse.mylyn.wikitext.textile.core/nbproject/project.properties +++ /dev/null @@ -1,19 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -release.external/org.eclipse.mylyn.wikitext.textile.core_2.6.0.v20150901-2143.jar=modules/org-eclipse-mylyn-wikitext-textile-core.jar -is.autoload=true -nbm.module.author=Tomas Stupka \ No newline at end of file diff --git a/ide/o.eclipse.mylyn.wikitext.textile.core/nbproject/project.xml b/ide/o.eclipse.mylyn.wikitext.textile.core/nbproject/project.xml deleted file mode 100644 index 491929a34819..000000000000 --- a/ide/o.eclipse.mylyn.wikitext.textile.core/nbproject/project.xml +++ /dev/null @@ -1,35 +0,0 @@ - - - - org.netbeans.modules.apisupport.project - - - org.eclipse.mylyn.wikitext.textile.core - - - - org-eclipse-mylyn-wikitext-textile-core.jar - external/org.eclipse.mylyn.wikitext.textile.core_2.6.0.v20150901-2143.jar - - - - \ No newline at end of file diff --git a/ide/team.commons/nbproject/project.xml b/ide/team.commons/nbproject/project.xml index 5869bfb7dde8..d2e2703b9d6d 100644 --- a/ide/team.commons/nbproject/project.xml +++ b/ide/team.commons/nbproject/project.xml @@ -209,7 +209,6 @@ org.netbeans.modules.odcs org.netbeans.modules.team.ide org.netbeans.modules.team.server - org.netbeans.modules.mylyn.util eu.doppel_helix.netbeans.MantisIntegration diff --git a/nb/bugzilla.exceptionreporter/build.xml b/nb/bugzilla.exceptionreporter/build.xml deleted file mode 100644 index 664e526e92a0..000000000000 --- a/nb/bugzilla.exceptionreporter/build.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - Builds, tests, and runs the project org.netbeans.modules.bugzilla.exceptionreporter - - diff --git a/nb/bugzilla.exceptionreporter/manifest.mf b/nb/bugzilla.exceptionreporter/manifest.mf deleted file mode 100644 index 4cc16695c360..000000000000 --- a/nb/bugzilla.exceptionreporter/manifest.mf +++ /dev/null @@ -1,7 +0,0 @@ -Manifest-Version: 1.0 -AutoUpdate-Show-In-Client: false -AutoUpdate-Essential-Module: true -OpenIDE-Module: org.netbeans.modules.bugzilla.exceptionreporter -OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/bugzilla/exceptionreporter/Bundle.properties -OpenIDE-Module-Specification-Version: 1.55 - diff --git a/nb/bugzilla.exceptionreporter/nbproject/project.properties b/nb/bugzilla.exceptionreporter/nbproject/project.properties deleted file mode 100644 index 4e0bbcabcf0d..000000000000 --- a/nb/bugzilla.exceptionreporter/nbproject/project.properties +++ /dev/null @@ -1,19 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -javac.source=1.8 -is.autoload=true -javac.compilerargs=-Xlint -Xlint:-serial diff --git a/nb/bugzilla.exceptionreporter/nbproject/project.xml b/nb/bugzilla.exceptionreporter/nbproject/project.xml deleted file mode 100644 index 68b48dc46f40..000000000000 --- a/nb/bugzilla.exceptionreporter/nbproject/project.xml +++ /dev/null @@ -1,88 +0,0 @@ - - - - org.netbeans.modules.apisupport.project - - - org.netbeans.modules.bugzilla.exceptionreporter - - - org.netbeans.lib.uihandler - - - - 1.37 - - - - org.netbeans.modules.bugzilla - - - - 1.40 - - - - org.netbeans.modules.keyring - - - - 1.0 - - - - org.openide.awt - - - - 7.59 - - - - org.openide.util.ui - - - - 9.3 - - - - org.openide.util - - - - 9.3 - - - - org.openide.util.lookup - - - - 8.0 - - - - - - - diff --git a/nb/bugzilla.exceptionreporter/src/org/netbeans/modules/bugzilla/exceptionreporter/Bundle.properties b/nb/bugzilla.exceptionreporter/src/org/netbeans/modules/bugzilla/exceptionreporter/Bundle.properties deleted file mode 100644 index 180d1d965388..000000000000 --- a/nb/bugzilla.exceptionreporter/src/org/netbeans/modules/bugzilla/exceptionreporter/Bundle.properties +++ /dev/null @@ -1,21 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - -OpenIDE-Module-Display-Category=Team -OpenIDE-Module-Name=Bugzilla-Exception Reporter Bridge - -OpenIDE-Module-Short-Description=Providess exception reporter access to the netbeans.org bugzilla diff --git a/nb/bugzilla.exceptionreporter/src/org/netbeans/modules/bugzilla/exceptionreporter/NBBugzillaAccessorImpl.java b/nb/bugzilla.exceptionreporter/src/org/netbeans/modules/bugzilla/exceptionreporter/NBBugzillaAccessorImpl.java deleted file mode 100644 index dbf4d78c0bb1..000000000000 --- a/nb/bugzilla.exceptionreporter/src/org/netbeans/modules/bugzilla/exceptionreporter/NBBugzillaAccessorImpl.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.netbeans.modules.bugzilla.exceptionreporter; - -import org.netbeans.lib.uihandler.BugTrackingAccessor; -import org.netbeans.modules.bugzilla.api.NBBugzillaUtils; -import org.openide.util.RequestProcessor; - -/** - * - * @author Tomas Stupka - */ -@org.openide.util.lookup.ServiceProvider(service = org.netbeans.lib.uihandler.BugTrackingAccessor.class) -public class NBBugzillaAccessorImpl extends BugTrackingAccessor { - - private RequestProcessor rp; - - @Override - public void openIssue(final String issueID) { - getRequestProcessor().post(new Runnable() { - @Override - public void run() { - NBBugzillaUtils.openIssue(issueID); - } - }); - } - - @Override - public String getUsername() { - return NBBugzillaUtils.getNBUsername(); - } - - @Override - public char[] getPassword() { - return NBBugzillaUtils.getNBPassword(); - } - - @Override - public void saveUsername(String username) { - NBBugzillaUtils.saveNBUsername(username); - } - - @Override - public void savePassword(char[] password) { - NBBugzillaUtils.saveNBPassword(password); - } - - private RequestProcessor getRequestProcessor() { - if(rp == null) { - rp = new RequestProcessor("NBBugzilaReports"); // NOI18N - } - return rp; - } - -} diff --git a/nbbuild/cluster.properties b/nbbuild/cluster.properties index aa4b31a1fc96..58775c1762c0 100644 --- a/nbbuild/cluster.properties +++ b/nbbuild/cluster.properties @@ -270,7 +270,6 @@ nb.cluster.ide=\ bugtracking,\ bugtracking.bridge,\ bugtracking.commons,\ - bugzilla,\ c.google.gson,\ c.google.guava,\ c.google.guava.failureaccess,\ @@ -408,18 +407,12 @@ nb.cluster.ide=\ libs.truffleapi,\ libs.xerces,\ localhistory,\ - localtasks,\ lsp.client,\ markdown,\ mercurial,\ - mylyn.util,\ nativeimage.api,\ notifications,\ - o.apache.commons.httpclient,\ - o.apache.commons.lang,\ - o.apache.ws.commons.util,\ o.apache.xml.resolver,\ - o.apache.xmlrpc,\ o.eclipse.core.contenttype,\ o.eclipse.core.jobs,\ o.eclipse.core.net,\ @@ -434,16 +427,6 @@ nb.cluster.ide=\ o.eclipse.jgit.gpg.bc,\ o.eclipse.jgit.lfs,\ o.eclipse.jgit.ssh.jsch,\ - o.eclipse.mylyn.bugzilla.core,\ - o.eclipse.mylyn.commons.core,\ - o.eclipse.mylyn.commons.net,\ - o.eclipse.mylyn.commons.repositories.core,\ - o.eclipse.mylyn.commons.xmlrpc,\ - o.eclipse.mylyn.tasks.core,\ - o.eclipse.mylyn.wikitext.confluence.core,\ - o.eclipse.mylyn.wikitext.core,\ - o.eclipse.mylyn.wikitext.markdown.core,\ - o.eclipse.mylyn.wikitext.textile.core,\ o.n.agent,\ o.n.swing.dirchooser,\ o.openidex.util,\ @@ -870,7 +853,6 @@ nb.cluster.nb.depends=\ nb.cluster.harness nb.cluster.nb=\ autoupdate.pluginimporter,\ - bugzilla.exceptionreporter,\ deadlock.detector,\ ide.branding,\ ide.branding.kit,\ From 3e2badd4f72e23e1f9ca58486b09fc4ab309c4ed Mon Sep 17 00:00:00 2001 From: Laszlo Kishalmi Date: Sat, 29 Nov 2025 08:40:51 -0800 Subject: [PATCH 2/2] Disable Bugtracking Functions when there are no Connectors --- .github/workflows/main.yml | 3 --- ide/bugtracking.bridge/nbproject/project.xml | 4 ---- .../bridge/nodes/BugtrackingRootNode.java | 10 ++++++++++ .../modules/bugtracking/vcs/HookPanel.java | 7 ++++++- .../modules/bugtracking/vcs/HgHookTest.java | 19 +++++++------------ .../modules/bugtracking/vcs/SvnHookTest.java | 17 ++++++----------- .../nbproject/project.properties | 1 + ide/bugtracking.commons/nbproject/project.xml | 6 ++---- ide/bugtracking/nbproject/project.properties | 1 + .../bugtracking/BugtrackingManager.java | 4 ++++ .../bugtracking/ui/issue/IssueAction.java | 5 +++++ .../ui/issue/IssueTopComponent.java | 10 +++------- .../bugtracking/ui/query/QueryAction.java | 5 +++++ .../ui/query/QueryTopComponent.java | 1 + 14 files changed, 51 insertions(+), 42 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 00767e2c7b5c..7727a32e1a8c 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -569,9 +569,6 @@ jobs: - name: ide/bugtracking.commons run: ant $OPTS -f ide/bugtracking.commons test -# - name: ide/bugzilla -# run: ant $OPTS -f ide/bugzilla test - - name: ide/code.analysis run: ant $OPTS -f ide/code.analysis test diff --git a/ide/bugtracking.bridge/nbproject/project.xml b/ide/bugtracking.bridge/nbproject/project.xml index e8a8ba6b49f4..7a45edae048b 100644 --- a/ide/bugtracking.bridge/nbproject/project.xml +++ b/ide/bugtracking.bridge/nbproject/project.xml @@ -172,10 +172,6 @@ unit - - org.eclipse.equinox.common - - org.netbeans.libs.junit4 diff --git a/ide/bugtracking.bridge/src/org/netbeans/modules/bugtracking/bridge/nodes/BugtrackingRootNode.java b/ide/bugtracking.bridge/src/org/netbeans/modules/bugtracking/bridge/nodes/BugtrackingRootNode.java index ffc39aee6c84..84f1197a0b47 100644 --- a/ide/bugtracking.bridge/src/org/netbeans/modules/bugtracking/bridge/nodes/BugtrackingRootNode.java +++ b/ide/bugtracking.bridge/src/org/netbeans/modules/bugtracking/bridge/nodes/BugtrackingRootNode.java @@ -32,7 +32,9 @@ import org.netbeans.modules.bugtracking.api.Repository; import org.netbeans.modules.bugtracking.api.RepositoryManager; import org.netbeans.modules.bugtracking.api.Util; +import org.netbeans.modules.bugtracking.spi.BugtrackingConnector; import org.openide.nodes.*; +import org.openide.util.Lookup; import org.openide.util.NbBundle; /** @@ -85,10 +87,18 @@ public static BugtrackingRootNode getDefault() { public Action[] getActions(boolean context) { return new Action[] { new AbstractAction(NbBundle.getMessage(BugtrackingRootNode.class, "LBL_CreateRepository")) { // NOI18N + final boolean hasConnector = Lookup.getDefault().lookup(BugtrackingConnector.class) != null; + @Override public void actionPerformed(ActionEvent e) { Util.createRepository(); } + + @Override + public boolean isEnabled() { + return hasConnector; + } + } }; } diff --git a/ide/bugtracking.bridge/src/org/netbeans/modules/bugtracking/vcs/HookPanel.java b/ide/bugtracking.bridge/src/org/netbeans/modules/bugtracking/vcs/HookPanel.java index 7fb4bd18d8b6..5db33f19a3dd 100644 --- a/ide/bugtracking.bridge/src/org/netbeans/modules/bugtracking/vcs/HookPanel.java +++ b/ide/bugtracking.bridge/src/org/netbeans/modules/bugtracking/vcs/HookPanel.java @@ -31,8 +31,10 @@ import org.netbeans.modules.bugtracking.api.Issue; import org.netbeans.modules.bugtracking.api.IssueQuickSearch; import org.netbeans.modules.bugtracking.api.Repository; +import org.netbeans.modules.bugtracking.spi.BugtrackingConnector; import org.netbeans.modules.versioning.util.VerticallyNonResizingPanel; import org.openide.filesystems.FileObject; +import org.openide.util.Lookup; /** * @@ -73,7 +75,7 @@ public HookPanel(FileObject context, boolean link, boolean resolve, boolean comm qs = IssueQuickSearch.create(context); qs.setChangeListener(this); - qs.setEnabled(true); + qs.setEnabled(hasRegisteredConnectors()); issuePanel.add(qs.getComponent(), BorderLayout.NORTH); linkCheckBox.setSelected(link); @@ -239,4 +241,7 @@ public void stateChanged(ChangeEvent e) { enableFields(); } + private boolean hasRegisteredConnectors() { + return Lookup.getDefault().lookup(BugtrackingConnector.class) != null; + } } diff --git a/ide/bugtracking.bridge/test/unit/src/org/netbeans/modules/bugtracking/vcs/HgHookTest.java b/ide/bugtracking.bridge/test/unit/src/org/netbeans/modules/bugtracking/vcs/HgHookTest.java index 57836bad5d20..aca97d8c94f9 100644 --- a/ide/bugtracking.bridge/test/unit/src/org/netbeans/modules/bugtracking/vcs/HgHookTest.java +++ b/ide/bugtracking.bridge/test/unit/src/org/netbeans/modules/bugtracking/vcs/HgHookTest.java @@ -24,20 +24,15 @@ import java.io.IOException; import java.lang.reflect.Field; import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; import java.net.MalformedURLException; import java.util.Collection; import java.util.Date; import java.util.logging.Level; import javax.swing.DefaultComboBoxModel; import javax.swing.JComboBox; -import org.eclipse.core.runtime.CoreException; import org.netbeans.junit.NbTestCase; -import org.netbeans.modules.bugtracking.IssueImpl; import org.netbeans.modules.bugtracking.TestKit; -import org.netbeans.modules.bugtracking.api.IssueQuickSearch; import org.netbeans.modules.bugtracking.api.Repository; -import org.netbeans.modules.bugtracking.ui.search.QuickSearchComboBar; import org.netbeans.modules.bugtracking.ui.search.QuickSearchPanel; import org.netbeans.modules.bugtracking.vcs.VCSHooksConfig.HookType; import org.netbeans.modules.bugtracking.vcs.VCSHooksConfig.PushOperation; @@ -66,7 +61,7 @@ protected void setUp() throws Exception { System.setProperty("netbeans.user", getWorkDir().getAbsolutePath() + "/userdir"); } - public void testPanel() throws MalformedURLException, CoreException, IOException, InterruptedException, NoSuchFieldException, IllegalArgumentException, IllegalAccessException, NoSuchMethodException, InvocationTargetException { + public void testPanel() throws MalformedURLException, IOException, InterruptedException, NoSuchFieldException, IllegalArgumentException, IllegalAccessException, NoSuchMethodException, InvocationTargetException { HgHookImpl hook = getHook(); VCSHooksConfig.getInstance(HookType.HG).setLink(true); @@ -101,7 +96,7 @@ public void testPanel() throws MalformedURLException, CoreException, IOException assertTrue(panel.pushRadioButton.isSelected()); } - public void testBeforeCommitNoLink() throws MalformedURLException, CoreException, IOException, InterruptedException, NoSuchFieldException, IllegalArgumentException, IllegalAccessException, NoSuchMethodException, InvocationTargetException { + public void testBeforeCommitNoLink() throws MalformedURLException, IOException, InterruptedException, NoSuchFieldException, IllegalArgumentException, IllegalAccessException, NoSuchMethodException, InvocationTargetException { HgHookImpl hook = getHook(); VCSHooksConfig.getInstance(HookType.HG).setLink(false); @@ -114,7 +109,7 @@ public void testBeforeCommitNoLink() throws MalformedURLException, CoreException assertNull(ctx); } - public void testBeforeCommitWithLink() throws MalformedURLException, CoreException, IOException, InterruptedException, NoSuchFieldException, IllegalArgumentException, IllegalAccessException, NoSuchMethodException, InvocationTargetException { + public void testBeforeCommitWithLink() throws MalformedURLException, IOException, InterruptedException, NoSuchFieldException, IllegalArgumentException, IllegalAccessException, NoSuchMethodException, InvocationTargetException { HgHookImpl hook = getHook(); VCSHooksConfig.getInstance(HookType.HG).setLink(true); @@ -130,7 +125,7 @@ public void testBeforeCommitWithLink() throws MalformedURLException, CoreExcepti assertNotSame(msg, ctx.getMessage()); // issue info was added } - public void testAfterCommitLink() throws MalformedURLException, CoreException, IOException, InterruptedException, NoSuchFieldException, IllegalArgumentException, IllegalAccessException, NoSuchMethodException, InvocationTargetException { + public void testAfterCommitLink() throws MalformedURLException, IOException, InterruptedException, NoSuchFieldException, IllegalArgumentException, IllegalAccessException, NoSuchMethodException, InvocationTargetException { HgHookImpl hook = getHook(); VCSHooksConfig.getInstance(HookType.HG).setAfterCommit(true); @@ -151,7 +146,7 @@ public void testAfterCommitLink() throws MalformedURLException, CoreException, I assertFalse(HookIssue.getInstance().closed); } - public void testAfterCommitResolve() throws MalformedURLException, CoreException, IOException, InterruptedException, NoSuchFieldException, IllegalArgumentException, IllegalAccessException, NoSuchMethodException, InvocationTargetException { + public void testAfterCommitResolve() throws MalformedURLException, IOException, InterruptedException, NoSuchFieldException, IllegalArgumentException, IllegalAccessException, NoSuchMethodException, InvocationTargetException { HgHookImpl hook = getHook(); VCSHooksConfig.getInstance(HookType.HG).setAfterCommit(true); @@ -171,7 +166,7 @@ public void testAfterCommitResolve() throws MalformedURLException, CoreException assertTrue(HookIssue.getInstance().closed); } - public void testAfterCommitLinkResolve() throws MalformedURLException, CoreException, IOException, InterruptedException, NoSuchFieldException, IllegalArgumentException, IllegalAccessException, NoSuchMethodException, InvocationTargetException { + public void testAfterCommitLinkResolve() throws MalformedURLException, IOException, InterruptedException, NoSuchFieldException, IllegalArgumentException, IllegalAccessException, NoSuchMethodException, InvocationTargetException { HgHookImpl hook = getHook(); VCSHooksConfig.getInstance(HookType.HG).setAfterCommit(true); @@ -192,7 +187,7 @@ public void testAfterCommitLinkResolve() throws MalformedURLException, CoreExcep assertTrue(HookIssue.getInstance().closed); } - public void testAfterCommitLinkResolveAfterPush() throws MalformedURLException, CoreException, IOException, InterruptedException, NoSuchFieldException, IllegalArgumentException, IllegalAccessException, NoSuchMethodException, InvocationTargetException { + public void testAfterCommitLinkResolveAfterPush() throws MalformedURLException, IOException, InterruptedException, NoSuchFieldException, IllegalArgumentException, IllegalAccessException, NoSuchMethodException, InvocationTargetException { HookIssue.getInstance().reset(); HgHookImpl hook = getHook(); diff --git a/ide/bugtracking.bridge/test/unit/src/org/netbeans/modules/bugtracking/vcs/SvnHookTest.java b/ide/bugtracking.bridge/test/unit/src/org/netbeans/modules/bugtracking/vcs/SvnHookTest.java index 6b6d0cbf2061..a5441bdb8b48 100644 --- a/ide/bugtracking.bridge/test/unit/src/org/netbeans/modules/bugtracking/vcs/SvnHookTest.java +++ b/ide/bugtracking.bridge/test/unit/src/org/netbeans/modules/bugtracking/vcs/SvnHookTest.java @@ -24,7 +24,6 @@ import java.io.IOException; import java.lang.reflect.Field; import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; import java.net.MalformedURLException; import java.util.Arrays; import java.util.Collection; @@ -32,14 +31,10 @@ import java.util.logging.Level; import javax.swing.DefaultComboBoxModel; import javax.swing.JComboBox; -import org.eclipse.core.runtime.CoreException; import org.netbeans.junit.NbTestCase; import org.netbeans.junit.RandomlyFails; -import org.netbeans.modules.bugtracking.IssueImpl; import org.netbeans.modules.bugtracking.TestKit; -import org.netbeans.modules.bugtracking.api.IssueQuickSearch; import org.netbeans.modules.bugtracking.api.Repository; -import org.netbeans.modules.bugtracking.ui.search.QuickSearchComboBar; import org.netbeans.modules.bugtracking.ui.search.QuickSearchPanel; import org.netbeans.modules.bugtracking.vcs.VCSHooksConfig.HookType; import org.netbeans.modules.versioning.hooks.SvnHook; @@ -68,7 +63,7 @@ protected void setUp() throws Exception { } @RandomlyFails - public void testPanel() throws MalformedURLException, CoreException, IOException, InterruptedException, NoSuchFieldException, IllegalArgumentException, IllegalAccessException, NoSuchMethodException, InvocationTargetException { + public void testPanel() throws MalformedURLException, IOException, InterruptedException, NoSuchFieldException, IllegalArgumentException, IllegalAccessException, NoSuchMethodException, InvocationTargetException { SvnHookImpl hook = getHook(); VCSHooksConfig.getInstance(HookType.SVN).setLink(true); @@ -98,7 +93,7 @@ public void testPanel() throws MalformedURLException, CoreException, IOException assertFalse(panel.resolveCheckBox.isSelected()); } - public void testBeforeCommitNoLink() throws MalformedURLException, CoreException, IOException, InterruptedException, NoSuchFieldException, IllegalArgumentException, IllegalAccessException, NoSuchMethodException, InvocationTargetException { + public void testBeforeCommitNoLink() throws MalformedURLException, IOException, InterruptedException, NoSuchFieldException, IllegalArgumentException, IllegalAccessException, NoSuchMethodException, InvocationTargetException { SvnHookImpl hook = getHook(); VCSHooksConfig.getInstance(HookType.SVN).setLink(false); @@ -111,7 +106,7 @@ public void testBeforeCommitNoLink() throws MalformedURLException, CoreException assertNull(ctx); } - public void testBeforeCommitWithLink() throws MalformedURLException, CoreException, IOException, InterruptedException, NoSuchFieldException, IllegalArgumentException, IllegalAccessException, NoSuchMethodException, InvocationTargetException { + public void testBeforeCommitWithLink() throws MalformedURLException, IOException, InterruptedException, NoSuchFieldException, IllegalArgumentException, IllegalAccessException, NoSuchMethodException, InvocationTargetException { SvnHookImpl hook = getHook(); VCSHooksConfig.getInstance(HookType.SVN).setLink(true); @@ -127,7 +122,7 @@ public void testBeforeCommitWithLink() throws MalformedURLException, CoreExcepti assertNotSame(msg, ctx.getMessage()); // issue info was added } - public void testAfterCommitLink() throws MalformedURLException, CoreException, IOException, InterruptedException, NoSuchFieldException, IllegalArgumentException, IllegalAccessException, NoSuchMethodException, InvocationTargetException { + public void testAfterCommitLink() throws MalformedURLException, IOException, InterruptedException, NoSuchFieldException, IllegalArgumentException, IllegalAccessException, NoSuchMethodException, InvocationTargetException { SvnHookImpl hook = getHook(); VCSHooksConfig.getInstance(HookType.SVN).setLink(true); @@ -147,7 +142,7 @@ public void testAfterCommitLink() throws MalformedURLException, CoreException, I assertFalse(HookIssue.getInstance().closed); } - public void testAfterCommitResolve() throws MalformedURLException, CoreException, IOException, InterruptedException, NoSuchFieldException, IllegalArgumentException, IllegalAccessException, NoSuchMethodException, InvocationTargetException { + public void testAfterCommitResolve() throws MalformedURLException, IOException, InterruptedException, NoSuchFieldException, IllegalArgumentException, IllegalAccessException, NoSuchMethodException, InvocationTargetException { SvnHookImpl hook = getHook(); VCSHooksConfig.getInstance(HookType.SVN).setLink(false); @@ -166,7 +161,7 @@ public void testAfterCommitResolve() throws MalformedURLException, CoreException assertTrue(HookIssue.getInstance().closed); } - public void testAfterCommitLinkResolve() throws MalformedURLException, CoreException, IOException, InterruptedException, NoSuchFieldException, IllegalArgumentException, IllegalAccessException, NoSuchMethodException, InvocationTargetException { + public void testAfterCommitLinkResolve() throws MalformedURLException, IOException, InterruptedException, NoSuchFieldException, IllegalArgumentException, IllegalAccessException, NoSuchMethodException, InvocationTargetException { SvnHookImpl hook = getHook(); VCSHooksConfig.getInstance(HookType.SVN).setLink(true); diff --git a/ide/bugtracking.commons/nbproject/project.properties b/ide/bugtracking.commons/nbproject/project.properties index 6abe2615bd7b..430766bd6587 100644 --- a/ide/bugtracking.commons/nbproject/project.properties +++ b/ide/bugtracking.commons/nbproject/project.properties @@ -15,6 +15,7 @@ # specific language governing permissions and limitations # under the License. +is.autoload=true javac.source=1.8 javac.compilerargs=-Xlint -Xlint:-serial diff --git a/ide/bugtracking.commons/nbproject/project.xml b/ide/bugtracking.commons/nbproject/project.xml index fbc2074982d2..b84e7f51d658 100644 --- a/ide/bugtracking.commons/nbproject/project.xml +++ b/ide/bugtracking.commons/nbproject/project.xml @@ -146,11 +146,9 @@ - - org.netbeans.modules.odcs.tasks - com.oracle.netbeans.bugdb + org.netbeans.modules.bugtracking.issuetable - + diff --git a/ide/bugtracking/nbproject/project.properties b/ide/bugtracking/nbproject/project.properties index a3810e58496a..6b2282f4eb1e 100644 --- a/ide/bugtracking/nbproject/project.properties +++ b/ide/bugtracking/nbproject/project.properties @@ -15,6 +15,7 @@ # specific language governing permissions and limitations # under the License. +is.autoload=true javac.source=1.8 javac.compilerargs=-Xlint -Xlint:-serial diff --git a/ide/bugtracking/src/org/netbeans/modules/bugtracking/BugtrackingManager.java b/ide/bugtracking/src/org/netbeans/modules/bugtracking/BugtrackingManager.java index 1183e7abf23e..5b1add58f18d 100644 --- a/ide/bugtracking/src/org/netbeans/modules/bugtracking/BugtrackingManager.java +++ b/ide/bugtracking/src/org/netbeans/modules/bugtracking/BugtrackingManager.java @@ -200,6 +200,10 @@ public static boolean isLocalConnectorID (String connectorID) { return LOCAL_CONNECTOR_ID.equals(connectorID); } + public boolean hasRegisteredConnectors() { + return getConnectors().length > 0; + } + public void addPropertyChangeListener(PropertyChangeListener listener) { support.addPropertyChangeListener(listener); } diff --git a/ide/bugtracking/src/org/netbeans/modules/bugtracking/ui/issue/IssueAction.java b/ide/bugtracking/src/org/netbeans/modules/bugtracking/ui/issue/IssueAction.java index 2884fa2359d3..1008f8c4c7de 100644 --- a/ide/bugtracking/src/org/netbeans/modules/bugtracking/ui/issue/IssueAction.java +++ b/ide/bugtracking/src/org/netbeans/modules/bugtracking/ui/issue/IssueAction.java @@ -61,6 +61,11 @@ public String getName() { return NbBundle.getMessage(IssueAction.class, "CTL_IssueAction"); } + @Override + public boolean isEnabled() { + return BugtrackingManager.getInstance().hasRegisteredConnectors(); + } + @Override public HelpCtx getHelpCtx() { return new HelpCtx(IssueAction.class); diff --git a/ide/bugtracking/src/org/netbeans/modules/bugtracking/ui/issue/IssueTopComponent.java b/ide/bugtracking/src/org/netbeans/modules/bugtracking/ui/issue/IssueTopComponent.java index 9844d3e0e80e..6dd10d473929 100644 --- a/ide/bugtracking/src/org/netbeans/modules/bugtracking/ui/issue/IssueTopComponent.java +++ b/ide/bugtracking/src/org/netbeans/modules/bugtracking/ui/issue/IssueTopComponent.java @@ -108,12 +108,8 @@ public IssueTopComponent() { RepositoryRegistry.getInstance().addPropertyChangeListener(this); preparingLabel.setVisible(false); - newButton.addActionListener(new ActionListener() { - @Override - public void actionPerformed(ActionEvent e) { - onNewClick(); - } - }); + newButton.addActionListener(this::onNewClick); + newButton.setEnabled(BugtrackingManager.getInstance().hasRegisteredConnectors()); JComponent findBar = FindSupport.create(this).getFindBar(); findBar.setVisible(false); issuePanel.add(findBar, BorderLayout.PAGE_END); @@ -344,7 +340,7 @@ private void initComponents() { ); }// //GEN-END:initComponents - private void onNewClick() { + private void onNewClick(ActionEvent evt) { RepositoryImpl repoImpl = BugtrackingUtil.createRepository(); if(repoImpl != null) { Repository repo = repoImpl.getRepository(); diff --git a/ide/bugtracking/src/org/netbeans/modules/bugtracking/ui/query/QueryAction.java b/ide/bugtracking/src/org/netbeans/modules/bugtracking/ui/query/QueryAction.java index 039b887975f0..3c84d8d4c21f 100644 --- a/ide/bugtracking/src/org/netbeans/modules/bugtracking/ui/query/QueryAction.java +++ b/ide/bugtracking/src/org/netbeans/modules/bugtracking/ui/query/QueryAction.java @@ -57,6 +57,11 @@ public String getName() { return NbBundle.getMessage(QueryAction.class, "CTL_QueryAction"); // NOI18N } + @Override + public boolean isEnabled() { + return BugtrackingManager.getInstance().hasRegisteredConnectors(); + } + @Override public HelpCtx getHelpCtx() { return new HelpCtx(QueryAction.class); diff --git a/ide/bugtracking/src/org/netbeans/modules/bugtracking/ui/query/QueryTopComponent.java b/ide/bugtracking/src/org/netbeans/modules/bugtracking/ui/query/QueryTopComponent.java index 109c09831b39..6f6a63cb9e06 100644 --- a/ide/bugtracking/src/org/netbeans/modules/bugtracking/ui/query/QueryTopComponent.java +++ b/ide/bugtracking/src/org/netbeans/modules/bugtracking/ui/query/QueryTopComponent.java @@ -142,6 +142,7 @@ public final class QueryTopComponent extends TopComponent getBundleText("QueryTopComponent.repositoryComboBox.AccessibleContext.accessibleDescription")); //NOI18N newButton.getAccessibleContext().setAccessibleDescription( getBundleText("QueryTopComponent.newButton.AccessibleContext.accessibleDescription")); //NOI18N + newButton.setEnabled(BugtrackingManager.getInstance().hasRegisteredConnectors()); /* background colors */ Color editorBgColor = UIManager.getDefaults()