Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrescobar2010-07-20 16:52:40 -0400
committerrescobar2010-07-20 16:52:40 -0400
commita88b295f5a066c21fce3aefc406d1e922ca44733 (patch)
tree2df201f4b2513b0ef1c521d0144db43580cb4aac /plugins
parent9dd043fbb2a826276a59d95ae1b0ddc5df14b21c (diff)
downloadorg.eclipse.osee-a88b295f5a066c21fce3aefc406d1e922ca44733.tar.gz
org.eclipse.osee-a88b295f5a066c21fce3aefc406d1e922ca44733.tar.xz
org.eclipse.osee-a88b295f5a066c21fce3aefc406d1e922ca44733.zip
Refactored to use Displays class
Diffstat (limited to 'plugins')
-rw-r--r--plugins/org.eclipse.osee.ats/META-INF/MANIFEST.MF1
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMAActionableItemHeader.java2
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMAEditor.java2
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMAEditorEventManager.java2
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMAGoalMembersSection.java312
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMARelationsSection.java87
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMAWorkFlowTab.java2
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMAWorkflowMetricsHeader.java2
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/widget/ReviewInfoXWidget.java2
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/widget/TaskInfoXWidget.java2
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/health/ValidateChangeReports.java2
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/hyper/ActionHyperView.java2
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/hyper/ActionSkyWalker.java2
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/hyper/ArtifactHyperView.java2
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/ArtifactImpactToActionSearchItem.java2
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/operation/DuplicateWorkflowBlam.java2
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/operation/ImportTasksFromSimpleList.java2
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/operation/ImportTasksFromSpreadsheet.java2
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/operation/PurgeUser.java2
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/operation/ReAssignATSObjectsToUser.java2
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/report/CreateActionArtifactChangeReportJob.java2
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/task/TaskEditor.java2
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/task/TaskXViewer.java2
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/AtsBranchCommitJob.java2
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/AtsUtil.java2
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/OpenInAtsLoopbackCmd.java110
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/XWorkingBranch.java2
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/commit/XCommitManager.java2
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/defect/DefectContentProvider.java2
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/defect/XDefectViewer.java2
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/role/UserRoleContentProvider.java2
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/role/XUserRoleViewer.java2
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/editor/AtsWorkflowConfigEditor.java2
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/editor/AtsWorkflowConfigEditorPaletteFactory.java287
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/editor/AtsWorkflowConfigRenderer.java2
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/AtsXWidgetActionFormPage.java2
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/WorldComposite.java2
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/WorldContentProvider.java2
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/WorldEditor.java2
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/WorldEditorParameterSearchItemProvider.java2
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/WorldViewerEventManager.java2
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/WorldXViewer.java2
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/WorldXViewerEventManager.java2
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/WorldXWidgetActionPage.java2
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/MultipleHridSearchOperation.java2
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/MultipleHridSearchUi.java2
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/WorldUISearchItem.java2
-rw-r--r--plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/editor/CoverageEditor.java2
-rw-r--r--plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/editor/CoverageEditorImportTab.java2
-rw-r--r--plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/editor/CoverageEditorLoadingTab.java2
-rw-r--r--plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/editor/CoverageEditorMergeTab.java2
-rw-r--r--plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/editor/CoverageEditorOverviewTab.java2
-rw-r--r--plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/navigate/CoverageNavigateView.java285
-rw-r--r--plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/traceability/operations/FindTraceUnitFromResource.java179
-rw-r--r--plugins/org.eclipse.osee.framework.ui.admin/src/org/eclipse/osee/framework/ui/admin/dbtabletab/DbTableTab.java327
-rw-r--r--plugins/org.eclipse.osee.framework.ui.branch.graph/src/org/eclipse/osee/framework/ui/branch/graph/core/BranchGraphPaletteProvider.java171
-rw-r--r--plugins/org.eclipse.osee.framework.ui.branch.graph/src/org/eclipse/osee/framework/ui/branch/graph/operation/LoadGraphOperation.java194
-rw-r--r--plugins/org.eclipse.osee.framework.ui.data.model.editor/src/org/eclipse/osee/framework/ui/data/model/editor/core/ODMPaletteFactory.java311
-rw-r--r--plugins/org.eclipse.osee.framework.ui.data.model.editor/src/org/eclipse/osee/framework/ui/data/model/editor/operation/ODMLoadGraphRunnable.java81
-rw-r--r--plugins/org.eclipse.osee.framework.ui.plugin/src/org/eclipse/osee/framework/ui/plugin/io/StreamToTextArea.java84
-rw-r--r--plugins/org.eclipse.osee.framework.ui.plugin/src/org/eclipse/osee/framework/ui/plugin/util/Displays.java42
-rw-r--r--plugins/org.eclipse.osee.framework.ui.plugin/src/org/eclipse/osee/framework/ui/plugin/util/GetChildrenJob.java1
-rw-r--r--plugins/org.eclipse.osee.framework.ui.plugin/src/org/eclipse/osee/framework/ui/plugin/util/JobbedNode.java1
-rw-r--r--plugins/org.eclipse.osee.framework.ui.plugin/src/org/eclipse/osee/framework/ui/plugin/util/OseeConsole.java422
-rw-r--r--plugins/org.eclipse.osee.framework.ui.plugin/src/org/eclipse/osee/framework/ui/plugin/util/WindowLocal.java1
-rw-r--r--plugins/org.eclipse.osee.framework.ui.plugin/src/org/eclipse/osee/framework/ui/plugin/workspace/EarlyStartup.java30
-rw-r--r--plugins/org.eclipse.osee.framework.ui.plugin/src/org/eclipse/osee/framework/ui/plugin/xnavigate/XNavigateComposite.java392
-rw-r--r--plugins/org.eclipse.osee.framework.ui.plugin/src/org/eclipse/osee/framework/ui/plugin/xnavigate/XNavigateItemAction.java2
-rw-r--r--plugins/org.eclipse.osee.framework.ui.service.control/src/org/eclipse/osee/framework/ui/service/control/actions/InspectLookUpServerAction.java33
-rw-r--r--plugins/org.eclipse.osee.framework.ui.service.control/src/org/eclipse/osee/framework/ui/service/control/actions/OpenLaunchWizard.java36
-rw-r--r--plugins/org.eclipse.osee.framework.ui.service.control/src/org/eclipse/osee/framework/ui/service/control/dialogs/PopulateInspectReggieDialog.java118
-rw-r--r--plugins/org.eclipse.osee.framework.ui.service.control/src/org/eclipse/osee/framework/ui/service/control/jobs/TextDisplayHelper.java113
-rw-r--r--plugins/org.eclipse.osee.framework.ui.service.control/src/org/eclipse/osee/framework/ui/service/control/jobs/UploadRemoteFileJob.java387
-rw-r--r--plugins/org.eclipse.osee.framework.ui.service.control/src/org/eclipse/osee/framework/ui/service/control/widgets/LookupViewer.java208
-rw-r--r--plugins/org.eclipse.osee.framework.ui.service.control/src/org/eclipse/osee/framework/ui/service/control/widgets/ServicesViewer.java309
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet.test/src/org/eclipse/osee/framework/ui/skynet/test/cases/ArtifactPasteOperationTest.java393
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/ArtifactExplorer.java2
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/ArtifactExplorerEventManager.java2
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/DialogPopupLoggerListener.java92
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/OseeContributionItem.java135
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/OseeServicesStatusContributionItem.java124
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/OseeUiEarlyStartup.java209
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/RelationsComposite.java2
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/ResServiceContributionItem.java2
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/SessionContributionItem.java7
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/SkynetGuiPlugin.java314
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/SkynetServiceContributionItem.java2
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/WorkspaceContributionItem.java111
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/ArtifactNameConflictHandler.java44
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/NonBlankAndNotSameAsStartingValidator.java27
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/OpenArtifactEditorLoopbackCmd.java123
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/annotation/AttributeAnnotationHandler.java21
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/editor/AbstractArtifactEditor.java131
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/editor/AbstractEventArtifactEditor.java322
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/editor/ArtifactEditor.java427
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/editor/ArtifactEditorActionBarContributor.java390
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/editor/ArtifactEditorContributor.java137
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/editor/ArtifactEditorEventManager.java2
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/editor/BaseArtifactEditorInput.java108
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/editor/pages/ArtifactFormPage.java390
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/editor/parts/AttributeFormPart.java445
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/editor/parts/MessageSummaryNote.java188
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/editor/sections/AttributeActionContribution.java115
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/editor/sections/AttributeTypeEditDisplay.java171
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/editor/sections/DetailsFormSection.java115
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/editor/sections/RelationsFormSection.java217
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/massEditor/MassArtifactEditor.java482
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/massEditor/MassArtifactEditorInput.java72
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/massEditor/MassContentProvider.java244
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/massEditor/MassLabelProvider.java152
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/massEditor/MassXViewer.java536
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/massEditor/MassXViewerEventManager.java2
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/BlamEditor.java2
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/operation/ImageCaptureBlam.java106
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/operation/PurgeArchivedBranch.java2
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/operation/UpdateArtifactTypeImage.java4
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/sections/BlamOutputSection.java2
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/change/view/ChangeReportPage.java401
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/CompressWordAttributesHandler.java2
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/branch/PurgeTransactionHandler.java66
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/branch/commit/CommitHandler.java307
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/dialogs/AuthenticationDialog.java412
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/group/GroupExplorer.java2
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/handler/ArtifactChangeHandler.java2
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/handler/RemoveTrackChangesHandler.java2
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/preferences/ArbitrationServerPage.java221
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/preferences/ConfigurationDetails.java171
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/preferences/DataSourceDetails.java173
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/ArtifactGuis.java2
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/DefaultArtifactRenderer.java2
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/WordTemplateRenderer.java2
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/word/WordTemplateProcessor.java2
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/results/ResultsEditor.java2
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/results/XResultData.java2
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/search/MaxMatchCountConfirmer.java2
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/search/page/ArtifactSearchPage.java2
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/search/page/DecoratingArtifactSearchLabelProvider.java140
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/util/SkynetViews.java95
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/util/WordUiUtil.java2
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XFlatDam.java430
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XFlatWidget.java700
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XListViewer.java2
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XSelectFromDialog.java341
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XStackedDam.java430
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XStackedWidget.java882
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/workflow/DynamicXWidgetLayout.java805
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xBranch/BranchView.java2
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xBranch/XBranchWidget.java2
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xHistory/HistoryView.java2
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xHistory/XHistoryWidget.java2
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xmerge/MergeView.java6
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xmerge/MergeXViewer.java2
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xmerge/MergeXWidget.java2
-rw-r--r--plugins/org.eclipse.osee.framework.ui.swt/src/org/eclipse/osee/framework/ui/swt/Displays.java66
-rw-r--r--plugins/org.eclipse.osee.framework.ui.swt/src/org/eclipse/osee/framework/ui/swt/FormattedText.java180
-rw-r--r--plugins/org.eclipse.osee.framework.ui.swt/src/org/eclipse/osee/framework/ui/swt/StackedViewer.java153
-rw-r--r--plugins/org.eclipse.osee.framework.ui.swt/src/org/eclipse/osee/framework/ui/swt/hex/BasicHexTable.java148
-rw-r--r--plugins/org.eclipse.osee.framework.ui.swt/src/org/eclipse/osee/framework/ui/swt/hex/DividerLabel.java80
-rw-r--r--plugins/org.eclipse.osee.framework.ui.swt/src/org/eclipse/osee/framework/ui/swt/hex/HexEditingSupport.java94
-rw-r--r--plugins/org.eclipse.osee.framework.ui.swt/src/org/eclipse/osee/framework/ui/swt/hex/OffsetColumnLabelProvider.java58
-rw-r--r--plugins/org.eclipse.osee.framework.ui.workspacebundleloader/META-INF/MANIFEST.MF1
-rw-r--r--plugins/org.eclipse.osee.framework.ui.workspacebundleloader/src/org/eclipse/osee/framework/ui/workspacebundleloader/EarlyStartup.java36
-rw-r--r--plugins/org.eclipse.osee.framework.ui.workspacebundleloader/src/org/eclipse/osee/framework/ui/workspacebundleloader/FileChangeDetector.java151
-rw-r--r--plugins/org.eclipse.osee.framework.ui.workspacebundleloader/src/org/eclipse/osee/framework/ui/workspacebundleloader/JarCollectionNature.java296
-rw-r--r--plugins/org.eclipse.osee.framework.ui.workspacebundleloader/src/org/eclipse/osee/framework/ui/workspacebundleloader/SafeWorkspaceTracker.java59
-rw-r--r--plugins/org.eclipse.osee.framework.ui.workspacebundleloader/src/org/eclipse/osee/framework/ui/workspacebundleloader/internal/Activator.java12
166 files changed, 9050 insertions, 8894 deletions
diff --git a/plugins/org.eclipse.osee.ats/META-INF/MANIFEST.MF b/plugins/org.eclipse.osee.ats/META-INF/MANIFEST.MF
index 3c4c8a68bc..d544817c24 100644
--- a/plugins/org.eclipse.osee.ats/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.osee.ats/META-INF/MANIFEST.MF
@@ -15,7 +15,6 @@ Require-Bundle: org.eclipse.gef,
org.eclipse.core.resources,
org.eclipse.ui.ide,
org.eclipse.ui,
- org.eclipse.core.runtime,
org.eclipse.help,
org.eclipse.osee.framework.ui.plugin,
org.eclipse.osee.framework.plugin.core,
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMAActionableItemHeader.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMAActionableItemHeader.java
index 836fe01baa..af4d9f1a9b 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMAActionableItemHeader.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMAActionableItemHeader.java
@@ -22,9 +22,9 @@ import org.eclipse.osee.framework.skynet.core.event.FrameworkTransactionData;
import org.eclipse.osee.framework.skynet.core.event.IFrameworkTransactionEventListener;
import org.eclipse.osee.framework.skynet.core.event.OseeEventManager;
import org.eclipse.osee.framework.skynet.core.event.Sender;
-import org.eclipse.osee.framework.ui.plugin.util.Displays;
import org.eclipse.osee.framework.ui.skynet.XFormToolkit;
import org.eclipse.osee.framework.ui.swt.ALayout;
+import org.eclipse.osee.framework.ui.swt.Displays;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.widgets.Composite;
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMAEditor.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMAEditor.java
index bee0463253..adddd23234 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMAEditor.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMAEditor.java
@@ -64,7 +64,6 @@ import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
import org.eclipse.osee.framework.skynet.core.utility.LoadedArtifacts;
import org.eclipse.osee.framework.ui.plugin.OseeUiActions;
import org.eclipse.osee.framework.ui.plugin.util.AWorkbench;
-import org.eclipse.osee.framework.ui.plugin.util.Displays;
import org.eclipse.osee.framework.ui.plugin.util.Result;
import org.eclipse.osee.framework.ui.skynet.ArtifactImageManager;
import org.eclipse.osee.framework.ui.skynet.AttributesComposite;
@@ -75,6 +74,7 @@ import org.eclipse.osee.framework.ui.skynet.artifact.editor.AbstractArtifactEdit
import org.eclipse.osee.framework.ui.skynet.notify.OseeNotificationManager;
import org.eclipse.osee.framework.ui.skynet.render.PresentationType;
import org.eclipse.osee.framework.ui.skynet.render.RendererManager;
+import org.eclipse.osee.framework.ui.swt.Displays;
import org.eclipse.osee.framework.ui.swt.IDirtiableEditor;
import org.eclipse.osee.framework.ui.swt.ImageManager;
import org.eclipse.swt.SWT;
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMAEditorEventManager.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMAEditorEventManager.java
index 44323a71aa..3acfc2f1c6 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMAEditorEventManager.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMAEditorEventManager.java
@@ -31,7 +31,7 @@ import org.eclipse.osee.framework.skynet.core.event.Sender;
import org.eclipse.osee.framework.skynet.core.event2.ArtifactEvent;
import org.eclipse.osee.framework.skynet.core.event2.artifact.IArtifactEventListener;
import org.eclipse.osee.framework.skynet.core.event2.filter.IEventFilter;
-import org.eclipse.osee.framework.ui.plugin.util.Displays;
+import org.eclipse.osee.framework.ui.swt.Displays;
/**
* Common location for event handling for SMAEditors in order to keep number of registrations and processing to a
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMAGoalMembersSection.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMAGoalMembersSection.java
index a0a4288ed3..46152c4461 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMAGoalMembersSection.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMAGoalMembersSection.java
@@ -32,12 +32,12 @@ import org.eclipse.osee.framework.ui.skynet.XFormToolkit;
import org.eclipse.osee.framework.ui.skynet.artifact.editor.ArtifactEditor;
import org.eclipse.osee.framework.ui.skynet.util.ArtifactDragAndDrop;
import org.eclipse.osee.framework.ui.swt.ALayout;
+import org.eclipse.osee.framework.ui.swt.Displays;
import org.eclipse.osee.framework.ui.swt.ImageManager;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Menu;
import org.eclipse.ui.forms.IManagedForm;
@@ -51,159 +51,161 @@ import org.eclipse.ui.forms.widgets.Section;
*/
public class SMAGoalMembersSection extends SectionPart implements IWorldEditor {
- private final SMAEditor editor;
- private WorldComposite worldComposite;
-
- public SMAGoalMembersSection(SMAEditor editor, Composite parent, XFormToolkit toolkit, int style) {
- super(parent, toolkit, style | Section.TITLE_BAR);
- this.editor = editor;
- }
-
- @Override
- public void initialize(final IManagedForm form) {
- super.initialize(form);
- final FormToolkit toolkit = form.getToolkit();
-
- Section section = getSection();
- section.setText("Members");
-
- section.setLayout(new GridLayout());
- section.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
-
- Composite sectionBody = toolkit.createComposite(section, toolkit.getBorderStyle());
- sectionBody.setLayout(ALayout.getZeroMarginLayout(2, true));
- GridData gd = new GridData(SWT.FILL, SWT.FILL, true, true);
- gd.widthHint = 300;
- sectionBody.setLayoutData(gd);
-
- addDropToAddLabel(toolkit, sectionBody);
- addDropToRemoveLabel(toolkit, sectionBody);
-
- worldComposite =
- new WorldComposite(this, new GoalXViewerFactory((GoalArtifact) editor.getSma()), sectionBody, SWT.BORDER);
- try {
- CustomizeData customizeData = worldComposite.getCustomizeDataCopy();
- ((WorldLabelProvider) worldComposite.getXViewer().getLabelProvider()).setParentGoal((GoalArtifact) editor.getSma());
- worldComposite.load("Members", editor.getSma().getRelatedArtifacts(AtsRelationTypes.Goal_Member),
- customizeData, TableLoadOption.None);
-
- } catch (OseeCoreException ex) {
- OseeLog.log(AtsPlugin.class, OseeLevel.SEVERE, ex);
- }
- gd = new GridData(SWT.FILL, SWT.FILL, true, true);
- gd.horizontalSpan = 2;
- gd.widthHint = 300;
- worldComposite.setLayoutData(gd);
-
- section.setClient(sectionBody);
- toolkit.paintBordersFor(section);
- }
-
- protected void addDropToAddLabel(FormToolkit toolkit, Composite sectionBody) {
- Label dropToAddLabel = new Label(sectionBody, SWT.BORDER);
- dropToAddLabel.setText(" Drop New Members Here");
- dropToAddLabel.setBackgroundImage(ImageManager.getImage(AtsImage.DROP_HERE_TO_ADD_BACKGROUND));
- GridData gd = new GridData(GridData.FILL_BOTH);
- gd.heightHint = 25;
- dropToAddLabel.setLayoutData(gd);
- toolkit.adapt(dropToAddLabel, true, true);
-
- new ArtifactDragAndDrop(dropToAddLabel, editor.getSma(), ArtifactEditor.EDITOR_ID) {
- @Override
- public void performArtifactDrop(Artifact[] dropArtifacts) {
- super.performArtifactDrop(dropArtifacts);
- try {
- List<Artifact> members = new ArrayList<Artifact>();
- members.addAll(((GoalArtifact) editor.getSma()).getMembers());
- for (Artifact art : dropArtifacts) {
- if (!members.contains(art)) {
- members.add(art);
- editor.getSma().addRelation(AtsRelationTypes.Goal_Member, art);
- }
- }
- editor.getSma().setRelationOrder(AtsRelationTypes.Goal_Member, members);
- editor.doSave(null);
- } catch (OseeCoreException ex) {
- OseeLog.log(AtsPlugin.class, OseeLevel.SEVERE_POPUP, ex);
- }
- }
- };
- }
-
- protected void addDropToRemoveLabel(FormToolkit toolkit, Composite sectionBody) {
- Label dropToAddLabel = new Label(sectionBody, SWT.BORDER);
- dropToAddLabel.setText(" Drop Members to Remove");
- dropToAddLabel.setBackgroundImage(ImageManager.getImage(AtsImage.DROP_HERE_TO_REMOVE_BACKGROUND));
- GridData gd = new GridData(GridData.FILL_BOTH);
- gd.heightHint = 25;
- dropToAddLabel.setLayoutData(gd);
- toolkit.adapt(dropToAddLabel, true, true);
-
- new ArtifactDragAndDrop(dropToAddLabel, editor.getSma(), ArtifactEditor.EDITOR_ID) {
- @Override
- public void performArtifactDrop(Artifact[] dropArtifacts) {
- super.performArtifactDrop(dropArtifacts);
- try {
- for (Artifact art : dropArtifacts) {
- editor.getSma().deleteRelation(AtsRelationTypes.Goal_Member, art);
- }
- editor.doSave(null);
- } catch (OseeCoreException ex) {
- OseeLog.log(AtsPlugin.class, OseeLevel.SEVERE_POPUP, ex);
- }
- }
- };
- }
-
- @Override
- public void refresh() {
- super.refresh();
- Display.getDefault().asyncExec(new Runnable() {
- public void run() {
- if (worldComposite != null && !worldComposite.isDisposed()) {
- worldComposite.getXViewer().refresh();
- }
- }
- });
- }
-
- @Override
- public void dispose() {
- if (worldComposite != null && !worldComposite.isDisposed()) {
- worldComposite.dispose();
- }
- super.dispose();
- }
-
- @Override
- public void createToolBarPulldown(Menu menu) {
- }
-
- @Override
- public String getCurrentTitleLabel() {
- return "";
- }
-
- @Override
- public IActionable getIActionable() {
- return null;
- }
-
- @Override
- public IWorldEditorProvider getWorldEditorProvider() {
- return null;
- }
-
- @Override
- public void reSearch() throws OseeCoreException {
- }
-
- @Override
- public void reflow() {
- }
-
- @Override
- public void setTableTitle(String title, boolean warning) {
- }
+ private final SMAEditor editor;
+ private WorldComposite worldComposite;
+
+ public SMAGoalMembersSection(SMAEditor editor, Composite parent, XFormToolkit toolkit, int style) {
+ super(parent, toolkit, style | Section.TITLE_BAR);
+ this.editor = editor;
+ }
+
+ @Override
+ public void initialize(final IManagedForm form) {
+ super.initialize(form);
+ final FormToolkit toolkit = form.getToolkit();
+
+ Section section = getSection();
+ section.setText("Members");
+
+ section.setLayout(new GridLayout());
+ section.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
+
+ Composite sectionBody = toolkit.createComposite(section, toolkit.getBorderStyle());
+ sectionBody.setLayout(ALayout.getZeroMarginLayout(2, true));
+ GridData gd = new GridData(SWT.FILL, SWT.FILL, true, true);
+ gd.widthHint = 300;
+ sectionBody.setLayoutData(gd);
+
+ addDropToAddLabel(toolkit, sectionBody);
+ addDropToRemoveLabel(toolkit, sectionBody);
+
+ worldComposite =
+ new WorldComposite(this, new GoalXViewerFactory((GoalArtifact) editor.getSma()), sectionBody, SWT.BORDER);
+ try {
+ CustomizeData customizeData = worldComposite.getCustomizeDataCopy();
+ ((WorldLabelProvider) worldComposite.getXViewer().getLabelProvider()).setParentGoal((GoalArtifact) editor.getSma());
+ worldComposite.load("Members", editor.getSma().getRelatedArtifacts(AtsRelationTypes.Goal_Member),
+ customizeData, TableLoadOption.None);
+
+ } catch (OseeCoreException ex) {
+ OseeLog.log(AtsPlugin.class, OseeLevel.SEVERE, ex);
+ }
+ gd = new GridData(SWT.FILL, SWT.FILL, true, true);
+ gd.horizontalSpan = 2;
+ gd.widthHint = 300;
+ worldComposite.setLayoutData(gd);
+
+ section.setClient(sectionBody);
+ toolkit.paintBordersFor(section);
+ }
+
+ protected void addDropToAddLabel(FormToolkit toolkit, Composite sectionBody) {
+ Label dropToAddLabel = new Label(sectionBody, SWT.BORDER);
+ dropToAddLabel.setText(" Drop New Members Here");
+ dropToAddLabel.setBackgroundImage(ImageManager.getImage(AtsImage.DROP_HERE_TO_ADD_BACKGROUND));
+ GridData gd = new GridData(GridData.FILL_BOTH);
+ gd.heightHint = 25;
+ dropToAddLabel.setLayoutData(gd);
+ toolkit.adapt(dropToAddLabel, true, true);
+
+ new ArtifactDragAndDrop(dropToAddLabel, editor.getSma(), ArtifactEditor.EDITOR_ID) {
+ @Override
+ public void performArtifactDrop(Artifact[] dropArtifacts) {
+ super.performArtifactDrop(dropArtifacts);
+ try {
+ List<Artifact> members = new ArrayList<Artifact>();
+ members.addAll(((GoalArtifact) editor.getSma()).getMembers());
+ for (Artifact art : dropArtifacts) {
+ if (!members.contains(art)) {
+ members.add(art);
+ editor.getSma().addRelation(AtsRelationTypes.Goal_Member, art);
+ }
+ }
+ editor.getSma().setRelationOrder(AtsRelationTypes.Goal_Member, members);
+ editor.doSave(null);
+ } catch (OseeCoreException ex) {
+ OseeLog.log(AtsPlugin.class, OseeLevel.SEVERE_POPUP, ex);
+ }
+ }
+ };
+ }
+
+ protected void addDropToRemoveLabel(FormToolkit toolkit, Composite sectionBody) {
+ Label dropToAddLabel = new Label(sectionBody, SWT.BORDER);
+ dropToAddLabel.setText(" Drop Members to Remove");
+ dropToAddLabel.setBackgroundImage(ImageManager.getImage(AtsImage.DROP_HERE_TO_REMOVE_BACKGROUND));
+ GridData gd = new GridData(GridData.FILL_BOTH);
+ gd.heightHint = 25;
+ dropToAddLabel.setLayoutData(gd);
+ toolkit.adapt(dropToAddLabel, true, true);
+
+ new ArtifactDragAndDrop(dropToAddLabel, editor.getSma(), ArtifactEditor.EDITOR_ID) {
+ @Override
+ public void performArtifactDrop(Artifact[] dropArtifacts) {
+ super.performArtifactDrop(dropArtifacts);
+ try {
+ for (Artifact art : dropArtifacts) {
+ editor.getSma().deleteRelation(AtsRelationTypes.Goal_Member, art);
+ }
+ editor.doSave(null);
+ } catch (OseeCoreException ex) {
+ OseeLog.log(AtsPlugin.class, OseeLevel.SEVERE_POPUP, ex);
+ }
+ }
+ };
+ }
+
+ @Override
+ public void refresh() {
+ super.refresh();
+ Displays.ensureInDisplayThread(new Runnable() {
+
+ @Override
+ public void run() {
+ if (worldComposite != null && !worldComposite.isDisposed()) {
+ worldComposite.getXViewer().refresh();
+ }
+ }
+ });
+ }
+
+ @Override
+ public void dispose() {
+ if (worldComposite != null && !worldComposite.isDisposed()) {
+ worldComposite.dispose();
+ }
+ super.dispose();
+ }
+
+ @Override
+ public void createToolBarPulldown(Menu menu) {
+ }
+
+ @Override
+ public String getCurrentTitleLabel() {
+ return "";
+ }
+
+ @Override
+ public IActionable getIActionable() {
+ return null;
+ }
+
+ @Override
+ public IWorldEditorProvider getWorldEditorProvider() {
+ return null;
+ }
+
+ @Override
+ public void reSearch() throws OseeCoreException {
+ }
+
+ @Override
+ public void reflow() {
+ }
+
+ @Override
+ public void setTableTitle(String title, boolean warning) {
+ }
}
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMARelationsSection.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMARelationsSection.java
index e2bfee71a7..7443cf6652 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMARelationsSection.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMARelationsSection.java
@@ -18,7 +18,6 @@ import org.eclipse.osee.ats.artifact.StateMachineArtifact;
import org.eclipse.osee.ats.util.AtsRelationTypes;
import org.eclipse.osee.ats.util.AtsUtil;
import org.eclipse.osee.framework.core.enums.CoreRelationTypes;
-import org.eclipse.osee.framework.core.exception.OseeCoreException;
import org.eclipse.osee.framework.core.model.type.RelationType;
import org.eclipse.osee.framework.ui.skynet.artifact.editor.BaseArtifactEditorInput;
import org.eclipse.osee.framework.ui.skynet.artifact.editor.sections.RelationsFormSection;
@@ -33,55 +32,55 @@ import org.eclipse.ui.forms.widgets.Section;
*/
public class SMARelationsSection extends RelationsFormSection {
- public SMARelationsSection(SMAEditor editor, Composite parent, FormToolkit toolkit, int style) {
- super(editor, parent, toolkit, style | Section.TWISTIE | Section.TITLE_BAR);
- }
+ public SMARelationsSection(SMAEditor editor, Composite parent, FormToolkit toolkit, int style) {
+ super(editor, parent, toolkit, style | Section.TWISTIE | Section.TITLE_BAR);
+ }
- @Override
- public SMAEditor getEditor() {
- return (SMAEditor) super.getEditor();
- }
+ @Override
+ public SMAEditor getEditor() {
+ return (SMAEditor) super.getEditor();
+ }
- @Override
- public BaseArtifactEditorInput getEditorInput() {
- return super.getEditorInput();
- }
+ @Override
+ public BaseArtifactEditorInput getEditorInput() {
+ return super.getEditorInput();
+ }
- @Override
- protected synchronized void createSection(Section section, FormToolkit toolkit) throws OseeCoreException {
- super.createSection(section, toolkit);
- // Don't allow users to see all relations
- if (!AtsUtil.isAtsAdmin()) {
- getRelationComposite().getTreeViewer().addFilter(userRelationsFilter);
- }
- }
+ @Override
+ protected synchronized void createSection(Section section, FormToolkit toolkit) {
+ super.createSection(section, toolkit);
+ // Don't allow users to see all relations
+ if (!AtsUtil.isAtsAdmin()) {
+ getRelationComposite().getTreeViewer().addFilter(userRelationsFilter);
+ }
+ }
- @Override
- protected void handleExpandAndCollapse() {
- ((SMAWorkFlowTab) getEditor().getSelectedPage()).getManagedForm().getForm().layout();
- }
+ @Override
+ protected void handleExpandAndCollapse() {
+ ((SMAWorkFlowTab) getEditor().getSelectedPage()).getManagedForm().getForm().layout();
+ }
- @Override
- protected void addDragAndDrop(Control dropArea) {
- new SMADragAndDrop(dropArea, (StateMachineArtifact) getEditorInput().getArtifact(), SMAEditor.EDITOR_ID);
- }
+ @Override
+ protected void addDragAndDrop(Control dropArea) {
+ new SMADragAndDrop(dropArea, (StateMachineArtifact) getEditorInput().getArtifact(), SMAEditor.EDITOR_ID);
+ }
- private static ViewerFilter userRelationsFilter = new ViewerFilter() {
- @Override
- public boolean select(Viewer viewer, Object parentElement, Object element) {
- if (element instanceof RelationType) {
- return !filteredRelationTypeNames.contains(((RelationType) element).getName());
- }
- return true;
- }
- };
+ private static ViewerFilter userRelationsFilter = new ViewerFilter() {
+ @Override
+ public boolean select(Viewer viewer, Object parentElement, Object element) {
+ if (element instanceof RelationType) {
+ return !filteredRelationTypeNames.contains(((RelationType) element).getName());
+ }
+ return true;
+ }
+ };
- private static List<String> filteredRelationTypeNames =
- Arrays.asList(AtsRelationTypes.ActionToWorkflow_Action.getName(), AtsRelationTypes.SmaToTask_Sma.getName(),
- AtsRelationTypes.TeamActionableItem_ActionableItem.getName(),
- AtsRelationTypes.TeamWorkflowTargetedForVersion_Version.getName(),
- AtsRelationTypes.TeamLead_Lead.getName(), AtsRelationTypes.TeamMember_Member.getName(),
- AtsRelationTypes.TeamWorkflowToReview_Review.getName(), CoreRelationTypes.WorkItem__Child.getName(),
- CoreRelationTypes.Default_Hierarchical__Child.getName(), CoreRelationTypes.Users_Artifact.getName());
+ private static List<String> filteredRelationTypeNames = Arrays.asList(
+ AtsRelationTypes.ActionToWorkflow_Action.getName(), AtsRelationTypes.SmaToTask_Sma.getName(),
+ AtsRelationTypes.TeamActionableItem_ActionableItem.getName(),
+ AtsRelationTypes.TeamWorkflowTargetedForVersion_Version.getName(),
+ AtsRelationTypes.TeamLead_Lead.getName(), AtsRelationTypes.TeamMember_Member.getName(),
+ AtsRelationTypes.TeamWorkflowToReview_Review.getName(), CoreRelationTypes.WorkItem__Child.getName(),
+ CoreRelationTypes.Default_Hierarchical__Child.getName(), CoreRelationTypes.Users_Artifact.getName());
}
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMAWorkFlowTab.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMAWorkFlowTab.java
index 50c9d1b9d8..406439fa1e 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMAWorkFlowTab.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMAWorkFlowTab.java
@@ -58,7 +58,6 @@ import org.eclipse.osee.framework.logging.OseeLevel;
import org.eclipse.osee.framework.logging.OseeLog;
import org.eclipse.osee.framework.plugin.core.IActionable;
import org.eclipse.osee.framework.ui.plugin.OseeUiActions;
-import org.eclipse.osee.framework.ui.plugin.util.Displays;
import org.eclipse.osee.framework.ui.plugin.util.Result;
import org.eclipse.osee.framework.ui.skynet.ArtifactImageManager;
import org.eclipse.osee.framework.ui.skynet.XFormToolkit;
@@ -70,6 +69,7 @@ import org.eclipse.osee.framework.ui.skynet.util.OseeDictionary;
import org.eclipse.osee.framework.ui.skynet.widgets.IArtifactWidget;
import org.eclipse.osee.framework.ui.skynet.widgets.XDate;
import org.eclipse.osee.framework.ui.swt.ALayout;
+import org.eclipse.osee.framework.ui.swt.Displays;
import org.eclipse.osee.framework.ui.swt.ExceptionComposite;
import org.eclipse.osee.framework.ui.swt.Widgets;
import org.eclipse.swt.SWT;
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMAWorkflowMetricsHeader.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMAWorkflowMetricsHeader.java
index 4de2d7f616..0ceab7706c 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMAWorkflowMetricsHeader.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMAWorkflowMetricsHeader.java
@@ -22,11 +22,11 @@ import org.eclipse.osee.framework.skynet.core.event.FrameworkTransactionData;
import org.eclipse.osee.framework.skynet.core.event.IFrameworkTransactionEventListener;
import org.eclipse.osee.framework.skynet.core.event.OseeEventManager;
import org.eclipse.osee.framework.skynet.core.event.Sender;
-import org.eclipse.osee.framework.ui.plugin.util.Displays;
import org.eclipse.osee.framework.ui.plugin.util.Result;
import org.eclipse.osee.framework.ui.skynet.XFormToolkit;
import org.eclipse.osee.framework.ui.skynet.util.FormsUtil;
import org.eclipse.osee.framework.ui.swt.ALayout;
+import org.eclipse.osee.framework.ui.swt.Displays;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.widgets.Composite;
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/widget/ReviewInfoXWidget.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/widget/ReviewInfoXWidget.java
index e1885eaf3b..f201a39492 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/widget/ReviewInfoXWidget.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/widget/ReviewInfoXWidget.java
@@ -40,11 +40,11 @@ import org.eclipse.osee.framework.skynet.core.event.OseeEventManager;
import org.eclipse.osee.framework.skynet.core.event.Sender;
import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
import org.eclipse.osee.framework.ui.plugin.util.AWorkbench;
-import org.eclipse.osee.framework.ui.plugin.util.Displays;
import org.eclipse.osee.framework.ui.plugin.util.Result;
import org.eclipse.osee.framework.ui.skynet.XFormToolkit;
import org.eclipse.osee.framework.ui.skynet.widgets.XLabelValueBase;
import org.eclipse.osee.framework.ui.swt.ALayout;
+import org.eclipse.osee.framework.ui.swt.Displays;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.widgets.Composite;
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/widget/TaskInfoXWidget.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/widget/TaskInfoXWidget.java
index 463e1ee9ee..52e761fba2 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/widget/TaskInfoXWidget.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/widget/TaskInfoXWidget.java
@@ -26,9 +26,9 @@ import org.eclipse.osee.framework.skynet.core.event.IFrameworkTransactionEventLi
import org.eclipse.osee.framework.skynet.core.event.OseeEventManager;
import org.eclipse.osee.framework.skynet.core.event.Sender;
import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
-import org.eclipse.osee.framework.ui.plugin.util.Displays;
import org.eclipse.osee.framework.ui.plugin.util.Result;
import org.eclipse.osee.framework.ui.skynet.widgets.XLabelValueBase;
+import org.eclipse.osee.framework.ui.swt.Displays;
import org.eclipse.osee.framework.ui.swt.Widgets;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Composite;
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/health/ValidateChangeReports.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/health/ValidateChangeReports.java
index 89bbd45a34..4763c00c1f 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/health/ValidateChangeReports.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/health/ValidateChangeReports.java
@@ -52,13 +52,13 @@ import org.eclipse.osee.framework.skynet.core.change.RelationChange;
import org.eclipse.osee.framework.skynet.core.revision.ChangeData;
import org.eclipse.osee.framework.skynet.core.revision.ChangeData.KindType;
import org.eclipse.osee.framework.ui.plugin.PluginUiImage;
-import org.eclipse.osee.framework.ui.plugin.util.Displays;
import org.eclipse.osee.framework.ui.plugin.util.Result;
import org.eclipse.osee.framework.ui.plugin.xnavigate.XNavigateComposite.TableLoadOption;
import org.eclipse.osee.framework.ui.plugin.xnavigate.XNavigateItem;
import org.eclipse.osee.framework.ui.plugin.xnavigate.XNavigateItemAction;
import org.eclipse.osee.framework.ui.skynet.compare.CompareHandler;
import org.eclipse.osee.framework.ui.skynet.results.XResultData;
+import org.eclipse.osee.framework.ui.swt.Displays;
import org.eclipse.swt.widgets.Display;
/**
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/hyper/ActionHyperView.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/hyper/ActionHyperView.java
index a43cc2e170..eb7ecee858 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/hyper/ActionHyperView.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/hyper/ActionHyperView.java
@@ -41,8 +41,8 @@ import org.eclipse.osee.framework.skynet.core.event2.artifact.IArtifactEventList
import org.eclipse.osee.framework.skynet.core.event2.filter.IEventFilter;
import org.eclipse.osee.framework.ui.plugin.OseeUiActions;
import org.eclipse.osee.framework.ui.plugin.util.AWorkbench;
-import org.eclipse.osee.framework.ui.plugin.util.Displays;
import org.eclipse.osee.framework.ui.skynet.util.DbConnectionExceptionComposite;
+import org.eclipse.osee.framework.ui.swt.Displays;
import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.Cursor;
import org.eclipse.swt.widgets.Composite;
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/hyper/ActionSkyWalker.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/hyper/ActionSkyWalker.java
index b46291abe2..afbd680e9d 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/hyper/ActionSkyWalker.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/hyper/ActionSkyWalker.java
@@ -35,9 +35,9 @@ import org.eclipse.osee.framework.skynet.core.event2.ArtifactEvent;
import org.eclipse.osee.framework.skynet.core.event2.artifact.IArtifactEventListener;
import org.eclipse.osee.framework.skynet.core.event2.filter.IEventFilter;
import org.eclipse.osee.framework.ui.plugin.PluginUiImage;
-import org.eclipse.osee.framework.ui.plugin.util.Displays;
import org.eclipse.osee.framework.ui.skynet.skywalker.SkyWalkerOptions;
import org.eclipse.osee.framework.ui.skynet.skywalker.SkyWalkerView;
+import org.eclipse.osee.framework.ui.swt.Displays;
import org.eclipse.osee.framework.ui.swt.ImageManager;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.ui.IActionBars;
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/hyper/ArtifactHyperView.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/hyper/ArtifactHyperView.java
index a9f57c0b01..1a40f8f0bd 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/hyper/ArtifactHyperView.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/hyper/ArtifactHyperView.java
@@ -42,9 +42,9 @@ import org.eclipse.osee.framework.skynet.core.event2.filter.IEventFilter;
import org.eclipse.osee.framework.skynet.core.relation.RelationLink;
import org.eclipse.osee.framework.ui.plugin.OseeUiActions;
import org.eclipse.osee.framework.ui.plugin.util.AWorkbench;
-import org.eclipse.osee.framework.ui.plugin.util.Displays;
import org.eclipse.osee.framework.ui.skynet.util.DbConnectionExceptionComposite;
import org.eclipse.osee.framework.ui.skynet.widgets.dialog.EntryDialog;
+import org.eclipse.osee.framework.ui.swt.Displays;
import org.eclipse.osee.framework.ui.swt.ImageManager;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.ui.IActionBars;
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/ArtifactImpactToActionSearchItem.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/ArtifactImpactToActionSearchItem.java
index 745d322d02..2402019efa 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/ArtifactImpactToActionSearchItem.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/ArtifactImpactToActionSearchItem.java
@@ -33,7 +33,6 @@ import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
import org.eclipse.osee.framework.skynet.core.artifact.BranchManager;
import org.eclipse.osee.framework.skynet.core.artifact.search.ArtifactQuery;
import org.eclipse.osee.framework.skynet.core.revision.ChangeManager;
-import org.eclipse.osee.framework.ui.plugin.util.Displays;
import org.eclipse.osee.framework.ui.plugin.xnavigate.XNavigateComposite.TableLoadOption;
import org.eclipse.osee.framework.ui.plugin.xnavigate.XNavigateItem;
import org.eclipse.osee.framework.ui.plugin.xnavigate.XNavigateItemAction;
@@ -41,6 +40,7 @@ import org.eclipse.osee.framework.ui.skynet.FrameworkImage;
import org.eclipse.osee.framework.ui.skynet.results.XResultData;
import org.eclipse.osee.framework.ui.skynet.widgets.dialog.ArtifactCheckTreeDialog;
import org.eclipse.osee.framework.ui.skynet.widgets.dialog.EntryDialogWithBranchSelect;
+import org.eclipse.osee.framework.ui.swt.Displays;
/**
* @author Donald G. Dunne
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/operation/DuplicateWorkflowBlam.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/operation/DuplicateWorkflowBlam.java
index bcfce41da3..5c59810a6f 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/operation/DuplicateWorkflowBlam.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/operation/DuplicateWorkflowBlam.java
@@ -37,13 +37,13 @@ import org.eclipse.osee.framework.skynet.core.UserManager;
import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
import org.eclipse.osee.framework.ui.plugin.util.AWorkbench;
-import org.eclipse.osee.framework.ui.plugin.util.Displays;
import org.eclipse.osee.framework.ui.skynet.blam.AbstractBlam;
import org.eclipse.osee.framework.ui.skynet.blam.VariableMap;
import org.eclipse.osee.framework.ui.skynet.widgets.XListDropViewer;
import org.eclipse.osee.framework.ui.skynet.widgets.XModifiedListener;
import org.eclipse.osee.framework.ui.skynet.widgets.XWidget;
import org.eclipse.osee.framework.ui.skynet.widgets.workflow.DynamicXWidgetLayout;
+import org.eclipse.osee.framework.ui.swt.Displays;
import org.eclipse.ui.forms.widgets.FormToolkit;
/**
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/operation/ImportTasksFromSimpleList.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/operation/ImportTasksFromSimpleList.java
index ca51f43d57..39e2fe128b 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/operation/ImportTasksFromSimpleList.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/operation/ImportTasksFromSimpleList.java
@@ -28,13 +28,13 @@ import org.eclipse.osee.framework.skynet.core.User;
import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
import org.eclipse.osee.framework.ui.plugin.util.AWorkbench;
-import org.eclipse.osee.framework.ui.plugin.util.Displays;
import org.eclipse.osee.framework.ui.skynet.blam.AbstractBlam;
import org.eclipse.osee.framework.ui.skynet.blam.VariableMap;
import org.eclipse.osee.framework.ui.skynet.widgets.XListDropViewer;
import org.eclipse.osee.framework.ui.skynet.widgets.XModifiedListener;
import org.eclipse.osee.framework.ui.skynet.widgets.XWidget;
import org.eclipse.osee.framework.ui.skynet.widgets.workflow.DynamicXWidgetLayout;
+import org.eclipse.osee.framework.ui.swt.Displays;
import org.eclipse.ui.forms.widgets.FormToolkit;
/**
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/operation/ImportTasksFromSpreadsheet.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/operation/ImportTasksFromSpreadsheet.java
index ff762703c3..cd1f74cf7a 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/operation/ImportTasksFromSpreadsheet.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/operation/ImportTasksFromSpreadsheet.java
@@ -30,13 +30,13 @@ import org.eclipse.osee.framework.plugin.core.util.Jobs;
import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
import org.eclipse.osee.framework.ui.plugin.util.AWorkbench;
-import org.eclipse.osee.framework.ui.plugin.util.Displays;
import org.eclipse.osee.framework.ui.skynet.blam.AbstractBlam;
import org.eclipse.osee.framework.ui.skynet.blam.VariableMap;
import org.eclipse.osee.framework.ui.skynet.widgets.XListDropViewer;
import org.eclipse.osee.framework.ui.skynet.widgets.XModifiedListener;
import org.eclipse.osee.framework.ui.skynet.widgets.XWidget;
import org.eclipse.osee.framework.ui.skynet.widgets.workflow.DynamicXWidgetLayout;
+import org.eclipse.osee.framework.ui.swt.Displays;
import org.eclipse.ui.forms.widgets.FormToolkit;
/**
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/operation/PurgeUser.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/operation/PurgeUser.java
index 13e8581c2a..03d5d41b91 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/operation/PurgeUser.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/operation/PurgeUser.java
@@ -27,10 +27,10 @@ import org.eclipse.osee.framework.skynet.core.User;
import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
import org.eclipse.osee.framework.skynet.core.artifact.search.ArtifactQuery;
import org.eclipse.osee.framework.ui.plugin.util.AWorkbench;
-import org.eclipse.osee.framework.ui.plugin.util.Displays;
import org.eclipse.osee.framework.ui.skynet.blam.AbstractBlam;
import org.eclipse.osee.framework.ui.skynet.blam.VariableMap;
import org.eclipse.osee.framework.ui.skynet.results.XResultData;
+import org.eclipse.osee.framework.ui.swt.Displays;
import org.eclipse.swt.widgets.Display;
/**
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/operation/ReAssignATSObjectsToUser.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/operation/ReAssignATSObjectsToUser.java
index 574d4e163c..1e773b020d 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/operation/ReAssignATSObjectsToUser.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/operation/ReAssignATSObjectsToUser.java
@@ -25,12 +25,12 @@ import org.eclipse.osee.framework.skynet.core.User;
import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
import org.eclipse.osee.framework.ui.plugin.util.AWorkbench;
-import org.eclipse.osee.framework.ui.plugin.util.Displays;
import org.eclipse.osee.framework.ui.skynet.blam.AbstractBlam;
import org.eclipse.osee.framework.ui.skynet.blam.VariableMap;
import org.eclipse.osee.framework.ui.skynet.notify.OseeNotificationManager;
import org.eclipse.osee.framework.ui.skynet.util.ArtifactTypeAndDescriptiveLabelProvider;
import org.eclipse.osee.framework.ui.skynet.widgets.dialog.ArtifactCheckTreeDialog;
+import org.eclipse.osee.framework.ui.swt.Displays;
/**
* @author Donald G. Dunne
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/report/CreateActionArtifactChangeReportJob.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/report/CreateActionArtifactChangeReportJob.java
index 88fce97b48..80cbd6052f 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/report/CreateActionArtifactChangeReportJob.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/report/CreateActionArtifactChangeReportJob.java
@@ -34,11 +34,11 @@ import org.eclipse.osee.framework.skynet.core.attribute.EnumeratedAttribute;
import org.eclipse.osee.framework.skynet.core.revision.ChangeData;
import org.eclipse.osee.framework.skynet.core.revision.ChangeData.KindType;
import org.eclipse.osee.framework.ui.plugin.util.AWorkbench;
-import org.eclipse.osee.framework.ui.plugin.util.Displays;
import org.eclipse.osee.framework.ui.plugin.util.Result;
import org.eclipse.osee.framework.ui.skynet.results.XResultData;
import org.eclipse.osee.framework.ui.skynet.results.html.XResultPage.Manipulations;
import org.eclipse.osee.framework.ui.skynet.util.HtmlExportTable;
+import org.eclipse.osee.framework.ui.swt.Displays;
/**
* @author Donald G. Dunne
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/task/TaskEditor.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/task/TaskEditor.java
index bc00fbfb54..3cab42ec12 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/task/TaskEditor.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/task/TaskEditor.java
@@ -38,12 +38,12 @@ import org.eclipse.osee.framework.plugin.core.IActionable;
import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
import org.eclipse.osee.framework.ui.plugin.util.AWorkbench;
-import org.eclipse.osee.framework.ui.plugin.util.Displays;
import org.eclipse.osee.framework.ui.plugin.util.Result;
import org.eclipse.osee.framework.ui.plugin.xnavigate.XNavigateComposite.TableLoadOption;
import org.eclipse.osee.framework.ui.skynet.OseeContributionItem;
import org.eclipse.osee.framework.ui.skynet.artifact.editor.AbstractArtifactEditor;
import org.eclipse.osee.framework.ui.swt.CursorManager;
+import org.eclipse.osee.framework.ui.swt.Displays;
import org.eclipse.osee.framework.ui.swt.IDirtiableEditor;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Composite;
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/task/TaskXViewer.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/task/TaskXViewer.java
index 79b398f86c..f6ab994418 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/task/TaskXViewer.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/task/TaskXViewer.java
@@ -44,10 +44,10 @@ import org.eclipse.osee.framework.skynet.core.event.OseeEventManager;
import org.eclipse.osee.framework.skynet.core.event.Sender;
import org.eclipse.osee.framework.skynet.core.relation.RelationTypeManager;
import org.eclipse.osee.framework.ui.plugin.util.AWorkbench;
-import org.eclipse.osee.framework.ui.plugin.util.Displays;
import org.eclipse.osee.framework.ui.plugin.util.Result;
import org.eclipse.osee.framework.ui.skynet.SkynetGuiPlugin;
import org.eclipse.osee.framework.ui.skynet.artifact.ArtifactPromptChange;
+import org.eclipse.osee.framework.ui.swt.Displays;
import org.eclipse.osee.framework.ui.swt.IDirtiableEditor;
import org.eclipse.swt.widgets.TreeColumn;
import org.eclipse.swt.widgets.TreeItem;
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/AtsBranchCommitJob.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/AtsBranchCommitJob.java
index a26bad93cc..864af2a808 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/AtsBranchCommitJob.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/AtsBranchCommitJob.java
@@ -29,9 +29,9 @@ import org.eclipse.osee.framework.logging.OseeLog;
import org.eclipse.osee.framework.skynet.core.artifact.BranchManager;
import org.eclipse.osee.framework.skynet.core.conflict.ConflictManagerExternal;
import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
-import org.eclipse.osee.framework.ui.plugin.util.Displays;
import org.eclipse.osee.framework.ui.plugin.util.Result;
import org.eclipse.osee.framework.ui.skynet.commandHandlers.branch.commit.CommitHandler;
+import org.eclipse.osee.framework.ui.swt.Displays;
import org.eclipse.swt.widgets.Display;
public class AtsBranchCommitJob extends Job {
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/AtsUtil.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/AtsUtil.java
index e66f99d470..15247122ad 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/AtsUtil.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/AtsUtil.java
@@ -61,7 +61,6 @@ import org.eclipse.osee.framework.skynet.core.event2.filter.IEventFilter;
import org.eclipse.osee.framework.skynet.core.utility.DbUtil;
import org.eclipse.osee.framework.skynet.core.utility.IncrementingNum;
import org.eclipse.osee.framework.ui.plugin.util.AWorkbench;
-import org.eclipse.osee.framework.ui.plugin.util.Displays;
import org.eclipse.osee.framework.ui.plugin.util.Result;
import org.eclipse.osee.framework.ui.plugin.xnavigate.XNavigateComposite.TableLoadOption;
import org.eclipse.osee.framework.ui.skynet.SkynetGuiPlugin;
@@ -70,6 +69,7 @@ import org.eclipse.osee.framework.ui.skynet.ats.OseeEditor;
import org.eclipse.osee.framework.ui.skynet.render.PresentationType;
import org.eclipse.osee.framework.ui.skynet.render.RendererManager;
import org.eclipse.osee.framework.ui.swt.ALayout;
+import org.eclipse.osee.framework.ui.swt.Displays;
import org.eclipse.osee.framework.ui.swt.ImageManager;
import org.eclipse.osee.framework.ui.swt.KeyedImage;
import org.eclipse.swt.SWT;
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/OpenInAtsLoopbackCmd.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/OpenInAtsLoopbackCmd.java
index dcd2dcf1a1..ba7e65ff14 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/OpenInAtsLoopbackCmd.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/OpenInAtsLoopbackCmd.java
@@ -23,67 +23,69 @@ import org.eclipse.osee.framework.logging.OseeLog;
import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
import org.eclipse.osee.framework.skynet.core.httpRequests.BaseArtifactLoopbackCmd;
import org.eclipse.osee.framework.ui.skynet.SkynetGuiPlugin;
-import org.eclipse.swt.widgets.Display;
+import org.eclipse.osee.framework.ui.swt.Displays;
/**
* @author Roberto E. Escobar
*/
public class OpenInAtsLoopbackCmd extends BaseArtifactLoopbackCmd {
- @Override
- public boolean isApplicable(String cmd) {
- return cmd != null && cmd.equalsIgnoreCase("open.ats");
- }
+ @Override
+ public boolean isApplicable(String cmd) {
+ return cmd != null && cmd.equalsIgnoreCase("open.ats");
+ }
- @Override
- public void process(final Artifact artifact, final Map<String, String> parameters, final HttpResponse httpResponse) {
- if (artifact != null) {
- try {
- boolean hasPermissionToRead = false;
- try {
- hasPermissionToRead = AccessControlManager.hasPermission(artifact, PermissionEnum.READ);
- } catch (Exception ex) {
- OseeLog.log(SkynetGuiPlugin.class, Level.SEVERE, ex);
- }
+ @Override
+ public void process(final Artifact artifact, final Map<String, String> parameters, final HttpResponse httpResponse) {
+ if (artifact != null) {
+ try {
+ boolean hasPermissionToRead = false;
+ try {
+ hasPermissionToRead = AccessControlManager.hasPermission(artifact, PermissionEnum.READ);
+ } catch (Exception ex) {
+ OseeLog.log(SkynetGuiPlugin.class, Level.SEVERE, ex);
+ }
- if (!hasPermissionToRead) {
- httpResponse.outputStandardError(HttpURLConnection.HTTP_UNAUTHORIZED, String.format(
- "Access denied - User does not have read access to [%s]", artifact));
- } else {
- final MutableBoolean isDone = new MutableBoolean(false);
- Display.getDefault().asyncExec(new Runnable() {
- public void run() {
- try {
- AtsUtil.openATSAction(artifact, AtsOpenOption.OpenOneOrPopupSelect);
- String html =
- AHTML.simplePage("Action [" + artifact.getName() + "]has been opened in OSEE ATS<br><br>" + "<form><input type=button onClick='window.opener=self;window.close()' value='Close'></form>");
- httpResponse.getPrintStream().println(html);
- } catch (Exception ex) {
- OseeLog.log(SkynetGuiPlugin.class, Level.SEVERE, ex);
- httpResponse.outputStandardError(HttpURLConnection.HTTP_INTERNAL_ERROR, String.format(
- "Unable to open: [%s]", artifact.getName()), ex);
- } finally {
- isDone.setValue(true);
- }
- }
- });
- int count = 1;
- while (!isDone.getValue() && count < 30) {
- try {
- Thread.sleep(350);
- } catch (InterruptedException ex) {
- }
- count++;
- }
- }
- } catch (Exception ex) {
- OseeLog.log(SkynetGuiPlugin.class, Level.SEVERE, ex);
- httpResponse.outputStandardError(HttpURLConnection.HTTP_INTERNAL_ERROR, String.format(
- "Unable to open: [%s]", artifact.getName()), ex);
- }
- } else {
- httpResponse.outputStandardError(HttpURLConnection.HTTP_BAD_REQUEST, "Unable to open null artifact");
- }
- }
+ if (!hasPermissionToRead) {
+ httpResponse.outputStandardError(HttpURLConnection.HTTP_UNAUTHORIZED,
+ String.format("Access denied - User does not have read access to [%s]", artifact));
+ } else {
+ final MutableBoolean isDone = new MutableBoolean(false);
+ Displays.ensureInDisplayThread(new Runnable() {
+
+ @Override
+ public void run() {
+ try {
+ AtsUtil.openATSAction(artifact, AtsOpenOption.OpenOneOrPopupSelect);
+ String html =
+ AHTML.simplePage("Action [" + artifact.getName() + "]has been opened in OSEE ATS<br><br>" + "<form><input type=button onClick='window.opener=self;window.close()' value='Close'></form>");
+ httpResponse.getPrintStream().println(html);
+ } catch (Exception ex) {
+ OseeLog.log(SkynetGuiPlugin.class, Level.SEVERE, ex);
+ httpResponse.outputStandardError(HttpURLConnection.HTTP_INTERNAL_ERROR,
+ String.format("Unable to open: [%s]", artifact.getName()), ex);
+ } finally {
+ isDone.setValue(true);
+ }
+ }
+ });
+ int count = 1;
+ while (!isDone.getValue() && count < 30) {
+ try {
+ Thread.sleep(350);
+ } catch (InterruptedException ex) {
+ }
+ count++;
+ }
+ }
+ } catch (Exception ex) {
+ OseeLog.log(SkynetGuiPlugin.class, Level.SEVERE, ex);
+ httpResponse.outputStandardError(HttpURLConnection.HTTP_INTERNAL_ERROR,
+ String.format("Unable to open: [%s]", artifact.getName()), ex);
+ }
+ } else {
+ httpResponse.outputStandardError(HttpURLConnection.HTTP_BAD_REQUEST, "Unable to open null artifact");
+ }
+ }
}
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/XWorkingBranch.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/XWorkingBranch.java
index e42e7d01a7..ac6d0c551e 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/XWorkingBranch.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/XWorkingBranch.java
@@ -31,13 +31,13 @@ import org.eclipse.osee.framework.skynet.core.event2.ArtifactEvent;
import org.eclipse.osee.framework.skynet.core.event2.BranchEvent;
import org.eclipse.osee.framework.skynet.core.event2.artifact.IArtifactEventListener;
import org.eclipse.osee.framework.skynet.core.event2.filter.IEventFilter;
-import org.eclipse.osee.framework.ui.plugin.util.Displays;
import org.eclipse.osee.framework.ui.plugin.util.Result;
import org.eclipse.osee.framework.ui.skynet.ArtifactExplorer;
import org.eclipse.osee.framework.ui.skynet.FrameworkImage;
import org.eclipse.osee.framework.ui.skynet.SkynetGuiPlugin;
import org.eclipse.osee.framework.ui.skynet.widgets.IArtifactWidget;
import org.eclipse.osee.framework.ui.skynet.widgets.XWidget;
+import org.eclipse.osee.framework.ui.swt.Displays;
import org.eclipse.osee.framework.ui.swt.ImageManager;
import org.eclipse.osee.framework.ui.swt.Widgets;
import org.eclipse.swt.SWT;
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/commit/XCommitManager.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/commit/XCommitManager.java
index d180dd191f..2bd0f869dc 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/commit/XCommitManager.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/commit/XCommitManager.java
@@ -37,12 +37,12 @@ import org.eclipse.osee.framework.skynet.core.event.OseeEventManager;
import org.eclipse.osee.framework.skynet.core.event.Sender;
import org.eclipse.osee.framework.skynet.core.event2.BranchEvent;
import org.eclipse.osee.framework.ui.plugin.PluginUiImage;
-import org.eclipse.osee.framework.ui.plugin.util.Displays;
import org.eclipse.osee.framework.ui.plugin.util.Result;
import org.eclipse.osee.framework.ui.skynet.SkynetGuiPlugin;
import org.eclipse.osee.framework.ui.skynet.widgets.IArtifactWidget;
import org.eclipse.osee.framework.ui.skynet.widgets.XWidget;
import org.eclipse.osee.framework.ui.swt.ALayout;
+import org.eclipse.osee.framework.ui.swt.Displays;
import org.eclipse.osee.framework.ui.swt.IDirtiableEditor;
import org.eclipse.osee.framework.ui.swt.ImageManager;
import org.eclipse.osee.framework.ui.swt.Widgets;
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/defect/DefectContentProvider.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/defect/DefectContentProvider.java
index 4cc22d1ffd..8d9503fb84 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/defect/DefectContentProvider.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/defect/DefectContentProvider.java
@@ -15,7 +15,7 @@ import java.util.Collection;
import java.util.HashSet;
import org.eclipse.jface.viewers.ITreeContentProvider;
import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.osee.framework.ui.plugin.util.Displays;
+import org.eclipse.osee.framework.ui.swt.Displays;
public class DefectContentProvider implements ITreeContentProvider {
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/defect/XDefectViewer.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/defect/XDefectViewer.java
index e1896c8d0f..5738edc2ea 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/defect/XDefectViewer.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/defect/XDefectViewer.java
@@ -46,7 +46,6 @@ import org.eclipse.osee.framework.skynet.core.event2.filter.IEventFilter;
import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
import org.eclipse.osee.framework.ui.plugin.PluginUiImage;
import org.eclipse.osee.framework.ui.plugin.util.AWorkbench;
-import org.eclipse.osee.framework.ui.plugin.util.Displays;
import org.eclipse.osee.framework.ui.plugin.util.Result;
import org.eclipse.osee.framework.ui.skynet.FrameworkImage;
import org.eclipse.osee.framework.ui.skynet.SkynetGuiPlugin;
@@ -55,6 +54,7 @@ import org.eclipse.osee.framework.ui.skynet.widgets.XDate;
import org.eclipse.osee.framework.ui.skynet.widgets.XWidget;
import org.eclipse.osee.framework.ui.skynet.widgets.dialog.EntryDialog;
import org.eclipse.osee.framework.ui.swt.ALayout;
+import org.eclipse.osee.framework.ui.swt.Displays;
import org.eclipse.osee.framework.ui.swt.IDirtiableEditor;
import org.eclipse.osee.framework.ui.swt.ImageManager;
import org.eclipse.swt.SWT;
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/role/UserRoleContentProvider.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/role/UserRoleContentProvider.java
index 4155f17273..0f8620cf93 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/role/UserRoleContentProvider.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/role/UserRoleContentProvider.java
@@ -15,7 +15,7 @@ import java.util.Collection;
import java.util.HashSet;
import org.eclipse.jface.viewers.ITreeContentProvider;
import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.osee.framework.ui.plugin.util.Displays;
+import org.eclipse.osee.framework.ui.swt.Displays;
public class UserRoleContentProvider implements ITreeContentProvider {
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/role/XUserRoleViewer.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/role/XUserRoleViewer.java
index 2676bbc8b4..4cec274a3a 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/role/XUserRoleViewer.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/role/XUserRoleViewer.java
@@ -43,13 +43,13 @@ import org.eclipse.osee.framework.skynet.core.event2.filter.IEventFilter;
import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
import org.eclipse.osee.framework.ui.plugin.PluginUiImage;
import org.eclipse.osee.framework.ui.plugin.util.AWorkbench;
-import org.eclipse.osee.framework.ui.plugin.util.Displays;
import org.eclipse.osee.framework.ui.plugin.util.Result;
import org.eclipse.osee.framework.ui.skynet.FrameworkImage;
import org.eclipse.osee.framework.ui.skynet.SkynetGuiPlugin;
import org.eclipse.osee.framework.ui.skynet.widgets.IArtifactWidget;
import org.eclipse.osee.framework.ui.skynet.widgets.XWidget;
import org.eclipse.osee.framework.ui.swt.ALayout;
+import org.eclipse.osee.framework.ui.swt.Displays;
import org.eclipse.osee.framework.ui.swt.IDirtiableEditor;
import org.eclipse.osee.framework.ui.swt.ImageManager;
import org.eclipse.swt.SWT;
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/editor/AtsWorkflowConfigEditor.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/editor/AtsWorkflowConfigEditor.java
index f6ccbe1e54..8305300517 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/editor/AtsWorkflowConfigEditor.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/editor/AtsWorkflowConfigEditor.java
@@ -66,10 +66,10 @@ import org.eclipse.osee.framework.skynet.core.event2.artifact.IArtifactEventList
import org.eclipse.osee.framework.skynet.core.event2.filter.IEventFilter;
import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
import org.eclipse.osee.framework.ui.plugin.util.AWorkbench;
-import org.eclipse.osee.framework.ui.plugin.util.Displays;
import org.eclipse.osee.framework.ui.plugin.util.Result;
import org.eclipse.osee.framework.ui.skynet.widgets.workflow.WorkFlowDefinition;
import org.eclipse.osee.framework.ui.skynet.widgets.workflow.WorkPageDefinition;
+import org.eclipse.osee.framework.ui.swt.Displays;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.ui.IActionBars;
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/editor/AtsWorkflowConfigEditorPaletteFactory.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/editor/AtsWorkflowConfigEditorPaletteFactory.java
index 313b783089..363ae01678 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/editor/AtsWorkflowConfigEditorPaletteFactory.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/editor/AtsWorkflowConfigEditorPaletteFactory.java
@@ -36,8 +36,8 @@ import org.eclipse.osee.ats.workflow.editor.model.TransitionConnection;
import org.eclipse.osee.ats.workflow.editor.model.WorkPageShape;
import org.eclipse.osee.framework.ui.plugin.OseeUiActions;
import org.eclipse.osee.framework.ui.skynet.FrameworkImage;
+import org.eclipse.osee.framework.ui.swt.Displays;
import org.eclipse.osee.framework.ui.swt.ImageManager;
-import org.eclipse.swt.widgets.Display;
/**
* Utility class that can create a GEF Palette.
@@ -47,145 +47,150 @@ import org.eclipse.swt.widgets.Display;
*/
final class AtsWorkflowConfigEditorPaletteFactory {
- /** Create the "States" drawer. */
- private static PaletteContainer createStatesDrawer() {
- PaletteDrawer componentsDrawer = new PaletteDrawer("States");
-
- CombinedTemplateCreationEntry component =
- new CombinedTemplateCreationEntry("State", "Create a new Workflow State", WorkPageShape.class,
- new SimpleFactory(WorkPageShape.class), ImageManager.getImageDescriptor(FrameworkImage.RECTANGLE_16),
- ImageManager.getImageDescriptor(FrameworkImage.RECTANGLE_24));
- componentsDrawer.add(component);
-
- component =
- new CombinedTemplateCreationEntry("Completed State", "Create a Completed State",
- CompletedWorkPageShape.class, new SimpleFactory(CompletedWorkPageShape.class),
- ImageManager.getImageDescriptor(FrameworkImage.RECTANGLE_16),
- ImageManager.getImageDescriptor(FrameworkImage.RECTANGLE_24));
- componentsDrawer.add(component);
-
- component =
- new CombinedTemplateCreationEntry("Cancelled State", "Create a Cancelled State",
- CancelledWorkPageShape.class, new SimpleFactory(CancelledWorkPageShape.class),
- ImageManager.getImageDescriptor(FrameworkImage.RECTANGLE_16),
- ImageManager.getImageDescriptor(FrameworkImage.RECTANGLE_24));
- componentsDrawer.add(component);
-
- return componentsDrawer;
- }
-
- /** Create the "Transitions" drawer. */
- private static PaletteContainer createTransitionsDrawer() {
- PaletteDrawer componentsDrawer = new PaletteDrawer("Transitions");
-
- ToolEntry tool =
- new ConnectionCreationToolEntry("Default Transition", "Create a Default Transition", new CreationFactory() {
- public Object getNewObject() {
- return null;
- }
-
- public Object getObjectType() {
- return DefaultTransitionConnection.class;
- }
- }, ImageManager.getImageDescriptor(AtsImage.CONECTION_16),
- ImageManager.getImageDescriptor(AtsImage.CONECTION_24));
- componentsDrawer.add(tool);
-
- tool =
- new ConnectionCreationToolEntry("Transition", "Create a Transition", new CreationFactory() {
- public Object getNewObject() {
- return null;
- }
-
- public Object getObjectType() {
- return TransitionConnection.class;
- }
- }, ImageManager.getImageDescriptor(AtsImage.CONECTION_16),
- ImageManager.getImageDescriptor(AtsImage.CONECTION_24));
- componentsDrawer.add(tool);
-
- tool =
- new ConnectionCreationToolEntry("Return Transition", "Create a Return Transition", new CreationFactory() {
- public Object getNewObject() {
- return null;
- }
-
- public Object getObjectType() {
- return ReturnTransitionConnection.class;
- }
- }, ImageManager.getImageDescriptor(AtsImage.CONECTION_16),
- ImageManager.getImageDescriptor(AtsImage.CONECTION_24));
- componentsDrawer.add(tool);
-
- return componentsDrawer;
- }
-
- /**
- * Creates the PaletteRoot and adds all palette elements. Use this factory method to create a new palette for your
- * graphical editor.
- *
- * @return a new PaletteRoot
- */
- static PaletteRoot createPalette(AtsWorkflowConfigEditor editor) {
- PaletteRoot palette = new PaletteRoot();
- palette.add(createToolsGroup(palette, editor));
- palette.add(createStatesDrawer());
- palette.add(createTransitionsDrawer());
- return palette;
- }
-
- /** Create the "Tools" group. */
- private static PaletteContainer createToolsGroup(PaletteRoot palette, AtsWorkflowConfigEditor editor) {
- PaletteToolbar toolbar = new PaletteToolbar("Tools");
-
- // Add a selection tool to the group
- ToolEntry tool = new PanningSelectionToolEntry();
- toolbar.add(tool);
- palette.setDefaultEntry(tool);
-
- // Add a marquee tool to the group
- toolbar.add(new MarqueeToolEntry());
-
- toolbar.add(new ValidateDiagramToolEntry());
-
- final Action action =
- OseeUiActions.createBugAction(AtsPlugin.getInstance(), editor, AtsWorkflowConfigEditor.EDITOR_ID,
- "ATS Workflow Config Editor");
- final ImageDescriptor img = action.getImageDescriptor();
-
- toolbar.add(new ToolEntry("", action.getText(), img, img, null) {
-
- @Override
- public Tool createTool() {
- return new AbstractTool() {
-
- @Override
- protected String getCommandName() {
- return action.getText();
- }
-
- @Override
- public void activate() {
- super.activate();
- Display.getDefault().asyncExec(new Runnable() {
- public void run() {
- deactivate();
- action.run();
- }
- });
-
- }
- };
- }
-
- });
-
- return toolbar;
- }
-
- /** Utility class. */
- private AtsWorkflowConfigEditorPaletteFactory() {
- // Utility class
- }
+ /** Create the "States" drawer. */
+ private static PaletteContainer createStatesDrawer() {
+ PaletteDrawer componentsDrawer = new PaletteDrawer("States");
+
+ CombinedTemplateCreationEntry component =
+ new CombinedTemplateCreationEntry("State", "Create a new Workflow State", WorkPageShape.class,
+ new SimpleFactory(WorkPageShape.class),
+ ImageManager.getImageDescriptor(FrameworkImage.RECTANGLE_16),
+ ImageManager.getImageDescriptor(FrameworkImage.RECTANGLE_24));
+ componentsDrawer.add(component);
+
+ component =
+ new CombinedTemplateCreationEntry("Completed State", "Create a Completed State",
+ CompletedWorkPageShape.class, new SimpleFactory(CompletedWorkPageShape.class),
+ ImageManager.getImageDescriptor(FrameworkImage.RECTANGLE_16),
+ ImageManager.getImageDescriptor(FrameworkImage.RECTANGLE_24));
+ componentsDrawer.add(component);
+
+ component =
+ new CombinedTemplateCreationEntry("Cancelled State", "Create a Cancelled State",
+ CancelledWorkPageShape.class, new SimpleFactory(CancelledWorkPageShape.class),
+ ImageManager.getImageDescriptor(FrameworkImage.RECTANGLE_16),
+ ImageManager.getImageDescriptor(FrameworkImage.RECTANGLE_24));
+ componentsDrawer.add(component);
+
+ return componentsDrawer;
+ }
+
+ /** Create the "Transitions" drawer. */
+ private static PaletteContainer createTransitionsDrawer() {
+ PaletteDrawer componentsDrawer = new PaletteDrawer("Transitions");
+
+ ToolEntry tool =
+ new ConnectionCreationToolEntry("Default Transition", "Create a Default Transition",
+ new CreationFactory() {
+ public Object getNewObject() {
+ return null;
+ }
+
+ public Object getObjectType() {
+ return DefaultTransitionConnection.class;
+ }
+ }, ImageManager.getImageDescriptor(AtsImage.CONECTION_16),
+ ImageManager.getImageDescriptor(AtsImage.CONECTION_24));
+ componentsDrawer.add(tool);
+
+ tool =
+ new ConnectionCreationToolEntry("Transition", "Create a Transition", new CreationFactory() {
+ public Object getNewObject() {
+ return null;
+ }
+
+ public Object getObjectType() {
+ return TransitionConnection.class;
+ }
+ }, ImageManager.getImageDescriptor(AtsImage.CONECTION_16),
+ ImageManager.getImageDescriptor(AtsImage.CONECTION_24));
+ componentsDrawer.add(tool);
+
+ tool =
+ new ConnectionCreationToolEntry("Return Transition", "Create a Return Transition",
+ new CreationFactory() {
+ public Object getNewObject() {
+ return null;
+ }
+
+ public Object getObjectType() {
+ return ReturnTransitionConnection.class;
+ }
+ }, ImageManager.getImageDescriptor(AtsImage.CONECTION_16),
+ ImageManager.getImageDescriptor(AtsImage.CONECTION_24));
+ componentsDrawer.add(tool);
+
+ return componentsDrawer;
+ }
+
+ /**
+ * Creates the PaletteRoot and adds all palette elements. Use this factory method to create a new palette for your
+ * graphical editor.
+ *
+ * @return a new PaletteRoot
+ */
+ static PaletteRoot createPalette(AtsWorkflowConfigEditor editor) {
+ PaletteRoot palette = new PaletteRoot();
+ palette.add(createToolsGroup(palette, editor));
+ palette.add(createStatesDrawer());
+ palette.add(createTransitionsDrawer());
+ return palette;
+ }
+
+ /** Create the "Tools" group. */
+ private static PaletteContainer createToolsGroup(PaletteRoot palette, AtsWorkflowConfigEditor editor) {
+ PaletteToolbar toolbar = new PaletteToolbar("Tools");
+
+ // Add a selection tool to the group
+ ToolEntry tool = new PanningSelectionToolEntry();
+ toolbar.add(tool);
+ palette.setDefaultEntry(tool);
+
+ // Add a marquee tool to the group
+ toolbar.add(new MarqueeToolEntry());
+
+ toolbar.add(new ValidateDiagramToolEntry());
+
+ final Action action =
+ OseeUiActions.createBugAction(AtsPlugin.getInstance(), editor, AtsWorkflowConfigEditor.EDITOR_ID,
+ "ATS Workflow Config Editor");
+ final ImageDescriptor img = action.getImageDescriptor();
+
+ toolbar.add(new ToolEntry("", action.getText(), img, img, null) {
+
+ @Override
+ public Tool createTool() {
+ return new AbstractTool() {
+
+ @Override
+ protected String getCommandName() {
+ return action.getText();
+ }
+
+ @Override
+ public void activate() {
+ super.activate();
+ Displays.ensureInDisplayThread(new Runnable() {
+
+ @Override
+ public void run() {
+ deactivate();
+ action.run();
+ }
+ });
+
+ }
+ };
+ }
+
+ });
+
+ return toolbar;
+ }
+
+ /** Utility class. */
+ private AtsWorkflowConfigEditorPaletteFactory() {
+ // Utility class
+ }
} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/editor/AtsWorkflowConfigRenderer.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/editor/AtsWorkflowConfigRenderer.java
index 8ccfaa761b..2dbd5ca4d5 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/editor/AtsWorkflowConfigRenderer.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/editor/AtsWorkflowConfigRenderer.java
@@ -20,11 +20,11 @@ import org.eclipse.osee.framework.logging.OseeLevel;
import org.eclipse.osee.framework.logging.OseeLog;
import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
import org.eclipse.osee.framework.ui.plugin.util.AWorkbench;
-import org.eclipse.osee.framework.ui.plugin.util.Displays;
import org.eclipse.osee.framework.ui.skynet.SkynetGuiPlugin;
import org.eclipse.osee.framework.ui.skynet.render.DefaultArtifactRenderer;
import org.eclipse.osee.framework.ui.skynet.render.PresentationType;
import org.eclipse.osee.framework.ui.skynet.widgets.workflow.WorkFlowDefinition;
+import org.eclipse.osee.framework.ui.swt.Displays;
import org.eclipse.osee.framework.ui.swt.ImageManager;
import org.eclipse.swt.graphics.Image;
import org.eclipse.ui.IEditorInput;
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/AtsXWidgetActionFormPage.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/AtsXWidgetActionFormPage.java
index 67a6066806..8805871c64 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/AtsXWidgetActionFormPage.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/AtsXWidgetActionFormPage.java
@@ -17,7 +17,6 @@ import org.eclipse.osee.ats.internal.AtsPlugin;
import org.eclipse.osee.framework.core.exception.OseeCoreException;
import org.eclipse.osee.framework.logging.OseeLevel;
import org.eclipse.osee.framework.logging.OseeLog;
-import org.eclipse.osee.framework.ui.plugin.util.Displays;
import org.eclipse.osee.framework.ui.plugin.util.Result;
import org.eclipse.osee.framework.ui.skynet.SkynetGuiPlugin;
import org.eclipse.osee.framework.ui.skynet.XFormToolkit;
@@ -29,6 +28,7 @@ import org.eclipse.osee.framework.ui.skynet.widgets.workflow.DynamicXWidgetLayou
import org.eclipse.osee.framework.ui.skynet.widgets.workflow.IDynamicWidgetLayoutListener;
import org.eclipse.osee.framework.ui.skynet.widgets.workflow.IXWidgetOptionResolver;
import org.eclipse.osee.framework.ui.swt.ALayout;
+import org.eclipse.osee.framework.ui.swt.Displays;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/WorldComposite.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/WorldComposite.java
index 8029d49fcd..a1256c4dfd 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/WorldComposite.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/WorldComposite.java
@@ -32,7 +32,6 @@ import org.eclipse.osee.framework.core.exception.OseeCoreException;
import org.eclipse.osee.framework.logging.OseeLevel;
import org.eclipse.osee.framework.logging.OseeLog;
import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
-import org.eclipse.osee.framework.ui.plugin.util.Displays;
import org.eclipse.osee.framework.ui.plugin.xnavigate.XNavigateComposite.TableLoadOption;
import org.eclipse.osee.framework.ui.skynet.action.RefreshAction.IRefreshActionHandler;
import org.eclipse.osee.framework.ui.skynet.render.PresentationType;
@@ -40,6 +39,7 @@ import org.eclipse.osee.framework.ui.skynet.render.RendererManager;
import org.eclipse.osee.framework.ui.skynet.util.DbConnectionExceptionComposite;
import org.eclipse.osee.framework.ui.skynet.widgets.XDate;
import org.eclipse.osee.framework.ui.swt.ALayout;
+import org.eclipse.osee.framework.ui.swt.Displays;
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.ScrolledComposite;
import org.eclipse.swt.graphics.Image;
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/WorldContentProvider.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/WorldContentProvider.java
index 089bbcb266..9387de3164 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/WorldContentProvider.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/WorldContentProvider.java
@@ -32,7 +32,7 @@ import org.eclipse.osee.framework.core.exception.OseeCoreException;
import org.eclipse.osee.framework.logging.OseeLevel;
import org.eclipse.osee.framework.logging.OseeLog;
import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
-import org.eclipse.osee.framework.ui.plugin.util.Displays;
+import org.eclipse.osee.framework.ui.swt.Displays;
public class WorldContentProvider implements ITreeContentProvider {
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/WorldEditor.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/WorldEditor.java
index b1f2ba6eb4..cf79b47d78 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/WorldEditor.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/WorldEditor.java
@@ -28,8 +28,8 @@ import org.eclipse.osee.framework.logging.OseeLog;
import org.eclipse.osee.framework.plugin.core.IActionable;
import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
import org.eclipse.osee.framework.ui.plugin.util.AWorkbench;
-import org.eclipse.osee.framework.ui.plugin.util.Displays;
import org.eclipse.osee.framework.ui.skynet.OseeContributionItem;
+import org.eclipse.osee.framework.ui.swt.Displays;
import org.eclipse.osee.framework.ui.swt.IDirtiableEditor;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Composite;
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/WorldEditorParameterSearchItemProvider.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/WorldEditorParameterSearchItemProvider.java
index 1a7522e70f..8b7c7d11a7 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/WorldEditorParameterSearchItemProvider.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/WorldEditorParameterSearchItemProvider.java
@@ -26,12 +26,12 @@ import org.eclipse.osee.framework.jdk.core.util.Strings;
import org.eclipse.osee.framework.logging.OseeLog;
import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
import org.eclipse.osee.framework.ui.plugin.util.AWorkbench;
-import org.eclipse.osee.framework.ui.plugin.util.Displays;
import org.eclipse.osee.framework.ui.plugin.util.Result;
import org.eclipse.osee.framework.ui.plugin.xnavigate.XNavigateComposite.TableLoadOption;
import org.eclipse.osee.framework.ui.skynet.widgets.workflow.DynamicXWidgetLayoutData;
import org.eclipse.osee.framework.ui.skynet.widgets.workflow.IDynamicWidgetLayoutListener;
import org.eclipse.osee.framework.ui.swt.CursorManager;
+import org.eclipse.osee.framework.ui.swt.Displays;
import org.eclipse.swt.SWT;
/**
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/WorldViewerEventManager.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/WorldViewerEventManager.java
index f71b272b2f..a4b93a771d 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/WorldViewerEventManager.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/WorldViewerEventManager.java
@@ -29,7 +29,7 @@ import org.eclipse.osee.framework.skynet.core.event2.artifact.EventBasicGuidArti
import org.eclipse.osee.framework.skynet.core.event2.artifact.EventModType;
import org.eclipse.osee.framework.skynet.core.event2.artifact.IArtifactEventListener;
import org.eclipse.osee.framework.skynet.core.event2.filter.IEventFilter;
-import org.eclipse.osee.framework.ui.plugin.util.Displays;
+import org.eclipse.osee.framework.ui.swt.Displays;
/**
* Common location for event handling for task and world composites in order to keep number of registrations and
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/WorldXViewer.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/WorldXViewer.java
index 23bcfc3e41..7b5557c999 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/WorldXViewer.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/WorldXViewer.java
@@ -73,12 +73,12 @@ import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
import org.eclipse.osee.framework.skynet.core.utility.Artifacts;
import org.eclipse.osee.framework.skynet.core.utility.LoadedArtifacts;
import org.eclipse.osee.framework.ui.plugin.util.AWorkbench;
-import org.eclipse.osee.framework.ui.plugin.util.Displays;
import org.eclipse.osee.framework.ui.plugin.xnavigate.XNavigateComposite.TableLoadOption;
import org.eclipse.osee.framework.ui.skynet.SkynetGuiPlugin;
import org.eclipse.osee.framework.ui.skynet.artifact.ArtifactPromptChange;
import org.eclipse.osee.framework.ui.skynet.results.XResultData;
import org.eclipse.osee.framework.ui.skynet.widgets.xviewer.skynet.column.XViewerAttributeColumn;
+import org.eclipse.osee.framework.ui.swt.Displays;
import org.eclipse.osee.framework.ui.swt.ImageManager;
import org.eclipse.osee.framework.ui.swt.Widgets;
import org.eclipse.swt.events.DisposeEvent;
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/WorldXViewerEventManager.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/WorldXViewerEventManager.java
index 6d1f385ad4..c52ae8fa75 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/WorldXViewerEventManager.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/WorldXViewerEventManager.java
@@ -24,7 +24,7 @@ import org.eclipse.osee.framework.skynet.core.event2.artifact.EventBasicGuidArti
import org.eclipse.osee.framework.skynet.core.event2.artifact.EventModType;
import org.eclipse.osee.framework.skynet.core.event2.artifact.IArtifactEventListener;
import org.eclipse.osee.framework.skynet.core.event2.filter.IEventFilter;
-import org.eclipse.osee.framework.ui.plugin.util.Displays;
+import org.eclipse.osee.framework.ui.swt.Displays;
/**
* Common location for event handling for task and world composites in order to keep number of registrations and
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/WorldXWidgetActionPage.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/WorldXWidgetActionPage.java
index d6e282a2ed..6af66d4291 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/WorldXWidgetActionPage.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/WorldXWidgetActionPage.java
@@ -43,13 +43,13 @@ import org.eclipse.osee.framework.plugin.core.util.Jobs;
import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
import org.eclipse.osee.framework.ui.plugin.OseeUiActions;
import org.eclipse.osee.framework.ui.plugin.util.AWorkbench;
-import org.eclipse.osee.framework.ui.plugin.util.Displays;
import org.eclipse.osee.framework.ui.plugin.util.Result;
import org.eclipse.osee.framework.ui.skynet.FrameworkImage;
import org.eclipse.osee.framework.ui.skynet.action.CollapseAllAction;
import org.eclipse.osee.framework.ui.skynet.action.ExpandAllAction;
import org.eclipse.osee.framework.ui.skynet.action.RefreshAction;
import org.eclipse.osee.framework.ui.skynet.widgets.workflow.IDynamicWidgetLayoutListener;
+import org.eclipse.osee.framework.ui.swt.Displays;
import org.eclipse.osee.framework.ui.swt.ImageManager;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.KeyEvent;
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/MultipleHridSearchOperation.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/MultipleHridSearchOperation.java
index b1a3a60337..c7ad923ecd 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/MultipleHridSearchOperation.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/MultipleHridSearchOperation.java
@@ -42,7 +42,6 @@ import org.eclipse.osee.framework.skynet.core.artifact.IATSArtifact;
import org.eclipse.osee.framework.skynet.core.artifact.search.ArtifactQuery;
import org.eclipse.osee.framework.ui.plugin.util.AWorkbench;
import org.eclipse.osee.framework.ui.plugin.util.ArrayTreeContentProvider;
-import org.eclipse.osee.framework.ui.plugin.util.Displays;
import org.eclipse.osee.framework.ui.plugin.xnavigate.XNavigateComposite.TableLoadOption;
import org.eclipse.osee.framework.ui.skynet.ArtifactDecoratorPreferences;
import org.eclipse.osee.framework.ui.skynet.ArtifactLabelProvider;
@@ -50,6 +49,7 @@ import org.eclipse.osee.framework.ui.skynet.ArtifactViewerSorter;
import org.eclipse.osee.framework.ui.skynet.render.PresentationType;
import org.eclipse.osee.framework.ui.skynet.render.RendererManager;
import org.eclipse.osee.framework.ui.skynet.util.filteredTree.SimpleCheckFilteredTreeDialog;
+import org.eclipse.osee.framework.ui.swt.Displays;
import org.eclipse.swt.widgets.Display;
import org.eclipse.ui.dialogs.ListDialog;
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/MultipleHridSearchUi.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/MultipleHridSearchUi.java
index e46b80d3ee..0961c0656a 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/MultipleHridSearchUi.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/MultipleHridSearchUi.java
@@ -14,12 +14,12 @@ import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.osee.ats.util.AtsUtil;
import org.eclipse.osee.framework.jdk.core.util.Strings;
import org.eclipse.osee.framework.ui.plugin.util.AWorkbench;
-import org.eclipse.osee.framework.ui.plugin.util.Displays;
import org.eclipse.osee.framework.ui.skynet.ArtifactImageManager;
import org.eclipse.osee.framework.ui.skynet.FrameworkImage;
import org.eclipse.osee.framework.ui.skynet.branch.BranchSelectionDialog;
import org.eclipse.osee.framework.ui.skynet.widgets.dialog.EntryCheckDialog;
import org.eclipse.osee.framework.ui.skynet.widgets.dialog.EntryDialog;
+import org.eclipse.osee.framework.ui.swt.Displays;
import org.eclipse.swt.widgets.Display;
/**
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/WorldUISearchItem.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/WorldUISearchItem.java
index ec7c02380a..751fb95849 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/WorldUISearchItem.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/WorldUISearchItem.java
@@ -16,7 +16,7 @@ import org.eclipse.osee.framework.core.exception.OseeCoreException;
import org.eclipse.osee.framework.logging.OseeLevel;
import org.eclipse.osee.framework.logging.OseeLog;
import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
-import org.eclipse.osee.framework.ui.plugin.util.Displays;
+import org.eclipse.osee.framework.ui.swt.Displays;
import org.eclipse.osee.framework.ui.swt.KeyedImage;
/**
diff --git a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/editor/CoverageEditor.java b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/editor/CoverageEditor.java
index 720c1ae6d1..f69e5e181d 100644
--- a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/editor/CoverageEditor.java
+++ b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/editor/CoverageEditor.java
@@ -38,11 +38,11 @@ import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
import org.eclipse.osee.framework.skynet.core.relation.RelationManager;
import org.eclipse.osee.framework.ui.plugin.OseeUiActions;
import org.eclipse.osee.framework.ui.plugin.util.AWorkbench;
-import org.eclipse.osee.framework.ui.plugin.util.Displays;
import org.eclipse.osee.framework.ui.skynet.OseeContributionItem;
import org.eclipse.osee.framework.ui.skynet.SkynetGuiPlugin;
import org.eclipse.osee.framework.ui.skynet.util.ElapsedTime;
import org.eclipse.osee.framework.ui.skynet.widgets.XDate;
+import org.eclipse.osee.framework.ui.swt.Displays;
import org.eclipse.osee.framework.ui.swt.ImageManager;
import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.IEditorReference;
diff --git a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/editor/CoverageEditorImportTab.java b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/editor/CoverageEditorImportTab.java
index 129bda8627..066872d5b0 100644
--- a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/editor/CoverageEditorImportTab.java
+++ b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/editor/CoverageEditorImportTab.java
@@ -34,7 +34,6 @@ import org.eclipse.osee.framework.jdk.core.util.Strings;
import org.eclipse.osee.framework.logging.OseeLevel;
import org.eclipse.osee.framework.logging.OseeLog;
import org.eclipse.osee.framework.ui.plugin.util.ArrayTreeContentProvider;
-import org.eclipse.osee.framework.ui.plugin.util.Displays;
import org.eclipse.osee.framework.ui.skynet.FrameworkImage;
import org.eclipse.osee.framework.ui.skynet.SkynetGuiPlugin;
import org.eclipse.osee.framework.ui.skynet.blam.AbstractBlam;
@@ -43,6 +42,7 @@ import org.eclipse.osee.framework.ui.skynet.blam.sections.BlamOutputSection;
import org.eclipse.osee.framework.ui.skynet.blam.sections.BlamUsageSection;
import org.eclipse.osee.framework.ui.skynet.widgets.XComboViewer;
import org.eclipse.osee.framework.ui.swt.ALayout;
+import org.eclipse.osee.framework.ui.swt.Displays;
import org.eclipse.osee.framework.ui.swt.ImageManager;
import org.eclipse.osee.framework.ui.swt.Widgets;
import org.eclipse.swt.SWT;
diff --git a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/editor/CoverageEditorLoadingTab.java b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/editor/CoverageEditorLoadingTab.java
index f09d640098..57c167ef7e 100644
--- a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/editor/CoverageEditorLoadingTab.java
+++ b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/editor/CoverageEditorLoadingTab.java
@@ -11,12 +11,12 @@
package org.eclipse.osee.coverage.editor;
import org.eclipse.osee.coverage.util.CoverageImage;
-import org.eclipse.osee.framework.ui.plugin.util.Displays;
import org.eclipse.osee.framework.ui.skynet.action.RefreshAction;
import org.eclipse.osee.framework.ui.skynet.action.RefreshAction.IRefreshActionHandler;
import org.eclipse.osee.framework.ui.skynet.results.XResultData;
import org.eclipse.osee.framework.ui.skynet.results.html.XResultsComposite;
import org.eclipse.osee.framework.ui.swt.ALayout;
+import org.eclipse.osee.framework.ui.swt.Displays;
import org.eclipse.osee.framework.ui.swt.ImageManager;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridData;
diff --git a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/editor/CoverageEditorMergeTab.java b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/editor/CoverageEditorMergeTab.java
index 836424a8ca..7b075dea10 100644
--- a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/editor/CoverageEditorMergeTab.java
+++ b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/editor/CoverageEditorMergeTab.java
@@ -53,7 +53,6 @@ import org.eclipse.osee.framework.logging.OseeLog;
import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
import org.eclipse.osee.framework.ui.plugin.util.AWorkbench;
-import org.eclipse.osee.framework.ui.plugin.util.Displays;
import org.eclipse.osee.framework.ui.plugin.util.Result;
import org.eclipse.osee.framework.ui.skynet.FrameworkImage;
import org.eclipse.osee.framework.ui.skynet.action.CollapseAllAction;
@@ -62,6 +61,7 @@ import org.eclipse.osee.framework.ui.skynet.action.RefreshAction;
import org.eclipse.osee.framework.ui.skynet.results.XResultData;
import org.eclipse.osee.framework.ui.skynet.widgets.dialog.CheckBoxDialog;
import org.eclipse.osee.framework.ui.swt.ALayout;
+import org.eclipse.osee.framework.ui.swt.Displays;
import org.eclipse.osee.framework.ui.swt.ImageManager;
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.SashForm;
diff --git a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/editor/CoverageEditorOverviewTab.java b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/editor/CoverageEditorOverviewTab.java
index 4fdc02fee8..8368c0b323 100644
--- a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/editor/CoverageEditorOverviewTab.java
+++ b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/editor/CoverageEditorOverviewTab.java
@@ -23,7 +23,6 @@ import org.eclipse.osee.coverage.model.CoveragePackageBase;
import org.eclipse.osee.coverage.model.CoverageUnit;
import org.eclipse.osee.coverage.util.CoverageUtil;
import org.eclipse.osee.framework.jdk.core.util.AHTML;
-import org.eclipse.osee.framework.ui.plugin.util.Displays;
import org.eclipse.osee.framework.ui.skynet.action.RefreshAction;
import org.eclipse.osee.framework.ui.skynet.action.RefreshAction.IRefreshActionHandler;
import org.eclipse.osee.framework.ui.skynet.action.browser.BrowserPrintAction;
@@ -31,6 +30,7 @@ import org.eclipse.osee.framework.ui.skynet.action.browser.IBrowserActionHandler
import org.eclipse.osee.framework.ui.skynet.results.XResultData;
import org.eclipse.osee.framework.ui.skynet.results.html.XResultsComposite;
import org.eclipse.osee.framework.ui.swt.ALayout;
+import org.eclipse.osee.framework.ui.swt.Displays;
import org.eclipse.osee.framework.ui.swt.ImageManager;
import org.eclipse.swt.SWT;
import org.eclipse.swt.browser.Browser;
diff --git a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/navigate/CoverageNavigateView.java b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/navigate/CoverageNavigateView.java
index c0bcc6b310..7461f89b1c 100644
--- a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/navigate/CoverageNavigateView.java
+++ b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/navigate/CoverageNavigateView.java
@@ -32,6 +32,7 @@ import org.eclipse.osee.framework.ui.plugin.xnavigate.XNavigateItem;
import org.eclipse.osee.framework.ui.skynet.OseeContributionItem;
import org.eclipse.osee.framework.ui.skynet.util.DbConnectionExceptionComposite;
import org.eclipse.osee.framework.ui.skynet.widgets.XBranchSelectWidget;
+import org.eclipse.osee.framework.ui.swt.Displays;
import org.eclipse.osee.framework.ui.swt.ImageManager;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridData;
@@ -47,146 +48,148 @@ import org.eclipse.ui.part.ViewPart;
*/
public class CoverageNavigateView extends ViewPart implements IActionable {
- public static final String VIEW_ID = "org.eclipse.osee.coverage.navigate.CoverageNavigateView";
- private XNavigateComposite xNavComp;
- private XBranchSelectWidget xBranchSelectWidget;
-
- public CoverageNavigateView() {
- }
-
- @Override
- public void setFocus() {
- }
-
- @Override
- public void createPartControl(Composite parent) {
- if (!DbConnectionExceptionComposite.dbConnectionIsOk(parent)) {
- return;
- }
-
- OseeContributionItem.addTo(this, false);
-
- Composite comp = new Composite(parent, SWT.None);
- comp.setLayoutData(new GridData(SWT.FILL, SWT.NONE, true, false));
-
- xBranchSelectWidget = new XBranchSelectWidget("");
- xBranchSelectWidget.setDisplayLabel(false);
- if (CoverageUtil.getBranch() != null) {
- xBranchSelectWidget.setSelection(CoverageUtil.getBranch());
- }
- xBranchSelectWidget.createWidgets(comp, 1);
- xBranchSelectWidget.addListener(new Listener() {
- @Override
- public void handleEvent(Event event) {
- try {
- Branch selectedBranch = xBranchSelectWidget.getData();
- if (selectedBranch != null) {
- CoverageUtil.setNavigatorSelectedBranch(selectedBranch);
- }
- } catch (Exception ex) {
- OseeLog.log(getClass(), Level.SEVERE, ex);
- }
- }
-
- });
- CoverageUtil.addBranchChangeListener(new Listener() {
- @Override
- public void handleEvent(Event event) {
- xBranchSelectWidget.setSelection(CoverageUtil.getBranch());
- }
- });
- xNavComp = new XNavigateComposite(new CoverageNavigateViewItems(), comp, SWT.NONE);
-
- createActions();
- xNavComp.refresh();
-
- Label label = new Label(xNavComp, SWT.None);
- String str = getWhoAmI();
- if (CoverageUtil.isAdmin()) {
- str += " - Admin";
- }
- if (!str.equals("")) {
- if (CoverageUtil.isAdmin()) {
- label.setForeground(Display.getCurrent().getSystemColor(SWT.COLOR_RED));
- } else {
- label.setForeground(Display.getCurrent().getSystemColor(SWT.COLOR_BLUE));
- }
- }
- label.setText(str);
- label.setToolTipText(str);
- GridData gridData = new GridData(GridData.HORIZONTAL_ALIGN_CENTER | GridData.VERTICAL_ALIGN_CENTER);
- gridData.heightHint = 15;
- label.setLayoutData(gridData);
-
- addExtensionPointListenerBecauseOfWorkspaceLoading();
- }
-
- private String getWhoAmI() {
- try {
- String userName = UserManager.getUser().getName();
- return String.format("%s - %s:%s", userName, ClientSessionManager.getDataStoreName(),
- ClientSessionManager.getDataStoreLoginName());
- } catch (Exception ex) {
- OseeLog.log(Activator.class, Level.SEVERE, ex);
- return "Exception: " + ex.getLocalizedMessage();
- }
- }
-
- private void addExtensionPointListenerBecauseOfWorkspaceLoading() {
- IExtensionRegistry extensionRegistry = Platform.getExtensionRegistry();
- extensionRegistry.addListener(new IRegistryEventListener() {
- @Override
- public void added(IExtension[] extensions) {
- refresh();
- }
-
- @Override
- public void added(IExtensionPoint[] extensionPoints) {
- refresh();
- }
-
- @Override
- public void removed(IExtension[] extensions) {
- refresh();
- }
-
- @Override
- public void removed(IExtensionPoint[] extensionPoints) {
- refresh();
- }
- }, "org.eclipse.osee.coverage.CoverageNavigateItem");
- }
-
- protected void createActions() {
- Action refreshAction = new Action("Refresh") {
-
- @Override
- public void run() {
- xNavComp.refresh();
- }
- };
- refreshAction.setImageDescriptor(ImageManager.getImageDescriptor(PluginUiImage.REFRESH));
- refreshAction.setToolTipText("Refresh");
- getViewSite().getActionBars().getMenuManager().add(refreshAction);
-
- OseeUiActions.addBugToViewToolbar(this, this, Activator.getInstance(), VIEW_ID, "Coverage Navigator");
-
- }
-
- public String getActionDescription() {
- IStructuredSelection sel = (IStructuredSelection) xNavComp.getFilteredTree().getViewer().getSelection();
- if (sel.iterator().hasNext()) {
- return String.format("Currently Selected - %s", ((XNavigateItem) sel.iterator().next()).getName());
- }
- return "";
- }
-
- public void refresh() {
- Display.getDefault().asyncExec(new Runnable() {
- public void run() {
- xNavComp.refresh();
- }
- });
- }
+ public static final String VIEW_ID = "org.eclipse.osee.coverage.navigate.CoverageNavigateView";
+ private XNavigateComposite xNavComp;
+ private XBranchSelectWidget xBranchSelectWidget;
+
+ public CoverageNavigateView() {
+ }
+
+ @Override
+ public void setFocus() {
+ }
+
+ @Override
+ public void createPartControl(Composite parent) {
+ if (!DbConnectionExceptionComposite.dbConnectionIsOk(parent)) {
+ return;
+ }
+
+ OseeContributionItem.addTo(this, false);
+
+ Composite comp = new Composite(parent, SWT.None);
+ comp.setLayoutData(new GridData(SWT.FILL, SWT.NONE, true, false));
+
+ xBranchSelectWidget = new XBranchSelectWidget("");
+ xBranchSelectWidget.setDisplayLabel(false);
+ if (CoverageUtil.getBranch() != null) {
+ xBranchSelectWidget.setSelection(CoverageUtil.getBranch());
+ }
+ xBranchSelectWidget.createWidgets(comp, 1);
+ xBranchSelectWidget.addListener(new Listener() {
+ @Override
+ public void handleEvent(Event event) {
+ try {
+ Branch selectedBranch = xBranchSelectWidget.getData();
+ if (selectedBranch != null) {
+ CoverageUtil.setNavigatorSelectedBranch(selectedBranch);
+ }
+ } catch (Exception ex) {
+ OseeLog.log(getClass(), Level.SEVERE, ex);
+ }
+ }
+
+ });
+ CoverageUtil.addBranchChangeListener(new Listener() {
+ @Override
+ public void handleEvent(Event event) {
+ xBranchSelectWidget.setSelection(CoverageUtil.getBranch());
+ }
+ });
+ xNavComp = new XNavigateComposite(new CoverageNavigateViewItems(), comp, SWT.NONE);
+
+ createActions();
+ xNavComp.refresh();
+
+ Label label = new Label(xNavComp, SWT.None);
+ String str = getWhoAmI();
+ if (CoverageUtil.isAdmin()) {
+ str += " - Admin";
+ }
+ if (!str.equals("")) {
+ if (CoverageUtil.isAdmin()) {
+ label.setForeground(Display.getCurrent().getSystemColor(SWT.COLOR_RED));
+ } else {
+ label.setForeground(Display.getCurrent().getSystemColor(SWT.COLOR_BLUE));
+ }
+ }
+ label.setText(str);
+ label.setToolTipText(str);
+ GridData gridData = new GridData(GridData.HORIZONTAL_ALIGN_CENTER | GridData.VERTICAL_ALIGN_CENTER);
+ gridData.heightHint = 15;
+ label.setLayoutData(gridData);
+
+ addExtensionPointListenerBecauseOfWorkspaceLoading();
+ }
+
+ private String getWhoAmI() {
+ try {
+ String userName = UserManager.getUser().getName();
+ return String.format("%s - %s:%s", userName, ClientSessionManager.getDataStoreName(),
+ ClientSessionManager.getDataStoreLoginName());
+ } catch (Exception ex) {
+ OseeLog.log(Activator.class, Level.SEVERE, ex);
+ return "Exception: " + ex.getLocalizedMessage();
+ }
+ }
+
+ private void addExtensionPointListenerBecauseOfWorkspaceLoading() {
+ IExtensionRegistry extensionRegistry = Platform.getExtensionRegistry();
+ extensionRegistry.addListener(new IRegistryEventListener() {
+ @Override
+ public void added(IExtension[] extensions) {
+ refresh();
+ }
+
+ @Override
+ public void added(IExtensionPoint[] extensionPoints) {
+ refresh();
+ }
+
+ @Override
+ public void removed(IExtension[] extensions) {
+ refresh();
+ }
+
+ @Override
+ public void removed(IExtensionPoint[] extensionPoints) {
+ refresh();
+ }
+ }, "org.eclipse.osee.coverage.CoverageNavigateItem");
+ }
+
+ protected void createActions() {
+ Action refreshAction = new Action("Refresh") {
+
+ @Override
+ public void run() {
+ xNavComp.refresh();
+ }
+ };
+ refreshAction.setImageDescriptor(ImageManager.getImageDescriptor(PluginUiImage.REFRESH));
+ refreshAction.setToolTipText("Refresh");
+ getViewSite().getActionBars().getMenuManager().add(refreshAction);
+
+ OseeUiActions.addBugToViewToolbar(this, this, Activator.getInstance(), VIEW_ID, "Coverage Navigator");
+
+ }
+
+ public String getActionDescription() {
+ IStructuredSelection sel = (IStructuredSelection) xNavComp.getFilteredTree().getViewer().getSelection();
+ if (sel.iterator().hasNext()) {
+ return String.format("Currently Selected - %s", ((XNavigateItem) sel.iterator().next()).getName());
+ }
+ return "";
+ }
+
+ public void refresh() {
+ Displays.ensureInDisplayThread(new Runnable() {
+
+ @Override
+ public void run() {
+ xNavComp.refresh();
+ }
+ });
+ }
} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/traceability/operations/FindTraceUnitFromResource.java b/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/traceability/operations/FindTraceUnitFromResource.java
index 5555dc3f5c..e86218dc07 100644
--- a/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/traceability/operations/FindTraceUnitFromResource.java
+++ b/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/traceability/operations/FindTraceUnitFromResource.java
@@ -34,103 +34,106 @@ import org.eclipse.osee.framework.skynet.core.artifact.search.ArtifactQuery;
import org.eclipse.osee.framework.ui.plugin.util.AWorkbench;
import org.eclipse.osee.framework.ui.skynet.artifact.editor.ArtifactEditor;
import org.eclipse.osee.framework.ui.skynet.artifact.editor.ArtifactEditorInput;
-import org.eclipse.swt.widgets.Display;
+import org.eclipse.osee.framework.ui.swt.Displays;
/**
* @author Roberto E. Escobar
*/
public class FindTraceUnitFromResource {
- private FindTraceUnitFromResource() {
- }
+ private FindTraceUnitFromResource() {
+ }
- private static HashCollection<String, String> toIdentifiers(IResource... resources) {
- HashCollection<String, String> toReturn = new HashCollection<String, String>(false, HashSet.class);
- if (resources != null && resources.length > 0) {
- try {
- Collection<ITraceUnitResourceLocator> locators =
- TraceUnitExtensionManager.getInstance().getAllTraceUnitLocators();
- for (IResource resource : resources) {
- resourceToId(toReturn, resource, locators);
- }
- } catch (Exception ex) {
- OseeLog.log(DefinePlugin.class, Level.SEVERE, ex);
- }
- }
- return toReturn;
- }
+ private static HashCollection<String, String> toIdentifiers(IResource... resources) {
+ HashCollection<String, String> toReturn = new HashCollection<String, String>(false, HashSet.class);
+ if (resources != null && resources.length > 0) {
+ try {
+ Collection<ITraceUnitResourceLocator> locators =
+ TraceUnitExtensionManager.getInstance().getAllTraceUnitLocators();
+ for (IResource resource : resources) {
+ resourceToId(toReturn, resource, locators);
+ }
+ } catch (Exception ex) {
+ OseeLog.log(DefinePlugin.class, Level.SEVERE, ex);
+ }
+ }
+ return toReturn;
+ }
- private static void resourceToId(HashCollection<String, String> idStore, IResource resource, Collection<ITraceUnitResourceLocator> locators) {
- try {
- IFileStore fileStore = EFS.getStore(resource.getLocationURI());
- for (ITraceUnitResourceLocator locator : locators) {
- if (locator.isValidFile(fileStore)) {
- InputStream inputStream = null;
- try {
- inputStream = fileStore.openInputStream(EFS.NONE, new NullProgressMonitor());
- CharBuffer buffer = Lib.inputStreamToCharBuffer(inputStream);
- String identifier = locator.getIdentifier(fileStore, buffer);
- String traceType = locator.getTraceUnitType(identifier, buffer);
- idStore.put(traceType, identifier);
- } catch (Exception ex) {
- OseeLog.log(DefinePlugin.class, Level.SEVERE, ex);
- } finally {
- if (inputStream != null) {
- try {
- inputStream.close();
- } catch (Exception ex) {
- // do nothing
- }
- }
- }
- }
- }
- } catch (Exception ex) {
- OseeLog.log(DefinePlugin.class, Level.SEVERE, ex);
- }
- }
+ private static void resourceToId(HashCollection<String, String> idStore, IResource resource, Collection<ITraceUnitResourceLocator> locators) {
+ try {
+ IFileStore fileStore = EFS.getStore(resource.getLocationURI());
+ for (ITraceUnitResourceLocator locator : locators) {
+ if (locator.isValidFile(fileStore)) {
+ InputStream inputStream = null;
+ try {
+ inputStream = fileStore.openInputStream(EFS.NONE, new NullProgressMonitor());
+ CharBuffer buffer = Lib.inputStreamToCharBuffer(inputStream);
+ String identifier = locator.getIdentifier(fileStore, buffer);
+ String traceType = locator.getTraceUnitType(identifier, buffer);
+ idStore.put(traceType, identifier);
+ } catch (Exception ex) {
+ OseeLog.log(DefinePlugin.class, Level.SEVERE, ex);
+ } finally {
+ if (inputStream != null) {
+ try {
+ inputStream.close();
+ } catch (Exception ex) {
+ // do nothing
+ }
+ }
+ }
+ }
+ }
+ } catch (Exception ex) {
+ OseeLog.log(DefinePlugin.class, Level.SEVERE, ex);
+ }
+ }
- public static void search(Branch branch, IResource... resources) {
- HashCollection<String, String> typeAndIds = toIdentifiers(resources);
- if (!typeAndIds.isEmpty()) {
- Set<Artifact> artifacts = new HashSet<Artifact>();
- for (String artifactTypeName : typeAndIds.keySet()) {
- Collection<String> items = typeAndIds.getValues(artifactTypeName);
- if (items != null) {
- for (String artifactName : items) {
- try {
- artifacts.addAll(ArtifactQuery.getArtifactListFromTypeAndName(artifactTypeName, artifactName, branch));
- } catch (OseeCoreException ex) {
- OseeLog.log(DefinePlugin.class, Level.SEVERE, ex);
- }
- }
- }
- }
+ public static void search(Branch branch, IResource... resources) {
+ HashCollection<String, String> typeAndIds = toIdentifiers(resources);
+ if (!typeAndIds.isEmpty()) {
+ Set<Artifact> artifacts = new HashSet<Artifact>();
+ for (String artifactTypeName : typeAndIds.keySet()) {
+ Collection<String> items = typeAndIds.getValues(artifactTypeName);
+ if (items != null) {
+ for (String artifactName : items) {
+ try {
+ artifacts.addAll(ArtifactQuery.getArtifactListFromTypeAndName(artifactTypeName, artifactName,
+ branch));
+ } catch (OseeCoreException ex) {
+ OseeLog.log(DefinePlugin.class, Level.SEVERE, ex);
+ }
+ }
+ }
+ }
- if (!artifacts.isEmpty()) {
- openArtifacts(artifacts);
- } else {
- AWorkbench.popup("Find Trace Unit from Resource", String.format("Unable to find trace for: %s",
- Arrays.deepToString(resources)));
- }
- } else {
- AWorkbench.popup("Find Trace Unit from Resource", String.format("Unable to find trace handler for: %s",
- Arrays.deepToString(resources)));
- }
- }
+ if (!artifacts.isEmpty()) {
+ openArtifacts(artifacts);
+ } else {
+ AWorkbench.popup("Find Trace Unit from Resource",
+ String.format("Unable to find trace for: %s", Arrays.deepToString(resources)));
+ }
+ } else {
+ AWorkbench.popup("Find Trace Unit from Resource",
+ String.format("Unable to find trace handler for: %s", Arrays.deepToString(resources)));
+ }
+ }
- private static void openArtifacts(final Collection<Artifact> artifacts) {
- Display.getDefault().asyncExec(new Runnable() {
- public void run() {
- try {
- for (Artifact artifact : artifacts) {
- AWorkbench.getActivePage().openEditor(new ArtifactEditorInput(artifact), ArtifactEditor.EDITOR_ID,
- true);
- }
- } catch (Exception ex) {
- OseeLog.log(DefinePlugin.class, Level.SEVERE, ex);
- }
- }
- });
- }
+ private static void openArtifacts(final Collection<Artifact> artifacts) {
+ Displays.ensureInDisplayThread(new Runnable() {
+
+ @Override
+ public void run() {
+ try {
+ for (Artifact artifact : artifacts) {
+ AWorkbench.getActivePage().openEditor(new ArtifactEditorInput(artifact), ArtifactEditor.EDITOR_ID,
+ true);
+ }
+ } catch (Exception ex) {
+ OseeLog.log(DefinePlugin.class, Level.SEVERE, ex);
+ }
+ }
+ });
+ }
}
diff --git a/plugins/org.eclipse.osee.framework.ui.admin/src/org/eclipse/osee/framework/ui/admin/dbtabletab/DbTableTab.java b/plugins/org.eclipse.osee.framework.ui.admin/src/org/eclipse/osee/framework/ui/admin/dbtabletab/DbTableTab.java
index feb69192fa..dc8b46b3ec 100644
--- a/plugins/org.eclipse.osee.framework.ui.admin/src/org/eclipse/osee/framework/ui/admin/dbtabletab/DbTableTab.java
+++ b/plugins/org.eclipse.osee.framework.ui.admin/src/org/eclipse/osee/framework/ui/admin/dbtabletab/DbTableTab.java
@@ -18,6 +18,7 @@ import org.eclipse.osee.framework.skynet.core.User;
import org.eclipse.osee.framework.ui.admin.AdminPlugin;
import org.eclipse.osee.framework.ui.admin.AdminView;
import org.eclipse.osee.framework.ui.skynet.widgets.XCombo;
+import org.eclipse.osee.framework.ui.swt.Displays;
import org.eclipse.swt.SWT;
import org.eclipse.swt.browser.Browser;
import org.eclipse.swt.events.ModifyEvent;
@@ -28,163 +29,185 @@ import org.eclipse.swt.graphics.Cursor;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Listener;
import org.eclipse.swt.widgets.TabFolder;
import org.eclipse.swt.widgets.TabItem;
public class DbTableTab {
- protected Browser browser;
- public static final String VIEW_ID = "org.eclipse.osee.framework.ui.admin.AdminView";
- public static User person;
- public static DbTableViewer dbTableViewer;
- private static XCombo filterCombo;
- private Label readOnlyLabel, addRecordLabel, publishLabel;
- private ArrayList<DbItem> dbItems;
- private Cursor handCursor;
- private boolean noListener = true;
- private Composite parent;
-
- public DbTableTab(TabFolder tabFolder) {
- super();
-
- dbItems = new ArrayList<DbItem>();
- dbItems.add(new SiteGssflRpcr());
- dbItems.add(new OseeInfoDbItem());
- handCursor = new Cursor(null, SWT.CURSOR_HAND);
-
- TabItem dbTab = new TabItem(tabFolder, SWT.NULL);
- dbTab.setText("Database");
-
- // Filter Composite
- int numColumns = 5;
- Composite c = new Composite(tabFolder, SWT.NONE);
- c.setLayout(new GridLayout(numColumns, false));
- c.setLayoutData(new GridData());
-
- c.setLayoutData(new GridData(GridData.FILL_BOTH));
- this.parent = c;
-
- filterCombo = new XCombo("DB Table", "");
- filterCombo.setDataStrings(getDbTableNames());
- filterCombo.createWidgets(c, 2);
- filterCombo.addModifyListener(new ModifyListener() {
-
- public void modifyText(ModifyEvent e) {
- try {
- handleTableSelect();
- } catch (OseeDataStoreException ex) {
- OseeLog.log(AdminPlugin.class, Level.SEVERE, ex);
- }
- AdminView.setSaveNeeded(false);
- }
- });
-
- readOnlyLabel = new Label(c, SWT.NONE);
- readOnlyLabel.setForeground(Display.getDefault().getSystemColor(SWT.COLOR_RED));
-
- addRecordLabel = new Label(c, SWT.NONE);
- addRecordLabel.setForeground(Display.getDefault().getSystemColor(SWT.COLOR_BLUE));
- addRecordLabel.addMouseTrackListener(new MouseTrackListener() {
-
- public void mouseEnter(MouseEvent e) {
- if (getSelectedDbItem() != null && getSelectedDbItem().isWriteAccess()) if (addRecordLabel != null) addRecordLabel.setCursor(handCursor);
- }
-
- public void mouseExit(MouseEvent e) {
- if (addRecordLabel != null) addRecordLabel.setCursor(null);
- };
-
- public void mouseHover(MouseEvent e) {
- }
- });
-
- publishLabel = new Label(c, SWT.NONE);
- publishLabel.setForeground(Display.getDefault().getSystemColor(SWT.COLOR_BLUE));
- publishLabel.addMouseTrackListener(new MouseTrackListener() {
-
- public void mouseEnter(MouseEvent e) {
- if (getSelectedDbItem() != null && getSelectedDbItem().isWriteAccess()) if (publishLabel != null) publishLabel.setCursor(handCursor);
- }
-
- public void mouseExit(MouseEvent e) {
- if (publishLabel != null) publishLabel.setCursor(null);
- };
-
- public void mouseHover(MouseEvent e) {
- }
- });
-
- updateReadOnly();
- dbTab.setControl(c);
- }
-
- Listener addRecordListener = new Listener() {
- public void handleEvent(org.eclipse.swt.widgets.Event event) {
- System.out.println("I am adding a row...");
- handleAddRecord();
- };
- };
-
- public void handleAddRecord() {
- System.out.println("trying to add a record");
- dbTableViewer.addRecord();
- }
-
- public void updateReadOnly() {
- DbItem selItem = getSelectedDbItem();
- if (selItem == null) {
- readOnlyLabel.setText("");
- addRecordLabel.setText(" ");
- } else if (selItem.isWriteAccess()) {
- readOnlyLabel.setText(" WRITE ACCESS");
- addRecordLabel.setText(" Add Record ");
-
- if (noListener) addRecordLabel.addListener(SWT.MouseUp, addRecordListener);
- noListener = false;
- } else {
- readOnlyLabel.setText(" READ ONLY ACCESS");
- addRecordLabel.setText(" ");
- addRecordLabel.removeListener(SWT.MouseUp, addRecordListener);
- }
- }
-
- public DbItem getSelectedDbItem() {
- for (DbItem d : dbItems) {
- if (filterCombo.get().equals(d.getTableName())) return d;
- }
- return null;
- }
-
- public void handleTableSelect() throws OseeDataStoreException {
- if (dbTableViewer != null) dbTableViewer.dispose();
- updateReadOnly();
- if (filterCombo.get().equals("")) return;
-
- dbTableViewer = new DbTableViewer(parent, 5, this, getSelectedDbItem());
- dbTableViewer.load();
- parent.layout();
- }
-
- public static void refresh() throws OseeDataStoreException {
- if (filterCombo.get().equals("")) return;
- if (dbTableViewer != null) {
- dbTableViewer.load();
- dbTableViewer.refresh();
- }
- }
-
- public XCombo getFilterCombo() {
- return filterCombo;
- }
-
- public String[] getDbTableNames() {
- String names[] = new String[dbItems.size()];
- for (int x = 0; x < dbItems.size(); x++) {
- names[x] = dbItems.get(x).getTableName();
- }
- return names;
- }
+ protected Browser browser;
+ public static final String VIEW_ID = "org.eclipse.osee.framework.ui.admin.AdminView";
+ public static User person;
+ public static DbTableViewer dbTableViewer;
+ private static XCombo filterCombo;
+ private final Label readOnlyLabel, addRecordLabel, publishLabel;
+ private final ArrayList<DbItem> dbItems;
+ private final Cursor handCursor;
+ private boolean noListener = true;
+ private final Composite parent;
+
+ public DbTableTab(TabFolder tabFolder) {
+ super();
+
+ dbItems = new ArrayList<DbItem>();
+ dbItems.add(new SiteGssflRpcr());
+ dbItems.add(new OseeInfoDbItem());
+ handCursor = new Cursor(null, SWT.CURSOR_HAND);
+
+ TabItem dbTab = new TabItem(tabFolder, SWT.NULL);
+ dbTab.setText("Database");
+
+ // Filter Composite
+ int numColumns = 5;
+ Composite c = new Composite(tabFolder, SWT.NONE);
+ c.setLayout(new GridLayout(numColumns, false));
+ c.setLayoutData(new GridData());
+
+ c.setLayoutData(new GridData(GridData.FILL_BOTH));
+ this.parent = c;
+
+ filterCombo = new XCombo("DB Table", "");
+ filterCombo.setDataStrings(getDbTableNames());
+ filterCombo.createWidgets(c, 2);
+ filterCombo.addModifyListener(new ModifyListener() {
+
+ public void modifyText(ModifyEvent e) {
+ try {
+ handleTableSelect();
+ } catch (OseeDataStoreException ex) {
+ OseeLog.log(AdminPlugin.class, Level.SEVERE, ex);
+ }
+ AdminView.setSaveNeeded(false);
+ }
+ });
+
+ readOnlyLabel = new Label(c, SWT.NONE);
+ readOnlyLabel.setForeground(Displays.getSystemColor(SWT.COLOR_RED));
+
+ addRecordLabel = new Label(c, SWT.NONE);
+ addRecordLabel.setForeground(Displays.getSystemColor(SWT.COLOR_BLUE));
+ addRecordLabel.addMouseTrackListener(new MouseTrackListener() {
+
+ public void mouseEnter(MouseEvent e) {
+ if (getSelectedDbItem() != null && getSelectedDbItem().isWriteAccess()) {
+ if (addRecordLabel != null) {
+ addRecordLabel.setCursor(handCursor);
+ }
+ }
+ }
+
+ public void mouseExit(MouseEvent e) {
+ if (addRecordLabel != null) {
+ addRecordLabel.setCursor(null);
+ }
+ };
+
+ public void mouseHover(MouseEvent e) {
+ }
+ });
+
+ publishLabel = new Label(c, SWT.NONE);
+ publishLabel.setForeground(Displays.getSystemColor(SWT.COLOR_BLUE));
+ publishLabel.addMouseTrackListener(new MouseTrackListener() {
+
+ @Override
+ public void mouseEnter(MouseEvent e) {
+ if (getSelectedDbItem() != null && getSelectedDbItem().isWriteAccess()) {
+ if (publishLabel != null) {
+ publishLabel.setCursor(handCursor);
+ }
+ }
+ }
+
+ public void mouseExit(MouseEvent e) {
+ if (publishLabel != null) {
+ publishLabel.setCursor(null);
+ }
+ };
+
+ public void mouseHover(MouseEvent e) {
+ }
+ });
+
+ updateReadOnly();
+ dbTab.setControl(c);
+ }
+
+ Listener addRecordListener = new Listener() {
+ public void handleEvent(org.eclipse.swt.widgets.Event event) {
+ System.out.println("I am adding a row...");
+ handleAddRecord();
+ };
+ };
+
+ public void handleAddRecord() {
+ System.out.println("trying to add a record");
+ dbTableViewer.addRecord();
+ }
+
+ public void updateReadOnly() {
+ DbItem selItem = getSelectedDbItem();
+ if (selItem == null) {
+ readOnlyLabel.setText("");
+ addRecordLabel.setText(" ");
+ } else if (selItem.isWriteAccess()) {
+ readOnlyLabel.setText(" WRITE ACCESS");
+ addRecordLabel.setText(" Add Record ");
+
+ if (noListener) {
+ addRecordLabel.addListener(SWT.MouseUp, addRecordListener);
+ }
+ noListener = false;
+ } else {
+ readOnlyLabel.setText(" READ ONLY ACCESS");
+ addRecordLabel.setText(" ");
+ addRecordLabel.removeListener(SWT.MouseUp, addRecordListener);
+ }
+ }
+
+ public DbItem getSelectedDbItem() {
+ for (DbItem d : dbItems) {
+ if (filterCombo.get().equals(d.getTableName())) {
+ return d;
+ }
+ }
+ return null;
+ }
+
+ public void handleTableSelect() throws OseeDataStoreException {
+ if (dbTableViewer != null) {
+ dbTableViewer.dispose();
+ }
+ updateReadOnly();
+ if (filterCombo.get().equals("")) {
+ return;
+ }
+
+ dbTableViewer = new DbTableViewer(parent, 5, this, getSelectedDbItem());
+ dbTableViewer.load();
+ parent.layout();
+ }
+
+ public static void refresh() throws OseeDataStoreException {
+ if (filterCombo.get().equals("")) {
+ return;
+ }
+ if (dbTableViewer != null) {
+ dbTableViewer.load();
+ dbTableViewer.refresh();
+ }
+ }
+
+ public XCombo getFilterCombo() {
+ return filterCombo;
+ }
+
+ public String[] getDbTableNames() {
+ String names[] = new String[dbItems.size()];
+ for (int x = 0; x < dbItems.size(); x++) {
+ names[x] = dbItems.get(x).getTableName();
+ }
+ return names;
+ }
}
diff --git a/plugins/org.eclipse.osee.framework.ui.branch.graph/src/org/eclipse/osee/framework/ui/branch/graph/core/BranchGraphPaletteProvider.java b/plugins/org.eclipse.osee.framework.ui.branch.graph/src/org/eclipse/osee/framework/ui/branch/graph/core/BranchGraphPaletteProvider.java
index 8dcba9e520..61b945c160 100644
--- a/plugins/org.eclipse.osee.framework.ui.branch.graph/src/org/eclipse/osee/framework/ui/branch/graph/core/BranchGraphPaletteProvider.java
+++ b/plugins/org.eclipse.osee.framework.ui.branch.graph/src/org/eclipse/osee/framework/ui/branch/graph/core/BranchGraphPaletteProvider.java
@@ -24,97 +24,98 @@ import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.osee.framework.ui.branch.graph.BranchGraphActivator;
import org.eclipse.osee.framework.ui.plugin.OseeUiActions;
import org.eclipse.osee.framework.ui.skynet.FrameworkImage;
+import org.eclipse.osee.framework.ui.swt.Displays;
import org.eclipse.osee.framework.ui.swt.ImageManager;
import org.eclipse.osee.framework.ui.swt.KeyedImage;
-import org.eclipse.swt.widgets.Display;
/**
* @author Roberto E. Escobar
*/
public class BranchGraphPaletteProvider {
- private static final String[] drawerNames = new String[] {"Filters"};
- private PaletteRoot paletteRoot;
- private final BranchGraphEditor editor;
-
- public BranchGraphPaletteProvider(BranchGraphEditor editor) {
- this.paletteRoot = null;
- this.editor = editor;
- }
-
- public PaletteRoot getPaletteRoot() {
- if (paletteRoot == null) {
- paletteRoot = new PaletteRoot();
- paletteRoot.add(createToolsGroup(paletteRoot));
- // addDrawers(paletteRoot);
- }
- return paletteRoot;
- }
-
- private void addDrawers(PaletteRoot paletteRoot) {
- for (String drawerName : drawerNames) {
- PaletteContainer container = new PaletteDrawer(drawerName);
-
- String name = "one";
- String description = "example";
- Class<?> clazz = Object.class;
-
- container.add(createComponent(name, description, clazz, FrameworkImage.RECTANGLE_16,
- FrameworkImage.RECTANGLE_24));
- paletteRoot.add(container);
- }
- }
-
- private ToolEntry createComponent(String label, String description, Class<?> clazz, KeyedImage smallImage, KeyedImage largeImage) {
- ToolEntry toolEntry =
- new ToolEntry(label, description, ImageManager.getImageDescriptor(smallImage),
- ImageManager.getImageDescriptor(largeImage)) {
-
- };
- return toolEntry;
- }
-
- private PaletteContainer createToolsGroup(PaletteRoot palette) {
- PaletteToolbar toolbar = new PaletteToolbar("Tools");
-
- ToolEntry tool = new PanningSelectionToolEntry();
- toolbar.add(tool);
- palette.setDefaultEntry(tool);
-
- toolbar.add(new MarqueeToolEntry());
-
- final Action action =
- OseeUiActions.createBugAction(BranchGraphActivator.getInstance(), editor, BranchGraphEditor.EDITOR_ID,
- "Branch Graph");
- final ImageDescriptor img = action.getImageDescriptor();
-
- toolbar.add(new ToolEntry("", action.getText(), img, img, null) {
-
- @Override
- public Tool createTool() {
- return new AbstractTool() {
-
- @Override
- protected String getCommandName() {
- return action.getText();
- }
-
- @Override
- public void activate() {
- super.activate();
- Display.getDefault().asyncExec(new Runnable() {
- public void run() {
- deactivate();
- action.run();
- }
- });
-
- }
- };
- }
-
- });
-
- return toolbar;
- }
+ private static final String[] drawerNames = new String[] {"Filters"};
+ private PaletteRoot paletteRoot;
+ private final BranchGraphEditor editor;
+
+ public BranchGraphPaletteProvider(BranchGraphEditor editor) {
+ this.paletteRoot = null;
+ this.editor = editor;
+ }
+
+ public PaletteRoot getPaletteRoot() {
+ if (paletteRoot == null) {
+ paletteRoot = new PaletteRoot();
+ paletteRoot.add(createToolsGroup(paletteRoot));
+ // addDrawers(paletteRoot);
+ }
+ return paletteRoot;
+ }
+
+ private void addDrawers(PaletteRoot paletteRoot) {
+ for (String drawerName : drawerNames) {
+ PaletteContainer container = new PaletteDrawer(drawerName);
+
+ String name = "one";
+ String description = "example";
+ Class<?> clazz = Object.class;
+
+ container.add(createComponent(name, description, clazz, FrameworkImage.RECTANGLE_16,
+ FrameworkImage.RECTANGLE_24));
+ paletteRoot.add(container);
+ }
+ }
+
+ private ToolEntry createComponent(String label, String description, Class<?> clazz, KeyedImage smallImage, KeyedImage largeImage) {
+ ToolEntry toolEntry =
+ new ToolEntry(label, description, ImageManager.getImageDescriptor(smallImage),
+ ImageManager.getImageDescriptor(largeImage)) {
+
+ };
+ return toolEntry;
+ }
+
+ private PaletteContainer createToolsGroup(PaletteRoot palette) {
+ PaletteToolbar toolbar = new PaletteToolbar("Tools");
+
+ ToolEntry tool = new PanningSelectionToolEntry();
+ toolbar.add(tool);
+ palette.setDefaultEntry(tool);
+
+ toolbar.add(new MarqueeToolEntry());
+
+ final Action action =
+ OseeUiActions.createBugAction(BranchGraphActivator.getInstance(), editor, BranchGraphEditor.EDITOR_ID,
+ "Branch Graph");
+ final ImageDescriptor img = action.getImageDescriptor();
+
+ toolbar.add(new ToolEntry("", action.getText(), img, img, null) {
+
+ @Override
+ public Tool createTool() {
+ return new AbstractTool() {
+
+ @Override
+ protected String getCommandName() {
+ return action.getText();
+ }
+
+ @Override
+ public void activate() {
+ super.activate();
+ Displays.ensureInDisplayThread(new Runnable() {
+ @Override
+ public void run() {
+ deactivate();
+ action.run();
+ }
+ });
+
+ }
+ };
+ }
+
+ });
+
+ return toolbar;
+ }
}
diff --git a/plugins/org.eclipse.osee.framework.ui.branch.graph/src/org/eclipse/osee/framework/ui/branch/graph/operation/LoadGraphOperation.java b/plugins/org.eclipse.osee.framework.ui.branch.graph/src/org/eclipse/osee/framework/ui/branch/graph/operation/LoadGraphOperation.java
index 765d476080..25120e5cf2 100644
--- a/plugins/org.eclipse.osee.framework.ui.branch.graph/src/org/eclipse/osee/framework/ui/branch/graph/operation/LoadGraphOperation.java
+++ b/plugins/org.eclipse.osee.framework.ui.branch.graph/src/org/eclipse/osee/framework/ui/branch/graph/operation/LoadGraphOperation.java
@@ -25,7 +25,7 @@ import org.eclipse.osee.framework.ui.branch.graph.core.BranchGraphEditorInput;
import org.eclipse.osee.framework.ui.branch.graph.model.GraphCache;
import org.eclipse.osee.framework.ui.branch.graph.model.GraphLoader;
import org.eclipse.osee.framework.ui.plugin.util.AWorkbench;
-import org.eclipse.swt.widgets.Display;
+import org.eclipse.osee.framework.ui.swt.Displays;
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.IWorkbenchPart;
import org.eclipse.ui.IWorkbenchWindow;
@@ -35,99 +35,101 @@ import org.eclipse.ui.IWorkbenchWindow;
*/
public class LoadGraphOperation implements IExceptionableRunnable {
- private Branch resource;
- private GraphicalViewer viewer;
- private BranchGraphEditor editor;
- private GraphCache graph;
-
- private static final int TOTAL_STEPS = Integer.MAX_VALUE;
- private static final int SHORT_TASK_STEPS = TOTAL_STEPS / 50;
- private static final int VERY_LONG_TASK = TOTAL_STEPS / 2;
- private static final int TASK_STEPS = (TOTAL_STEPS - SHORT_TASK_STEPS * 3 - VERY_LONG_TASK) / 2;
-
- protected LoadGraphOperation(IWorkbenchPart part, GraphicalViewer viewer, BranchGraphEditor editor) {
- super();
- this.viewer = viewer;
- this.editor = editor;
- }
-
- public LoadGraphOperation(IWorkbenchPart part, GraphicalViewer viewer, BranchGraphEditor editor, Branch resource) {
- this(part, viewer, editor);
- this.resource = resource;
- }
-
- public String getName() {
- return "Loading graph information";
- }
-
- @Override
- public IStatus run(IProgressMonitor monitor) throws Exception {
- boolean error = false;
- monitor.beginTask(getName(), TOTAL_STEPS);
- monitor.worked(SHORT_TASK_STEPS);
- try {
- TransactionRecord transaction = TransactionManager.getHeadTransaction(resource);
- if (editor != null) {
- ((BranchGraphEditorInput) editor.getEditorInput()).setTransactionId(transaction);
- }
- Branch path = transaction.getBranch();
-
- monitor.setTaskName("Initializating cache");
-
- monitor.worked(SHORT_TASK_STEPS);
-
- if (editor != null) {
- if (error == true || monitor.isCanceled()) {
- Display.getDefault().syncExec(new Runnable() {
- public void run() {
- IWorkbenchWindow window = editor.getEditorSite().getWorkbenchWindow();
- IWorkbenchPage page = window.getActivePage();
- page.activate(editor);
- page.closeEditor(editor, false);
- }
- });
- } else {
- updateView(monitor, path, transaction);
- }
- }
- } catch (Exception ex) {
- AWorkbench.popup("Error Calculating Revision Graph Information", Lib.exceptionToString(ex));
- } finally {
- monitor.done();
- }
- return Status.OK_STATUS;
- }
-
- private void updateView(IProgressMonitor monitor, Branch branch, TransactionRecord revision) throws OseeCoreException {
- monitor.setTaskName("Finding root node");
- int unitWork = TASK_STEPS / (int) (revision.getId());
- if (unitWork < 1) {
- unitWork = 1;
- }
- monitor.setTaskName("Calculating graph");
- graph = new GraphCache(branch);
- GraphLoader.load(graph, new InternalTaskProgressListener(monitor, unitWork));
- monitor.setTaskName("Drawing graph");
-
- Display.getDefault().syncExec(new Runnable() {
- public void run() {
- viewer.setContents(graph);
- editor.setOutlineContent(graph);
- }
- });
- }
- private final class InternalTaskProgressListener implements IProgressListener {
-
- private IProgressMonitor monitor;
- private int unitWork;
-
- public InternalTaskProgressListener(IProgressMonitor monitor, int unitWork) {
- this.monitor = monitor;
- this.unitWork = unitWork;
- }
-
- public void worked() {
- monitor.worked(unitWork);
- }
- }
+ private Branch resource;
+ private final GraphicalViewer viewer;
+ private final BranchGraphEditor editor;
+ private GraphCache graph;
+
+ private static final int TOTAL_STEPS = Integer.MAX_VALUE;
+ private static final int SHORT_TASK_STEPS = TOTAL_STEPS / 50;
+ private static final int VERY_LONG_TASK = TOTAL_STEPS / 2;
+ private static final int TASK_STEPS = (TOTAL_STEPS - SHORT_TASK_STEPS * 3 - VERY_LONG_TASK) / 2;
+
+ protected LoadGraphOperation(IWorkbenchPart part, GraphicalViewer viewer, BranchGraphEditor editor) {
+ super();
+ this.viewer = viewer;
+ this.editor = editor;
+ }
+
+ public LoadGraphOperation(IWorkbenchPart part, GraphicalViewer viewer, BranchGraphEditor editor, Branch resource) {
+ this(part, viewer, editor);
+ this.resource = resource;
+ }
+
+ public String getName() {
+ return "Loading graph information";
+ }
+
+ @Override
+ public IStatus run(IProgressMonitor monitor) throws Exception {
+ boolean error = false;
+ monitor.beginTask(getName(), TOTAL_STEPS);
+ monitor.worked(SHORT_TASK_STEPS);
+ try {
+ TransactionRecord transaction = TransactionManager.getHeadTransaction(resource);
+ if (editor != null) {
+ ((BranchGraphEditorInput) editor.getEditorInput()).setTransactionId(transaction);
+ }
+ Branch path = transaction.getBranch();
+
+ monitor.setTaskName("Initializating cache");
+
+ monitor.worked(SHORT_TASK_STEPS);
+
+ if (editor != null) {
+ if (error == true || monitor.isCanceled()) {
+ Displays.pendInDisplayThread(new Runnable() {
+ @Override
+ public void run() {
+ IWorkbenchWindow window = editor.getEditorSite().getWorkbenchWindow();
+ IWorkbenchPage page = window.getActivePage();
+ page.activate(editor);
+ page.closeEditor(editor, false);
+ }
+ });
+ } else {
+ updateView(monitor, path, transaction);
+ }
+ }
+ } catch (Exception ex) {
+ AWorkbench.popup("Error Calculating Revision Graph Information", Lib.exceptionToString(ex));
+ } finally {
+ monitor.done();
+ }
+ return Status.OK_STATUS;
+ }
+
+ private void updateView(IProgressMonitor monitor, Branch branch, TransactionRecord revision) throws OseeCoreException {
+ monitor.setTaskName("Finding root node");
+ int unitWork = TASK_STEPS / (revision.getId());
+ if (unitWork < 1) {
+ unitWork = 1;
+ }
+ monitor.setTaskName("Calculating graph");
+ graph = new GraphCache(branch);
+ GraphLoader.load(graph, new InternalTaskProgressListener(monitor, unitWork));
+ monitor.setTaskName("Drawing graph");
+
+ Displays.pendInDisplayThread(new Runnable() {
+ @Override
+ public void run() {
+ viewer.setContents(graph);
+ editor.setOutlineContent(graph);
+ }
+ });
+ }
+ private final class InternalTaskProgressListener implements IProgressListener {
+
+ private final IProgressMonitor monitor;
+ private final int unitWork;
+
+ public InternalTaskProgressListener(IProgressMonitor monitor, int unitWork) {
+ this.monitor = monitor;
+ this.unitWork = unitWork;
+ }
+
+ public void worked() {
+ monitor.worked(unitWork);
+ }
+ }
}
diff --git a/plugins/org.eclipse.osee.framework.ui.data.model.editor/src/org/eclipse/osee/framework/ui/data/model/editor/core/ODMPaletteFactory.java b/plugins/org.eclipse.osee.framework.ui.data.model.editor/src/org/eclipse/osee/framework/ui/data/model/editor/core/ODMPaletteFactory.java
index 3d7b40e813..e377706cf6 100644
--- a/plugins/org.eclipse.osee.framework.ui.data.model.editor/src/org/eclipse/osee/framework/ui/data/model/editor/core/ODMPaletteFactory.java
+++ b/plugins/org.eclipse.osee.framework.ui.data.model.editor/src/org/eclipse/osee/framework/ui/data/model/editor/core/ODMPaletteFactory.java
@@ -43,160 +43,161 @@ import org.eclipse.osee.framework.ui.swt.ImageManager;
*/
public class ODMPaletteFactory {
- private final static String DATA_TYPE_TIP_FORMAT = "Add [%s] %s type to %s";
- private final ODMEditor editor;
- private PaletteRoot paletteRoot;
-
- private enum DrawerEnum {
- Artifact_Types,
- Attribute_Types,
- Relation_Types;
-
- public String asLabel() {
- return this.name().replaceAll("_", " ");
- }
- }
-
- private final Map<DrawerEnum, PaletteContainer> containers;
-
- public ODMPaletteFactory(ODMEditor editor) {
- this.containers = new LinkedHashMap<DrawerEnum, PaletteContainer>();
- this.editor = editor;
- }
-
- private void updateDrawers() {
- if (editor.getEditorInput() == null) {
- return;
- }
- DataTypeCache dataTypeCache = editor.getEditorInput().getDataTypeCache();
-
- for (DrawerEnum drawerType : DrawerEnum.values()) {
- PaletteContainer container = containers.get(drawerType);
- if (container == null) {
- container = new PaletteDrawer(drawerType.asLabel());
- containers.put(drawerType, container);
- getPaletteRoot().add(container);
- } else {
- for (Object child : container.getChildren()) {
- container.remove((PaletteEntry) child);
- }
- }
- container.addAll(getToolEntries(drawerType, dataTypeCache));
- }
- }
-
- private List<CombinedTemplateCreationEntry> getToolEntries(DrawerEnum drawerType, DataTypeCache dataTypeCache) {
- List<CombinedTemplateCreationEntry> toReturn = new ArrayList<CombinedTemplateCreationEntry>();
- ImageDescriptor image = null;
- String message = null;
- for (String sourceId : dataTypeCache.getDataTypeSourceIds()) {
- DataTypeSource dataTypeSource = dataTypeCache.getDataTypeSourceById(sourceId);
- switch (drawerType) {
- case Artifact_Types:
- for (ArtifactDataType dataType : dataTypeSource.getArtifactTypeManager().getAllSorted()) {
- image = ImageDescriptor.createFromImage(dataType.getImage());
- message = String.format(DATA_TYPE_TIP_FORMAT, dataType.getName(), "artifact", "the diagram");
- toReturn.add(createDataTypeToolEntry(dataType, image, message));
- }
- break;
- case Attribute_Types:
- image = ImageManager.getImageDescriptor(ODMImage.LOCAL_ATTRIBUTE);
- for (AttributeDataType dataType : dataTypeSource.getAttributeTypeManager().getAllSorted()) {
- message = String.format(DATA_TYPE_TIP_FORMAT, dataType.getName(), "attribute", "an artifact type");
- toReturn.add(createDataTypeToolEntry(dataType, image, message));
- }
- break;
- case Relation_Types:
- image = ImageManager.getImageDescriptor(ODMImage.LOCAL_RELATION);
- for (RelationDataType dataType : dataTypeSource.getRelationTypeManager().getAllSorted()) {
- message = String.format(DATA_TYPE_TIP_FORMAT, dataType.getName(), "relation", "an artifact type");
- toReturn.add(createDataTypeToolEntry(dataType, image, message));
- }
- break;
- default:
- break;
- }
- }
- return toReturn;
- }
-
- private CombinedTemplateCreationEntry createDataTypeToolEntry(final DataType dataType, ImageDescriptor imageDescriptor, String message) {
- CreationFactory factory = new CreationFactory() {
-
- @Override
- public Object getNewObject() {
- return dataType;
- }
-
- @Override
- public Object getObjectType() {
- return null;
- }
-
- };
- return new CombinedTemplateCreationEntry(dataType.getName(), message, factory, factory, imageDescriptor,
- imageDescriptor);
- }
-
- private PaletteContainer createToolsGroup(PaletteRoot palette) {
- PaletteToolbar toolbar = new PaletteToolbar("Tools");
-
- ToolEntry tool = new PanningSelectionToolEntry();
- toolbar.add(tool);
- palette.setDefaultEntry(tool);
-
- toolbar.add(new MarqueeToolEntry());
- toolbar.add(new PaletteSeparator());
-
- ImageDescriptor img = ImageManager.getImageDescriptor(ODMImage.INHERITANCE);
- toolbar.add(new ConnectionCreationToolEntry("Inheritance", "Inherit from an artifact", new SimpleFactory(
- InheritanceLinkModel.class), img, img));
-
- // final Action action =
- // OseeAts.createBugAction(ODMEditorActivator.getInstance(), editor, "OSEE Data Model Editor",
- // ODMEditor.EDITOR_ID);
- // img = action.getImageDescriptor();
- //
- // toolbar.add(new ToolEntry("", action.getText(), img, img, null) {
- //
- // @Override
- // public Tool createTool() {
- // return new AbstractTool() {
- //
- // @Override
- // protected String getCommandName() {
- // return action.getText();
- // }
- //
- // @Override
- // public void activate() {
- // super.activate();
- // Display.getDefault().asyncExec(new Runnable() {
- // public void run() {
- // deactivate();
- // action.run();
- // }
- // });
- //
- // }
- // };
- // }
- //
- // });
- return toolbar;
- }
-
- public void updatePaletteRoot() {
- updateDrawers();
- }
-
- public PaletteRoot getPaletteRoot() {
- if (paletteRoot == null) {
- paletteRoot = new PaletteRoot();
- paletteRoot.add(createToolsGroup(paletteRoot));
- updateDrawers();
- }
- return paletteRoot;
- }
+ private final static String DATA_TYPE_TIP_FORMAT = "Add [%s] %s type to %s";
+ private final ODMEditor editor;
+ private PaletteRoot paletteRoot;
+
+ private enum DrawerEnum {
+ Artifact_Types,
+ Attribute_Types,
+ Relation_Types;
+
+ public String asLabel() {
+ return this.name().replaceAll("_", " ");
+ }
+ }
+
+ private final Map<DrawerEnum, PaletteContainer> containers;
+
+ public ODMPaletteFactory(ODMEditor editor) {
+ this.containers = new LinkedHashMap<DrawerEnum, PaletteContainer>();
+ this.editor = editor;
+ }
+
+ private void updateDrawers() {
+ if (editor.getEditorInput() == null) {
+ return;
+ }
+ DataTypeCache dataTypeCache = editor.getEditorInput().getDataTypeCache();
+
+ for (DrawerEnum drawerType : DrawerEnum.values()) {
+ PaletteContainer container = containers.get(drawerType);
+ if (container == null) {
+ container = new PaletteDrawer(drawerType.asLabel());
+ containers.put(drawerType, container);
+ getPaletteRoot().add(container);
+ } else {
+ for (Object child : container.getChildren()) {
+ container.remove((PaletteEntry) child);
+ }
+ }
+ container.addAll(getToolEntries(drawerType, dataTypeCache));
+ }
+ }
+
+ private List<CombinedTemplateCreationEntry> getToolEntries(DrawerEnum drawerType, DataTypeCache dataTypeCache) {
+ List<CombinedTemplateCreationEntry> toReturn = new ArrayList<CombinedTemplateCreationEntry>();
+ ImageDescriptor image = null;
+ String message = null;
+ for (String sourceId : dataTypeCache.getDataTypeSourceIds()) {
+ DataTypeSource dataTypeSource = dataTypeCache.getDataTypeSourceById(sourceId);
+ switch (drawerType) {
+ case Artifact_Types:
+ for (ArtifactDataType dataType : dataTypeSource.getArtifactTypeManager().getAllSorted()) {
+ image = ImageDescriptor.createFromImage(dataType.getImage());
+ message = String.format(DATA_TYPE_TIP_FORMAT, dataType.getName(), "artifact", "the diagram");
+ toReturn.add(createDataTypeToolEntry(dataType, image, message));
+ }
+ break;
+ case Attribute_Types:
+ image = ImageManager.getImageDescriptor(ODMImage.LOCAL_ATTRIBUTE);
+ for (AttributeDataType dataType : dataTypeSource.getAttributeTypeManager().getAllSorted()) {
+ message = String.format(DATA_TYPE_TIP_FORMAT, dataType.getName(), "attribute", "an artifact type");
+ toReturn.add(createDataTypeToolEntry(dataType, image, message));
+ }
+ break;
+ case Relation_Types:
+ image = ImageManager.getImageDescriptor(ODMImage.LOCAL_RELATION);
+ for (RelationDataType dataType : dataTypeSource.getRelationTypeManager().getAllSorted()) {
+ message = String.format(DATA_TYPE_TIP_FORMAT, dataType.getName(), "relation", "an artifact type");
+ toReturn.add(createDataTypeToolEntry(dataType, image, message));
+ }
+ break;
+ default:
+ break;
+ }
+ }
+ return toReturn;
+ }
+
+ private CombinedTemplateCreationEntry createDataTypeToolEntry(final DataType dataType, ImageDescriptor imageDescriptor, String message) {
+ CreationFactory factory = new CreationFactory() {
+
+ @Override
+ public Object getNewObject() {
+ return dataType;
+ }
+
+ @Override
+ public Object getObjectType() {
+ return null;
+ }
+
+ };
+ return new CombinedTemplateCreationEntry(dataType.getName(), message, factory, factory, imageDescriptor,
+ imageDescriptor);
+ }
+
+ private PaletteContainer createToolsGroup(PaletteRoot palette) {
+ PaletteToolbar toolbar = new PaletteToolbar("Tools");
+
+ ToolEntry tool = new PanningSelectionToolEntry();
+ toolbar.add(tool);
+ palette.setDefaultEntry(tool);
+
+ toolbar.add(new MarqueeToolEntry());
+ toolbar.add(new PaletteSeparator());
+
+ ImageDescriptor img = ImageManager.getImageDescriptor(ODMImage.INHERITANCE);
+ toolbar.add(new ConnectionCreationToolEntry("Inheritance", "Inherit from an artifact", new SimpleFactory(
+ InheritanceLinkModel.class), img, img));
+
+ // final Action action =
+ // OseeAts.createBugAction(ODMEditorActivator.getInstance(), editor, "OSEE Data Model Editor",
+ // ODMEditor.EDITOR_ID);
+ // img = action.getImageDescriptor();
+ //
+ // toolbar.add(new ToolEntry("", action.getText(), img, img, null) {
+ //
+ // @Override
+ // public Tool createTool() {
+ // return new AbstractTool() {
+ //
+ // @Override
+ // protected String getCommandName() {
+ // return action.getText();
+ // }
+ //
+ // @Override
+ // public void activate() {
+ // super.activate();
+ // Displays.ensureInDisplayThread(new Runnable() {
+ // @Override
+ // public void run() {
+ // deactivate();
+ // action.run();
+ // }
+ // });
+ //
+ // }
+ // };
+ // }
+ //
+ // });
+ return toolbar;
+ }
+
+ public void updatePaletteRoot() {
+ updateDrawers();
+ }
+
+ public PaletteRoot getPaletteRoot() {
+ if (paletteRoot == null) {
+ paletteRoot = new PaletteRoot();
+ paletteRoot.add(createToolsGroup(paletteRoot));
+ updateDrawers();
+ }
+ return paletteRoot;
+ }
}
diff --git a/plugins/org.eclipse.osee.framework.ui.data.model.editor/src/org/eclipse/osee/framework/ui/data/model/editor/operation/ODMLoadGraphRunnable.java b/plugins/org.eclipse.osee.framework.ui.data.model.editor/src/org/eclipse/osee/framework/ui/data/model/editor/operation/ODMLoadGraphRunnable.java
index 025371b6da..e82eea0d8f 100644
--- a/plugins/org.eclipse.osee.framework.ui.data.model.editor/src/org/eclipse/osee/framework/ui/data/model/editor/operation/ODMLoadGraphRunnable.java
+++ b/plugins/org.eclipse.osee.framework.ui.data.model.editor/src/org/eclipse/osee/framework/ui/data/model/editor/operation/ODMLoadGraphRunnable.java
@@ -23,56 +23,57 @@ import org.eclipse.osee.framework.ui.data.model.editor.model.DataTypeCache;
import org.eclipse.osee.framework.ui.data.model.editor.model.DataTypeSource;
import org.eclipse.osee.framework.ui.data.model.editor.model.ODMDiagram;
import org.eclipse.osee.framework.ui.data.model.editor.utility.ODMConstants;
-import org.eclipse.swt.widgets.Display;
+import org.eclipse.osee.framework.ui.swt.Displays;
/**
* @author Roberto E. Escobar
*/
public class ODMLoadGraphRunnable implements IExceptionableRunnable {
- private GraphicalViewer viewer;
- private ODMEditor editor;
- private ODMEditorInput input;
+ private final GraphicalViewer viewer;
+ private final ODMEditor editor;
+ private final ODMEditorInput input;
- public ODMLoadGraphRunnable(GraphicalViewer viewer, ODMEditor editor, ODMEditorInput input) {
- super();
- this.viewer = viewer;
- this.editor = editor;
- this.input = input;
- }
+ public ODMLoadGraphRunnable(GraphicalViewer viewer, ODMEditor editor, ODMEditorInput input) {
+ super();
+ this.viewer = viewer;
+ this.editor = editor;
+ this.input = input;
+ }
- public String getName() {
- return "Loading Osee Data Type Graph";
- }
+ public String getName() {
+ return "Loading Osee Data Type Graph";
+ }
- @Override
- public IStatus run(IProgressMonitor monitor) throws Exception {
- monitor.beginTask(getName(), ODMConstants.TOTAL_STEPS);
- monitor.worked(ODMConstants.SHORT_TASK_STEPS);
- monitor.setTaskName("Initializating cache");
- DataTypeCache dataTypeCache = input.getDataTypeCache();
- dataTypeCache.clear();
- monitor.worked(ODMConstants.SHORT_TASK_STEPS);
+ @Override
+ public IStatus run(IProgressMonitor monitor) throws Exception {
+ monitor.beginTask(getName(), ODMConstants.TOTAL_STEPS);
+ monitor.worked(ODMConstants.SHORT_TASK_STEPS);
+ monitor.setTaskName("Initializating cache");
+ DataTypeCache dataTypeCache = input.getDataTypeCache();
+ dataTypeCache.clear();
+ monitor.worked(ODMConstants.SHORT_TASK_STEPS);
- OseeDataTypeFactory.addTypesFromDataStore(dataTypeCache);
- monitor.worked(ODMConstants.SHORT_TASK_STEPS);
+ OseeDataTypeFactory.addTypesFromDataStore(dataTypeCache);
+ monitor.worked(ODMConstants.SHORT_TASK_STEPS);
- IResource resource = input.getResource();
- if (resource != null) {
- DataTypeSource dataTypeSource = OseeDataTypeFactory.loadFromFile(resource.getFullPath());
- dataTypeCache.addDataTypeSource(dataTypeSource);
- }
- monitor.worked(ODMConstants.SHORT_TASK_STEPS);
+ IResource resource = input.getResource();
+ if (resource != null) {
+ DataTypeSource dataTypeSource = OseeDataTypeFactory.loadFromFile(resource.getFullPath());
+ dataTypeCache.addDataTypeSource(dataTypeSource);
+ }
+ monitor.worked(ODMConstants.SHORT_TASK_STEPS);
- if (editor != null) {
- monitor.setTaskName("Drawing graph");
- Display.getDefault().syncExec(new Runnable() {
- public void run() {
- viewer.setContents(new ODMDiagram(input.getDataTypeCache()));
- editor.updatePalette();
- }
- });
- }
- return Status.OK_STATUS;
- }
+ if (editor != null) {
+ monitor.setTaskName("Drawing graph");
+ Displays.ensureInDisplayThread(new Runnable() {
+ @Override
+ public void run() {
+ viewer.setContents(new ODMDiagram(input.getDataTypeCache()));
+ editor.updatePalette();
+ }
+ });
+ }
+ return Status.OK_STATUS;
+ }
}
diff --git a/plugins/org.eclipse.osee.framework.ui.plugin/src/org/eclipse/osee/framework/ui/plugin/io/StreamToTextArea.java b/plugins/org.eclipse.osee.framework.ui.plugin/src/org/eclipse/osee/framework/ui/plugin/io/StreamToTextArea.java
index e9c58b2db6..7f2f72fbc8 100644
--- a/plugins/org.eclipse.osee.framework.ui.plugin/src/org/eclipse/osee/framework/ui/plugin/io/StreamToTextArea.java
+++ b/plugins/org.eclipse.osee.framework.ui.plugin/src/org/eclipse/osee/framework/ui/plugin/io/StreamToTextArea.java
@@ -15,57 +15,59 @@ import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
+import org.eclipse.osee.framework.ui.swt.Displays;
import org.eclipse.osee.framework.ui.swt.FormattedText;
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.StyledText;
-import org.eclipse.swt.widgets.Display;
/**
* @author Roberto E. Escobar
*/
public class StreamToTextArea extends Thread {
- private InputStream is;
- private String type;
- private FormattedText textArea;
- private StyledText styledText;
- private int swtColor;
- private boolean isStopped;
+ private final InputStream is;
+ private final String type;
+ private final FormattedText textArea;
+ private final StyledText styledText;
+ private int swtColor;
+ private boolean isStopped;
- public StreamToTextArea(InputStream is, String type, FormattedText textArea) {
- this.is = is;
- this.type = type;
- this.textArea = textArea;
- this.styledText = textArea.getStyledText();
- this.isStopped = false;
- }
+ public StreamToTextArea(InputStream is, String type, FormattedText textArea) {
+ this.is = is;
+ this.type = type;
+ this.textArea = textArea;
+ this.styledText = textArea.getStyledText();
+ this.isStopped = false;
+ }
- public void typeColor(int swtColor) {
- this.swtColor = swtColor;
- }
+ public void typeColor(int swtColor) {
+ this.swtColor = swtColor;
+ }
- public void setStopped(boolean value) {
- this.isStopped = value;
- }
+ public void setStopped(boolean value) {
+ this.isStopped = value;
+ }
- public void run() {
- try {
- BufferedReader br = new BufferedReader(new InputStreamReader(is));
- String line = null;
- while (true != isStopped && null != textArea && true != textArea.getStyledText().isDisposed() && null != (line =
- br.readLine())) {
- final String toDisplay = line;
- Display.getDefault().asyncExec(new Runnable() {
- public void run() {
- if (textArea != null && !textArea.getStyledText().isDisposed()) {
- textArea.addText("\t" + type + "> ", SWT.NORMAL, swtColor);
- textArea.addText(toDisplay + "\n");
- styledText.setSelection(styledText.getCharCount());
- }
- }
- });
- }
- } catch (IOException ioe) {
- ioe.printStackTrace();
- }
- }
+ @Override
+ public void run() {
+ try {
+ BufferedReader br = new BufferedReader(new InputStreamReader(is));
+ String line = null;
+ while (true != isStopped && null != textArea && true != textArea.getStyledText().isDisposed() && null != (line =
+ br.readLine())) {
+ final String toDisplay = line;
+ Displays.ensureInDisplayThread(new Runnable() {
+ @Override
+ public void run() {
+ if (textArea != null && !textArea.getStyledText().isDisposed()) {
+ textArea.addText("\t" + type + "> ", SWT.NORMAL, swtColor);
+ textArea.addText(toDisplay + "\n");
+ styledText.setSelection(styledText.getCharCount());
+ }
+ }
+ });
+ }
+ } catch (IOException ioe) {
+ ioe.printStackTrace();
+ }
+ }
}
diff --git a/plugins/org.eclipse.osee.framework.ui.plugin/src/org/eclipse/osee/framework/ui/plugin/util/Displays.java b/plugins/org.eclipse.osee.framework.ui.plugin/src/org/eclipse/osee/framework/ui/plugin/util/Displays.java
deleted file mode 100644
index e3a52745e7..0000000000
--- a/plugins/org.eclipse.osee.framework.ui.plugin/src/org/eclipse/osee/framework/ui/plugin/util/Displays.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2007 Boeing.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Boeing - initial API and implementation
- *******************************************************************************/
-package org.eclipse.osee.framework.ui.plugin.util;
-
-import org.eclipse.swt.widgets.Display;
-
-/**
- * @author Robert A. Fisher
- */
-public class Displays {
-
- public static void ensureInDisplayThread(Runnable runnable) {
- ensureInDisplayThread(runnable, false);
- }
-
- public static void ensureInDisplayThread(Runnable runnable, boolean forcePend) {
- if (isDisplayThread()) {
- // No need to check for force since this will always pend
- runnable.run();
- } else {
- if (forcePend) {
- Display.getDefault().syncExec(runnable);
- } else {
- Display.getDefault().asyncExec(runnable);
- }
- }
- }
-
- public static boolean isDisplayThread() {
- if (Display.getCurrent() == null) return false;
-
- return Display.getCurrent().getThread() == Thread.currentThread();
- }
-}
diff --git a/plugins/org.eclipse.osee.framework.ui.plugin/src/org/eclipse/osee/framework/ui/plugin/util/GetChildrenJob.java b/plugins/org.eclipse.osee.framework.ui.plugin/src/org/eclipse/osee/framework/ui/plugin/util/GetChildrenJob.java
index e66c311727..6864c61dfa 100644
--- a/plugins/org.eclipse.osee.framework.ui.plugin/src/org/eclipse/osee/framework/ui/plugin/util/GetChildrenJob.java
+++ b/plugins/org.eclipse.osee.framework.ui.plugin/src/org/eclipse/osee/framework/ui/plugin/util/GetChildrenJob.java
@@ -18,6 +18,7 @@ import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.osee.framework.logging.OseeLog;
import org.eclipse.osee.framework.ui.plugin.internal.OseePluginUiActivator;
+import org.eclipse.osee.framework.ui.swt.Displays;
import org.eclipse.osee.framework.ui.swt.IContentProviderRunnable;
/**
diff --git a/plugins/org.eclipse.osee.framework.ui.plugin/src/org/eclipse/osee/framework/ui/plugin/util/JobbedNode.java b/plugins/org.eclipse.osee.framework.ui.plugin/src/org/eclipse/osee/framework/ui/plugin/util/JobbedNode.java
index d7c102e441..db294bd789 100644
--- a/plugins/org.eclipse.osee.framework.ui.plugin/src/org/eclipse/osee/framework/ui/plugin/util/JobbedNode.java
+++ b/plugins/org.eclipse.osee.framework.ui.plugin/src/org/eclipse/osee/framework/ui/plugin/util/JobbedNode.java
@@ -13,6 +13,7 @@ package org.eclipse.osee.framework.ui.plugin.util;
import org.eclipse.jface.viewers.TreeViewer;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.osee.framework.plugin.core.util.Jobs;
+import org.eclipse.osee.framework.ui.swt.Displays;
import org.eclipse.osee.framework.ui.swt.IContentProviderRunnable;
import org.eclipse.osee.framework.ui.swt.ITreeNode;
import org.eclipse.osee.framework.ui.swt.TreeNode;
diff --git a/plugins/org.eclipse.osee.framework.ui.plugin/src/org/eclipse/osee/framework/ui/plugin/util/OseeConsole.java b/plugins/org.eclipse.osee.framework.ui.plugin/src/org/eclipse/osee/framework/ui/plugin/util/OseeConsole.java
index 24d2897baa..488e0d3e2f 100644
--- a/plugins/org.eclipse.osee.framework.ui.plugin/src/org/eclipse/osee/framework/ui/plugin/util/OseeConsole.java
+++ b/plugins/org.eclipse.osee.framework.ui.plugin/src/org/eclipse/osee/framework/ui/plugin/util/OseeConsole.java
@@ -22,9 +22,8 @@ import org.eclipse.osee.framework.jdk.core.util.IConsoleInputListener;
import org.eclipse.osee.framework.jdk.core.util.Lib;
import org.eclipse.osee.framework.logging.OseeLog;
import org.eclipse.osee.framework.ui.plugin.internal.OseePluginUiActivator;
+import org.eclipse.osee.framework.ui.swt.Displays;
import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.console.ConsolePlugin;
import org.eclipse.ui.console.IConsole;
import org.eclipse.ui.console.IOConsole;
@@ -37,213 +36,214 @@ import org.eclipse.ui.console.IOConsoleOutputStream;
* @author Donald G. Dunne
*/
public class OseeConsole {
- private IOConsoleOutputStream streamOut = null;
-
- private IOConsoleOutputStream streamErr = null;
-
- private IOConsoleOutputStream streamPrompt = null;
-
- private final IOConsole console;
-
- private final HandleInput inputHandler;
-
- private final boolean time;
-
- private final Thread thread;
-
- public OseeConsole(String title) {
- this(title, true);
- }
-
- private OseeConsole(String title, boolean time) {
- console = new IOConsole(title, null);
- this.time = time;
- this.inputHandler = new HandleInput();
-
- thread = new Thread(inputHandler);
- thread.setName("Osee console input handler");
- ConsolePlugin.getDefault().getConsoleManager().addConsoles(new IConsole[] {console});
- PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() {
- public void run() {
- streamOut = console.newOutputStream();// newMessageStream();
- streamOut.setColor(Display.getDefault().getSystemColor(SWT.COLOR_BLACK));
- streamOut.setActivateOnWrite(false);
- streamErr = console.newOutputStream();
- streamErr.setColor(Display.getDefault().getSystemColor(SWT.COLOR_RED));
- streamErr.setActivateOnWrite(false);
- streamPrompt = console.newOutputStream();
- streamPrompt.setColor(Display.getDefault().getSystemColor(SWT.COLOR_BLUE));
- streamPrompt.setActivateOnWrite(false);
- }
- });
- thread.start();
- }
-
- public PrintStream getPrintStream() {
- return new PrintStream(streamOut);
- }
-
- public void shutdown() {
- thread.interrupt();
- try {
- thread.join(5000);
- } catch (InterruptedException e) {
- e.printStackTrace();
- } finally {
- ConsolePlugin.getDefault().getConsoleManager().removeConsoles(new IConsole[] {console});
- }
- }
-
- public static final int CONSOLE_ERROR = 0;
-
- public static final int CONSOLE_OUT = 1;
-
- public static final int CONSOLE_PROMPT = 2;
-
- /**
- * Writes string to console without popping console forward
- *
- * @param str
- */
- public void write(String str) {
- write(str, false);
- }
-
- /**
- * Writes string to console without popping console forward
- *
- * @param str
- */
- public void writeError(String str) {
- write(str, CONSOLE_ERROR, true);
- }
-
- /**
- * Writes string to console
- *
- * @param str
- * @param popup bring console window forward
- */
- public void write(String str, boolean popup) {
- write(str, CONSOLE_OUT, popup);
- }
-
- /**
- * Write string to console
- *
- * @param str
- * @param type CONSOLE_ERROR, CONSOLE_OUT, CONSOLE_PROMPT
- */
- public void write(String str, int type) {
- write(str, type, false);
- }
-
- /**
- * Write string to console
- *
- * @param str
- * @param type CONSOLE_ERROR, CONSOLE_OUT, CONSOLE_PROMPT
- * @param popup bring console window forward
- */
- public void write(String str, int type, boolean popup) {
- String time = "";
- if (this.time) {
- Calendar cal = Calendar.getInstance();
- cal.setTime(new Date());
-
- if (cal.get(Calendar.HOUR) == 0) {
- time = "12";
- } else {
- time = "" + cal.get(Calendar.HOUR);
- }
- time = Lib.padLeading(time, '0', 2);
- String minute = "" + cal.get(Calendar.MINUTE);
- minute = Lib.padLeading(minute, '0', 2);
- time += ":" + minute + " => ";
- }
- try {
- sendToStreams(type, time);
- if (str.length() > 100000) {
- int i = 0;
-
- while (i < str.length()) {
- int endIndex = i + 100000;
- endIndex = endIndex > str.length() ? str.length() : endIndex;
- String chunk = str.substring(i, endIndex);
- sendToStreams(type, chunk);
- i = endIndex;
- }
- } else {
- sendToStreams(type, str);
- }
-
- sendToStreams(type, "\n");
- if (popup) {
- popup();
- }
- } catch (IOException ex) {
- ex.printStackTrace();
- }
- }
-
- public void prompt(String str) throws IOException {
- sendToStreams(CONSOLE_PROMPT, str);
- }
-
- private void sendToStreams(int type, String str) throws IOException {
- if (type == CONSOLE_ERROR && streamErr != null) {
- streamErr.write(str);
- }
- if (type == CONSOLE_PROMPT && streamPrompt != null) {
- streamPrompt.write(str);
- }
- if (type == CONSOLE_OUT && streamOut != null) {
- streamOut.write(str);
- }
- }
-
- public void popup() {
- ConsolePlugin.getDefault().getConsoleManager().showConsoleView(console);
- }
-
- public void addInputListener(IConsoleInputListener listener) {
- inputHandler.addListener(listener);
- }
-
- public void removeInputListener(IConsoleInputListener listener) {
- inputHandler.removeListener(listener);
- }
-
- private class HandleInput implements Runnable {
-
- private final CopyOnWriteArrayList<IConsoleInputListener> listeners;
-
- public HandleInput() {
- listeners = new CopyOnWriteArrayList<IConsoleInputListener>();
- }
-
- public void addListener(IConsoleInputListener listener) {
- listeners.add(listener);
- }
-
- public void removeListener(IConsoleInputListener listener) {
- listeners.remove(listener);
- }
-
- public void run() {
- BufferedReader input = new BufferedReader(new InputStreamReader(console.getInputStream()));
- try {
- String line = null;
- while ((line = input.readLine()) != null) {
- for (IConsoleInputListener listener : listeners) {
- listener.lineRead(line);
- }
- }
- } catch (IOException e) {
- e.printStackTrace();
- }
- OseeLog.log(OseePluginUiActivator.class, Level.INFO, "done with the handling of input");
- }
-
- }
+ private IOConsoleOutputStream streamOut = null;
+
+ private IOConsoleOutputStream streamErr = null;
+
+ private IOConsoleOutputStream streamPrompt = null;
+
+ private final IOConsole console;
+
+ private final HandleInput inputHandler;
+
+ private final boolean time;
+
+ private final Thread thread;
+
+ public OseeConsole(String title) {
+ this(title, true);
+ }
+
+ private OseeConsole(String title, boolean time) {
+ console = new IOConsole(title, null);
+ this.time = time;
+ this.inputHandler = new HandleInput();
+
+ thread = new Thread(inputHandler);
+ thread.setName("Osee console input handler");
+ ConsolePlugin.getDefault().getConsoleManager().addConsoles(new IConsole[] {console});
+ Displays.ensureInDisplayThread(new Runnable() {
+ @Override
+ public void run() {
+ streamOut = console.newOutputStream();// newMessageStream();
+ streamOut.setColor(Displays.getSystemColor(SWT.COLOR_BLACK));
+ streamOut.setActivateOnWrite(false);
+ streamErr = console.newOutputStream();
+ streamErr.setColor(Displays.getSystemColor(SWT.COLOR_RED));
+ streamErr.setActivateOnWrite(false);
+ streamPrompt = console.newOutputStream();
+ streamPrompt.setColor(Displays.getSystemColor(SWT.COLOR_BLUE));
+ streamPrompt.setActivateOnWrite(false);
+ }
+ });
+ thread.start();
+ }
+
+ public PrintStream getPrintStream() {
+ return new PrintStream(streamOut);
+ }
+
+ public void shutdown() {
+ thread.interrupt();
+ try {
+ thread.join(5000);
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ } finally {
+ ConsolePlugin.getDefault().getConsoleManager().removeConsoles(new IConsole[] {console});
+ }
+ }
+
+ public static final int CONSOLE_ERROR = 0;
+
+ public static final int CONSOLE_OUT = 1;
+
+ public static final int CONSOLE_PROMPT = 2;
+
+ /**
+ * Writes string to console without popping console forward
+ *
+ * @param str
+ */
+ public void write(String str) {
+ write(str, false);
+ }
+
+ /**
+ * Writes string to console without popping console forward
+ *
+ * @param str
+ */
+ public void writeError(String str) {
+ write(str, CONSOLE_ERROR, true);
+ }
+
+ /**
+ * Writes string to console
+ *
+ * @param str
+ * @param popup bring console window forward
+ */
+ public void write(String str, boolean popup) {
+ write(str, CONSOLE_OUT, popup);
+ }
+
+ /**
+ * Write string to console
+ *
+ * @param str
+ * @param type CONSOLE_ERROR, CONSOLE_OUT, CONSOLE_PROMPT
+ */
+ public void write(String str, int type) {
+ write(str, type, false);
+ }
+
+ /**
+ * Write string to console
+ *
+ * @param str
+ * @param type CONSOLE_ERROR, CONSOLE_OUT, CONSOLE_PROMPT
+ * @param popup bring console window forward
+ */
+ public void write(String str, int type, boolean popup) {
+ String time = "";
+ if (this.time) {
+ Calendar cal = Calendar.getInstance();
+ cal.setTime(new Date());
+
+ if (cal.get(Calendar.HOUR) == 0) {
+ time = "12";
+ } else {
+ time = "" + cal.get(Calendar.HOUR);
+ }
+ time = Lib.padLeading(time, '0', 2);
+ String minute = "" + cal.get(Calendar.MINUTE);
+ minute = Lib.padLeading(minute, '0', 2);
+ time += ":" + minute + " => ";
+ }
+ try {
+ sendToStreams(type, time);
+ if (str.length() > 100000) {
+ int i = 0;
+
+ while (i < str.length()) {
+ int endIndex = i + 100000;
+ endIndex = endIndex > str.length() ? str.length() : endIndex;
+ String chunk = str.substring(i, endIndex);
+ sendToStreams(type, chunk);
+ i = endIndex;
+ }
+ } else {
+ sendToStreams(type, str);
+ }
+
+ sendToStreams(type, "\n");
+ if (popup) {
+ popup();
+ }
+ } catch (IOException ex) {
+ ex.printStackTrace();
+ }
+ }
+
+ public void prompt(String str) throws IOException {
+ sendToStreams(CONSOLE_PROMPT, str);
+ }
+
+ private void sendToStreams(int type, String str) throws IOException {
+ if (type == CONSOLE_ERROR && streamErr != null) {
+ streamErr.write(str);
+ }
+ if (type == CONSOLE_PROMPT && streamPrompt != null) {
+ streamPrompt.write(str);
+ }
+ if (type == CONSOLE_OUT && streamOut != null) {
+ streamOut.write(str);
+ }
+ }
+
+ public void popup() {
+ ConsolePlugin.getDefault().getConsoleManager().showConsoleView(console);
+ }
+
+ public void addInputListener(IConsoleInputListener listener) {
+ inputHandler.addListener(listener);
+ }
+
+ public void removeInputListener(IConsoleInputListener listener) {
+ inputHandler.removeListener(listener);
+ }
+
+ private class HandleInput implements Runnable {
+
+ private final CopyOnWriteArrayList<IConsoleInputListener> listeners;
+
+ public HandleInput() {
+ listeners = new CopyOnWriteArrayList<IConsoleInputListener>();
+ }
+
+ public void addListener(IConsoleInputListener listener) {
+ listeners.add(listener);
+ }
+
+ public void removeListener(IConsoleInputListener listener) {
+ listeners.remove(listener);
+ }
+
+ public void run() {
+ BufferedReader input = new BufferedReader(new InputStreamReader(console.getInputStream()));
+ try {
+ String line = null;
+ while ((line = input.readLine()) != null) {
+ for (IConsoleInputListener listener : listeners) {
+ listener.lineRead(line);
+ }
+ }
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ OseeLog.log(OseePluginUiActivator.class, Level.INFO, "done with the handling of input");
+ }
+
+ }
} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.framework.ui.plugin/src/org/eclipse/osee/framework/ui/plugin/util/WindowLocal.java b/plugins/org.eclipse.osee.framework.ui.plugin/src/org/eclipse/osee/framework/ui/plugin/util/WindowLocal.java
index fb421a558b..425ff3e8f7 100644
--- a/plugins/org.eclipse.osee.framework.ui.plugin/src/org/eclipse/osee/framework/ui/plugin/util/WindowLocal.java
+++ b/plugins/org.eclipse.osee.framework.ui.plugin/src/org/eclipse/osee/framework/ui/plugin/util/WindowLocal.java
@@ -12,6 +12,7 @@ package org.eclipse.osee.framework.ui.plugin.util;
import java.util.HashMap;
import java.util.Map;
+import org.eclipse.osee.framework.ui.swt.Displays;
import org.eclipse.ui.PlatformUI;
/**
diff --git a/plugins/org.eclipse.osee.framework.ui.plugin/src/org/eclipse/osee/framework/ui/plugin/workspace/EarlyStartup.java b/plugins/org.eclipse.osee.framework.ui.plugin/src/org/eclipse/osee/framework/ui/plugin/workspace/EarlyStartup.java
index a9a9177832..c96da9859c 100644
--- a/plugins/org.eclipse.osee.framework.ui.plugin/src/org/eclipse/osee/framework/ui/plugin/workspace/EarlyStartup.java
+++ b/plugins/org.eclipse.osee.framework.ui.plugin/src/org/eclipse/osee/framework/ui/plugin/workspace/EarlyStartup.java
@@ -13,7 +13,7 @@ package org.eclipse.osee.framework.ui.plugin.workspace;
import org.eclipse.core.runtime.Platform;
import org.eclipse.osee.framework.ui.plugin.internal.OseePluginUiActivator;
import org.eclipse.osee.framework.ui.plugin.workspace.internal.SafeWorkspaceAccessImpl;
-import org.eclipse.swt.widgets.Display;
+import org.eclipse.osee.framework.ui.swt.Displays;
import org.eclipse.ui.IStartup;
import org.osgi.framework.Bundle;
@@ -22,20 +22,20 @@ import org.osgi.framework.Bundle;
*/
public class EarlyStartup implements IStartup {
- @Override
- public void earlyStartup() {
- Display.getDefault().asyncExec(new Runnable() {
- @Override
- public void run() {
- registerWorkspaceAccessService();
- }
- });
- }
+ @Override
+ public void earlyStartup() {
+ Displays.ensureInDisplayThread(new Runnable() {
+ @Override
+ public void run() {
+ registerWorkspaceAccessService();
+ }
+ });
+ }
- private void registerWorkspaceAccessService() {
- Bundle bundle = Platform.getBundle(OseePluginUiActivator.PLUGIN_ID);
- bundle.getBundleContext().registerService(SafeWorkspaceAccess.class.getName(), new SafeWorkspaceAccessImpl(),
- null);
- }
+ private void registerWorkspaceAccessService() {
+ Bundle bundle = Platform.getBundle(OseePluginUiActivator.PLUGIN_ID);
+ bundle.getBundleContext().registerService(SafeWorkspaceAccess.class.getName(), new SafeWorkspaceAccessImpl(),
+ null);
+ }
}
diff --git a/plugins/org.eclipse.osee.framework.ui.plugin/src/org/eclipse/osee/framework/ui/plugin/xnavigate/XNavigateComposite.java b/plugins/org.eclipse.osee.framework.ui.plugin/src/org/eclipse/osee/framework/ui/plugin/xnavigate/XNavigateComposite.java
index e95170bdde..60c923b107 100644
--- a/plugins/org.eclipse.osee.framework.ui.plugin/src/org/eclipse/osee/framework/ui/plugin/xnavigate/XNavigateComposite.java
+++ b/plugins/org.eclipse.osee.framework.ui.plugin/src/org/eclipse/osee/framework/ui/plugin/xnavigate/XNavigateComposite.java
@@ -19,6 +19,7 @@ import org.eclipse.osee.framework.core.exception.OseeCoreException;
import org.eclipse.osee.framework.logging.OseeLevel;
import org.eclipse.osee.framework.logging.OseeLog;
import org.eclipse.osee.framework.ui.plugin.internal.OseePluginUiActivator;
+import org.eclipse.osee.framework.ui.swt.Displays;
import org.eclipse.osee.framework.ui.swt.OSEEFilteredTree;
import org.eclipse.swt.SWT;
import org.eclipse.swt.browser.Browser;
@@ -45,217 +46,218 @@ import org.eclipse.ui.dialogs.PatternFilter;
*/
public class XNavigateComposite extends Composite {
- protected Browser browser;
- protected OSEEFilteredTree filteredTree;
- private static PatternFilter patternFilter = new PatternFilter();
- protected final XNavigateViewItems navigateViewItems;
- private List<XNavigateItem> items;
- public static enum TableLoadOption {
- None,
- // Wait for table to be loaded before returning; for test only
- ForcePend,
- //
- ClearLastSearchItem,
- // Don't perform UI check, just search
- NoUI,
- // Don't create fresh copy of search item; for test only
- DontCopySearchItem
- };
+ protected Browser browser;
+ protected OSEEFilteredTree filteredTree;
+ private static PatternFilter patternFilter = new PatternFilter();
+ protected final XNavigateViewItems navigateViewItems;
+ private List<XNavigateItem> items;
+ public static enum TableLoadOption {
+ None,
+ // Wait for table to be loaded before returning; for test only
+ ForcePend,
+ //
+ ClearLastSearchItem,
+ // Don't perform UI check, just search
+ NoUI,
+ // Don't create fresh copy of search item; for test only
+ DontCopySearchItem
+ };
- /**
- * @param parent
- * @param style
- */
- public XNavigateComposite(XNavigateViewItems navigateViewItems, Composite parent, int style) {
- super(parent, style);
- this.navigateViewItems = navigateViewItems;
+ /**
+ * @param parent
+ * @param style
+ */
+ public XNavigateComposite(XNavigateViewItems navigateViewItems, Composite parent, int style) {
+ super(parent, style);
+ this.navigateViewItems = navigateViewItems;
- setLayout(new GridLayout(1, false));
- setLayoutData(new GridData(GridData.FILL_BOTH));
+ setLayout(new GridLayout(1, false));
+ setLayoutData(new GridData(GridData.FILL_BOTH));
- /*
- * Create a grid layout object so the text and treeviewer are layed out the way I want.
- */
- GridLayout layout = new GridLayout();
- layout.numColumns = 1;
- layout.verticalSpacing = 0;
- layout.marginWidth = 0;
- layout.marginHeight = 0;
- parent.setLayout(layout);
- parent.setLayoutData(new GridData(GridData.FILL_BOTH));
- // parent.setBackground(parent.getDisplay().getSystemColor(SWT.COLOR_WHITE));
+ /*
+ * Create a grid layout object so the text and treeviewer are layed out the way I want.
+ */
+ GridLayout layout = new GridLayout();
+ layout.numColumns = 1;
+ layout.verticalSpacing = 0;
+ layout.marginWidth = 0;
+ layout.marginHeight = 0;
+ parent.setLayout(layout);
+ parent.setLayoutData(new GridData(GridData.FILL_BOTH));
+ // parent.setBackground(parent.getDisplay().getSystemColor(SWT.COLOR_WHITE));
- // if (!ConnectionHandler.isConnected()) {
- // (new Label(parent, SWT.NONE)).setText("DB Connection Unavailable");
- // return;
- // }
+ // if (!ConnectionHandler.isConnected()) {
+ // (new Label(parent, SWT.NONE)).setText("DB Connection Unavailable");
+ // return;
+ // }
- filteredTree = new OSEEFilteredTree(this, SWT.SINGLE | SWT.BORDER, patternFilter);
- filteredTree.getViewer().setContentProvider(new XNavigateContentProvider());
- filteredTree.setInitialText("");
- filteredTree.getViewer().setLabelProvider(new XNavigateLabelProvider());
- GridData gd = new GridData(GridData.FILL_BOTH);
- filteredTree.getViewer().getTree().setLayoutData(gd);
- filteredTree.getViewer().addDoubleClickListener(new IDoubleClickListener() {
- @Override
- public void doubleClick(DoubleClickEvent event) {
- try {
- handleDoubleClick();
- } catch (OseeCoreException ex) {
- OseeLog.log(OseePluginUiActivator.class, OseeLevel.SEVERE_POPUP, ex);
- }
- }
- });
- filteredTree.getViewer().getTree().addKeyListener(new KeyListener() {
- public void keyPressed(KeyEvent e) {
- }
+ filteredTree = new OSEEFilteredTree(this, SWT.SINGLE | SWT.BORDER, patternFilter);
+ filteredTree.getViewer().setContentProvider(new XNavigateContentProvider());
+ filteredTree.setInitialText("");
+ filteredTree.getViewer().setLabelProvider(new XNavigateLabelProvider());
+ GridData gd = new GridData(GridData.FILL_BOTH);
+ filteredTree.getViewer().getTree().setLayoutData(gd);
+ filteredTree.getViewer().addDoubleClickListener(new IDoubleClickListener() {
+ @Override
+ public void doubleClick(DoubleClickEvent event) {
+ try {
+ handleDoubleClick();
+ } catch (OseeCoreException ex) {
+ OseeLog.log(OseePluginUiActivator.class, OseeLevel.SEVERE_POPUP, ex);
+ }
+ }
+ });
+ filteredTree.getViewer().getTree().addKeyListener(new KeyListener() {
+ public void keyPressed(KeyEvent e) {
+ }
- public void keyReleased(KeyEvent e) {
- if (e.keyCode == SWT.CR || e.keyCode == SWT.KEYPAD_CR) {
- try {
- handleDoubleClick();
- } catch (OseeCoreException ex) {
- OseeLog.log(OseePluginUiActivator.class, OseeLevel.SEVERE_POPUP, ex);
- }
- }
- }
- });
- // Disable native tree tooltip
- filteredTree.getViewer().getTree().setToolTipText("");
- filteredTree.getViewer().getTree().addListener(SWT.Dispose, tableListener);
- filteredTree.getViewer().getTree().addListener(SWT.KeyDown, tableListener);
- filteredTree.getViewer().getTree().addListener(SWT.MouseMove, tableListener);
- filteredTree.getViewer().getTree().addListener(SWT.MouseHover, tableListener);
+ public void keyReleased(KeyEvent e) {
+ if (e.keyCode == SWT.CR || e.keyCode == SWT.KEYPAD_CR) {
+ try {
+ handleDoubleClick();
+ } catch (OseeCoreException ex) {
+ OseeLog.log(OseePluginUiActivator.class, OseeLevel.SEVERE_POPUP, ex);
+ }
+ }
+ }
+ });
+ // Disable native tree tooltip
+ filteredTree.getViewer().getTree().setToolTipText("");
+ filteredTree.getViewer().getTree().addListener(SWT.Dispose, tableListener);
+ filteredTree.getViewer().getTree().addListener(SWT.KeyDown, tableListener);
+ filteredTree.getViewer().getTree().addListener(SWT.MouseMove, tableListener);
+ filteredTree.getViewer().getTree().addListener(SWT.MouseHover, tableListener);
- }
+ }
- // Implement a "fake" tooltip
- final Listener labelListener = new Listener() {
- public void handleEvent(Event event) {
- Label label = (Label) event.widget;
- Shell shell = label.getShell();
- switch (event.type) {
- case SWT.MouseDown:
- Event e = new Event();
- e.item = (TableItem) label.getData("_TABLEITEM");
- // Assuming table is single select, set the selection as if
- // the mouse down event went through to the table
- // filteredTree.getViewer().getTree().setSelection(new TableItem[] {(TableItem) e.item});
- filteredTree.getViewer().getTree().notifyListeners(SWT.Selection, e);
- shell.dispose();
- filteredTree.getViewer().getTree().setFocus();
- break;
- case SWT.MouseExit:
- shell.dispose();
- break;
- }
- }
- };
+ // Implement a "fake" tooltip
+ final Listener labelListener = new Listener() {
+ public void handleEvent(Event event) {
+ Label label = (Label) event.widget;
+ Shell shell = label.getShell();
+ switch (event.type) {
+ case SWT.MouseDown:
+ Event e = new Event();
+ e.item = (TableItem) label.getData("_TABLEITEM");
+ // Assuming table is single select, set the selection as if
+ // the mouse down event went through to the table
+ // filteredTree.getViewer().getTree().setSelection(new TableItem[] {(TableItem) e.item});
+ filteredTree.getViewer().getTree().notifyListeners(SWT.Selection, e);
+ shell.dispose();
+ filteredTree.getViewer().getTree().setFocus();
+ break;
+ case SWT.MouseExit:
+ shell.dispose();
+ break;
+ }
+ }
+ };
- Shell tip = null;
- Label label = null;
+ Shell tip = null;
+ Label label = null;
- protected void disposeTooltip() {
- if (tip == null) {
- return;
- }
- tip.dispose();
- tip = null;
- label = null;
- }
- Listener tableListener = new Listener() {
+ protected void disposeTooltip() {
+ if (tip == null) {
+ return;
+ }
+ tip.dispose();
+ tip = null;
+ label = null;
+ }
+ Listener tableListener = new Listener() {
- public void handleEvent(Event event) {
- switch (event.type) {
- case SWT.Dispose:
- case SWT.KeyDown:
- case SWT.MouseMove: {
- if (tip == null) {
- break;
- }
- disposeTooltip();
- break;
- }
- case SWT.MouseHover: {
- TreeItem item = filteredTree.getViewer().getTree().getItem(new Point(event.x, event.y));
- if (item != null && item.getData() instanceof XNavigateItem && ((XNavigateItem) item.getData()).getDescription() != null && !((XNavigateItem) item.getData()).getDescription().equals(
- "")) {
- if (tip != null && !tip.isDisposed()) {
- tip.dispose();
- }
- tip = new Shell(Display.getCurrent().getActiveShell(), SWT.ON_TOP | SWT.NO_FOCUS | SWT.TOOL);
- tip.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_INFO_BACKGROUND));
- FillLayout layout = new FillLayout();
- layout.marginWidth = 2;
- tip.setLayout(layout);
- label = new Label(tip, SWT.NONE);
- label.setForeground(Display.getCurrent().getSystemColor(SWT.COLOR_INFO_FOREGROUND));
- label.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_INFO_BACKGROUND));
- label.setData("_TABLEITEM", item);
- label.setText(item.getText() + "\n\n" + ((XNavigateItem) item.getData()).getDescription());
- label.addListener(SWT.MouseExit, labelListener);
- label.addListener(SWT.MouseDown, labelListener);
- Point size = tip.computeSize(SWT.DEFAULT, SWT.DEFAULT);
- Rectangle rect = item.getBounds(0);
- Point pt = filteredTree.getViewer().getTree().toDisplay(rect.x, rect.y);
- tip.setBounds(pt.x, pt.y + 15, size.x, size.y);
- tip.setVisible(true);
- }
- }
- }
- }
- };
+ public void handleEvent(Event event) {
+ switch (event.type) {
+ case SWT.Dispose:
+ case SWT.KeyDown:
+ case SWT.MouseMove: {
+ if (tip == null) {
+ break;
+ }
+ disposeTooltip();
+ break;
+ }
+ case SWT.MouseHover: {
+ TreeItem item = filteredTree.getViewer().getTree().getItem(new Point(event.x, event.y));
+ if (item != null && item.getData() instanceof XNavigateItem && ((XNavigateItem) item.getData()).getDescription() != null && !((XNavigateItem) item.getData()).getDescription().equals(
+ "")) {
+ if (tip != null && !tip.isDisposed()) {
+ tip.dispose();
+ }
+ tip = new Shell(Display.getCurrent().getActiveShell(), SWT.ON_TOP | SWT.NO_FOCUS | SWT.TOOL);
+ tip.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_INFO_BACKGROUND));
+ FillLayout layout = new FillLayout();
+ layout.marginWidth = 2;
+ tip.setLayout(layout);
+ label = new Label(tip, SWT.NONE);
+ label.setForeground(Display.getCurrent().getSystemColor(SWT.COLOR_INFO_FOREGROUND));
+ label.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_INFO_BACKGROUND));
+ label.setData("_TABLEITEM", item);
+ label.setText(item.getText() + "\n\n" + ((XNavigateItem) item.getData()).getDescription());
+ label.addListener(SWT.MouseExit, labelListener);
+ label.addListener(SWT.MouseDown, labelListener);
+ Point size = tip.computeSize(SWT.DEFAULT, SWT.DEFAULT);
+ Rectangle rect = item.getBounds(0);
+ Point pt = filteredTree.getViewer().getTree().toDisplay(rect.x, rect.y);
+ tip.setBounds(pt.x, pt.y + 15, size.x, size.y);
+ tip.setVisible(true);
+ }
+ }
+ }
+ }
+ };
- protected void handleDoubleClick() throws OseeCoreException {
- IStructuredSelection sel = (IStructuredSelection) filteredTree.getViewer().getSelection();
- if (!sel.iterator().hasNext()) {
- return;
- }
- XNavigateItem item = (XNavigateItem) sel.iterator().next();
- handleDoubleClick(item);
- }
+ protected void handleDoubleClick() throws OseeCoreException {
+ IStructuredSelection sel = (IStructuredSelection) filteredTree.getViewer().getSelection();
+ if (!sel.iterator().hasNext()) {
+ return;
+ }
+ XNavigateItem item = (XNavigateItem) sel.iterator().next();
+ handleDoubleClick(item);
+ }
- protected void handleDoubleClick(XNavigateItem item, TableLoadOption... tableLoadOptions) throws OseeCoreException {
- disposeTooltip();
+ protected void handleDoubleClick(XNavigateItem item, TableLoadOption... tableLoadOptions) throws OseeCoreException {
+ disposeTooltip();
- if (item.getChildren().size() > 0) {
- filteredTree.getViewer().setExpandedState(item, true);
- } else {
- try {
- item.run(tableLoadOptions);
- } catch (Exception ex) {
- OseeLog.log(OseePluginUiActivator.class, OseeLevel.SEVERE_POPUP, ex);
- }
- }
- }
+ if (item.getChildren().size() > 0) {
+ filteredTree.getViewer().setExpandedState(item, true);
+ } else {
+ try {
+ item.run(tableLoadOptions);
+ } catch (Exception ex) {
+ OseeLog.log(OseePluginUiActivator.class, OseeLevel.SEVERE_POPUP, ex);
+ }
+ }
+ }
- public void refresh() {
- items = navigateViewItems.getSearchNavigateItems();
- Display.getDefault().asyncExec(new Runnable() {
- public void run() {
- filteredTree.getViewer().setInput(items);
- }
- });
- }
+ public void refresh() {
+ items = navigateViewItems.getSearchNavigateItems();
+ Displays.ensureInDisplayThread(new Runnable() {
+ @Override
+ public void run() {
+ filteredTree.getViewer().setInput(items);
+ }
+ });
+ }
- /**
- * @return the listViewer
- */
- public FilteredTree getFilteredTree() {
- return filteredTree;
- }
+ /**
+ * @return the listViewer
+ */
+ public FilteredTree getFilteredTree() {
+ return filteredTree;
+ }
- /**
- * @return the patternFilter
- */
- public PatternFilter getPatternFilter() {
- return patternFilter;
- }
+ /**
+ * @return the patternFilter
+ */
+ public PatternFilter getPatternFilter() {
+ return patternFilter;
+ }
- /**
- * @return the items
- */
- public List<XNavigateItem> getItems() {
- return items;
- }
+ /**
+ * @return the items
+ */
+ public List<XNavigateItem> getItems() {
+ return items;
+ }
}
diff --git a/plugins/org.eclipse.osee.framework.ui.plugin/src/org/eclipse/osee/framework/ui/plugin/xnavigate/XNavigateItemAction.java b/plugins/org.eclipse.osee.framework.ui.plugin/src/org/eclipse/osee/framework/ui/plugin/xnavigate/XNavigateItemAction.java
index 7ae43ce8cc..11854a2a46 100644
--- a/plugins/org.eclipse.osee.framework.ui.plugin/src/org/eclipse/osee/framework/ui/plugin/xnavigate/XNavigateItemAction.java
+++ b/plugins/org.eclipse.osee.framework.ui.plugin/src/org/eclipse/osee/framework/ui/plugin/xnavigate/XNavigateItemAction.java
@@ -12,8 +12,8 @@ package org.eclipse.osee.framework.ui.plugin.xnavigate;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.osee.framework.ui.plugin.util.Displays;
import org.eclipse.osee.framework.ui.plugin.xnavigate.XNavigateComposite.TableLoadOption;
+import org.eclipse.osee.framework.ui.swt.Displays;
import org.eclipse.osee.framework.ui.swt.KeyedImage;
import org.eclipse.swt.widgets.Display;
diff --git a/plugins/org.eclipse.osee.framework.ui.service.control/src/org/eclipse/osee/framework/ui/service/control/actions/InspectLookUpServerAction.java b/plugins/org.eclipse.osee.framework.ui.service.control/src/org/eclipse/osee/framework/ui/service/control/actions/InspectLookUpServerAction.java
index 1720b4c3ec..c0f9d366fd 100644
--- a/plugins/org.eclipse.osee.framework.ui.service.control/src/org/eclipse/osee/framework/ui/service/control/actions/InspectLookUpServerAction.java
+++ b/plugins/org.eclipse.osee.framework.ui.service.control/src/org/eclipse/osee/framework/ui/service/control/actions/InspectLookUpServerAction.java
@@ -17,27 +17,28 @@ import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.osee.framework.ui.service.control.dialogs.InspectReggieDialogHelper;
import org.eclipse.osee.framework.ui.service.control.widgets.ManagerMain;
-import org.eclipse.swt.widgets.Display;
+import org.eclipse.osee.framework.ui.swt.Displays;
/**
* @author Roberto E. Escobar
*/
public class InspectLookUpServerAction implements IDoubleClickListener {
- private ManagerMain mainWindow;
+ private final ManagerMain mainWindow;
- public InspectLookUpServerAction(ManagerMain mainWindow) {
- super();
- this.mainWindow = mainWindow;
- this.mainWindow.getLookupViewer().getViewer().addDoubleClickListener(this);
- }
+ public InspectLookUpServerAction(ManagerMain mainWindow) {
+ super();
+ this.mainWindow = mainWindow;
+ this.mainWindow.getLookupViewer().getViewer().addDoubleClickListener(this);
+ }
- public void doubleClick(DoubleClickEvent event) {
- ISelection sel = event.getSelection();
- if (!sel.isEmpty()) {
- Object object = ((StructuredSelection) sel).getFirstElement();
- if (object instanceof ServiceRegistrar) {
- Display.getDefault().asyncExec(new InspectReggieDialogHelper(mainWindow, (ServiceRegistrar) object));
- }
- }
- }
+ @Override
+ public void doubleClick(DoubleClickEvent event) {
+ ISelection sel = event.getSelection();
+ if (!sel.isEmpty()) {
+ Object object = ((StructuredSelection) sel).getFirstElement();
+ if (object instanceof ServiceRegistrar) {
+ Displays.ensureInDisplayThread(new InspectReggieDialogHelper(mainWindow, (ServiceRegistrar) object));
+ }
+ }
+ }
}
diff --git a/plugins/org.eclipse.osee.framework.ui.service.control/src/org/eclipse/osee/framework/ui/service/control/actions/OpenLaunchWizard.java b/plugins/org.eclipse.osee.framework.ui.service.control/src/org/eclipse/osee/framework/ui/service/control/actions/OpenLaunchWizard.java
index eea7eb0ebe..3d2d790116 100644
--- a/plugins/org.eclipse.osee.framework.ui.service.control/src/org/eclipse/osee/framework/ui/service/control/actions/OpenLaunchWizard.java
+++ b/plugins/org.eclipse.osee.framework.ui.service.control/src/org/eclipse/osee/framework/ui/service/control/actions/OpenLaunchWizard.java
@@ -15,31 +15,31 @@ import org.eclipse.osee.framework.ui.service.control.ServiceControlImage;
import org.eclipse.osee.framework.ui.service.control.widgets.ManagerMain;
import org.eclipse.osee.framework.ui.service.control.wizards.launcher.ServiceLaunchWizard;
import org.eclipse.osee.framework.ui.service.control.wizards.launcher.ServiceWizardDialog;
+import org.eclipse.osee.framework.ui.swt.Displays;
import org.eclipse.osee.framework.ui.swt.ImageManager;
-import org.eclipse.swt.widgets.Display;
/**
* @author Roberto E. Escobar
*/
public class OpenLaunchWizard extends Action {
- public OpenLaunchWizard(ManagerMain mainWindow) {
- super();
- setImageDescriptor(ImageManager.getImageDescriptor(ServiceControlImage.ROCKET));
- setText("Launch A Service");
- // setToolTipText("Open the service launching wizard.");
- //TODO: Please remove next two lines upon action 4ZXCH completion.
- this.setToolTipText("Disabled until action 4ZXCH is complete.");
- this.setEnabled(false);
- }
+ public OpenLaunchWizard(ManagerMain mainWindow) {
+ super();
+ setImageDescriptor(ImageManager.getImageDescriptor(ServiceControlImage.ROCKET));
+ setText("Launch A Service");
+ // setToolTipText("Open the service launching wizard.");
+ //TODO: Please remove next two lines upon action 4ZXCH completion.
+ this.setToolTipText("Disabled until action 4ZXCH is complete.");
+ this.setEnabled(false);
+ }
- @Override
- public void run() {
- super.run();
- ServiceLaunchWizard wizard = new ServiceLaunchWizard();
- ServiceWizardDialog dialog = new ServiceWizardDialog(Display.getDefault().getActiveShell(), wizard);
- dialog.setBlockOnOpen(true);
- dialog.open();
- }
+ @Override
+ public void run() {
+ super.run();
+ ServiceLaunchWizard wizard = new ServiceLaunchWizard();
+ ServiceWizardDialog dialog = new ServiceWizardDialog(Displays.getActiveShell(), wizard);
+ dialog.setBlockOnOpen(true);
+ dialog.open();
+ }
}
diff --git a/plugins/org.eclipse.osee.framework.ui.service.control/src/org/eclipse/osee/framework/ui/service/control/dialogs/PopulateInspectReggieDialog.java b/plugins/org.eclipse.osee.framework.ui.service.control/src/org/eclipse/osee/framework/ui/service/control/dialogs/PopulateInspectReggieDialog.java
index 01225a8770..a3378aaae3 100644
--- a/plugins/org.eclipse.osee.framework.ui.service.control/src/org/eclipse/osee/framework/ui/service/control/dialogs/PopulateInspectReggieDialog.java
+++ b/plugins/org.eclipse.osee.framework.ui.service.control/src/org/eclipse/osee/framework/ui/service/control/dialogs/PopulateInspectReggieDialog.java
@@ -23,7 +23,7 @@ import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.osee.framework.plugin.core.util.ExportClassLoader;
import org.eclipse.osee.framework.ui.service.control.ControlPlugin;
import org.eclipse.osee.framework.ui.service.control.managers.ServiceTreeBuilder;
-import org.eclipse.swt.widgets.Display;
+import org.eclipse.osee.framework.ui.swt.Displays;
import org.eclipse.ui.PlatformUI;
/**
@@ -31,67 +31,71 @@ import org.eclipse.ui.PlatformUI;
*/
public class PopulateInspectReggieDialog extends Job {
- private ServiceRegistrar reggie;
- private ServiceTreeBuilder serviceTreeBuilder;
+ private final ServiceRegistrar reggie;
+ private final ServiceTreeBuilder serviceTreeBuilder;
- public PopulateInspectReggieDialog(String title, ServiceTreeBuilder serviceTreeBuilder, ServiceRegistrar reggie) {
- super(title);
- this.serviceTreeBuilder = serviceTreeBuilder;
- this.reggie = reggie;
+ public PopulateInspectReggieDialog(String title, ServiceTreeBuilder serviceTreeBuilder, ServiceRegistrar reggie) {
+ super(title);
+ this.serviceTreeBuilder = serviceTreeBuilder;
+ this.reggie = reggie;
- }
+ }
- public static void scheduleJob(Job job) {
- job.setUser(true);
- job.setPriority(Job.SHORT);
- job.schedule();
- }
+ public static void scheduleJob(Job job) {
+ job.setUser(true);
+ job.setPriority(Job.SHORT);
+ job.schedule();
+ }
- @Override
- protected IStatus run(IProgressMonitor monitor) {
- IStatus status = Status.CANCEL_STATUS;
- ClassLoader loader = this.getThread().getContextClassLoader();
- try {
- this.getThread().setContextClassLoader(ExportClassLoader.getInstance());
- ServiceMatches serviceMatches = reggie.lookup(new ServiceTemplate(null, null, null), Integer.MAX_VALUE);
- final ServiceItem[] serviceItemArray = serviceMatches.items;
- Display.getDefault().asyncExec(new Runnable() {
- public void run() {
- for (ServiceItem item : serviceItemArray) {
- serviceTreeBuilder.serviceAdded(item);
- }
- }
- });
- status = Status.OK_STATUS;
- } catch (RemoteException ex) {
- try {
- displayMessage("Reggie Lookup Error", String.format("Error searching for services in [%s:%s] reggie.\n%s",
- reggie.getLocator().getHost(), reggie.getLocator().getPort(), ControlPlugin.getStackMessages(ex)));
- } catch (RemoteException ex1) {
- displayMessage("Reggie Lookup Error", String.format("Unable to access selected the selected reggie.\n%s",
- ControlPlugin.getStackMessages(ex)));
- }
- } finally {
- this.getThread().setContextClassLoader(loader);
- }
- return status;
- }
+ @Override
+ protected IStatus run(IProgressMonitor monitor) {
+ IStatus status = Status.CANCEL_STATUS;
+ ClassLoader loader = this.getThread().getContextClassLoader();
+ try {
+ this.getThread().setContextClassLoader(ExportClassLoader.getInstance());
+ ServiceMatches serviceMatches = reggie.lookup(new ServiceTemplate(null, null, null), Integer.MAX_VALUE);
+ final ServiceItem[] serviceItemArray = serviceMatches.items;
+ Displays.ensureInDisplayThread(new Runnable() {
+ @Override
+ public void run() {
+ for (ServiceItem item : serviceItemArray) {
+ serviceTreeBuilder.serviceAdded(item);
+ }
+ }
+ });
+ status = Status.OK_STATUS;
+ } catch (RemoteException ex) {
+ try {
+ displayMessage("Reggie Lookup Error", String.format("Error searching for services in [%s:%s] reggie.\n%s",
+ reggie.getLocator().getHost(), reggie.getLocator().getPort(), ControlPlugin.getStackMessages(ex)));
+ } catch (RemoteException ex1) {
+ displayMessage(
+ "Reggie Lookup Error",
+ String.format("Unable to access selected the selected reggie.\n%s",
+ ControlPlugin.getStackMessages(ex)));
+ }
+ } finally {
+ this.getThread().setContextClassLoader(loader);
+ }
+ return status;
+ }
- private void displayMessage(final String title, final String message) {
- displayMessage(title, message, true);
- }
+ private void displayMessage(final String title, final String message) {
+ displayMessage(title, message, true);
+ }
- private void displayMessage(final String title, final String message, final boolean isError) {
- Display.getDefault().syncExec(new Runnable() {
- public void run() {
- if (isError) {
- MessageDialog.openError(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), title, message);
- } else {
- MessageDialog.openInformation(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), title,
- message);
- }
- }
- });
- }
+ private void displayMessage(final String title, final String message, final boolean isError) {
+ Displays.pendInDisplayThread(new Runnable() {
+ @Override
+ public void run() {
+ if (isError) {
+ MessageDialog.openError(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), title, message);
+ } else {
+ MessageDialog.openInformation(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), title,
+ message);
+ }
+ }
+ });
+ }
}
diff --git a/plugins/org.eclipse.osee.framework.ui.service.control/src/org/eclipse/osee/framework/ui/service/control/jobs/TextDisplayHelper.java b/plugins/org.eclipse.osee.framework.ui.service.control/src/org/eclipse/osee/framework/ui/service/control/jobs/TextDisplayHelper.java
index 59636198ed..e310cb40f7 100644
--- a/plugins/org.eclipse.osee.framework.ui.service.control/src/org/eclipse/osee/framework/ui/service/control/jobs/TextDisplayHelper.java
+++ b/plugins/org.eclipse.osee.framework.ui.service.control/src/org/eclipse/osee/framework/ui/service/control/jobs/TextDisplayHelper.java
@@ -11,9 +11,9 @@
package org.eclipse.osee.framework.ui.service.control.jobs;
import org.eclipse.osee.framework.ui.plugin.io.StreamToTextArea;
+import org.eclipse.osee.framework.ui.swt.Displays;
import org.eclipse.osee.framework.ui.swt.FormattedText;
import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.Display;
import org.eclipse.ui.PlatformUI;
/**
@@ -21,67 +21,68 @@ import org.eclipse.ui.PlatformUI;
*/
public class TextDisplayHelper {
- private FormattedText formattedText;
- private StreamToTextArea errorGobbler;
- private StreamToTextArea outputGobbler;
+ private final FormattedText formattedText;
+ private StreamToTextArea errorGobbler;
+ private StreamToTextArea outputGobbler;
- public TextDisplayHelper(FormattedText formattedText) {
- this.formattedText = formattedText;
- this.errorGobbler = null;
- this.outputGobbler = null;
- }
+ public TextDisplayHelper(FormattedText formattedText) {
+ this.formattedText = formattedText;
+ this.errorGobbler = null;
+ this.outputGobbler = null;
+ }
- public void updateScrollBar() {
- PlatformUI.getWorkbench().getDisplay().syncExec(new Runnable() {
- public void run() {
- formattedText.getStyledText().setSelection(formattedText.getStyledText().getCharCount());
- }
- });
- }
+ public void updateScrollBar() {
+ PlatformUI.getWorkbench().getDisplay().syncExec(new Runnable() {
+ public void run() {
+ formattedText.getStyledText().setSelection(formattedText.getStyledText().getCharCount());
+ }
+ });
+ }
- public void addText(final String toDisplay, final int format, final int color, final boolean underline) {
- PlatformUI.getWorkbench().getDisplay().syncExec(new Runnable() {
- public void run() {
- formattedText.addText(toDisplay, format, color, underline);
- }
- });
- }
+ public void addText(final String toDisplay, final int format, final int color, final boolean underline) {
+ PlatformUI.getWorkbench().getDisplay().syncExec(new Runnable() {
+ public void run() {
+ formattedText.addText(toDisplay, format, color, underline);
+ }
+ });
+ }
- public void clear() {
- PlatformUI.getWorkbench().getDisplay().syncExec(new Runnable() {
- public void run() {
- formattedText.clearTextArea();
- }
- });
- }
+ public void clear() {
+ PlatformUI.getWorkbench().getDisplay().syncExec(new Runnable() {
+ public void run() {
+ formattedText.clearTextArea();
+ }
+ });
+ }
- public FormattedText getFormattedText() {
- return formattedText;
- }
+ public FormattedText getFormattedText() {
+ return formattedText;
+ }
- public void startProcessHandling(Process process) {
- disposeProcessHandling();
- errorGobbler = new StreamToTextArea(process.getErrorStream(), "\t\terr", getFormattedText());
- errorGobbler.setName("ServiceErrorHandler");
- errorGobbler.typeColor(SWT.COLOR_RED);
- outputGobbler = new StreamToTextArea(process.getInputStream(), "\t\tout", getFormattedText());
- outputGobbler.setName("ServiceOutputHandler");
- outputGobbler.typeColor(SWT.COLOR_DARK_BLUE);
+ public void startProcessHandling(Process process) {
+ disposeProcessHandling();
+ errorGobbler = new StreamToTextArea(process.getErrorStream(), "\t\terr", getFormattedText());
+ errorGobbler.setName("ServiceErrorHandler");
+ errorGobbler.typeColor(SWT.COLOR_RED);
+ outputGobbler = new StreamToTextArea(process.getInputStream(), "\t\tout", getFormattedText());
+ outputGobbler.setName("ServiceOutputHandler");
+ outputGobbler.typeColor(SWT.COLOR_DARK_BLUE);
- errorGobbler.start();
- outputGobbler.start();
- }
+ errorGobbler.start();
+ outputGobbler.start();
+ }
- public void disposeProcessHandling() {
- Display.getDefault().asyncExec(new Runnable() {
- public void run() {
- if (errorGobbler != null) {
- errorGobbler.setStopped(true);
- }
- if (outputGobbler != null) {
- outputGobbler.setStopped(true);
- }
- }
- });
- }
+ public void disposeProcessHandling() {
+ Displays.ensureInDisplayThread(new Runnable() {
+ @Override
+ public void run() {
+ if (errorGobbler != null) {
+ errorGobbler.setStopped(true);
+ }
+ if (outputGobbler != null) {
+ outputGobbler.setStopped(true);
+ }
+ }
+ });
+ }
}
diff --git a/plugins/org.eclipse.osee.framework.ui.service.control/src/org/eclipse/osee/framework/ui/service/control/jobs/UploadRemoteFileJob.java b/plugins/org.eclipse.osee.framework.ui.service.control/src/org/eclipse/osee/framework/ui/service/control/jobs/UploadRemoteFileJob.java
index 105db5a7b3..e5c7947c8f 100644
--- a/plugins/org.eclipse.osee.framework.ui.service.control/src/org/eclipse/osee/framework/ui/service/control/jobs/UploadRemoteFileJob.java
+++ b/plugins/org.eclipse.osee.framework.ui.service.control/src/org/eclipse/osee/framework/ui/service/control/jobs/UploadRemoteFileJob.java
@@ -18,7 +18,6 @@ import java.io.InputStream;
import java.io.OutputStream;
import java.net.URL;
import java.util.Map;
-
import org.eclipse.core.runtime.FileLocator;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
@@ -29,13 +28,12 @@ import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.osee.framework.ui.service.control.ControlPlugin;
import org.eclipse.osee.framework.ui.service.control.wizards.launcher.ServiceLaunchingInformation;
import org.eclipse.osee.framework.ui.service.control.wizards.launcher.pages.UploadPage.LabelEnum;
+import org.eclipse.osee.framework.ui.swt.Displays;
import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.ProgressBar;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Text;
import org.osgi.framework.Bundle;
-
import com.jcraft.jsch.ChannelSftp;
import com.jcraft.jsch.SftpException;
@@ -44,191 +42,200 @@ import com.jcraft.jsch.SftpException;
*/
public class UploadRemoteFileJob extends Job {
- private ServiceLaunchingInformation serviceInfo;
- private TextDisplayHelper display;
- private ProgressBar progress;
- private Map<LabelEnum, Text> dataMap;
- private boolean isUploadDirCreationAllowed;
-
- public UploadRemoteFileJob(String name, ServiceLaunchingInformation serviceInfo, TextDisplayHelper display, ProgressBar progress, Map<LabelEnum, Text> dataMap) {
- super(name);
- if (serviceInfo == null) throw new IllegalArgumentException("serviceInfo can not be null");
- if (display == null) throw new IllegalArgumentException("display can not be null");
- if (progress == null) throw new IllegalArgumentException("progress can not be null");
- this.serviceInfo = serviceInfo;
- this.display = display;
- this.progress = progress;
- this.dataMap = dataMap;
- this.isUploadDirCreationAllowed = false;
- progress.setSelection(0);
- progress.setMaximum(0);
- progress.setMaximum(5);
- }
-
- private void incrementProgress(final int increment) {
- Display.getDefault().asyncExec(new Runnable() {
- public void run() {
- int position = progress.getSelection();
- progress.setSelection(position + increment);
- }
- });
- }
-
- private void displayInitMessage(File zipLocation) {
- display.clear();
- display.addText("\t\t ----------- Unzip -------------\n\n", SWT.BOLD, SWT.COLOR_BLACK, false);
- display.addText("\tFrom Location: ", SWT.BOLD, SWT.COLOR_DARK_BLUE, true);
- display.addText(String.format("\t%s\n", zipLocation.getAbsolutePath()), SWT.NORMAL, SWT.COLOR_BLACK, false);
- display.addText("\tTo Location: ", SWT.BOLD, SWT.COLOR_DARK_BLUE, true);
- display.addText(String.format("\t%s://%s\n", serviceInfo.getSelectedHost(), serviceInfo.getUnzipLocation()),
- SWT.NORMAL, SWT.COLOR_BLACK, false);
- }
-
- private ChannelSftp getScpConnection() throws Exception {
- display.addText("\n\tStarting SCP...", SWT.NORMAL, SWT.COLOR_BLACK, false);
- ChannelSftp sftp = this.serviceInfo.getSSHConnection().getScpConnection();
- incrementProgress(1);
- return sftp;
- }
-
- private void createRemotePathOrCdIntoIt(IProgressMonitor monitor, ChannelSftp sftp) throws Exception {
- if (monitor.isCanceled() != true) {
- try {
- sftp.cd(serviceInfo.getUnzipLocation());
- } catch (SftpException ex1) {
- this.isUploadDirCreationAllowed = false;
- Display.getDefault().syncExec(new Runnable() {
- public void run() {
- Shell shell = Display.getDefault().getActiveShell();
- isUploadDirCreationAllowed =
- MessageDialog.openQuestion(shell, "Scp",
- "Unable to find remote path. Would you like to create it?");
- }
- });
-
- if (isUploadDirCreationAllowed == true) {
- try {
- sftp.mkdir(serviceInfo.getUnzipLocation());
- } catch (SftpException ex2) {
- throw new Exception("Unable to create remote path.");
- }
- } else {
- throw new Exception("Unable to find remote path - user selected not to create it.");
- }
-
- } finally {
- incrementProgress(1);
- }
- }
- }
-
- private void uploadFile(IProgressMonitor monitor, ChannelSftp sftp, File fileToUpload) throws Exception {
- if (monitor.isCanceled() != true) {
- display.addText(String.format("\n\tUploading [%s]", fileToUpload.getAbsolutePath()), SWT.NORMAL,
- SWT.COLOR_BLACK, false);
- InputStream input = null;
- OutputStream output = null;
- try {
- input = new FileInputStream(fileToUpload);
- output = sftp.put(fileToUpload.getName());
- byte[] buffer = new byte[1024];
- int count = -1;
- while ((count = input.read(buffer)) != -1) {
- output.write(buffer, 0, count);
- }
- display.addText(String.format("\n\tTransferred [%s] bytes", fileToUpload.length()), SWT.NORMAL,
- SWT.COLOR_BLACK, false);
- } catch (SftpException ex1) {
- throw new Exception("Error uploading file.");
- } finally {
- incrementProgress(1);
- if (input != null) {
- input.close();
- }
- if (output != null) {
- output.close();
- }
- }
- }
- }
-
- private void unzipRemoteFiles(IProgressMonitor monitor) throws Exception {
- if (monitor.isCanceled() != true) {
- String toExec =
- String.format("cd %s\nunzip -o %s", serviceInfo.getUnzipLocation(),
- serviceInfo.getServiceItem().getZipName());
-
- display.addText("\n\tUnzip Cmd: ", SWT.BOLD, SWT.COLOR_DARK_BLUE, true);
- display.addText("\t" + toExec.split("\n")[1] + "\n", SWT.NORMAL, SWT.COLOR_BLACK, false);
-
- String output = this.serviceInfo.getSSHConnection().executeCommandList(toExec.split("\n"));
- display.addText("\n\t" + output + "\n", SWT.NORMAL, SWT.COLOR_BLACK, false);
- incrementProgress(1);
- }
- }
-
- public File getFile(Bundle bundle, String path) throws FileNotFoundException, IOException {
- URL url = bundle.getEntry(path);
- if (url == null) {
- throw new FileNotFoundException("Could not locate the file " + path);
- }
- try {
- url = FileLocator.toFileURL(url);
- File file = new File(url.getFile());
- return file;
- } catch (Throwable e) {
- throw new IOException("Invalid URL format for the URL " + url.toString(), e);
- }
- }
-
- @Override
- public IStatus run(IProgressMonitor monitor) {
- IStatus toReturn = Status.OK_STATUS;
- ChannelSftp sftp = null;
- try {
- Display.getDefault().syncExec(new Runnable() {
- public void run() {
- serviceInfo.setUnzipLocation(dataMap.get(LabelEnum.Host_Upload_Location).getText());
- }
- });
- Bundle bundle = Platform.getBundle(serviceInfo.getServiceItem().getPlugin());
- File zipLocation = getFile(bundle, serviceInfo.getServiceItem().getZipName());
-
- displayInitMessage(zipLocation);
-
- sftp = getScpConnection();
-
- createRemotePathOrCdIntoIt(monitor, sftp);
-
- uploadFile(monitor, sftp, zipLocation);
-
- unzipRemoteFiles(monitor);
-
- } catch (Exception ex) {
- display.addText(String.format("\n\t%s\n\n", ex.getLocalizedMessage()), SWT.NORMAL, SWT.COLOR_RED, false);
- toReturn = new Status(Status.ERROR, ControlPlugin.PLUGIN_PREFERENCE_SCOPE, "Error during upload.", ex);
- } finally {
- incrementProgress(5);
- if (sftp != null) {
- sftp.exit();
- sftp.disconnect();
- }
- }
-
- // incrementProgress(1);
- // if (true != createDestinationFolder()) {
- // incrementProgress(4);
- // toReturn = Status.CANCEL_STATUS;
- // } else {
-
- // if (true != toReturn.equals(Status.OK_STATUS)) {
- // PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() {
- // public void run() {
- // MessageDialog.openError(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), "Upload Error",
- // "Upload of files to remote host failed.");
- // }
- // });
- // }
- return toReturn;
- }
+ private final ServiceLaunchingInformation serviceInfo;
+ private final TextDisplayHelper display;
+ private final ProgressBar progress;
+ private final Map<LabelEnum, Text> dataMap;
+ private boolean isUploadDirCreationAllowed;
+
+ public UploadRemoteFileJob(String name, ServiceLaunchingInformation serviceInfo, TextDisplayHelper display, ProgressBar progress, Map<LabelEnum, Text> dataMap) {
+ super(name);
+ if (serviceInfo == null) {
+ throw new IllegalArgumentException("serviceInfo can not be null");
+ }
+ if (display == null) {
+ throw new IllegalArgumentException("display can not be null");
+ }
+ if (progress == null) {
+ throw new IllegalArgumentException("progress can not be null");
+ }
+ this.serviceInfo = serviceInfo;
+ this.display = display;
+ this.progress = progress;
+ this.dataMap = dataMap;
+ this.isUploadDirCreationAllowed = false;
+ progress.setSelection(0);
+ progress.setMaximum(0);
+ progress.setMaximum(5);
+ }
+
+ private void incrementProgress(final int increment) {
+ Displays.ensureInDisplayThread(new Runnable() {
+ @Override
+ public void run() {
+ int position = progress.getSelection();
+ progress.setSelection(position + increment);
+ }
+ });
+ }
+
+ private void displayInitMessage(File zipLocation) {
+ display.clear();
+ display.addText("\t\t ----------- Unzip -------------\n\n", SWT.BOLD, SWT.COLOR_BLACK, false);
+ display.addText("\tFrom Location: ", SWT.BOLD, SWT.COLOR_DARK_BLUE, true);
+ display.addText(String.format("\t%s\n", zipLocation.getAbsolutePath()), SWT.NORMAL, SWT.COLOR_BLACK, false);
+ display.addText("\tTo Location: ", SWT.BOLD, SWT.COLOR_DARK_BLUE, true);
+ display.addText(String.format("\t%s://%s\n", serviceInfo.getSelectedHost(), serviceInfo.getUnzipLocation()),
+ SWT.NORMAL, SWT.COLOR_BLACK, false);
+ }
+
+ private ChannelSftp getScpConnection() throws Exception {
+ display.addText("\n\tStarting SCP...", SWT.NORMAL, SWT.COLOR_BLACK, false);
+ ChannelSftp sftp = this.serviceInfo.getSSHConnection().getScpConnection();
+ incrementProgress(1);
+ return sftp;
+ }
+
+ private void createRemotePathOrCdIntoIt(IProgressMonitor monitor, ChannelSftp sftp) throws Exception {
+ if (monitor.isCanceled() != true) {
+ try {
+ sftp.cd(serviceInfo.getUnzipLocation());
+ } catch (SftpException ex1) {
+ this.isUploadDirCreationAllowed = false;
+ Displays.pendInDisplayThread(new Runnable() {
+ @Override
+ public void run() {
+ Shell shell = Displays.getActiveShell();
+ isUploadDirCreationAllowed =
+ MessageDialog.openQuestion(shell, "Scp",
+ "Unable to find remote path. Would you like to create it?");
+ }
+ });
+
+ if (isUploadDirCreationAllowed == true) {
+ try {
+ sftp.mkdir(serviceInfo.getUnzipLocation());
+ } catch (SftpException ex2) {
+ throw new Exception("Unable to create remote path.");
+ }
+ } else {
+ throw new Exception("Unable to find remote path - user selected not to create it.");
+ }
+
+ } finally {
+ incrementProgress(1);
+ }
+ }
+ }
+
+ private void uploadFile(IProgressMonitor monitor, ChannelSftp sftp, File fileToUpload) throws Exception {
+ if (monitor.isCanceled() != true) {
+ display.addText(String.format("\n\tUploading [%s]", fileToUpload.getAbsolutePath()), SWT.NORMAL,
+ SWT.COLOR_BLACK, false);
+ InputStream input = null;
+ OutputStream output = null;
+ try {
+ input = new FileInputStream(fileToUpload);
+ output = sftp.put(fileToUpload.getName());
+ byte[] buffer = new byte[1024];
+ int count = -1;
+ while ((count = input.read(buffer)) != -1) {
+ output.write(buffer, 0, count);
+ }
+ display.addText(String.format("\n\tTransferred [%s] bytes", fileToUpload.length()), SWT.NORMAL,
+ SWT.COLOR_BLACK, false);
+ } catch (SftpException ex1) {
+ throw new Exception("Error uploading file.");
+ } finally {
+ incrementProgress(1);
+ if (input != null) {
+ input.close();
+ }
+ if (output != null) {
+ output.close();
+ }
+ }
+ }
+ }
+
+ private void unzipRemoteFiles(IProgressMonitor monitor) throws Exception {
+ if (monitor.isCanceled() != true) {
+ String toExec =
+ String.format("cd %s\nunzip -o %s", serviceInfo.getUnzipLocation(),
+ serviceInfo.getServiceItem().getZipName());
+
+ display.addText("\n\tUnzip Cmd: ", SWT.BOLD, SWT.COLOR_DARK_BLUE, true);
+ display.addText("\t" + toExec.split("\n")[1] + "\n", SWT.NORMAL, SWT.COLOR_BLACK, false);
+
+ String output = this.serviceInfo.getSSHConnection().executeCommandList(toExec.split("\n"));
+ display.addText("\n\t" + output + "\n", SWT.NORMAL, SWT.COLOR_BLACK, false);
+ incrementProgress(1);
+ }
+ }
+
+ public File getFile(Bundle bundle, String path) throws FileNotFoundException, IOException {
+ URL url = bundle.getEntry(path);
+ if (url == null) {
+ throw new FileNotFoundException("Could not locate the file " + path);
+ }
+ try {
+ url = FileLocator.toFileURL(url);
+ File file = new File(url.getFile());
+ return file;
+ } catch (Throwable e) {
+ throw new IOException("Invalid URL format for the URL " + url.toString(), e);
+ }
+ }
+
+ @Override
+ public IStatus run(IProgressMonitor monitor) {
+ IStatus toReturn = Status.OK_STATUS;
+ ChannelSftp sftp = null;
+ try {
+ Displays.pendInDisplayThread(new Runnable() {
+ @Override
+ public void run() {
+ serviceInfo.setUnzipLocation(dataMap.get(LabelEnum.Host_Upload_Location).getText());
+ }
+ });
+ Bundle bundle = Platform.getBundle(serviceInfo.getServiceItem().getPlugin());
+ File zipLocation = getFile(bundle, serviceInfo.getServiceItem().getZipName());
+
+ displayInitMessage(zipLocation);
+
+ sftp = getScpConnection();
+
+ createRemotePathOrCdIntoIt(monitor, sftp);
+
+ uploadFile(monitor, sftp, zipLocation);
+
+ unzipRemoteFiles(monitor);
+
+ } catch (Exception ex) {
+ display.addText(String.format("\n\t%s\n\n", ex.getLocalizedMessage()), SWT.NORMAL, SWT.COLOR_RED, false);
+ toReturn = new Status(Status.ERROR, ControlPlugin.PLUGIN_PREFERENCE_SCOPE, "Error during upload.", ex);
+ } finally {
+ incrementProgress(5);
+ if (sftp != null) {
+ sftp.exit();
+ sftp.disconnect();
+ }
+ }
+
+ // incrementProgress(1);
+ // if (true != createDestinationFolder()) {
+ // incrementProgress(4);
+ // toReturn = Status.CANCEL_STATUS;
+ // } else {
+
+ // if (true != toReturn.equals(Status.OK_STATUS)) {
+ // PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() {
+ // public void run() {
+ // MessageDialog.openError(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), "Upload Error",
+ // "Upload of files to remote host failed.");
+ // }
+ // });
+ // }
+ return toReturn;
+ }
}
diff --git a/plugins/org.eclipse.osee.framework.ui.service.control/src/org/eclipse/osee/framework/ui/service/control/widgets/LookupViewer.java b/plugins/org.eclipse.osee.framework.ui.service.control/src/org/eclipse/osee/framework/ui/service/control/widgets/LookupViewer.java
index 43247b475e..f07005ddfe 100644
--- a/plugins/org.eclipse.osee.framework.ui.service.control/src/org/eclipse/osee/framework/ui/service/control/widgets/LookupViewer.java
+++ b/plugins/org.eclipse.osee.framework.ui.service.control/src/org/eclipse/osee/framework/ui/service/control/widgets/LookupViewer.java
@@ -23,13 +23,13 @@ import org.eclipse.jface.viewers.ViewerSorter;
import org.eclipse.osee.framework.ui.service.control.ServiceControlImage;
import org.eclipse.osee.framework.ui.service.control.renderer.IRenderer;
import org.eclipse.osee.framework.ui.service.control.renderer.ReggieItemHandler;
+import org.eclipse.osee.framework.ui.swt.Displays;
import org.eclipse.osee.framework.ui.swt.ImageManager;
import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Table;
import org.eclipse.swt.widgets.TableItem;
@@ -38,106 +38,108 @@ import org.eclipse.swt.widgets.TableItem;
*/
public class LookupViewer extends Composite {
- private static final Image LOOK_UP_IMAGE = ImageManager.getImage(ServiceControlImage.CONNECTION);//ControlPlugin.getInstance().getImage("connection.gif");
- private static final Image DISCONNECTED_IMAGE = ImageManager.getImage(ServiceControlImage.DISCONNECTED);//ControlPlugin.getInstance().getImage("disconnected.gif");
-
- private StructuredViewer viewer;
- private Map<ServiceID, IRenderer> handlerMap;
-
- public LookupViewer(Composite parent, int style) {
- super(parent, style);
- createControl();
- }
-
- private void createControl() {
- this.setLayout(new GridLayout());
- this.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
-
- viewer = new TableViewer(this, SWT.SINGLE | SWT.READ_ONLY | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER);
- viewer.getControl().setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
- viewer.setLabelProvider(new ListLabelProvider());
- viewer.setContentProvider(new ArrayContentProvider());
- viewer.setSorter(new ViewerSorter());
- viewer.setInput(new String[0]);
- }
-
- public void refresh() {
- Display.getDefault().asyncExec(new Runnable() {
- public void run() {
- viewer.refresh();
- }
- });
- }
-
- public void setSelection(final String serviceId) {
- Display.getDefault().asyncExec(new Runnable() {
- public void run() {
- Table table = ((TableViewer) viewer).getTable();
- TableItem[] items = table.getItems();
- for (TableItem item : items) {
- Object object = item.getData();
- if (object instanceof ServiceRegistrar) {
- if (((ServiceRegistrar) object).getServiceID().toString().equals(serviceId)) {
- table.setSelection(new TableItem[] {item});
- return;
- }
- }
- }
- }
- });
- }
-
- public StructuredViewer getViewer() {
- return viewer;
- }
-
- public void setInput(Collection<?> input) {
- viewer.setInput(input);
- }
-
- public void setRendererMap(Map<ServiceID, IRenderer> map) {
- this.handlerMap = map;
- }
-
- public IRenderer getRenderer(ServiceID serviceId) {
- if (handlerMap != null) {
- return handlerMap.get(serviceId);
- } else {
- return null;
- }
- }
-
- private class ListLabelProvider extends LabelProvider {
-
- @Override
- public Image getImage(Object element) {
- if (element instanceof ServiceRegistrar) {
- if (ReggieItemHandler.isAllowed((ServiceRegistrar) element)) {
- return LOOK_UP_IMAGE;
- } else {
- return DISCONNECTED_IMAGE;
- }
- }
- return null;
- }
-
- @Override
- public String getText(Object element) {
- if (element instanceof ServiceRegistrar) {
- ServiceRegistrar reggie = (ServiceRegistrar) element;
- try {
- return " Jini Lookup: " + reggie.getLocator().getHost() + " : " + reggie.getLocator().getPort();
- } catch (RemoteException ex) {
- ex.printStackTrace();
- return "Jini Lookup: " + "UNABLE TO LOCATE";
- }
- }
- return "";
- }
- }
-
- @Override
- public void dispose() {
- viewer.getControl().dispose();
- }
+ private static final Image LOOK_UP_IMAGE = ImageManager.getImage(ServiceControlImage.CONNECTION);//ControlPlugin.getInstance().getImage("connection.gif");
+ private static final Image DISCONNECTED_IMAGE = ImageManager.getImage(ServiceControlImage.DISCONNECTED);//ControlPlugin.getInstance().getImage("disconnected.gif");
+
+ private StructuredViewer viewer;
+ private Map<ServiceID, IRenderer> handlerMap;
+
+ public LookupViewer(Composite parent, int style) {
+ super(parent, style);
+ createControl();
+ }
+
+ private void createControl() {
+ this.setLayout(new GridLayout());
+ this.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
+
+ viewer = new TableViewer(this, SWT.SINGLE | SWT.READ_ONLY | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER);
+ viewer.getControl().setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
+ viewer.setLabelProvider(new ListLabelProvider());
+ viewer.setContentProvider(new ArrayContentProvider());
+ viewer.setSorter(new ViewerSorter());
+ viewer.setInput(new String[0]);
+ }
+
+ public void refresh() {
+ Displays.ensureInDisplayThread(new Runnable() {
+ @Override
+ public void run() {
+ viewer.refresh();
+ }
+ });
+ }
+
+ public void setSelection(final String serviceId) {
+ Displays.ensureInDisplayThread(new Runnable() {
+ @Override
+ public void run() {
+ Table table = ((TableViewer) viewer).getTable();
+ TableItem[] items = table.getItems();
+ for (TableItem item : items) {
+ Object object = item.getData();
+ if (object instanceof ServiceRegistrar) {
+ if (((ServiceRegistrar) object).getServiceID().toString().equals(serviceId)) {
+ table.setSelection(new TableItem[] {item});
+ return;
+ }
+ }
+ }
+ }
+ });
+ }
+
+ public StructuredViewer getViewer() {
+ return viewer;
+ }
+
+ public void setInput(Collection<?> input) {
+ viewer.setInput(input);
+ }
+
+ public void setRendererMap(Map<ServiceID, IRenderer> map) {
+ this.handlerMap = map;
+ }
+
+ public IRenderer getRenderer(ServiceID serviceId) {
+ if (handlerMap != null) {
+ return handlerMap.get(serviceId);
+ } else {
+ return null;
+ }
+ }
+
+ private class ListLabelProvider extends LabelProvider {
+
+ @Override
+ public Image getImage(Object element) {
+ if (element instanceof ServiceRegistrar) {
+ if (ReggieItemHandler.isAllowed((ServiceRegistrar) element)) {
+ return LOOK_UP_IMAGE;
+ } else {
+ return DISCONNECTED_IMAGE;
+ }
+ }
+ return null;
+ }
+
+ @Override
+ public String getText(Object element) {
+ if (element instanceof ServiceRegistrar) {
+ ServiceRegistrar reggie = (ServiceRegistrar) element;
+ try {
+ return " Jini Lookup: " + reggie.getLocator().getHost() + " : " + reggie.getLocator().getPort();
+ } catch (RemoteException ex) {
+ ex.printStackTrace();
+ return "Jini Lookup: " + "UNABLE TO LOCATE";
+ }
+ }
+ return "";
+ }
+ }
+
+ @Override
+ public void dispose() {
+ viewer.getControl().dispose();
+ }
} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.framework.ui.service.control/src/org/eclipse/osee/framework/ui/service/control/widgets/ServicesViewer.java b/plugins/org.eclipse.osee.framework.ui.service.control/src/org/eclipse/osee/framework/ui/service/control/widgets/ServicesViewer.java
index a13ddb49df..2cc3bd0a39 100644
--- a/plugins/org.eclipse.osee.framework.ui.service.control/src/org/eclipse/osee/framework/ui/service/control/widgets/ServicesViewer.java
+++ b/plugins/org.eclipse.osee.framework.ui.service.control/src/org/eclipse/osee/framework/ui/service/control/widgets/ServicesViewer.java
@@ -30,13 +30,13 @@ import org.eclipse.osee.framework.ui.service.control.data.CategoryParent;
import org.eclipse.osee.framework.ui.service.control.data.GroupParent;
import org.eclipse.osee.framework.ui.service.control.data.ServiceNode;
import org.eclipse.osee.framework.ui.service.control.managers.ConnectionManager;
+import org.eclipse.osee.framework.ui.swt.Displays;
import org.eclipse.osee.framework.ui.swt.ImageManager;
import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
import org.eclipse.ui.ISharedImages;
import org.eclipse.ui.PlatformUI;
@@ -45,158 +45,159 @@ import org.eclipse.ui.PlatformUI;
*/
public class ServicesViewer extends Composite {
- private static final Image CONFIG_IMAGE = ImageManager.getImage(ServiceControlImage.CONFIG);
- private static final Image FOLDER_IMAGE =
- PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_OBJ_FOLDER);
- private static final Image GROUP_IMAGE = ImageManager.getImage(ServiceControlImage.GROUP);
- private static final Image CONNECT_FOLDER_IMAGE = ImageManager.getImage(ServiceControlImage.CONNECT_FOLDER);
- private static final Image CONNECTED_IMAGE = ImageManager.getImage(ServiceControlImage.CONNECTED_PLUG);
-
- private StructuredViewer viewer;
- private final Map<Class<?>, Image> serviceIconMap;
-
- public ServicesViewer(Composite parent, int style) {
- super(parent, style);
- create();
- serviceIconMap = new HashMap<Class<?>, Image>();
- }
-
- private void create() {
- this.setLayout(new GridLayout());
- this.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
- createTreeArea(this);
- }
-
- private void createTreeArea(Composite parent) {
- viewer = new TreeViewer(parent, SWT.SINGLE | SWT.READ_ONLY | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER);
- viewer.getControl().setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
- viewer.setContentProvider(new TreeContentProvider());
- viewer.setLabelProvider(new TreeLabelProvider());
- viewer.setSorter(new ViewerSorter());
- viewer.setInput(new ArrayList<String>());
- viewer.getControl().setBackground(Display.getDefault().getSystemColor(SWT.COLOR_WHITE));
- }
-
- private class TreeLabelProvider extends LabelProvider {
-
- @Override
- public Image getImage(Object obj) {
- Image toReturn = null;
- if (obj instanceof GroupParent) {
- toReturn = GROUP_IMAGE;
- } else if (obj instanceof CategoryParent) {
- toReturn = FOLDER_IMAGE;
- CategoryParent categoryParent = (CategoryParent) obj;
- if (categoryParent.hasChildren()) {
- Object child = categoryParent.getChildren()[0];
- if (child instanceof ServiceNode) {
- ServiceNode serviceNode = (ServiceNode) child;
- if (ConnectionManager.getInstance().isAllowedConnectionType(serviceNode.getServiceItem())) {
- toReturn = CONNECT_FOLDER_IMAGE;
- }
- }
- }
- } else if (obj instanceof ServiceNode) {
- ServiceNode node = (ServiceNode) obj;
- if (node.isConnected()) {
- toReturn = CONNECTED_IMAGE;
- } else {
- toReturn = CONFIG_IMAGE;
- ServiceItem serviceItem = node.getServiceItem();
- for (Class<?> classType : serviceIconMap.keySet()) {
- if (classType.isInstance(serviceItem.service)) {
- Image image = serviceIconMap.get(classType);
- if (image != null) {
- toReturn = image;
- }
- break;
- }
- }
- }
- }
- return toReturn;
- }
-
- @Override
- public String getText(Object obj) {
- return obj.toString();
- }
- }
-
- private class TreeContentProvider implements ITreeContentProvider {
-
- public void dispose() {
- }
-
- public Object[] getChildren(Object parentElement) {
- if (parentElement != null && parentElement instanceof TreeParent) {
- TreeParent parent = (TreeParent) parentElement;
- if (parent.hasChildren()) {
- return parent.getChildren();
- }
- }
- return new Object[0];
- }
-
- public Object[] getElements(Object inputElement) {
- if (inputElement != null && inputElement instanceof Collection<?>) {
- Collection<?> elementArray = (Collection<?>) inputElement;
- return elementArray.toArray();
- }
- return new Object[0];
- }
-
- public Object getParent(Object element) {
- if (element != null && element instanceof TreeObject) {
- TreeObject child = (TreeObject) element;
- return child.getParent();
- }
- return new Object();
- }
-
- public boolean hasChildren(Object element) {
- if (element instanceof TreeParent) {
- TreeParent parent = (TreeParent) element;
- return parent.hasChildren();
- }
- return false;
- }
-
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
- }
- }
-
- @Override
- public boolean setFocus() {
- return this.viewer.getControl().setFocus();
- }
-
- public StructuredViewer getViewer() {
- return viewer;
- }
-
- public void setInput(List<TreeParent> input) {
- viewer.setInput(input);
- }
-
- public void refresh() {
- Display.getDefault().asyncExec(new Runnable() {
- public void run() {
- if (viewer != null && !viewer.getControl().isDisposed()) {
- viewer.refresh();
- }
- }
- });
- }
-
- @Override
- public void dispose() {
- viewer.getControl().dispose();
- super.dispose();
- }
-
- public void registerImage(Class<?> serviceType, ImageDescriptor icon) {
- serviceIconMap.put(serviceType, icon.createImage());
- }
+ private static final Image CONFIG_IMAGE = ImageManager.getImage(ServiceControlImage.CONFIG);
+ private static final Image FOLDER_IMAGE = PlatformUI.getWorkbench().getSharedImages().getImage(
+ ISharedImages.IMG_OBJ_FOLDER);
+ private static final Image GROUP_IMAGE = ImageManager.getImage(ServiceControlImage.GROUP);
+ private static final Image CONNECT_FOLDER_IMAGE = ImageManager.getImage(ServiceControlImage.CONNECT_FOLDER);
+ private static final Image CONNECTED_IMAGE = ImageManager.getImage(ServiceControlImage.CONNECTED_PLUG);
+
+ private StructuredViewer viewer;
+ private final Map<Class<?>, Image> serviceIconMap;
+
+ public ServicesViewer(Composite parent, int style) {
+ super(parent, style);
+ create();
+ serviceIconMap = new HashMap<Class<?>, Image>();
+ }
+
+ private void create() {
+ this.setLayout(new GridLayout());
+ this.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
+ createTreeArea(this);
+ }
+
+ private void createTreeArea(Composite parent) {
+ viewer = new TreeViewer(parent, SWT.SINGLE | SWT.READ_ONLY | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER);
+ viewer.getControl().setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
+ viewer.setContentProvider(new TreeContentProvider());
+ viewer.setLabelProvider(new TreeLabelProvider());
+ viewer.setSorter(new ViewerSorter());
+ viewer.setInput(new ArrayList<String>());
+ viewer.getControl().setBackground(Displays.getSystemColor(SWT.COLOR_WHITE));
+ }
+
+ private class TreeLabelProvider extends LabelProvider {
+
+ @Override
+ public Image getImage(Object obj) {
+ Image toReturn = null;
+ if (obj instanceof GroupParent) {
+ toReturn = GROUP_IMAGE;
+ } else if (obj instanceof CategoryParent) {
+ toReturn = FOLDER_IMAGE;
+ CategoryParent categoryParent = (CategoryParent) obj;
+ if (categoryParent.hasChildren()) {
+ Object child = categoryParent.getChildren()[0];
+ if (child instanceof ServiceNode) {
+ ServiceNode serviceNode = (ServiceNode) child;
+ if (ConnectionManager.getInstance().isAllowedConnectionType(serviceNode.getServiceItem())) {
+ toReturn = CONNECT_FOLDER_IMAGE;
+ }
+ }
+ }
+ } else if (obj instanceof ServiceNode) {
+ ServiceNode node = (ServiceNode) obj;
+ if (node.isConnected()) {
+ toReturn = CONNECTED_IMAGE;
+ } else {
+ toReturn = CONFIG_IMAGE;
+ ServiceItem serviceItem = node.getServiceItem();
+ for (Class<?> classType : serviceIconMap.keySet()) {
+ if (classType.isInstance(serviceItem.service)) {
+ Image image = serviceIconMap.get(classType);
+ if (image != null) {
+ toReturn = image;
+ }
+ break;
+ }
+ }
+ }
+ }
+ return toReturn;
+ }
+
+ @Override
+ public String getText(Object obj) {
+ return obj.toString();
+ }
+ }
+
+ private class TreeContentProvider implements ITreeContentProvider {
+
+ public void dispose() {
+ }
+
+ public Object[] getChildren(Object parentElement) {
+ if (parentElement != null && parentElement instanceof TreeParent) {
+ TreeParent parent = (TreeParent) parentElement;
+ if (parent.hasChildren()) {
+ return parent.getChildren();
+ }
+ }
+ return new Object[0];
+ }
+
+ public Object[] getElements(Object inputElement) {
+ if (inputElement != null && inputElement instanceof Collection<?>) {
+ Collection<?> elementArray = (Collection<?>) inputElement;
+ return elementArray.toArray();
+ }
+ return new Object[0];
+ }
+
+ public Object getParent(Object element) {
+ if (element != null && element instanceof TreeObject) {
+ TreeObject child = (TreeObject) element;
+ return child.getParent();
+ }
+ return new Object();
+ }
+
+ public boolean hasChildren(Object element) {
+ if (element instanceof TreeParent) {
+ TreeParent parent = (TreeParent) element;
+ return parent.hasChildren();
+ }
+ return false;
+ }
+
+ public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
+ }
+ }
+
+ @Override
+ public boolean setFocus() {
+ return this.viewer.getControl().setFocus();
+ }
+
+ public StructuredViewer getViewer() {
+ return viewer;
+ }
+
+ public void setInput(List<TreeParent> input) {
+ viewer.setInput(input);
+ }
+
+ public void refresh() {
+ Displays.ensureInDisplayThread(new Runnable() {
+ @Override
+ public void run() {
+ if (viewer != null && !viewer.getControl().isDisposed()) {
+ viewer.refresh();
+ }
+ }
+ });
+ }
+
+ @Override
+ public void dispose() {
+ viewer.getControl().dispose();
+ super.dispose();
+ }
+
+ public void registerImage(Class<?> serviceType, ImageDescriptor icon) {
+ serviceIconMap.put(serviceType, icon.createImage());
+ }
}
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet.test/src/org/eclipse/osee/framework/ui/skynet/test/cases/ArtifactPasteOperationTest.java b/plugins/org.eclipse.osee.framework.ui.skynet.test/src/org/eclipse/osee/framework/ui/skynet/test/cases/ArtifactPasteOperationTest.java
index 8667aae1da..82ed90df11 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet.test/src/org/eclipse/osee/framework/ui/skynet/test/cases/ArtifactPasteOperationTest.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet.test/src/org/eclipse/osee/framework/ui/skynet/test/cases/ArtifactPasteOperationTest.java
@@ -14,7 +14,6 @@ import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Map.Entry;
-import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.osee.framework.core.enums.CoreArtifactTypes;
import org.eclipse.osee.framework.core.enums.CoreRelationTypes;
@@ -46,200 +45,200 @@ import org.junit.Test;
*/
public class ArtifactPasteOperationTest {
- private static Artifact parent1;
-
- private static Artifact child1;
- private static Artifact child2;
- private static Artifact child3;
- private static Artifact destination;
- private static RelationOrderFactory relationOrderFactory;
-
- @BeforeClass
- public static void setup() throws OseeCoreException {
- List<Artifact> emptyList = Collections.emptyList();
- relationOrderFactory = new RelationOrderFactory();
-
- Branch branch = BranchManager.getCommonBranch();
- parent1 = ArtifactTypeManager.addArtifact(CoreArtifactTypes.Folder, branch, "Parent");
-
- child1 = ArtifactTypeManager.addArtifact(CoreArtifactTypes.Folder, branch, "child_a");
- child1.setRelationOrder(CoreRelationTypes.Default_Hierarchical__Child, emptyList);
-
- child2 = ArtifactTypeManager.addArtifact(CoreArtifactTypes.Folder, branch, "child_b");
- child3 = ArtifactTypeManager.addArtifact(CoreArtifactTypes.Folder, branch, "child_c");
-
- parent1.setRelationOrder(CoreRelationTypes.Default_Hierarchical__Child, emptyList);
- parent1.addChild(child1);
- parent1.addChild(child3);
- parent1.addChild(child2);
-
- destination = ArtifactTypeManager.addArtifact(CoreArtifactTypes.Folder, branch, "Destination");
- destination.setRelationOrder(CoreRelationTypes.Default_Hierarchical__Child, emptyList);
- destination.addChild(parent1);
- }
-
- @AfterClass
- public static void cleanup() throws OseeCoreException {
- delete(child1);
- delete(child2);
- delete(child3);
- delete(parent1);
- delete(destination);
- relationOrderFactory = null;
- }
-
- private static void delete(Artifact artifact) throws OseeCoreException {
- if (artifact != null) {
- artifact.deleteAndPersist();
- }
- }
-
- @Test
- public void testPasteArtifactNoChildren() throws Exception {
- String resolvedName = "Empty Parent First";
- try {
- performPaste(false, true, destination, Arrays.asList(parent1), resolvedName);
- checkPaste(destination, resolvedName, parent1, RelationOrderBaseTypes.USER_DEFINED);
- } finally {
- Artifact toDelete = destination.getChild(resolvedName);
- delete(toDelete);
- }
- }
-
- @Test
- public void testPasteArtifactFolderThenAddChild() throws Exception {
- String resolvedName = "Parent No Children";
- try {
- performPaste(false, true, destination, Arrays.asList(parent1), resolvedName);
- checkPaste(destination, resolvedName, parent1, RelationOrderBaseTypes.USER_DEFINED);
-
- Artifact newArtifact = destination.getChild(resolvedName);
- performPaste(false, true, newArtifact, Arrays.asList(child1), null);
- checkPaste(newArtifact, child1.getName(), child1, RelationOrderBaseTypes.USER_DEFINED);
-
- } finally {
- Artifact toDelete = destination.getChild(resolvedName);
- delete(toDelete);
- }
-
- }
-
- @Test
- public void testPasteArtifactsWithChildren() throws Exception {
- String resolvedName = "Parent With Children";
- try {
- performPaste(true, true, destination, Arrays.asList(parent1), resolvedName);
- checkPaste(destination, resolvedName, parent1, RelationOrderBaseTypes.USER_DEFINED, "child_a", "child_c",
- "child_b");
- } finally {
- Artifact toDelete = destination.getChild(resolvedName);
- delete(toDelete);
- }
- }
-
- private void checkPaste(Artifact destination, String expectedChild, Artifact copiedArtifact, RelationOrderBaseTypes expectedOrderType, String... names) throws OseeCoreException {
- Artifact newArtifact = destination.getChild(expectedChild);
- Assert.assertNotNull(newArtifact);
- Assert.assertTrue(!copiedArtifact.getGuid().equals(newArtifact.getGuid()));
-
- boolean hasChildren = names != null && names.length > 0;
-
- List<Artifact> childArtifacts = newArtifact.getChildren();
-
- Assert.assertEquals(hasChildren, !childArtifacts.isEmpty());
- if (hasChildren) {
- Assert.assertEquals(names.length, childArtifacts.size());
-
- List<Artifact> sourceChildren = parent1.getChildren();
- List<String> guids = Artifacts.toGuids(sourceChildren);
- for (int index = 0; index < names.length; index++) {
- IArtifact childArtifact = childArtifacts.get(index);
- Assert.assertEquals(names[index], childArtifact.getName());
- Assert.assertTrue(!guids.contains(childArtifact.getGuid()));
- }
- } else {
- Assert.assertTrue(childArtifacts.isEmpty());
- }
- checkRelationOrder(newArtifact, expectedOrderType, hasChildren);
- checkRelationOrder(destination, RelationOrderBaseTypes.USER_DEFINED, true);
- }
-
- private void checkRelationOrder(Artifact artifactToCheck, RelationOrderBaseTypes expectedOrderType, boolean hasChildren) throws OseeCoreException {
- RelationOrderData data = relationOrderFactory.createRelationOrderData(artifactToCheck);
- Assert.assertEquals(1, data.size());
-
- List<Artifact> childArtifacts = artifactToCheck.getChildren();
- Assert.assertEquals(hasChildren, !childArtifacts.isEmpty());
- for (Entry<Pair<String, String>, Pair<String, List<String>>> entry : data.entrySet()) {
- String relationType = entry.getKey().getFirst();
- String relationSide = entry.getKey().getSecond();
- String orderGuid = entry.getValue().getFirst();
- List<String> guids = entry.getValue().getSecond();
-
- Assert.assertEquals(CoreRelationTypes.Default_Hierarchical__Child.getName(), relationType);
- Assert.assertEquals(RelationSide.SIDE_B.name(), relationSide);
- Assert.assertEquals(expectedOrderType.getGuid(), orderGuid);
- if (hasChildren && expectedOrderType == RelationOrderBaseTypes.USER_DEFINED) {
- Assert.assertEquals(childArtifacts.size(), guids.size());
- for (int index = 0; index < guids.size(); index++) {
- IArtifact orderedChild = childArtifacts.get(index);
- String guid = guids.get(index);
- Assert.assertEquals(orderedChild.getGuid(), guid);
- }
- } else {
- Assert.assertTrue(guids.isEmpty());
- }
- }
- }
-
- private void performPaste(boolean includeChildren, boolean pasteRelationOrder, Artifact destination, List<Artifact> itemsToCopy, String resolvedName) throws Exception {
- ArtifactPasteConfiguration config = new ArtifactPasteConfiguration();
- config.setIncludeChildrenOfCopiedElements(includeChildren);
- config.setKeepRelationOrderSettings(pasteRelationOrder);
-
- Assert.assertEquals(includeChildren, config.isIncludeChildrenOfCopiedElements());
- Assert.assertEquals(pasteRelationOrder, config.isKeepRelationOrderSettings());
-
- MockArtifactNameConflictHandler handler = new MockArtifactNameConflictHandler();
- handler.setResolveWith(resolvedName);
- handler.setConflictedArtifact(itemsToCopy.get(0));
-
- ArtifactPasteOperation op = new ArtifactPasteOperation(config, destination, itemsToCopy, handler);
- Operations.executeWorkAndCheckStatus(op, new NullProgressMonitor(), -1);
- }
-
- private final static class MockArtifactNameConflictHandler extends ArtifactNameConflictHandler {
-
- private String resolveWith;
- private IArtifact conflictedArtifact;
-
- public MockArtifactNameConflictHandler() {
- resolveWith = null;
- conflictedArtifact = null;
- }
-
- public void setConflictedArtifact(IArtifact conflictedArtifact) {
- this.conflictedArtifact = conflictedArtifact;
- }
-
- public IArtifact getConflictedArtifact() {
- return conflictedArtifact;
- }
-
- public void setResolveWith(String resolveWith) {
- this.resolveWith = resolveWith;
- }
-
- public String getResolveWith() {
- return resolveWith;
- }
-
- @Override
- public String resolve(IArtifact artifact) throws CoreException {
- Assert.assertNotNull(artifact);
- Assert.assertEquals(getConflictedArtifact(), artifact);
- return getResolveWith();
- }
-
- }
+ private static Artifact parent1;
+
+ private static Artifact child1;
+ private static Artifact child2;
+ private static Artifact child3;
+ private static Artifact destination;
+ private static RelationOrderFactory relationOrderFactory;
+
+ @BeforeClass
+ public static void setup() throws OseeCoreException {
+ List<Artifact> emptyList = Collections.emptyList();
+ relationOrderFactory = new RelationOrderFactory();
+
+ Branch branch = BranchManager.getCommonBranch();
+ parent1 = ArtifactTypeManager.addArtifact(CoreArtifactTypes.Folder, branch, "Parent");
+
+ child1 = ArtifactTypeManager.addArtifact(CoreArtifactTypes.Folder, branch, "child_a");
+ child1.setRelationOrder(CoreRelationTypes.Default_Hierarchical__Child, emptyList);
+
+ child2 = ArtifactTypeManager.addArtifact(CoreArtifactTypes.Folder, branch, "child_b");
+ child3 = ArtifactTypeManager.addArtifact(CoreArtifactTypes.Folder, branch, "child_c");
+
+ parent1.setRelationOrder(CoreRelationTypes.Default_Hierarchical__Child, emptyList);
+ parent1.addChild(child1);
+ parent1.addChild(child3);
+ parent1.addChild(child2);
+
+ destination = ArtifactTypeManager.addArtifact(CoreArtifactTypes.Folder, branch, "Destination");
+ destination.setRelationOrder(CoreRelationTypes.Default_Hierarchical__Child, emptyList);
+ destination.addChild(parent1);
+ }
+
+ @AfterClass
+ public static void cleanup() throws OseeCoreException {
+ delete(child1);
+ delete(child2);
+ delete(child3);
+ delete(parent1);
+ delete(destination);
+ relationOrderFactory = null;
+ }
+
+ private static void delete(Artifact artifact) throws OseeCoreException {
+ if (artifact != null) {
+ artifact.deleteAndPersist();
+ }
+ }
+
+ @Test
+ public void testPasteArtifactNoChildren() throws Exception {
+ String resolvedName = "Empty Parent First";
+ try {
+ performPaste(false, true, destination, Arrays.asList(parent1), resolvedName);
+ checkPaste(destination, resolvedName, parent1, RelationOrderBaseTypes.USER_DEFINED);
+ } finally {
+ Artifact toDelete = destination.getChild(resolvedName);
+ delete(toDelete);
+ }
+ }
+
+ @Test
+ public void testPasteArtifactFolderThenAddChild() throws Exception {
+ String resolvedName = "Parent No Children";
+ try {
+ performPaste(false, true, destination, Arrays.asList(parent1), resolvedName);
+ checkPaste(destination, resolvedName, parent1, RelationOrderBaseTypes.USER_DEFINED);
+
+ Artifact newArtifact = destination.getChild(resolvedName);
+ performPaste(false, true, newArtifact, Arrays.asList(child1), null);
+ checkPaste(newArtifact, child1.getName(), child1, RelationOrderBaseTypes.USER_DEFINED);
+
+ } finally {
+ Artifact toDelete = destination.getChild(resolvedName);
+ delete(toDelete);
+ }
+
+ }
+
+ @Test
+ public void testPasteArtifactsWithChildren() throws Exception {
+ String resolvedName = "Parent With Children";
+ try {
+ performPaste(true, true, destination, Arrays.asList(parent1), resolvedName);
+ checkPaste(destination, resolvedName, parent1, RelationOrderBaseTypes.USER_DEFINED, "child_a", "child_c",
+ "child_b");
+ } finally {
+ Artifact toDelete = destination.getChild(resolvedName);
+ delete(toDelete);
+ }
+ }
+
+ private void checkPaste(Artifact destination, String expectedChild, Artifact copiedArtifact, RelationOrderBaseTypes expectedOrderType, String... names) throws OseeCoreException {
+ Artifact newArtifact = destination.getChild(expectedChild);
+ Assert.assertNotNull(newArtifact);
+ Assert.assertTrue(!copiedArtifact.getGuid().equals(newArtifact.getGuid()));
+
+ boolean hasChildren = names != null && names.length > 0;
+
+ List<Artifact> childArtifacts = newArtifact.getChildren();
+
+ Assert.assertEquals(hasChildren, !childArtifacts.isEmpty());
+ if (hasChildren) {
+ Assert.assertEquals(names.length, childArtifacts.size());
+
+ List<Artifact> sourceChildren = parent1.getChildren();
+ List<String> guids = Artifacts.toGuids(sourceChildren);
+ for (int index = 0; index < names.length; index++) {
+ IArtifact childArtifact = childArtifacts.get(index);
+ Assert.assertEquals(names[index], childArtifact.getName());
+ Assert.assertTrue(!guids.contains(childArtifact.getGuid()));
+ }
+ } else {
+ Assert.assertTrue(childArtifacts.isEmpty());
+ }
+ checkRelationOrder(newArtifact, expectedOrderType, hasChildren);
+ checkRelationOrder(destination, RelationOrderBaseTypes.USER_DEFINED, true);
+ }
+
+ private void checkRelationOrder(Artifact artifactToCheck, RelationOrderBaseTypes expectedOrderType, boolean hasChildren) throws OseeCoreException {
+ RelationOrderData data = relationOrderFactory.createRelationOrderData(artifactToCheck);
+ Assert.assertEquals(1, data.size());
+
+ List<Artifact> childArtifacts = artifactToCheck.getChildren();
+ Assert.assertEquals(hasChildren, !childArtifacts.isEmpty());
+ for (Entry<Pair<String, String>, Pair<String, List<String>>> entry : data.entrySet()) {
+ String relationType = entry.getKey().getFirst();
+ String relationSide = entry.getKey().getSecond();
+ String orderGuid = entry.getValue().getFirst();
+ List<String> guids = entry.getValue().getSecond();
+
+ Assert.assertEquals(CoreRelationTypes.Default_Hierarchical__Child.getName(), relationType);
+ Assert.assertEquals(RelationSide.SIDE_B.name(), relationSide);
+ Assert.assertEquals(expectedOrderType.getGuid(), orderGuid);
+ if (hasChildren && expectedOrderType == RelationOrderBaseTypes.USER_DEFINED) {
+ Assert.assertEquals(childArtifacts.size(), guids.size());
+ for (int index = 0; index < guids.size(); index++) {
+ IArtifact orderedChild = childArtifacts.get(index);
+ String guid = guids.get(index);
+ Assert.assertEquals(orderedChild.getGuid(), guid);
+ }
+ } else {
+ Assert.assertTrue(guids.isEmpty());
+ }
+ }
+ }
+
+ private void performPaste(boolean includeChildren, boolean pasteRelationOrder, Artifact destination, List<Artifact> itemsToCopy, String resolvedName) throws Exception {
+ ArtifactPasteConfiguration config = new ArtifactPasteConfiguration();
+ config.setIncludeChildrenOfCopiedElements(includeChildren);
+ config.setKeepRelationOrderSettings(pasteRelationOrder);
+
+ Assert.assertEquals(includeChildren, config.isIncludeChildrenOfCopiedElements());
+ Assert.assertEquals(pasteRelationOrder, config.isKeepRelationOrderSettings());
+
+ MockArtifactNameConflictHandler handler = new MockArtifactNameConflictHandler();
+ handler.setResolveWith(resolvedName);
+ handler.setConflictedArtifact(itemsToCopy.get(0));
+
+ ArtifactPasteOperation op = new ArtifactPasteOperation(config, destination, itemsToCopy, handler);
+ Operations.executeWorkAndCheckStatus(op, new NullProgressMonitor(), -1);
+ }
+
+ private final static class MockArtifactNameConflictHandler extends ArtifactNameConflictHandler {
+
+ private String resolveWith;
+ private IArtifact conflictedArtifact;
+
+ public MockArtifactNameConflictHandler() {
+ resolveWith = null;
+ conflictedArtifact = null;
+ }
+
+ public void setConflictedArtifact(IArtifact conflictedArtifact) {
+ this.conflictedArtifact = conflictedArtifact;
+ }
+
+ public IArtifact getConflictedArtifact() {
+ return conflictedArtifact;
+ }
+
+ public void setResolveWith(String resolveWith) {
+ this.resolveWith = resolveWith;
+ }
+
+ public String getResolveWith() {
+ return resolveWith;
+ }
+
+ @Override
+ public String resolve(IArtifact artifact) {
+ Assert.assertNotNull(artifact);
+ Assert.assertEquals(getConflictedArtifact(), artifact);
+ return getResolveWith();
+ }
+
+ }
}
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/ArtifactExplorer.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/ArtifactExplorer.java
index a7ffc3453b..e667ba37fc 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/ArtifactExplorer.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/ArtifactExplorer.java
@@ -79,7 +79,6 @@ import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
import org.eclipse.osee.framework.skynet.core.utility.LoadedArtifacts;
import org.eclipse.osee.framework.ui.plugin.OseeUiActions;
import org.eclipse.osee.framework.ui.plugin.util.AWorkbench;
-import org.eclipse.osee.framework.ui.plugin.util.Displays;
import org.eclipse.osee.framework.ui.plugin.util.SelectionCountChangeListener;
import org.eclipse.osee.framework.ui.skynet.access.PolicyDialog;
import org.eclipse.osee.framework.ui.skynet.action.OpenAssociatedArtifactFromBranchProvider;
@@ -105,6 +104,7 @@ import org.eclipse.osee.framework.ui.skynet.util.SkynetViews;
import org.eclipse.osee.framework.ui.skynet.widgets.XBranchSelectWidget;
import org.eclipse.osee.framework.ui.skynet.widgets.dialog.ArtifactTypeFilteredTreeEntryDialog;
import org.eclipse.osee.framework.ui.skynet.widgets.xHistory.HistoryView;
+import org.eclipse.osee.framework.ui.swt.Displays;
import org.eclipse.osee.framework.ui.swt.ImageManager;
import org.eclipse.osee.framework.ui.swt.MenuItems;
import org.eclipse.osee.framework.ui.swt.TreeViewerUtility;
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/ArtifactExplorerEventManager.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/ArtifactExplorerEventManager.java
index 970fe74f63..63c7fef9d7 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/ArtifactExplorerEventManager.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/ArtifactExplorerEventManager.java
@@ -19,7 +19,7 @@ import org.eclipse.osee.framework.skynet.core.event2.artifact.EventBasicGuidArti
import org.eclipse.osee.framework.skynet.core.event2.artifact.EventModType;
import org.eclipse.osee.framework.skynet.core.event2.artifact.IArtifactEventListener;
import org.eclipse.osee.framework.skynet.core.event2.filter.IEventFilter;
-import org.eclipse.osee.framework.ui.plugin.util.Displays;
+import org.eclipse.osee.framework.ui.swt.Displays;
/**
* Common location for event handling for ArtifactExplorers in order to keep number of registrations and processing to a
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/DialogPopupLoggerListener.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/DialogPopupLoggerListener.java
index c8da4cfc48..d341e10e14 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/DialogPopupLoggerListener.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/DialogPopupLoggerListener.java
@@ -19,58 +19,58 @@ import org.eclipse.core.runtime.Status;
import org.eclipse.jface.dialogs.ErrorDialog;
import org.eclipse.osee.framework.logging.ILoggerListener;
import org.eclipse.osee.framework.logging.OseeLevel;
-import org.eclipse.swt.widgets.Display;
+import org.eclipse.osee.framework.ui.swt.Displays;
/**
* @author Andrew M. Finkbeiner
*/
public class DialogPopupLoggerListener implements ILoggerListener {
- @Override
- public void log(String loggerName, Level level, String message, Throwable th) {
- if (level == OseeLevel.SEVERE_POPUP) {
- String title = "OSEE Error";
- String messageText = message;
- String reasonMessage = "";
- if (th != null) {
- reasonMessage = th.getMessage();
- }
- final IStatus status;
- if (th != null) {
- List<IStatus> exc = new ArrayList<IStatus>();
- exceptionToString(true, loggerName, th, exc);
- status = new MultiStatus(loggerName, Status.ERROR, exc.toArray(new IStatus[exc.size()]), reasonMessage, th);
- } else {
- status = new Status(Status.ERROR, loggerName, -20, reasonMessage, th);
- }
- final String realTitle = title;
- final String realMessageText = messageText;
- Display.getDefault().syncExec(new Runnable() {
- @Override
- public void run() {
- ErrorDialog.openError(Display.getDefault().getActiveShell(), realTitle, realMessageText, status);
- }
- });
- }
- }
+ @Override
+ public void log(String loggerName, Level level, String message, Throwable th) {
+ if (level == OseeLevel.SEVERE_POPUP) {
+ String title = "OSEE Error";
+ String messageText = message;
+ String reasonMessage = "";
+ if (th != null) {
+ reasonMessage = th.getMessage();
+ }
+ final IStatus status;
+ if (th != null) {
+ List<IStatus> exc = new ArrayList<IStatus>();
+ exceptionToString(true, loggerName, th, exc);
+ status = new MultiStatus(loggerName, Status.ERROR, exc.toArray(new IStatus[exc.size()]), reasonMessage, th);
+ } else {
+ status = new Status(Status.ERROR, loggerName, -20, reasonMessage, th);
+ }
+ final String realTitle = title;
+ final String realMessageText = messageText;
+ Displays.pendInDisplayThread(new Runnable() {
+ @Override
+ public void run() {
+ ErrorDialog.openError(Displays.getActiveShell(), realTitle, realMessageText, status);
+ }
+ });
+ }
+ }
- private static void exceptionToString(boolean firstTime, String loggerName, Throwable ex, List<IStatus> exc) {
- if (ex == null) {
- return;
- }
- if (!firstTime) {
- exc.add(new Status(Status.ERROR, loggerName, ex.getMessage()));
- }
- StackTraceElement st[] = ex.getStackTrace();
- for (int i = 0; i < st.length; i++) {
- StackTraceElement ste = st[i];
- exc.add(new Status(Status.ERROR, loggerName, ste.toString()));
- }
- Throwable cause = ex.getCause();
- if (cause != null) {
- exc.add(new Status(Status.ERROR, loggerName, " caused by "));
- exceptionToString(false, loggerName, cause, exc);
- }
- }
+ private static void exceptionToString(boolean firstTime, String loggerName, Throwable ex, List<IStatus> exc) {
+ if (ex == null) {
+ return;
+ }
+ if (!firstTime) {
+ exc.add(new Status(Status.ERROR, loggerName, ex.getMessage()));
+ }
+ StackTraceElement st[] = ex.getStackTrace();
+ for (int i = 0; i < st.length; i++) {
+ StackTraceElement ste = st[i];
+ exc.add(new Status(Status.ERROR, loggerName, ste.toString()));
+ }
+ Throwable cause = ex.getCause();
+ if (cause != null) {
+ exc.add(new Status(Status.ERROR, loggerName, " caused by "));
+ exceptionToString(false, loggerName, cause, exc);
+ }
+ }
}
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/OseeContributionItem.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/OseeContributionItem.java
index c5d2fe4dbb..63a57e0a46 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/OseeContributionItem.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/OseeContributionItem.java
@@ -13,8 +13,8 @@ package org.eclipse.osee.framework.ui.skynet;
import org.eclipse.jface.action.IStatusLineManager;
import org.eclipse.osee.framework.ui.skynet.ats.IOseeAtsService;
import org.eclipse.osee.framework.ui.skynet.ats.OseeAts;
+import org.eclipse.osee.framework.ui.swt.Displays;
import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Display;
import org.eclipse.ui.part.IPageSite;
import org.eclipse.ui.part.MultiPageEditorPart;
import org.eclipse.ui.part.ViewPart;
@@ -25,71 +25,72 @@ import org.eclipse.ui.texteditor.StatusLineContributionItem;
*/
public abstract class OseeContributionItem extends StatusLineContributionItem {
- protected OseeContributionItem(String id) {
- this(id, 4);
- }
-
- protected OseeContributionItem(String id, int width) {
- super(id, true, width);
- }
-
- protected abstract String getEnabledToolTip();
-
- protected abstract String getDisabledToolTip();
-
- protected abstract Image getEnabledImage();
-
- protected abstract Image getDisabledImage();
-
- protected void updateStatus(final boolean isActive) {
- Display.getDefault().asyncExec(new Runnable() {
- public void run() {
- Image image = isActive ? getEnabledImage() : getDisabledImage();
- String toolTip = isActive ? getEnabledToolTip() : getDisabledToolTip();
-
- if (image != null) {
- setImage(image);
- }
- if (toolTip != null) {
- setToolTipText(toolTip);
- }
- }
- });
- }
-
- public static void addTo(IStatusLineManager manager) {
- OseeBuildTypeContributionItem.addTo(manager);
- ResServiceContributionItem.addTo(manager);
- IOseeAtsService atsService = OseeAts.getInstance();
- if (atsService != null && atsService.isAtsAdmin()) {
- AdminContributionItem.addTo(manager);
- }
- SkynetServiceContributionItem.addTo(manager);
- OseeServicesStatusContributionItem.addTo(manager);
- SessionContributionItem.addTo(manager);
- }
-
- public static void addTo(IPageSite pageSite, boolean update) {
- addTo(pageSite.getActionBars().getStatusLineManager());
-
- if (update) {
- pageSite.getActionBars().updateActionBars();
- }
- }
-
- public static void addTo(ViewPart view, boolean update) {
- addTo(view.getViewSite().getActionBars().getStatusLineManager());
-
- if (update) {
- view.getViewSite().getActionBars().updateActionBars();
- }
- }
-
- public static void addTo(MultiPageEditorPart editorPart, boolean update) {
- addTo(editorPart.getEditorSite().getActionBars().getStatusLineManager());
- if (update) {
- editorPart.getEditorSite().getActionBars().updateActionBars();
- }
- }
+ protected OseeContributionItem(String id) {
+ this(id, 4);
+ }
+
+ protected OseeContributionItem(String id, int width) {
+ super(id, true, width);
+ }
+
+ protected abstract String getEnabledToolTip();
+
+ protected abstract String getDisabledToolTip();
+
+ protected abstract Image getEnabledImage();
+
+ protected abstract Image getDisabledImage();
+
+ protected void updateStatus(final boolean isActive) {
+ Displays.ensureInDisplayThread(new Runnable() {
+ @Override
+ public void run() {
+ Image image = isActive ? getEnabledImage() : getDisabledImage();
+ String toolTip = isActive ? getEnabledToolTip() : getDisabledToolTip();
+
+ if (image != null) {
+ setImage(image);
+ }
+ if (toolTip != null) {
+ setToolTipText(toolTip);
+ }
+ }
+ });
+ }
+
+ public static void addTo(IStatusLineManager manager) {
+ OseeBuildTypeContributionItem.addTo(manager);
+ ResServiceContributionItem.addTo(manager);
+ IOseeAtsService atsService = OseeAts.getInstance();
+ if (atsService != null && atsService.isAtsAdmin()) {
+ AdminContributionItem.addTo(manager);
+ }
+ SkynetServiceContributionItem.addTo(manager);
+ OseeServicesStatusContributionItem.addTo(manager);
+ SessionContributionItem.addTo(manager);
+ }
+
+ public static void addTo(IPageSite pageSite, boolean update) {
+ addTo(pageSite.getActionBars().getStatusLineManager());
+
+ if (update) {
+ pageSite.getActionBars().updateActionBars();
+ }
+ }
+
+ public static void addTo(ViewPart view, boolean update) {
+ addTo(view.getViewSite().getActionBars().getStatusLineManager());
+
+ if (update) {
+ view.getViewSite().getActionBars().updateActionBars();
+ }
+ }
+
+ public static void addTo(MultiPageEditorPart editorPart, boolean update) {
+ addTo(editorPart.getEditorSite().getActionBars().getStatusLineManager());
+ if (update) {
+ editorPart.getEditorSite().getActionBars().updateActionBars();
+ }
+ }
}
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/OseeServicesStatusContributionItem.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/OseeServicesStatusContributionItem.java
index e7827932f4..d4383ec2c7 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/OseeServicesStatusContributionItem.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/OseeServicesStatusContributionItem.java
@@ -15,84 +15,84 @@ import org.eclipse.jface.action.IStatusLineManager;
import org.eclipse.osee.framework.logging.IHealthStatus;
import org.eclipse.osee.framework.logging.IStatusListener;
import org.eclipse.osee.framework.logging.OseeLog;
+import org.eclipse.osee.framework.ui.swt.Displays;
import org.eclipse.osee.framework.ui.swt.ImageManager;
import org.eclipse.osee.framework.ui.swt.OverlayImage;
import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Display;
/**
* @author Roberto E. Escobar
*/
public class OseeServicesStatusContributionItem extends OseeContributionItem implements IStatusListener {
- private static final String ID = "osee.service.status";
- private static final Image DISABLED_IMAGE =
- new OverlayImage(ImageManager.getImage(FrameworkImage.APPLICATION_SERVER),
- ImageManager.getImageDescriptor(FrameworkImage.SLASH_RED_OVERLAY)).createImage();
+ private static final String ID = "osee.service.status";
+ private static final Image DISABLED_IMAGE = new OverlayImage(
+ ImageManager.getImage(FrameworkImage.APPLICATION_SERVER),
+ ImageManager.getImageDescriptor(FrameworkImage.SLASH_RED_OVERLAY)).createImage();
- private static String errorMessage;
- private static String okMessage;
+ private static String errorMessage;
+ private static String okMessage;
- private OseeServicesStatusContributionItem() {
- super(ID);
- errorMessage = null;
- okMessage = null;
- updateStatus(true);
- OseeLog.register(this);
- }
+ private OseeServicesStatusContributionItem() {
+ super(ID);
+ errorMessage = null;
+ okMessage = null;
+ updateStatus(true);
+ OseeLog.register(this);
+ }
- @Override
- public void dispose() {
- OseeLog.deregister(this);
- super.dispose();
- }
+ @Override
+ public void dispose() {
+ OseeLog.deregister(this);
+ super.dispose();
+ }
- public static void addTo(IStatusLineManager manager) {
- boolean wasFound = false;
- for (IContributionItem item : manager.getItems()) {
- if (item instanceof OseeServicesStatusContributionItem) {
- wasFound = true;
- break;
- }
- }
- if (!wasFound) {
- manager.add(new OseeServicesStatusContributionItem());
- }
- }
+ public static void addTo(IStatusLineManager manager) {
+ boolean wasFound = false;
+ for (IContributionItem item : manager.getItems()) {
+ if (item instanceof OseeServicesStatusContributionItem) {
+ wasFound = true;
+ break;
+ }
+ }
+ if (!wasFound) {
+ manager.add(new OseeServicesStatusContributionItem());
+ }
+ }
- @Override
- protected Image getDisabledImage() {
- return DISABLED_IMAGE;
- }
+ @Override
+ protected Image getDisabledImage() {
+ return DISABLED_IMAGE;
+ }
- @Override
- protected String getDisabledToolTip() {
- return errorMessage;
- }
+ @Override
+ protected String getDisabledToolTip() {
+ return errorMessage;
+ }
- @Override
- protected Image getEnabledImage() {
- return ImageManager.getImage(FrameworkImage.APPLICATION_SERVER);
- }
+ @Override
+ protected Image getEnabledImage() {
+ return ImageManager.getImage(FrameworkImage.APPLICATION_SERVER);
+ }
- @Override
- protected String getEnabledToolTip() {
- return okMessage;
- }
+ @Override
+ protected String getEnabledToolTip() {
+ return okMessage;
+ }
- @Override
- public void onStatus(final IHealthStatus status) {
- Display.getDefault().asyncExec(new Runnable() {
- @Override
- public void run() {
- if (status.isOk()) {
- okMessage = status.getMessage();
- } else {
- Throwable error = status.getException();
- errorMessage = error != null ? error.getLocalizedMessage() : "Undefined Error";
- }
- updateStatus(status.isOk());
- }
- });
+ @Override
+ public void onStatus(final IHealthStatus status) {
+ Displays.ensureInDisplayThread(new Runnable() {
+ @Override
+ public void run() {
+ if (status.isOk()) {
+ okMessage = status.getMessage();
+ } else {
+ Throwable error = status.getException();
+ errorMessage = error != null ? error.getLocalizedMessage() : "Undefined Error";
+ }
+ updateStatus(status.isOk());
+ }
+ });
- }
+ }
}
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/OseeUiEarlyStartup.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/OseeUiEarlyStartup.java
index cebb2ab63d..3e33da6ef9 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/OseeUiEarlyStartup.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/OseeUiEarlyStartup.java
@@ -8,107 +8,108 @@
* Contributors:
* Boeing - initial API and implementation
*******************************************************************************/
-package org.eclipse.osee.framework.ui.skynet;
-
-import java.util.logging.Level;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.osee.framework.logging.OseeLog;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.IPartListener;
-import org.eclipse.ui.IPerspectiveDescriptor;
-import org.eclipse.ui.IPerspectiveListener;
-import org.eclipse.ui.IStartup;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.part.ViewPart;
-import org.osgi.framework.Bundle;
-
-/**
- * @author Ryan Schmitt
- */
-public class OseeUiEarlyStartup implements IStartup {
-
- @Override
- public void earlyStartup() {
- if (PlatformUI.isWorkbenchRunning()) {
- Display.getDefault().asyncExec(new Runnable() {
- public void run() {
- PlatformUI.getWorkbench().getActiveWorkbenchWindow().getPartService().addPartListener(
- new IPartListener() {
-
- @Override
- public void partActivated(IWorkbenchPart part) {
- // WorkspaceContributionItem.addToAllViews();
- if (part instanceof ViewPart) {
- WorkspaceContributionItem.addToViewpart((ViewPart) part);
- }
-
- }
-
- @Override
- public void partBroughtToTop(IWorkbenchPart part) {
- // WorkspaceContributionItem.addToAllViews();
- if (part instanceof ViewPart) {
- WorkspaceContributionItem.addToViewpart((ViewPart) part);
- }
-
- }
-
- @Override
- public void partClosed(IWorkbenchPart part) {
- }
-
- @Override
- public void partDeactivated(IWorkbenchPart part) {
- }
-
- @Override
- public void partOpened(IWorkbenchPart part) {
- // WorkspaceContributionItem.addToAllViews();
- if (part instanceof ViewPart) {
- WorkspaceContributionItem.addToViewpart((ViewPart) part);
- }
-
- }
-
- });
- PlatformUI.getWorkbench().getActiveWorkbenchWindow().addPerspectiveListener(new IPerspectiveListener() {
-
- @Override
- public void perspectiveActivated(IWorkbenchPage page, IPerspectiveDescriptor perspective) {
- // WorkspaceContributionItem.addToAllViews();
- if (page instanceof ViewPart) {
- WorkspaceContributionItem.addToViewpart((ViewPart) page);
- }
-
- }
-
- @Override
- public void perspectiveChanged(IWorkbenchPage page, IPerspectiveDescriptor perspective, String changeId) {
- // WorkspaceContributionItem.addToAllViews();
- if (page instanceof ViewPart) {
- WorkspaceContributionItem.addToViewpart((ViewPart) page);
- }
-
- }
-
- });
- }
- });
- startOseeTypes();
- }
- WorkspaceContributionItem.addToAllViews();
- }
-
- private void startOseeTypes() {
- try {
- Bundle bundle = Platform.getBundle("org.eclipse.osee.framework.types.bridge");
- if (bundle.getState() != Bundle.ACTIVE) {
- bundle.start();
- }
- } catch (Exception ex) {
- OseeLog.log(SkynetGuiPlugin.class, Level.SEVERE, ex);
- }
- }
-}
+package org.eclipse.osee.framework.ui.skynet;
+
+import java.util.logging.Level;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.osee.framework.logging.OseeLog;
+import org.eclipse.osee.framework.ui.swt.Displays;
+import org.eclipse.ui.IPartListener;
+import org.eclipse.ui.IPerspectiveDescriptor;
+import org.eclipse.ui.IPerspectiveListener;
+import org.eclipse.ui.IStartup;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.part.ViewPart;
+import org.osgi.framework.Bundle;
+
+/**
+ * @author Ryan Schmitt
+ */
+public class OseeUiEarlyStartup implements IStartup {
+
+ @Override
+ public void earlyStartup() {
+ if (PlatformUI.isWorkbenchRunning()) {
+ Displays.ensureInDisplayThread(new Runnable() {
+ @Override
+ public void run() {
+ PlatformUI.getWorkbench().getActiveWorkbenchWindow().getPartService().addPartListener(
+ new IPartListener() {
+
+ @Override
+ public void partActivated(IWorkbenchPart part) {
+ // WorkspaceContributionItem.addToAllViews();
+ if (part instanceof ViewPart) {
+ WorkspaceContributionItem.addToViewpart((ViewPart) part);
+ }
+
+ }
+
+ @Override
+ public void partBroughtToTop(IWorkbenchPart part) {
+ // WorkspaceContributionItem.addToAllViews();
+ if (part instanceof ViewPart) {
+ WorkspaceContributionItem.addToViewpart((ViewPart) part);
+ }
+
+ }
+
+ @Override
+ public void partClosed(IWorkbenchPart part) {
+ }
+
+ @Override
+ public void partDeactivated(IWorkbenchPart part) {
+ }
+
+ @Override
+ public void partOpened(IWorkbenchPart part) {
+ // WorkspaceContributionItem.addToAllViews();
+ if (part instanceof ViewPart) {
+ WorkspaceContributionItem.addToViewpart((ViewPart) part);
+ }
+
+ }
+
+ });
+ PlatformUI.getWorkbench().getActiveWorkbenchWindow().addPerspectiveListener(new IPerspectiveListener() {
+
+ @Override
+ public void perspectiveActivated(IWorkbenchPage page, IPerspectiveDescriptor perspective) {
+ // WorkspaceContributionItem.addToAllViews();
+ if (page instanceof ViewPart) {
+ WorkspaceContributionItem.addToViewpart((ViewPart) page);
+ }
+
+ }
+
+ @Override
+ public void perspectiveChanged(IWorkbenchPage page, IPerspectiveDescriptor perspective, String changeId) {
+ // WorkspaceContributionItem.addToAllViews();
+ if (page instanceof ViewPart) {
+ WorkspaceContributionItem.addToViewpart((ViewPart) page);
+ }
+
+ }
+
+ });
+ }
+ });
+ startOseeTypes();
+ }
+ WorkspaceContributionItem.addToAllViews();
+ }
+
+ private void startOseeTypes() {
+ try {
+ Bundle bundle = Platform.getBundle("org.eclipse.osee.framework.types.bridge");
+ if (bundle.getState() != Bundle.ACTIVE) {
+ bundle.start();
+ }
+ } catch (Exception ex) {
+ OseeLog.log(SkynetGuiPlugin.class, Level.SEVERE, ex);
+ }
+ }
+}
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/RelationsComposite.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/RelationsComposite.java
index 7b0dbd4cf3..dd0070caf5 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/RelationsComposite.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/RelationsComposite.java
@@ -47,12 +47,12 @@ import org.eclipse.osee.framework.skynet.core.event.Sender;
import org.eclipse.osee.framework.skynet.core.relation.RelationManager;
import org.eclipse.osee.framework.skynet.core.relation.RelationTypeSide;
import org.eclipse.osee.framework.skynet.core.relation.RelationTypeSideSorter;
-import org.eclipse.osee.framework.ui.plugin.util.Displays;
import org.eclipse.osee.framework.ui.skynet.artifact.massEditor.MassArtifactEditor;
import org.eclipse.osee.framework.ui.skynet.relation.explorer.RelationExplorerWindow;
import org.eclipse.osee.framework.ui.skynet.render.PresentationType;
import org.eclipse.osee.framework.ui.skynet.render.RendererManager;
import org.eclipse.osee.framework.ui.skynet.util.SkynetDragAndDrop;
+import org.eclipse.osee.framework.ui.swt.Displays;
import org.eclipse.osee.framework.ui.swt.IDirtiableEditor;
import org.eclipse.swt.SWT;
import org.eclipse.swt.dnd.DND;
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/ResServiceContributionItem.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/ResServiceContributionItem.java
index 9b15f7fc92..dd1e7419d2 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/ResServiceContributionItem.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/ResServiceContributionItem.java
@@ -18,7 +18,7 @@ import org.eclipse.osee.framework.skynet.core.event.OseeEventManager;
import org.eclipse.osee.framework.skynet.core.event.RemoteEventManager2;
import org.eclipse.osee.framework.skynet.core.event.RemoteEventServiceEventType;
import org.eclipse.osee.framework.skynet.core.event.Sender;
-import org.eclipse.osee.framework.ui.plugin.util.Displays;
+import org.eclipse.osee.framework.ui.swt.Displays;
import org.eclipse.osee.framework.ui.swt.ImageManager;
import org.eclipse.osee.framework.ui.swt.OverlayImage;
import org.eclipse.swt.graphics.Image;
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/SessionContributionItem.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/SessionContributionItem.java
index 39006907c9..6db8bfe57d 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/SessionContributionItem.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/SessionContributionItem.java
@@ -25,8 +25,8 @@ import org.eclipse.osee.framework.skynet.core.event.OseeEventManager;
import org.eclipse.osee.framework.skynet.core.event.Sender;
import org.eclipse.osee.framework.skynet.core.event2.AccessControlEvent;
import org.eclipse.osee.framework.skynet.core.utility.LoadedArtifacts;
-import org.eclipse.osee.framework.ui.plugin.util.Displays;
import org.eclipse.osee.framework.ui.skynet.dialogs.AuthenticationDialog;
+import org.eclipse.osee.framework.ui.swt.Displays;
import org.eclipse.osee.framework.ui.swt.ImageManager;
import org.eclipse.osee.framework.ui.swt.OverlayImage;
import org.eclipse.swt.graphics.Image;
@@ -76,8 +76,9 @@ public final class SessionContributionItem extends OseeContributionItem implemen
// oseeAuthentication.authenticate("", "", "", false);
// }
if (ClientSessionManager.isSessionValid()) {
- Display.getDefault().asyncExec(new Runnable() {
- public void run() {
+ Displays.ensureInDisplayThread(new Runnable() {
+ @Override
+ public void run() {
try {
AccessControlEvent event = new AccessControlEvent();
event.setEventType(AccessControlEventType.UserAuthenticated);
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/SkynetGuiPlugin.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/SkynetGuiPlugin.java
index cf2a4d75dc..0e7e6809f9 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/SkynetGuiPlugin.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/SkynetGuiPlugin.java
@@ -30,7 +30,7 @@ import org.eclipse.osee.framework.skynet.core.utility.DbUtil;
import org.eclipse.osee.framework.ui.plugin.OseeFormActivator;
import org.eclipse.osee.framework.ui.skynet.artifact.ArtifactSaveNotificationHandler;
import org.eclipse.osee.framework.ui.skynet.ats.IOseeAtsService;
-import org.eclipse.swt.widgets.Display;
+import org.eclipse.osee.framework.ui.swt.Displays;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchListener;
import org.eclipse.ui.PlatformUI;
@@ -39,159 +39,161 @@ import org.osgi.service.packageadmin.PackageAdmin;
import org.osgi.util.tracker.ServiceTracker;
public class SkynetGuiPlugin extends OseeFormActivator implements IBroadcastEventListener, IOseeDatabaseServiceProvider {
- private static SkynetGuiPlugin pluginInstance; // The shared instance.
- public static final String PLUGIN_ID = "org.eclipse.osee.framework.ui.skynet";
- public static final String CHANGE_REPORT_ATTRIBUTES_PREF =
- "org.eclipse.osee.framework.ui.skynet.changeReportAttributes";
- public static final String ARTIFACT_EXPLORER_ATTRIBUTES_PREF =
- "org.eclipse.osee.framework.ui.skynet.artifactExplorerAttributes";
-
- public static final String ARTIFACT_SEARCH_RESULTS_ATTRIBUTES_PREF =
- "org.eclipse.osee.framework.ui.skynet.artifactSearchResultsAttributes";
- private ServiceTracker packageAdminTracker;
- private ServiceTracker cacheServiceTracker;
- private ServiceTracker databaseServiceTracker;
- private ServiceTracker atsServiceTracker;
-
- public SkynetGuiPlugin() {
- super();
- pluginInstance = this;
- }
-
- @Override
- public void stop(BundleContext context) throws Exception {
- super.stop(context);
- packageAdminTracker.close();
- cacheServiceTracker.close();
- databaseServiceTracker.close();
- atsServiceTracker.close();
- }
-
- @Override
- public void start(BundleContext context) throws Exception {
- super.start(context);
- packageAdminTracker = new ServiceTracker(context, PackageAdmin.class.getName(), null);
- packageAdminTracker.open();
-
- cacheServiceTracker = new ServiceTracker(context, IOseeCachingService.class.getName(), null);
- cacheServiceTracker.open();
-
- databaseServiceTracker = new ServiceTracker(context, IOseeDatabaseService.class.getName(), null);
- databaseServiceTracker.open();
-
- atsServiceTracker = new ServiceTracker(context, IOseeAtsService.class.getName(), null);
- atsServiceTracker.open();
-
- OseeEventManager.addListener(this);
-
- if (PlatformUI.isWorkbenchRunning()) {
-
- OseeLog.registerLoggerListener(new DialogPopupLoggerListener());
-
- IWorkbench workbench = PlatformUI.getWorkbench();
- workbench.addWorkbenchListener(new IWorkbenchListener() {
-
- @Override
- public void postShutdown(IWorkbench workbench) {
- }
-
- @Override
- public boolean preShutdown(IWorkbench workbench, boolean forced) {
- if (!DbUtil.isDbInit()) {
- try {
- UserManager.getUser().saveSettings();
- } catch (Throwable th) {
- th.printStackTrace();
- }
- }
- return true;
- }
- });
-
- PlatformUI.getWorkbench().addWorkbenchListener(new ArtifactSaveNotificationHandler());
- }
- }
-
- public static SkynetGuiPlugin getInstance() {
- return pluginInstance;
- }
-
- @Override
- protected String getPluginName() {
- return PLUGIN_ID;
- }
-
- public PackageAdmin getPackageAdmin() {
- return (PackageAdmin) this.packageAdminTracker.getService();
- }
-
- public IOseeCachingService getOseeCacheService() {
- return (IOseeCachingService) cacheServiceTracker.getService();
- }
-
- public IOseeDatabaseService getOseeDatabaseService() {
- return (IOseeDatabaseService) databaseServiceTracker.getService();
- }
-
- public IOseeAtsService getOseeAtsService() {
- return (IOseeAtsService) atsServiceTracker.getService();
- }
-
- @Override
- public void handleBroadcastEvent(Sender sender, final BroadcastEvent broadcastEvent) {
-
- // Determine whether this is a shutdown event
- // Prevent shutting down users without a valid message
- if (broadcastEvent.getBroadcastEventType() == BroadcastEventType.Force_Shutdown) {
- if (broadcastEvent.getMessage() == null || broadcastEvent.getMessage().length() == 0) {
- return;
- }
- Display.getDefault().asyncExec(new Runnable() {
- public void run() {
- boolean isShutdownRequest = false;
- try {
- isShutdownRequest = broadcastEvent.getUsers().contains(UserManager.getUser());
- } catch (OseeCoreException ex) {
- // do nothing
- }
- if (isShutdownRequest) {
- MessageDialog.openWarning(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),
- "Shutdown Requested", broadcastEvent.getMessage());
- // Shutdown the bench when this event is received
- PlatformUI.getWorkbench().close();
- }
- }
- });
- } else if (broadcastEvent.getBroadcastEventType() == BroadcastEventType.Message) {
- if (broadcastEvent.getMessage() == null || broadcastEvent.getMessage().length() == 0) {
- return;
- }
- Display.getDefault().asyncExec(new Runnable() {
- public void run() {
- MessageDialog.openInformation(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),
- "Remote Message", broadcastEvent.getMessage());
- }
- });
- } else if (broadcastEvent.getBroadcastEventType() == BroadcastEventType.Ping) {
- // Another client ping'd this client for session information; Pong back with
- // original client's session id so it can be identified as the correct pong
- try {
- OseeEventManager.kickBroadcastEvent(this, new BroadcastEvent(BroadcastEventType.Pong, null,
- sender.getOseeSession().toString()));
- } catch (Exception ex) {
- OseeLog.log(SkynetGuiPlugin.class, OseeLevel.SEVERE_POPUP, ex);
- }
- } else if (broadcastEvent.getBroadcastEventType() == BroadcastEventType.Pong) {
- // Got pong from another client; If message == this client's sessionId, then it's
- // the response from this client's ping
- try {
- if (broadcastEvent.getMessage() != null && broadcastEvent.getMessage().equals(
- ClientSessionManager.getSession().toString())) {
- OseeLog.log(SkynetGuiPlugin.class, Level.INFO, "Pong: " + sender.toString());
- }
- } catch (OseeAuthenticationRequiredException ex) {
- OseeLog.log(SkynetGuiPlugin.class, Level.SEVERE, "Pong: " + sender.toString(), ex);
- }
- }
- }
+ private static SkynetGuiPlugin pluginInstance; // The shared instance.
+ public static final String PLUGIN_ID = "org.eclipse.osee.framework.ui.skynet";
+ public static final String CHANGE_REPORT_ATTRIBUTES_PREF =
+ "org.eclipse.osee.framework.ui.skynet.changeReportAttributes";
+ public static final String ARTIFACT_EXPLORER_ATTRIBUTES_PREF =
+ "org.eclipse.osee.framework.ui.skynet.artifactExplorerAttributes";
+
+ public static final String ARTIFACT_SEARCH_RESULTS_ATTRIBUTES_PREF =
+ "org.eclipse.osee.framework.ui.skynet.artifactSearchResultsAttributes";
+ private ServiceTracker packageAdminTracker;
+ private ServiceTracker cacheServiceTracker;
+ private ServiceTracker databaseServiceTracker;
+ private ServiceTracker atsServiceTracker;
+
+ public SkynetGuiPlugin() {
+ super();
+ pluginInstance = this;
+ }
+
+ @Override
+ public void stop(BundleContext context) throws Exception {
+ super.stop(context);
+ packageAdminTracker.close();
+ cacheServiceTracker.close();
+ databaseServiceTracker.close();
+ atsServiceTracker.close();
+ }
+
+ @Override
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ packageAdminTracker = new ServiceTracker(context, PackageAdmin.class.getName(), null);
+ packageAdminTracker.open();
+
+ cacheServiceTracker = new ServiceTracker(context, IOseeCachingService.class.getName(), null);
+ cacheServiceTracker.open();
+
+ databaseServiceTracker = new ServiceTracker(context, IOseeDatabaseService.class.getName(), null);
+ databaseServiceTracker.open();
+
+ atsServiceTracker = new ServiceTracker(context, IOseeAtsService.class.getName(), null);
+ atsServiceTracker.open();
+
+ OseeEventManager.addListener(this);
+
+ if (PlatformUI.isWorkbenchRunning()) {
+
+ OseeLog.registerLoggerListener(new DialogPopupLoggerListener());
+
+ IWorkbench workbench = PlatformUI.getWorkbench();
+ workbench.addWorkbenchListener(new IWorkbenchListener() {
+
+ @Override
+ public void postShutdown(IWorkbench workbench) {
+ }
+
+ @Override
+ public boolean preShutdown(IWorkbench workbench, boolean forced) {
+ if (!DbUtil.isDbInit()) {
+ try {
+ UserManager.getUser().saveSettings();
+ } catch (Throwable th) {
+ th.printStackTrace();
+ }
+ }
+ return true;
+ }
+ });
+
+ PlatformUI.getWorkbench().addWorkbenchListener(new ArtifactSaveNotificationHandler());
+ }
+ }
+
+ public static SkynetGuiPlugin getInstance() {
+ return pluginInstance;
+ }
+
+ @Override
+ protected String getPluginName() {
+ return PLUGIN_ID;
+ }
+
+ public PackageAdmin getPackageAdmin() {
+ return (PackageAdmin) this.packageAdminTracker.getService();
+ }
+
+ public IOseeCachingService getOseeCacheService() {
+ return (IOseeCachingService) cacheServiceTracker.getService();
+ }
+
+ public IOseeDatabaseService getOseeDatabaseService() {
+ return (IOseeDatabaseService) databaseServiceTracker.getService();
+ }
+
+ public IOseeAtsService getOseeAtsService() {
+ return (IOseeAtsService) atsServiceTracker.getService();
+ }
+
+ @Override
+ public void handleBroadcastEvent(Sender sender, final BroadcastEvent broadcastEvent) {
+
+ // Determine whether this is a shutdown event
+ // Prevent shutting down users without a valid message
+ if (broadcastEvent.getBroadcastEventType() == BroadcastEventType.Force_Shutdown) {
+ if (broadcastEvent.getMessage() == null || broadcastEvent.getMessage().length() == 0) {
+ return;
+ }
+ Displays.ensureInDisplayThread(new Runnable() {
+ @Override
+ public void run() {
+ boolean isShutdownRequest = false;
+ try {
+ isShutdownRequest = broadcastEvent.getUsers().contains(UserManager.getUser());
+ } catch (OseeCoreException ex) {
+ // do nothing
+ }
+ if (isShutdownRequest) {
+ MessageDialog.openWarning(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),
+ "Shutdown Requested", broadcastEvent.getMessage());
+ // Shutdown the bench when this event is received
+ PlatformUI.getWorkbench().close();
+ }
+ }
+ });
+ } else if (broadcastEvent.getBroadcastEventType() == BroadcastEventType.Message) {
+ if (broadcastEvent.getMessage() == null || broadcastEvent.getMessage().length() == 0) {
+ return;
+ }
+ Displays.ensureInDisplayThread(new Runnable() {
+ @Override
+ public void run() {
+ MessageDialog.openInformation(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),
+ "Remote Message", broadcastEvent.getMessage());
+ }
+ });
+ } else if (broadcastEvent.getBroadcastEventType() == BroadcastEventType.Ping) {
+ // Another client ping'd this client for session information; Pong back with
+ // original client's session id so it can be identified as the correct pong
+ try {
+ OseeEventManager.kickBroadcastEvent(this, new BroadcastEvent(BroadcastEventType.Pong, null,
+ sender.getOseeSession().toString()));
+ } catch (Exception ex) {
+ OseeLog.log(SkynetGuiPlugin.class, OseeLevel.SEVERE_POPUP, ex);
+ }
+ } else if (broadcastEvent.getBroadcastEventType() == BroadcastEventType.Pong) {
+ // Got pong from another client; If message == this client's sessionId, then it's
+ // the response from this client's ping
+ try {
+ if (broadcastEvent.getMessage() != null && broadcastEvent.getMessage().equals(
+ ClientSessionManager.getSession().toString())) {
+ OseeLog.log(SkynetGuiPlugin.class, Level.INFO, "Pong: " + sender.toString());
+ }
+ } catch (OseeAuthenticationRequiredException ex) {
+ OseeLog.log(SkynetGuiPlugin.class, Level.SEVERE, "Pong: " + sender.toString(), ex);
+ }
+ }
+ }
} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/SkynetServiceContributionItem.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/SkynetServiceContributionItem.java
index 2ed1430fc8..886b2cd6f8 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/SkynetServiceContributionItem.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/SkynetServiceContributionItem.java
@@ -18,7 +18,7 @@ import org.eclipse.osee.framework.skynet.core.event.OseeEventManager;
import org.eclipse.osee.framework.skynet.core.event.RemoteEventManager;
import org.eclipse.osee.framework.skynet.core.event.RemoteEventServiceEventType;
import org.eclipse.osee.framework.skynet.core.event.Sender;
-import org.eclipse.osee.framework.ui.plugin.util.Displays;
+import org.eclipse.osee.framework.ui.swt.Displays;
import org.eclipse.osee.framework.ui.swt.ImageManager;
import org.eclipse.osee.framework.ui.swt.OverlayImage;
import org.eclipse.swt.graphics.Image;
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/WorkspaceContributionItem.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/WorkspaceContributionItem.java
index 4ec6639842..eda8b62383 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/WorkspaceContributionItem.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/WorkspaceContributionItem.java
@@ -14,8 +14,8 @@ import java.io.File;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.action.IContributionItem;
+import org.eclipse.osee.framework.ui.swt.Displays;
import org.eclipse.swt.program.Program;
-import org.eclipse.swt.widgets.Display;
import org.eclipse.ui.IViewPart;
import org.eclipse.ui.IViewReference;
import org.eclipse.ui.PlatformUI;
@@ -23,61 +23,62 @@ import org.eclipse.ui.part.ViewPart;
import org.eclipse.ui.texteditor.StatusLineContributionItem;
public class WorkspaceContributionItem extends StatusLineContributionItem {
- public WorkspaceContributionItem() {
- super("org.eclipse.osee.framework.ui.skynet.workspace.status", true, getShortPath().length() + 5);
- setToolTipText(ResourcesPlugin.getWorkspace().getRoot().getLocation().toOSString());
- setText(getShortPath());
- setActionHandler(new Action() {
- @Override
- public void run() {
- Program.launch(ResourcesPlugin.getWorkspace().getRoot().getLocation().toOSString());
- }
- });
- }
+ public WorkspaceContributionItem() {
+ super("org.eclipse.osee.framework.ui.skynet.workspace.status", true, getShortPath().length() + 5);
+ setToolTipText(ResourcesPlugin.getWorkspace().getRoot().getLocation().toOSString());
+ setText(getShortPath());
+ setActionHandler(new Action() {
+ @Override
+ public void run() {
+ Program.launch(ResourcesPlugin.getWorkspace().getRoot().getLocation().toOSString());
+ }
+ });
+ }
- private static String getShortPath() {
- String path = ResourcesPlugin.getWorkspace().getRoot().getLocation().toString();
- String elements[] = path.split("\\/");
- if (elements.length >= 2) {
- return elements[elements.length - 2] + File.separator + elements[elements.length - 1];
- }
- return path;
- }
+ private static String getShortPath() {
+ String path = ResourcesPlugin.getWorkspace().getRoot().getLocation().toString();
+ String elements[] = path.split("\\/");
+ if (elements.length >= 2) {
+ return elements[elements.length - 2] + File.separator + elements[elements.length - 1];
+ }
+ return path;
+ }
- public static void addToAllViews() {
- Display.getDefault().asyncExec(new Runnable() {
- public void run() {
- try {
- if (PlatformUI.getWorkbench() == null || PlatformUI.getWorkbench().getActiveWorkbenchWindow() == null) {
- return;
- }
- for (IViewReference viewDesc : PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getViewReferences()) {
- IViewPart viewPart = viewDesc.getView(false);
- if (viewPart != null) {
- addToViewpart((ViewPart) viewPart);
- }
- }
- } catch (Exception ex) {
- // DO NOTHING
- }
- }
- });
- }
+ public static void addToAllViews() {
+ Displays.ensureInDisplayThread(new Runnable() {
+ @Override
+ public void run() {
+ try {
+ if (PlatformUI.getWorkbench() == null || PlatformUI.getWorkbench().getActiveWorkbenchWindow() == null) {
+ return;
+ }
+ for (IViewReference viewDesc : PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getViewReferences()) {
+ IViewPart viewPart = viewDesc.getView(false);
+ if (viewPart != null) {
+ addToViewpart((ViewPart) viewPart);
+ }
+ }
+ } catch (Exception ex) {
+ // DO NOTHING
+ }
+ }
+ });
+ }
- public static void addToViewpart(ViewPart viewPart) {
- // Attempt to add to PackageExplorerPart
- try {
- if (viewPart != null) {
- for (IContributionItem item : viewPart.getViewSite().getActionBars().getStatusLineManager().getItems()) {
- if (item instanceof WorkspaceContributionItem) {
- return;
- }
- }
- // System.err.println("Adding to " + viewPart);
- viewPart.getViewSite().getActionBars().getStatusLineManager().add(new WorkspaceContributionItem());
- }
- } catch (Exception ex) {
- // do nothing
- }
- }
+ public static void addToViewpart(ViewPart viewPart) {
+ // Attempt to add to PackageExplorerPart
+ try {
+ if (viewPart != null) {
+ for (IContributionItem item : viewPart.getViewSite().getActionBars().getStatusLineManager().getItems()) {
+ if (item instanceof WorkspaceContributionItem) {
+ return;
+ }
+ }
+ // System.err.println("Adding to " + viewPart);
+ viewPart.getViewSite().getActionBars().getStatusLineManager().add(new WorkspaceContributionItem());
+ }
+ } catch (Exception ex) {
+ // do nothing
+ }
+ }
}
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/ArtifactNameConflictHandler.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/ArtifactNameConflictHandler.java
index 226a8028d1..7985b2fa07 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/ArtifactNameConflictHandler.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/ArtifactNameConflictHandler.java
@@ -10,11 +10,11 @@
*******************************************************************************/
package org.eclipse.osee.framework.ui.skynet.artifact;
-import org.eclipse.core.runtime.CoreException;
import org.eclipse.jface.dialogs.InputDialog;
import org.eclipse.jface.window.Window;
import org.eclipse.osee.framework.jdk.core.type.Pair;
import org.eclipse.osee.framework.skynet.core.types.IArtifact;
+import org.eclipse.osee.framework.ui.swt.Displays;
import org.eclipse.swt.widgets.Display;
/**
@@ -22,26 +22,26 @@ import org.eclipse.swt.widgets.Display;
*/
public class ArtifactNameConflictHandler {
- public String resolve(IArtifact source) throws CoreException {
- final Pair<String, String> beforeAfterNames = new Pair<String, String>("", "");
- if (source instanceof IArtifact) {
- String startingName = source.getName();
- beforeAfterNames.setFirst(startingName);
- beforeAfterNames.setSecond(startingName);
- }
+ public String resolve(IArtifact source) {
+ final Pair<String, String> beforeAfterNames = new Pair<String, String>("", "");
- Display.getDefault().syncExec(new Runnable() {
- public void run() {
- String startingName = beforeAfterNames.getFirst();
- InputDialog dialog =
- new InputDialog(Display.getCurrent().getActiveShell(), "Name Artifact", "Enter artifact name",
- startingName, new NonBlankAndNotSameAsStartingValidator(startingName));
- int result = dialog.open();
- if (result == Window.OK) {
- beforeAfterNames.setSecond(dialog.getValue());
- }
- }
- });
- return beforeAfterNames.getSecond();
- }
+ String startingName = source.getName();
+ beforeAfterNames.setFirst(startingName);
+ beforeAfterNames.setSecond(startingName);
+
+ Displays.pendInDisplayThread(new Runnable() {
+ @Override
+ public void run() {
+ String startingName = beforeAfterNames.getFirst();
+ InputDialog dialog =
+ new InputDialog(Display.getCurrent().getActiveShell(), "Name Artifact", "Enter artifact name",
+ startingName, new NonBlankAndNotSameAsStartingValidator(startingName));
+ int result = dialog.open();
+ if (result == Window.OK) {
+ beforeAfterNames.setSecond(dialog.getValue());
+ }
+ }
+ });
+ return beforeAfterNames.getSecond();
+ }
}
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/NonBlankAndNotSameAsStartingValidator.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/NonBlankAndNotSameAsStartingValidator.java
index a3391658f9..dfd89faf97 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/NonBlankAndNotSameAsStartingValidator.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/NonBlankAndNotSameAsStartingValidator.java
@@ -17,19 +17,20 @@ import org.eclipse.osee.framework.jdk.core.util.Strings;
* @author Roberto E. Escobar
*/
public final class NonBlankAndNotSameAsStartingValidator implements IInputValidator {
- private final String startingName;
+ private final String startingName;
- public NonBlankAndNotSameAsStartingValidator(String startingName) {
- this.startingName = startingName;
- }
+ public NonBlankAndNotSameAsStartingValidator(String startingName) {
+ this.startingName = startingName;
+ }
- public String isValid(String newText) {
- String errorMessage = null;
- if (!Strings.isValid(newText)) {
- errorMessage = "The new name cannot be blank";
- } else if (Strings.isValid(startingName) && startingName.equals(newText)) {
- errorMessage = "The new name must be different";
- }
- return errorMessage;
- }
+ @Override
+ public String isValid(String newText) {
+ String errorMessage = null;
+ if (!Strings.isValid(newText)) {
+ errorMessage = "The new name cannot be blank";
+ } else if (Strings.isValid(startingName) && startingName.equals(newText)) {
+ errorMessage = "The new name must be different";
+ }
+ return errorMessage;
+ }
} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/OpenArtifactEditorLoopbackCmd.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/OpenArtifactEditorLoopbackCmd.java
index 09c694f614..53934b4b0b 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/OpenArtifactEditorLoopbackCmd.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/OpenArtifactEditorLoopbackCmd.java
@@ -25,7 +25,7 @@ import org.eclipse.osee.framework.ui.plugin.util.AWorkbench;
import org.eclipse.osee.framework.ui.skynet.SkynetGuiPlugin;
import org.eclipse.osee.framework.ui.skynet.artifact.editor.ArtifactEditor;
import org.eclipse.osee.framework.ui.skynet.artifact.editor.ArtifactEditorInput;
-import org.eclipse.swt.widgets.Display;
+import org.eclipse.osee.framework.ui.swt.Displays;
import org.eclipse.ui.IEditorPart;
/**
@@ -33,68 +33,69 @@ import org.eclipse.ui.IEditorPart;
*/
public class OpenArtifactEditorLoopbackCmd extends BaseArtifactLoopbackCmd {
- @Override
- public boolean isApplicable(String cmd) {
- return cmd != null && cmd.equalsIgnoreCase("open.artifact");
- }
+ @Override
+ public boolean isApplicable(String cmd) {
+ return cmd != null && cmd.equalsIgnoreCase("open.artifact");
+ }
- @Override
- public void process(final Artifact artifact, final Map<String, String> parameters, final HttpResponse httpResponse) {
- if (artifact != null) {
- try {
- boolean hasPermissionToRead = false;
- try {
- hasPermissionToRead = AccessControlManager.hasPermission(artifact, PermissionEnum.READ);
- } catch (Exception ex) {
- OseeLog.log(SkynetGuiPlugin.class, Level.SEVERE, ex);
- }
+ @Override
+ public void process(final Artifact artifact, final Map<String, String> parameters, final HttpResponse httpResponse) {
+ if (artifact != null) {
+ try {
+ boolean hasPermissionToRead = false;
+ try {
+ hasPermissionToRead = AccessControlManager.hasPermission(artifact, PermissionEnum.READ);
+ } catch (Exception ex) {
+ OseeLog.log(SkynetGuiPlugin.class, Level.SEVERE, ex);
+ }
- if (!hasPermissionToRead) {
- httpResponse.outputStandardError(HttpURLConnection.HTTP_UNAUTHORIZED, String.format(
- "Access denied - User does not have read access to [%s]", artifact));
- } else {
- final MutableBoolean isDone = new MutableBoolean(false);
+ if (!hasPermissionToRead) {
+ httpResponse.outputStandardError(HttpURLConnection.HTTP_UNAUTHORIZED,
+ String.format("Access denied - User does not have read access to [%s]", artifact));
+ } else {
+ final MutableBoolean isDone = new MutableBoolean(false);
- Display.getDefault().asyncExec(new Runnable() {
- public void run() {
- try {
- IEditorPart part =
- AWorkbench.getActivePage().openEditor(new ArtifactEditorInput(artifact),
- ArtifactEditor.EDITOR_ID, true);
- if (part != null) {
- String html =
- AHTML.simplePage(artifact.getName() + " has been opened in OSEE on branch " + artifact.getBranch() + "<br><br>" + "<form><input type=button onClick='window.opener=self;window.close()' value='Close'></form>");
- httpResponse.getPrintStream().println(html);
- } else {
- httpResponse.outputStandardError(HttpURLConnection.HTTP_INTERNAL_ERROR, String.format(
- "Unable to open: [%s]", artifact.getName()));
- }
- } catch (Exception ex) {
- OseeLog.log(SkynetGuiPlugin.class, Level.SEVERE, ex);
- httpResponse.outputStandardError(HttpURLConnection.HTTP_INTERNAL_ERROR, String.format(
- "Unable to open: [%s]", artifact.getName()), ex);
- } finally {
- isDone.setValue(true);
- }
- }
- });
+ Displays.ensureInDisplayThread(new Runnable() {
+ @Override
+ public void run() {
+ try {
+ IEditorPart part =
+ AWorkbench.getActivePage().openEditor(new ArtifactEditorInput(artifact),
+ ArtifactEditor.EDITOR_ID, true);
+ if (part != null) {
+ String html =
+ AHTML.simplePage(artifact.getName() + " has been opened in OSEE on branch " + artifact.getBranch() + "<br><br>" + "<form><input type=button onClick='window.opener=self;window.close()' value='Close'></form>");
+ httpResponse.getPrintStream().println(html);
+ } else {
+ httpResponse.outputStandardError(HttpURLConnection.HTTP_INTERNAL_ERROR,
+ String.format("Unable to open: [%s]", artifact.getName()));
+ }
+ } catch (Exception ex) {
+ OseeLog.log(SkynetGuiPlugin.class, Level.SEVERE, ex);
+ httpResponse.outputStandardError(HttpURLConnection.HTTP_INTERNAL_ERROR,
+ String.format("Unable to open: [%s]", artifact.getName()), ex);
+ } finally {
+ isDone.setValue(true);
+ }
+ }
+ });
- int count = 1;
- while (!isDone.getValue() && count < 30) {
- try {
- Thread.sleep(350);
- } catch (InterruptedException ex) {
- }
- count++;
- }
- }
- } catch (Exception ex) {
- OseeLog.log(SkynetGuiPlugin.class, Level.SEVERE, ex);
- httpResponse.outputStandardError(HttpURLConnection.HTTP_INTERNAL_ERROR, String.format(
- "Unable to open: [%s]", artifact.getName()), ex);
- }
- } else {
- httpResponse.outputStandardError(HttpURLConnection.HTTP_BAD_REQUEST, "Unable to open null artifact");
- }
- }
+ int count = 1;
+ while (!isDone.getValue() && count < 30) {
+ try {
+ Thread.sleep(350);
+ } catch (InterruptedException ex) {
+ }
+ count++;
+ }
+ }
+ } catch (Exception ex) {
+ OseeLog.log(SkynetGuiPlugin.class, Level.SEVERE, ex);
+ httpResponse.outputStandardError(HttpURLConnection.HTTP_INTERNAL_ERROR,
+ String.format("Unable to open: [%s]", artifact.getName()), ex);
+ }
+ } else {
+ httpResponse.outputStandardError(HttpURLConnection.HTTP_BAD_REQUEST, "Unable to open null artifact");
+ }
+ }
}
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/annotation/AttributeAnnotationHandler.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/annotation/AttributeAnnotationHandler.java
index 75cfb562eb..e5bc5b7dc7 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/annotation/AttributeAnnotationHandler.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/annotation/AttributeAnnotationHandler.java
@@ -26,14 +26,15 @@ import org.eclipse.osee.framework.ui.skynet.SkynetGuiPlugin;
*/
public class AttributeAnnotationHandler implements IArtifactAnnotation {
- public void getAnnotations(Artifact artifact, Set<ArtifactAnnotation> annotations) {
- try {
- if (artifact.isAttributeTypeValid(CoreAttributeTypes.Annotation)) {
- AttributeAnnotationManager mgr = new AttributeAnnotationManager(artifact);
- annotations.addAll(mgr.getAnnotations());
- }
- } catch (OseeCoreException ex) {
- OseeLog.log(SkynetGuiPlugin.class, Level.SEVERE, ex);
- }
- }
+ @Override
+ public void getAnnotations(Artifact artifact, Set<ArtifactAnnotation> annotations) {
+ try {
+ if (artifact.isAttributeTypeValid(CoreAttributeTypes.Annotation)) {
+ AttributeAnnotationManager mgr = new AttributeAnnotationManager(artifact);
+ annotations.addAll(mgr.getAnnotations());
+ }
+ } catch (OseeCoreException ex) {
+ OseeLog.log(SkynetGuiPlugin.class, Level.SEVERE, ex);
+ }
+ }
}
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/editor/AbstractArtifactEditor.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/editor/AbstractArtifactEditor.java
index 8267ded200..8d2aecbff1 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/editor/AbstractArtifactEditor.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/editor/AbstractArtifactEditor.java
@@ -30,69 +30,70 @@ import org.eclipse.ui.forms.editor.FormEditor;
*/
public abstract class AbstractArtifactEditor extends FormEditor implements IDirtiableEditor {
- private final static Object[] EMPTY_ARRAY = new Object[0];
-
- @Override
- protected XFormToolkit createToolkit(Display display) {
- // Create a toolkit that shares colors between editors.
- // the toolkit will be disposed by the super class (FormEditor)
- return new XFormToolkit(SkynetGuiPlugin.getInstance().getSharedFormColors(display));
- }
-
- @Override
- public void doSave(IProgressMonitor monitor) {
- }
-
- @Override
- public void doSaveAs() {
- }
-
- @Override
- public boolean isSaveAsAllowed() {
- return false;
- }
-
- public void onDirtied() {
- }
-
- @Override
- public XFormToolkit getToolkit() {
- return (XFormToolkit) super.getToolkit();
- }
-
- public Artifact getArtifactFromEditorInput() {
- return (Artifact) getEditorInput().getAdapter(Artifact.class);
- }
-
- @Override
- public void init(IEditorSite site, IEditorInput input) throws PartInitException {
- super.init(site, input);
- ISelectionProvider provider = new ArtifactEditorSelectionProvider();
- Artifact artifact = getArtifactFromEditorInput();
- Object[] selected = artifact != null ? new Object[] {artifact} : EMPTY_ARRAY;
- provider.setSelection(new StructuredSelection(selected));
- getSite().setSelectionProvider(provider);
- }
-
- private final class ArtifactEditorSelectionProvider implements ISelectionProvider {
- private ISelection selection;
-
- @Override
- public void addSelectionChangedListener(ISelectionChangedListener listener) {
- }
-
- @Override
- public ISelection getSelection() {
- return selection;
- }
-
- @Override
- public void removeSelectionChangedListener(ISelectionChangedListener listener) {
- }
-
- @Override
- public void setSelection(ISelection selection) {
- this.selection = selection;
- }
- }
+ private final static Object[] EMPTY_ARRAY = new Object[0];
+
+ @Override
+ protected XFormToolkit createToolkit(Display display) {
+ // Create a toolkit that shares colors between editors.
+ // the toolkit will be disposed by the super class (FormEditor)
+ return new XFormToolkit(SkynetGuiPlugin.getInstance().getSharedFormColors(display));
+ }
+
+ @Override
+ public void doSave(IProgressMonitor monitor) {
+ }
+
+ @Override
+ public void doSaveAs() {
+ }
+
+ @Override
+ public boolean isSaveAsAllowed() {
+ return false;
+ }
+
+ @Override
+ public void onDirtied() {
+ }
+
+ @Override
+ public XFormToolkit getToolkit() {
+ return (XFormToolkit) super.getToolkit();
+ }
+
+ public Artifact getArtifactFromEditorInput() {
+ return (Artifact) getEditorInput().getAdapter(Artifact.class);
+ }
+
+ @Override
+ public void init(IEditorSite site, IEditorInput input) throws PartInitException {
+ super.init(site, input);
+ ISelectionProvider provider = new ArtifactEditorSelectionProvider();
+ Artifact artifact = getArtifactFromEditorInput();
+ Object[] selected = artifact != null ? new Object[] {artifact} : EMPTY_ARRAY;
+ provider.setSelection(new StructuredSelection(selected));
+ getSite().setSelectionProvider(provider);
+ }
+
+ private final class ArtifactEditorSelectionProvider implements ISelectionProvider {
+ private ISelection selection;
+
+ @Override
+ public void addSelectionChangedListener(ISelectionChangedListener listener) {
+ }
+
+ @Override
+ public ISelection getSelection() {
+ return selection;
+ }
+
+ @Override
+ public void removeSelectionChangedListener(ISelectionChangedListener listener) {
+ }
+
+ @Override
+ public void setSelection(ISelection selection) {
+ this.selection = selection;
+ }
+ }
} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/editor/AbstractEventArtifactEditor.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/editor/AbstractEventArtifactEditor.java
index 5af7b269b7..74958fca31 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/editor/AbstractEventArtifactEditor.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/editor/AbstractEventArtifactEditor.java
@@ -27,9 +27,9 @@ import org.eclipse.osee.framework.skynet.core.event.Sender;
import org.eclipse.osee.framework.skynet.core.event2.AccessControlEvent;
import org.eclipse.osee.framework.skynet.core.event2.BranchEvent;
import org.eclipse.osee.framework.skynet.core.utility.LoadedArtifacts;
-import org.eclipse.osee.framework.ui.plugin.util.Displays;
import org.eclipse.osee.framework.ui.skynet.ArtifactImageManager;
import org.eclipse.osee.framework.ui.skynet.SkynetGuiPlugin;
+import org.eclipse.osee.framework.ui.swt.Displays;
import org.eclipse.swt.graphics.Image;
/**
@@ -37,162 +37,166 @@ import org.eclipse.swt.graphics.Image;
*/
public abstract class AbstractEventArtifactEditor extends AbstractArtifactEditor implements IArtifactEditorEventHandler {
- private final InternalEventHandler internalEventHandler;
-
- public AbstractEventArtifactEditor() {
- super();
- if (OseeEventManager.isOldEvents()) {
- internalEventHandler = new InternalEventHandler();
- OseeEventManager.addListener(internalEventHandler);
- } else {
- internalEventHandler = null;
- ArtifactEditorEventManager.add(this);
- }
- }
-
- @Override
- protected void addPages() {
- }
-
- @Override
- public boolean isDirty() {
- boolean wasDirty = false;
- Artifact artifact = getArtifactFromEditorInput();
- if (artifact != null) {
- if (!artifact.isDeleted()) {
- wasDirty = super.isDirty() || artifact.isDirty();
- }
- }
- return wasDirty;
- }
-
- protected abstract void checkEnabledTooltems();
-
- public abstract void refreshDirtyArtifact();
-
- public abstract void closeEditor();
-
- public abstract void refreshRelations();
-
- public void setMainImage(Image titleImage) {
- super.setTitleImage(titleImage);
- }
-
- @Override
- public void dispose() {
- super.dispose();
- if (OseeEventManager.isOldEvents()) {
- OseeEventManager.removeListener(internalEventHandler);
- }
- }
-
- @Override
- public AbstractEventArtifactEditor getEditor() {
- return this;
- }
-
- /**
- * <REM2> this entire listener can be removed cause handled through ArtifactEditorEventManager
- *
- * @author Donald G. Dunne
- */
- private final class InternalEventHandler implements IArtifactsPurgedEventListener, IBranchEventListener, IAccessControlEventListener, IArtifactsChangeTypeEventListener, IFrameworkTransactionEventListener {
-
- @Override
- public void handleArtifactsChangeTypeEvent(Sender sender, int toArtifactTypeId, final LoadedArtifacts loadedArtifacts) {
- Displays.ensureInDisplayThread(new Runnable() {
- @Override
- public void run() {
- try {
- Artifact localArtifact = getArtifactFromEditorInput();
- if (loadedArtifacts.getLoadedArtifacts().contains(localArtifact)) {
- closeEditor();
- }
- } catch (OseeCoreException ex) {
- OseeLog.log(SkynetGuiPlugin.class, Level.SEVERE, ex);
- }
- }
- });
- }
-
- @Override
- public void handleFrameworkTransactionEvent(Sender sender, final FrameworkTransactionData transData) throws OseeCoreException {
- Displays.ensureInDisplayThread(new Runnable() {
- @Override
- public void run() {
- Artifact localArtifact = getArtifactFromEditorInput();
- if (!transData.isHasEvent(localArtifact)) {
- return;
- }
- if (transData.isDeleted(localArtifact)) {
- closeEditor();
- }
- if (transData.isRelAddedChangedDeleted(localArtifact)) {
- refreshRelations();
- }
- if (transData.isChanged(localArtifact)) {
- refreshDirtyArtifact();
- }
- onDirtied();
- }
- });
- }
-
- @Override
- public void handleArtifactsPurgedEvent(Sender sender, final LoadedArtifacts loadedArtifacts) throws OseeCoreException {
- Displays.ensureInDisplayThread(new Runnable() {
- @Override
- public void run() {
- try {
- if (loadedArtifacts.getLoadedArtifacts().contains(getArtifactFromEditorInput())) {
- closeEditor();
- }
- } catch (OseeCoreException ex) {
- OseeLog.log(SkynetGuiPlugin.class, Level.SEVERE, ex);
- }
- }
- });
- }
-
- @Override
- public void handleBranchEventREM1(Sender sender, final BranchEventType branchModType, final int branchId) {
- Displays.ensureInDisplayThread(new Runnable() {
- @Override
- public void run() {
- if (branchModType == BranchEventType.Committed) {
- if (getArtifactFromEditorInput().getBranch().getId() == branchId) {
- closeEditor();
- }
- }
- }
- });
- }
-
- @Override
- public void handleAccessControlArtifactsEvent(Sender sender, AccessControlEvent accessControlEvent) {
- try {
- if (accessControlEvent.getEventType() == AccessControlEventType.ArtifactsLocked || accessControlEvent.getEventType() == AccessControlEventType.ArtifactsUnlocked) {
- if (accessControlEvent.getArtifacts().contains(getArtifactFromEditorInput())) {
- Displays.ensureInDisplayThread(new Runnable() {
- @Override
- public void run() {
- setTitleImage(ArtifactImageManager.getImage(getArtifactFromEditorInput()));
- }
- });
- }
- }
- } catch (Exception ex) {
- // do nothing
- }
- }
-
- @Override
- public void handleBranchEvent(Sender sender, final BranchEvent branchEvent) {
- // Handled by ArtifactEditorEventManager
- }
-
- @Override
- public void handleLocalBranchToArtifactCacheUpdateEvent(Sender sender) {
- }
- }
+ private final InternalEventHandler internalEventHandler;
+
+ public AbstractEventArtifactEditor() {
+ super();
+ if (OseeEventManager.isOldEvents()) {
+ internalEventHandler = new InternalEventHandler();
+ OseeEventManager.addListener(internalEventHandler);
+ } else {
+ internalEventHandler = null;
+ ArtifactEditorEventManager.add(this);
+ }
+ }
+
+ @Override
+ protected void addPages() {
+ }
+
+ @Override
+ public boolean isDirty() {
+ boolean wasDirty = false;
+ Artifact artifact = getArtifactFromEditorInput();
+ if (artifact != null) {
+ if (!artifact.isDeleted()) {
+ wasDirty = super.isDirty() || artifact.isDirty();
+ }
+ }
+ return wasDirty;
+ }
+
+ protected abstract void checkEnabledTooltems();
+
+ @Override
+ public abstract void refreshDirtyArtifact();
+
+ @Override
+ public abstract void closeEditor();
+
+ @Override
+ public abstract void refreshRelations();
+
+ @Override
+ public void setMainImage(Image titleImage) {
+ super.setTitleImage(titleImage);
+ }
+
+ @Override
+ public void dispose() {
+ super.dispose();
+ if (OseeEventManager.isOldEvents()) {
+ OseeEventManager.removeListener(internalEventHandler);
+ }
+ }
+
+ @Override
+ public AbstractEventArtifactEditor getEditor() {
+ return this;
+ }
+
+ /**
+ * <REM2> this entire listener can be removed cause handled through ArtifactEditorEventManager
+ *
+ * @author Donald G. Dunne
+ */
+ private final class InternalEventHandler implements IArtifactsPurgedEventListener, IBranchEventListener, IAccessControlEventListener, IArtifactsChangeTypeEventListener, IFrameworkTransactionEventListener {
+
+ @Override
+ public void handleArtifactsChangeTypeEvent(Sender sender, int toArtifactTypeId, final LoadedArtifacts loadedArtifacts) {
+ Displays.ensureInDisplayThread(new Runnable() {
+ @Override
+ public void run() {
+ try {
+ Artifact localArtifact = getArtifactFromEditorInput();
+ if (loadedArtifacts.getLoadedArtifacts().contains(localArtifact)) {
+ closeEditor();
+ }
+ } catch (OseeCoreException ex) {
+ OseeLog.log(SkynetGuiPlugin.class, Level.SEVERE, ex);
+ }
+ }
+ });
+ }
+
+ @Override
+ public void handleFrameworkTransactionEvent(Sender sender, final FrameworkTransactionData transData) {
+ Displays.ensureInDisplayThread(new Runnable() {
+ @Override
+ public void run() {
+ Artifact localArtifact = getArtifactFromEditorInput();
+ if (!transData.isHasEvent(localArtifact)) {
+ return;
+ }
+ if (transData.isDeleted(localArtifact)) {
+ closeEditor();
+ }
+ if (transData.isRelAddedChangedDeleted(localArtifact)) {
+ refreshRelations();
+ }
+ if (transData.isChanged(localArtifact)) {
+ refreshDirtyArtifact();
+ }
+ onDirtied();
+ }
+ });
+ }
+
+ @Override
+ public void handleArtifactsPurgedEvent(Sender sender, final LoadedArtifacts loadedArtifacts) {
+ Displays.ensureInDisplayThread(new Runnable() {
+ @Override
+ public void run() {
+ try {
+ if (loadedArtifacts.getLoadedArtifacts().contains(getArtifactFromEditorInput())) {
+ closeEditor();
+ }
+ } catch (OseeCoreException ex) {
+ OseeLog.log(SkynetGuiPlugin.class, Level.SEVERE, ex);
+ }
+ }
+ });
+ }
+
+ @Override
+ public void handleBranchEventREM1(Sender sender, final BranchEventType branchModType, final int branchId) {
+ Displays.ensureInDisplayThread(new Runnable() {
+ @Override
+ public void run() {
+ if (branchModType == BranchEventType.Committed) {
+ if (getArtifactFromEditorInput().getBranch().getId() == branchId) {
+ closeEditor();
+ }
+ }
+ }
+ });
+ }
+
+ @Override
+ public void handleAccessControlArtifactsEvent(Sender sender, AccessControlEvent accessControlEvent) {
+ try {
+ if (accessControlEvent.getEventType() == AccessControlEventType.ArtifactsLocked || accessControlEvent.getEventType() == AccessControlEventType.ArtifactsUnlocked) {
+ if (accessControlEvent.getArtifacts().contains(getArtifactFromEditorInput())) {
+ Displays.ensureInDisplayThread(new Runnable() {
+ @Override
+ public void run() {
+ setTitleImage(ArtifactImageManager.getImage(getArtifactFromEditorInput()));
+ }
+ });
+ }
+ }
+ } catch (Exception ex) {
+ // do nothing
+ }
+ }
+
+ @Override
+ public void handleBranchEvent(Sender sender, final BranchEvent branchEvent) {
+ // Handled by ArtifactEditorEventManager
+ }
+
+ @Override
+ public void handleLocalBranchToArtifactCacheUpdateEvent(Sender sender) {
+ }
+ }
}
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/editor/ArtifactEditor.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/editor/ArtifactEditor.java
index 888f6d3bdf..a543bf2c1b 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/editor/ArtifactEditor.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/editor/ArtifactEditor.java
@@ -22,14 +22,13 @@ import org.eclipse.osee.framework.plugin.core.IActionable;
import org.eclipse.osee.framework.plugin.core.util.Jobs;
import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
import org.eclipse.osee.framework.ui.plugin.util.AWorkbench;
-import org.eclipse.osee.framework.ui.plugin.util.Displays;
import org.eclipse.osee.framework.ui.skynet.OseeContributionItem;
import org.eclipse.osee.framework.ui.skynet.RelationsComposite;
import org.eclipse.osee.framework.ui.skynet.SkynetGuiPlugin;
import org.eclipse.osee.framework.ui.skynet.artifact.editor.pages.ArtifactEditorOutlinePage;
import org.eclipse.osee.framework.ui.skynet.artifact.editor.pages.ArtifactFormPage;
+import org.eclipse.osee.framework.ui.swt.Displays;
import org.eclipse.osee.framework.ui.swt.Widgets;
-import org.eclipse.swt.widgets.Display;
import org.eclipse.ui.PartInitException;
import org.eclipse.ui.progress.UIJob;
import org.eclipse.ui.views.contentoutline.IContentOutlinePage;
@@ -38,215 +37,217 @@ import org.eclipse.ui.views.contentoutline.IContentOutlinePage;
* @author Roberto E. Escobar
*/
public class ArtifactEditor extends AbstractEventArtifactEditor {
- public static final String EDITOR_ID = "org.eclipse.osee.framework.ui.skynet.artifact.editor.ArtifactEditor";
-
- private IActionContributor actionBarContributor;
- private ArtifactFormPage formPage;
- private ArtifactEditorOutlinePage outlinePage;
-
- public ArtifactEditor() {
- super();
- }
-
- public IActionContributor getActionBarContributor() {
- if (actionBarContributor == null) {
- actionBarContributor = new ArtifactEditorActionBarContributor(this);
- }
- return actionBarContributor;
- }
-
- @Override
- public BaseArtifactEditorInput getEditorInput() {
- return (BaseArtifactEditorInput) super.getEditorInput();
- }
-
- @Override
- public void onDirtied() {
- Display.getDefault().asyncExec(new Runnable() {
- public void run() {
- firePropertyChange(PROP_DIRTY);
- }
- });
- }
-
- @Override
- public void showBusy(boolean busy) {
- super.showBusy(busy);
- ArtifactFormPage page = getFormPage();
- if (page != null) {
- page.showBusy(busy);
- }
- }
-
- @Override
- public void doSave(IProgressMonitor monitor) {
- try {
- getFormPage().doSave(monitor);
- Artifact artifact = getEditorInput().getArtifact();
- artifact.persist();
- firePropertyChange(PROP_DIRTY);
- } catch (OseeCoreException ex) {
- onDirtied();
- OseeLog.log(SkynetGuiPlugin.class, Level.SEVERE, ex);
- }
- }
-
- @Override
- public void dispose() {
- try {
- // If the artifact is dirty when the editor gets disposed, then it needs to be reverted
- Artifact artifact = getEditorInput().getArtifact();
- if (!artifact.isDeleted() && artifact.isDirty()) {
- try {
- artifact.reloadAttributesAndRelations();
- } catch (OseeCoreException ex) {
- OseeLog.log(SkynetGuiPlugin.class, Level.SEVERE, ex);
- }
- }
- } catch (Exception ex) {
- OseeLog.log(SkynetGuiPlugin.class, Level.SEVERE, ex);
- } finally {
- super.dispose();
- }
- }
-
- @Override
- protected void checkEnabledTooltems() {
- // if (!attributeComposite.isDisposed()) {
- // Display.getDefault().asyncExec(new Runnable() {
- // public void run() {
- // boolean isEditAllowed = artifact.isReadOnly() != true;
- //
- // if (attributeComposite.getToolBar() == null || attributeComposite.getToolBar().isDisposed()) {
- // return;
- // }
- // attributeComposite.getToolBar().getItem(REVEAL_ARTIFACT_INDEX).setEnabled(true);
- // attributeComposite.getToolBar().getItem(EDIT_ARTIFACT_INDEX).setEnabled(isEditAllowed);
- // attributeComposite.getToolBar().update();
- //
- // relationsComposite.getToolBar().getItem(REVEAL_ARTIFACT_INDEX).setEnabled(true);
- // relationsComposite.getToolBar().getItem(EDIT_ARTIFACT_INDEX).setEnabled(isEditAllowed);
- // relationsComposite.getToolBar().update();
- // }
- // });
- // }
- }
-
- @Override
- public void closeEditor() {
- Displays.ensureInDisplayThread(new Runnable() {
- @Override
- public void run() {
- AWorkbench.getActivePage().closeEditor(ArtifactEditor.this, false);
- }
- });
- }
-
- @Override
- public void refreshDirtyArtifact() {
- Jobs.startJob(new RefreshDirtyArtifactJob());
- }
-
- @Override
- public void refreshRelations() {
- Jobs.startJob(new RefreshRelations());
- }
-
- @Override
- protected void addPages() {
- OseeContributionItem.addTo(this, true);
- setPartName(getEditorInput().getName());
- setTitleImage(getEditorInput().getImage());
-
- formPage = new ArtifactFormPage(this, "ArtifactFormPage", null);
- try {
- addPage(formPage);
- } catch (PartInitException ex) {
- OseeLog.log(SkynetGuiPlugin.class, OseeLevel.SEVERE_POPUP, ex);
- }
- }
-
- private ArtifactFormPage getFormPage() {
- return formPage;
- }
-
- @SuppressWarnings("rawtypes")
- @Override
- public Object getAdapter(Class adapter) {
- if (adapter == IActionable.class) {
- return new IActionable() {
- @Override
- public String getActionDescription() {
- return "";
- }
- };
- } else if (adapter == IContentOutlinePage.class) {
- ArtifactEditorOutlinePage page = getOutlinePage();
- page.setInput(this);
- return page;
- } else if (adapter == RelationsComposite.class) {
- return getFormPage().getRelationsComposite();
- }
- return super.getAdapter(adapter);
- }
-
- protected ArtifactEditorOutlinePage getOutlinePage() {
- if (outlinePage == null) {
- outlinePage = new ArtifactEditorOutlinePage();
- }
- return outlinePage;
- }
-
- private final class RefreshRelations extends UIJob {
- public RefreshRelations() {
- super("Refresh Relations");
- }
-
- @Override
- public IStatus runInUIThread(IProgressMonitor monitor) {
- ArtifactFormPage page = getFormPage();
- if (page != null) {
- page.showBusy(true);
- RelationsComposite relationsComposite = page.getRelationsComposite();
- if (relationsComposite != null && !relationsComposite.isDisposed()) {
- relationsComposite.refresh();
- onDirtied();
- }
- page.showBusy(false);
- }
- return Status.OK_STATUS;
- }
- }
-
- private final class RefreshDirtyArtifactJob extends UIJob {
-
- public RefreshDirtyArtifactJob() {
- super("Refresh Dirty Artifact");
- }
-
- @Override
- public IStatus runInUIThread(IProgressMonitor monitor) {
- try {
- setPartName(getEditorInput().getName());
- setTitleImage(getEditorInput().getImage());
- ArtifactEditorOutlinePage outlinePage = getOutlinePage();
- if (outlinePage != null) {
- outlinePage.refresh();
- }
- ArtifactFormPage page = getFormPage();
- if (page != null && Widgets.isAccessible(page.getPartControl())) {
- page.refresh();
- }
- onDirtied();
- } catch (Exception ex) {
- OseeLog.log(SkynetGuiPlugin.class, Level.SEVERE, ex);
- }
- return Status.OK_STATUS;
- }
- }
-
- @Override
- public boolean isDisposed() {
- return formPage == null || formPage.getPartControl() == null || formPage.getPartControl().isDisposed();
- }
+ public static final String EDITOR_ID = "org.eclipse.osee.framework.ui.skynet.artifact.editor.ArtifactEditor";
+
+ private IActionContributor actionBarContributor;
+ private ArtifactFormPage formPage;
+ private ArtifactEditorOutlinePage outlinePage;
+
+ public ArtifactEditor() {
+ super();
+ }
+
+ public IActionContributor getActionBarContributor() {
+ if (actionBarContributor == null) {
+ actionBarContributor = new ArtifactEditorActionBarContributor(this);
+ }
+ return actionBarContributor;
+ }
+
+ @Override
+ public BaseArtifactEditorInput getEditorInput() {
+ return (BaseArtifactEditorInput) super.getEditorInput();
+ }
+
+ @Override
+ public void onDirtied() {
+ Displays.ensureInDisplayThread(new Runnable() {
+ @Override
+ public void run() {
+ firePropertyChange(PROP_DIRTY);
+ }
+ });
+ }
+
+ @Override
+ public void showBusy(boolean busy) {
+ super.showBusy(busy);
+ ArtifactFormPage page = getFormPage();
+ if (page != null) {
+ page.showBusy(busy);
+ }
+ }
+
+ @Override
+ public void doSave(IProgressMonitor monitor) {
+ try {
+ getFormPage().doSave(monitor);
+ Artifact artifact = getEditorInput().getArtifact();
+ artifact.persist();
+ firePropertyChange(PROP_DIRTY);
+ } catch (OseeCoreException ex) {
+ onDirtied();
+ OseeLog.log(SkynetGuiPlugin.class, Level.SEVERE, ex);
+ }
+ }
+
+ @Override
+ public void dispose() {
+ try {
+ // If the artifact is dirty when the editor gets disposed, then it needs to be reverted
+ Artifact artifact = getEditorInput().getArtifact();
+ if (!artifact.isDeleted() && artifact.isDirty()) {
+ try {
+ artifact.reloadAttributesAndRelations();
+ } catch (OseeCoreException ex) {
+ OseeLog.log(SkynetGuiPlugin.class, Level.SEVERE, ex);
+ }
+ }
+ } catch (Exception ex) {
+ OseeLog.log(SkynetGuiPlugin.class, Level.SEVERE, ex);
+ } finally {
+ super.dispose();
+ }
+ }
+
+ @Override
+ protected void checkEnabledTooltems() {
+ // if (!attributeComposite.isDisposed()) {
+ // Displays.ensureInDisplayThread(new Runnable() {
+ // @Override
+ // public void run() {
+ // boolean isEditAllowed = artifact.isReadOnly() != true;
+ //
+ // if (attributeComposite.getToolBar() == null || attributeComposite.getToolBar().isDisposed()) {
+ // return;
+ // }
+ // attributeComposite.getToolBar().getItem(REVEAL_ARTIFACT_INDEX).setEnabled(true);
+ // attributeComposite.getToolBar().getItem(EDIT_ARTIFACT_INDEX).setEnabled(isEditAllowed);
+ // attributeComposite.getToolBar().update();
+ //
+ // relationsComposite.getToolBar().getItem(REVEAL_ARTIFACT_INDEX).setEnabled(true);
+ // relationsComposite.getToolBar().getItem(EDIT_ARTIFACT_INDEX).setEnabled(isEditAllowed);
+ // relationsComposite.getToolBar().update();
+ // }
+ // });
+ // }
+ }
+
+ @Override
+ public void closeEditor() {
+ Displays.ensureInDisplayThread(new Runnable() {
+ @Override
+ public void run() {
+ AWorkbench.getActivePage().closeEditor(ArtifactEditor.this, false);
+ }
+ });
+ }
+
+ @Override
+ public void refreshDirtyArtifact() {
+ Jobs.startJob(new RefreshDirtyArtifactJob());
+ }
+
+ @Override
+ public void refreshRelations() {
+ Jobs.startJob(new RefreshRelations());
+ }
+
+ @Override
+ protected void addPages() {
+ OseeContributionItem.addTo(this, true);
+ setPartName(getEditorInput().getName());
+ setTitleImage(getEditorInput().getImage());
+
+ formPage = new ArtifactFormPage(this, "ArtifactFormPage", null);
+ try {
+ addPage(formPage);
+ } catch (PartInitException ex) {
+ OseeLog.log(SkynetGuiPlugin.class, OseeLevel.SEVERE_POPUP, ex);
+ }
+ }
+
+ private ArtifactFormPage getFormPage() {
+ return formPage;
+ }
+
+ @SuppressWarnings("rawtypes")
+ @Override
+ public Object getAdapter(Class adapter) {
+ if (adapter == IActionable.class) {
+ return new IActionable() {
+ @Override
+ public String getActionDescription() {
+ return "";
+ }
+ };
+ } else if (adapter == IContentOutlinePage.class) {
+ ArtifactEditorOutlinePage page = getOutlinePage();
+ page.setInput(this);
+ return page;
+ } else if (adapter == RelationsComposite.class) {
+ return getFormPage().getRelationsComposite();
+ }
+ return super.getAdapter(adapter);
+ }
+
+ protected ArtifactEditorOutlinePage getOutlinePage() {
+ if (outlinePage == null) {
+ outlinePage = new ArtifactEditorOutlinePage();
+ }
+ return outlinePage;
+ }
+
+ private final class RefreshRelations extends UIJob {
+ public RefreshRelations() {
+ super("Refresh Relations");
+ }
+
+ @Override
+ public IStatus runInUIThread(IProgressMonitor monitor) {
+ ArtifactFormPage page = getFormPage();
+ if (page != null) {
+ page.showBusy(true);
+ RelationsComposite relationsComposite = page.getRelationsComposite();
+ if (relationsComposite != null && !relationsComposite.isDisposed()) {
+ relationsComposite.refresh();
+ onDirtied();
+ }
+ page.showBusy(false);
+ }
+ return Status.OK_STATUS;
+ }
+ }
+
+ private final class RefreshDirtyArtifactJob extends UIJob {
+
+ public RefreshDirtyArtifactJob() {
+ super("Refresh Dirty Artifact");
+ }
+
+ @Override
+ public IStatus runInUIThread(IProgressMonitor monitor) {
+ try {
+ setPartName(getEditorInput().getName());
+ setTitleImage(getEditorInput().getImage());
+ ArtifactEditorOutlinePage outlinePage = getOutlinePage();
+ if (outlinePage != null) {
+ outlinePage.refresh();
+ }
+ ArtifactFormPage page = getFormPage();
+ if (page != null && Widgets.isAccessible(page.getPartControl())) {
+ page.refresh();
+ }
+ onDirtied();
+ } catch (Exception ex) {
+ OseeLog.log(SkynetGuiPlugin.class, Level.SEVERE, ex);
+ }
+ return Status.OK_STATUS;
+ }
+ }
+
+ @Override
+ public boolean isDisposed() {
+ return formPage == null || formPage.getPartControl() == null || formPage.getPartControl().isDisposed();
+ }
} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/editor/ArtifactEditorActionBarContributor.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/editor/ArtifactEditorActionBarContributor.java
index 83dedf40c9..49608fac57 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/editor/ArtifactEditorActionBarContributor.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/editor/ArtifactEditorActionBarContributor.java
@@ -50,224 +50,230 @@ import org.eclipse.ui.PlatformUI;
*/
public class ArtifactEditorActionBarContributor implements IActionContributor {
- private final AbstractArtifactEditor editor;
+ private final AbstractArtifactEditor editor;
- public ArtifactEditorActionBarContributor(AbstractArtifactEditor editor) {
- this.editor = editor;
- }
+ public ArtifactEditorActionBarContributor(AbstractArtifactEditor editor) {
+ this.editor = editor;
+ }
- public void contributeToToolBar(IToolBarManager manager) {
- manager.add(createAtsBugAction());
- manager.add(new Separator());
- addOpenWithContributionItem(manager);
- manager.add(new DeleteArtifactAction());
- manager.add(new Separator());
- manager.add(new OpenOutlineAction());
- manager.add(new OpenHistoryAction());
- manager.add(new RevealInExplorerAction());
- manager.add(new RevealBranchAction());
- manager.add(new Separator());
- manager.add(new AccessControlAction());
- manager.add(new Separator());
- manager.add(new CopyArtifactURLAction());
- manager.add(new Separator());
- manager.add(new DirtyReportAction(editor.getArtifactFromEditorInput()));
- }
+ @Override
+ public void contributeToToolBar(IToolBarManager manager) {
+ manager.add(createAtsBugAction());
+ manager.add(new Separator());
+ addOpenWithContributionItem(manager);
+ manager.add(new DeleteArtifactAction());
+ manager.add(new Separator());
+ manager.add(new OpenOutlineAction());
+ manager.add(new OpenHistoryAction());
+ manager.add(new RevealInExplorerAction());
+ manager.add(new RevealBranchAction());
+ manager.add(new Separator());
+ manager.add(new AccessControlAction());
+ manager.add(new Separator());
+ manager.add(new CopyArtifactURLAction());
+ manager.add(new Separator());
+ manager.add(new DirtyReportAction(editor.getArtifactFromEditorInput()));
+ }
- private Artifact getSelectedArtifact() {
- Artifact toReturn = null;
+ private Artifact getSelectedArtifact() {
+ Artifact toReturn = null;
- ISelectionProvider provider = editor.getSite().getSelectionProvider();
- ISelection selection = provider.getSelection();
- if (!selection.isEmpty()) {
- IStructuredSelection structuredSelection = (IStructuredSelection) selection;
- Object selectedObject = structuredSelection.getFirstElement();
- if (selectedObject instanceof Artifact) {
- toReturn = (Artifact) selectedObject;
- }
- }
- return toReturn;
- }
+ ISelectionProvider provider = editor.getSite().getSelectionProvider();
+ ISelection selection = provider.getSelection();
+ if (!selection.isEmpty()) {
+ IStructuredSelection structuredSelection = (IStructuredSelection) selection;
+ Object selectedObject = structuredSelection.getFirstElement();
+ if (selectedObject instanceof Artifact) {
+ toReturn = (Artifact) selectedObject;
+ }
+ }
+ return toReturn;
+ }
- private void addOpenWithContributionItem(IToolBarManager manager) {
- OpenWithContributionItem contributionItem = new OpenWithContributionItem();
- contributionItem.setVisible(true);
- manager.add(contributionItem);
- }
+ private void addOpenWithContributionItem(IToolBarManager manager) {
+ OpenWithContributionItem contributionItem = new OpenWithContributionItem();
+ contributionItem.setVisible(true);
+ manager.add(contributionItem);
+ }
- private final Action createAtsBugAction() {
- IEditorSite site = editor.getEditorSite();
- return OseeUiActions.createBugAction(SkynetGuiPlugin.getInstance(), editor, site.getId(), site.getRegisteredName());
- }
+ private final Action createAtsBugAction() {
+ IEditorSite site = editor.getEditorSite();
+ return OseeUiActions.createBugAction(SkynetGuiPlugin.getInstance(), editor, site.getId(),
+ site.getRegisteredName());
+ }
- private final class RevealBranchAction extends Action {
- public RevealBranchAction() {
- super();
- setImageDescriptor(ImageManager.getImageDescriptor(FrameworkImage.BRANCH));
- setToolTipText("Reveal the branch this artifact is on in the Branch Manager");
- }
+ private final class RevealBranchAction extends Action {
+ public RevealBranchAction() {
+ super();
+ setImageDescriptor(ImageManager.getImageDescriptor(FrameworkImage.BRANCH));
+ setToolTipText("Reveal the branch this artifact is on in the Branch Manager");
+ }
- @Override
- public void run() {
- try {
- BranchView.revealBranch(getSelectedArtifact().getBranch());
- } catch (Exception ex) {
- OseeLog.log(getClass(), OseeLevel.SEVERE_POPUP, ex);
- }
- }
+ @Override
+ public void run() {
+ try {
+ BranchView.revealBranch(getSelectedArtifact().getBranch());
+ } catch (Exception ex) {
+ OseeLog.log(getClass(), OseeLevel.SEVERE_POPUP, ex);
+ }
+ }
- }
+ }
- private final class DeleteArtifactAction extends Action {
+ private final class DeleteArtifactAction extends Action {
- public DeleteArtifactAction() {
- super("&Delete Artifact\tDelete", Action.AS_PUSH_BUTTON);
- setImageDescriptor(ImageManager.getImageDescriptor(FrameworkImage.DELETE));
- }
+ public DeleteArtifactAction() {
+ super("&Delete Artifact\tDelete", Action.AS_PUSH_BUTTON);
+ setImageDescriptor(ImageManager.getImageDescriptor(FrameworkImage.DELETE));
+ }
- @Override
- public void run() {
- try {
- MessageDialog dialog =
- new MessageDialog(Display.getCurrent().getActiveShell(), "Confirm Artifact Deletion", null,
- " Are you sure you want to delete this artifact and all of the default hierarchy children?",
- MessageDialog.QUESTION, new String[] {IDialogConstants.YES_LABEL, IDialogConstants.NO_LABEL}, 1);
- if (dialog.open() == Window.OK) {
- getSelectedArtifact().deleteAndPersist();
- }
- } catch (Exception ex) {
- OseeLog.log(SkynetGuiPlugin.class, OseeLevel.SEVERE_POPUP, ex);
- }
- }
- }
+ @Override
+ public void run() {
+ try {
+ MessageDialog dialog =
+ new MessageDialog(
+ Display.getCurrent().getActiveShell(),
+ "Confirm Artifact Deletion",
+ null,
+ " Are you sure you want to delete this artifact and all of the default hierarchy children?",
+ MessageDialog.QUESTION, new String[] {IDialogConstants.YES_LABEL,
+ IDialogConstants.NO_LABEL}, 1);
+ if (dialog.open() == Window.OK) {
+ getSelectedArtifact().deleteAndPersist();
+ }
+ } catch (Exception ex) {
+ OseeLog.log(SkynetGuiPlugin.class, OseeLevel.SEVERE_POPUP, ex);
+ }
+ }
+ }
- private final class OpenHistoryAction extends Action {
+ private final class OpenHistoryAction extends Action {
- public OpenHistoryAction() {
- super();
- setImageDescriptor(ImageManager.getImageDescriptor(FrameworkImage.DB_ICON_BLUE));
- setToolTipText("Show this artifact in the Resource History");
- }
+ public OpenHistoryAction() {
+ super();
+ setImageDescriptor(ImageManager.getImageDescriptor(FrameworkImage.DB_ICON_BLUE));
+ setToolTipText("Show this artifact in the Resource History");
+ }
- @Override
- public void run() {
- try {
- HistoryView.open(getSelectedArtifact());
- } catch (Exception ex) {
- OseeLog.log(getClass(), OseeLevel.SEVERE_POPUP, ex);
- }
- }
- }
+ @Override
+ public void run() {
+ try {
+ HistoryView.open(getSelectedArtifact());
+ } catch (Exception ex) {
+ OseeLog.log(getClass(), OseeLevel.SEVERE_POPUP, ex);
+ }
+ }
+ }
- private final class RevealInExplorerAction extends Action {
- public RevealInExplorerAction() {
- super();
- setImageDescriptor(ImageManager.getImageDescriptor(FrameworkImage.MAGNIFY));
- setToolTipText("Reveal this artifact in the Artifact Explorer");
- }
+ private final class RevealInExplorerAction extends Action {
+ public RevealInExplorerAction() {
+ super();
+ setImageDescriptor(ImageManager.getImageDescriptor(FrameworkImage.MAGNIFY));
+ setToolTipText("Reveal this artifact in the Artifact Explorer");
+ }
- @Override
- public void run() {
- try {
- ArtifactExplorer.revealArtifact(getSelectedArtifact());
- } catch (Exception ex) {
- OseeLog.log(getClass(), OseeLevel.SEVERE_POPUP, ex);
- }
- }
- }
+ @Override
+ public void run() {
+ try {
+ ArtifactExplorer.revealArtifact(getSelectedArtifact());
+ } catch (Exception ex) {
+ OseeLog.log(getClass(), OseeLevel.SEVERE_POPUP, ex);
+ }
+ }
+ }
- private final class AccessControlAction extends Action {
- public AccessControlAction() {
- super();
- setImageDescriptor(ImageManager.getImageDescriptor(FrameworkImage.AUTHENTICATED));
- setToolTipText("&Access Control");
- setText("&Access Control");
- }
+ private final class AccessControlAction extends Action {
+ public AccessControlAction() {
+ super();
+ setImageDescriptor(ImageManager.getImageDescriptor(FrameworkImage.AUTHENTICATED));
+ setToolTipText("&Access Control");
+ setText("&Access Control");
+ }
- @Override
- public void run() {
- try {
- PolicyDialog pd = new PolicyDialog(Display.getCurrent().getActiveShell(), getSelectedArtifact());
- pd.open();
- } catch (Exception ex) {
- OseeLog.log(getClass(), OseeLevel.SEVERE_POPUP, ex);
- }
- }
- }
+ @Override
+ public void run() {
+ try {
+ PolicyDialog pd = new PolicyDialog(Display.getCurrent().getActiveShell(), getSelectedArtifact());
+ pd.open();
+ } catch (Exception ex) {
+ OseeLog.log(getClass(), OseeLevel.SEVERE_POPUP, ex);
+ }
+ }
+ }
- public static final class DirtyReportAction extends Action {
- private final Artifact artifact;
+ public static final class DirtyReportAction extends Action {
+ private final Artifact artifact;
- public DirtyReportAction(Artifact artifact) {
- super();
- this.artifact = artifact;
- setImageDescriptor(ImageManager.getImageDescriptor(FrameworkImage.DIRTY));
- setToolTipText("&Dirty Report");
- setText("&Dirty Report");
- }
+ public DirtyReportAction(Artifact artifact) {
+ super();
+ this.artifact = artifact;
+ setImageDescriptor(ImageManager.getImageDescriptor(FrameworkImage.DIRTY));
+ setToolTipText("&Dirty Report");
+ setText("&Dirty Report");
+ }
- @Override
- public void run() {
- String rString = null;
- for (Attribute<?> attribute : artifact.internalGetAttributes()) {
- if (attribute.isDirty()) {
- rString = "Attribute: " + attribute.getNameValueDescription();
- break;
- }
- }
+ @Override
+ public void run() {
+ String rString = null;
+ for (Attribute<?> attribute : artifact.internalGetAttributes()) {
+ if (attribute.isDirty()) {
+ rString = "Attribute: " + attribute.getNameValueDescription();
+ break;
+ }
+ }
- if (rString == null) {
- rString = RelationManager.reportHasDirtyLinks(artifact);
- }
- AWorkbench.popup("Dirty Report", rString == null || rString.equals("") ? "Not Dirty" : "Dirty -> " + rString);
- }
- }
+ if (rString == null) {
+ rString = RelationManager.reportHasDirtyLinks(artifact);
+ }
+ AWorkbench.popup("Dirty Report", rString == null || rString.equals("") ? "Not Dirty" : "Dirty -> " + rString);
+ }
+ }
- private final class CopyArtifactURLAction extends Action {
- public CopyArtifactURLAction() {
- super();
- setImageDescriptor(ImageManager.getImageDescriptor(FrameworkImage.COPYTOCLIPBOARD));
- setToolTipText("Copy artifact url link to clipboard. NOTE: This is a link pointing to the latest version of the artifact.");
- }
+ private final class CopyArtifactURLAction extends Action {
+ public CopyArtifactURLAction() {
+ super();
+ setImageDescriptor(ImageManager.getImageDescriptor(FrameworkImage.COPYTOCLIPBOARD));
+ setToolTipText("Copy artifact url link to clipboard. NOTE: This is a link pointing to the latest version of the artifact.");
+ }
- @Override
- public void run() {
- if (getSelectedArtifact() != null) {
- Clipboard clipboard = null;
- try {
- URL url = ArtifactURL.getExternalArtifactLink(getSelectedArtifact());
- clipboard = new Clipboard(null);
- clipboard.setContents(new Object[] {url.toString()}, new Transfer[] {TextTransfer.getInstance()});
- } catch (Exception ex) {
- OseeLog.log(SkynetGuiPlugin.class, Level.SEVERE, String.format(
- "Error obtaining url for - guid: [%s] branch:[%s]", getSelectedArtifact().getGuid(),
- getSelectedArtifact().getBranch()), ex);
- } finally {
- if (clipboard != null && !clipboard.isDisposed()) {
- clipboard.dispose();
- clipboard = null;
- }
- }
- }
- }
- }
+ @Override
+ public void run() {
+ if (getSelectedArtifact() != null) {
+ Clipboard clipboard = null;
+ try {
+ URL url = ArtifactURL.getExternalArtifactLink(getSelectedArtifact());
+ clipboard = new Clipboard(null);
+ clipboard.setContents(new Object[] {url.toString()}, new Transfer[] {TextTransfer.getInstance()});
+ } catch (Exception ex) {
+ OseeLog.log(SkynetGuiPlugin.class, Level.SEVERE, String.format(
+ "Error obtaining url for - guid: [%s] branch:[%s]", getSelectedArtifact().getGuid(),
+ getSelectedArtifact().getBranch()), ex);
+ } finally {
+ if (clipboard != null && !clipboard.isDisposed()) {
+ clipboard.dispose();
+ clipboard = null;
+ }
+ }
+ }
+ }
+ }
- private final class OpenOutlineAction extends Action {
- public OpenOutlineAction() {
- super();
- setImageDescriptor(ImageManager.getImageDescriptor(FrameworkImage.OUTLINE));
- setToolTipText("Open Outline");
- }
+ private final class OpenOutlineAction extends Action {
+ public OpenOutlineAction() {
+ super();
+ setImageDescriptor(ImageManager.getImageDescriptor(FrameworkImage.OUTLINE));
+ setToolTipText("Open Outline");
+ }
- @Override
- public void run() {
- try {
- PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().showView(
- "org.eclipse.ui.views.ContentOutline");
- } catch (PartInitException ex) {
- OseeLog.log(SkynetGuiPlugin.class, OseeLevel.SEVERE_POPUP, "Unable to open outline", ex);
- }
- }
- }
+ @Override
+ public void run() {
+ try {
+ PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().showView(
+ "org.eclipse.ui.views.ContentOutline");
+ } catch (PartInitException ex) {
+ OseeLog.log(SkynetGuiPlugin.class, OseeLevel.SEVERE_POPUP, "Unable to open outline", ex);
+ }
+ }
+ }
}
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/editor/ArtifactEditorContributor.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/editor/ArtifactEditorContributor.java
index 3bff197ec1..7d1ec1d890 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/editor/ArtifactEditorContributor.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/editor/ArtifactEditorContributor.java
@@ -23,79 +23,70 @@ import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.part.MultiPageEditorActionBarContributor;
import org.eclipse.ui.texteditor.StatusLineContributionItem;
-/**
- * Manages the installation/deinstallation of global actions for multi-page editors. Responsible for the redirection of
- * global actions to the active editor. Multi-page contributor replaces the contributors for the individual editors in
- * the multi-page editor.
- */
public class ArtifactEditorContributor extends MultiPageEditorActionBarContributor {
- private StatusLineContributionItem typeStatusItem;
- private ShowInExplorerAction showInExplorerAction;
-
- /**
- * Creates a multi-page contributor.
- */
- public ArtifactEditorContributor() {
- super();
-
- createActions();
- }
-
- @Override
- public void setActiveEditor(IEditorPart part) {
- super.setActiveEditor(part);
- Artifact artifact = (Artifact) part.getAdapter(Artifact.class);
- if (artifact != null) {
- typeStatusItem.setText(artifact.getArtifactType().getName());
- typeStatusItem.setImage(ArtifactImageManager.getImage(artifact));
- showInExplorerAction.setArtifact(artifact);
-
- RelationsComposite composite = (RelationsComposite) part.getAdapter(RelationsComposite.class);
- if (composite != null) {
- composite.getTreeViewer().addSelectionChangedListener(
- new SelectionCountChangeListener(this.getActionBars().getStatusLineManager()));
- }
- }
- }
-
- @Override
- public void setActivePage(IEditorPart part) {
- }
-
- private void createActions() {
- typeStatusItem = new StatusLineContributionItem("skynet.artifactType", true, 25);
- typeStatusItem.setToolTipText("The type of the artifact being edited.");
-
- showInExplorerAction = new ShowInExplorerAction();
- }
-
- @Override
- public void contributeToStatusLine(IStatusLineManager statusLineManager) {
- statusLineManager.add(typeStatusItem);
- OseeContributionItem.addTo(statusLineManager);
- }
-
- @Override
- public void contributeToCoolBar(ICoolBarManager coolBarManager) {
- coolBarManager.add(showInExplorerAction);
- }
-
- private static class ShowInExplorerAction extends Action {
- private Artifact artifact;
-
- public ShowInExplorerAction() {
- setText("Show in Artifact Explorer");
- setToolTipText("Show the Artifact being edited in the Artifact Explorer");
- }
-
- public void setArtifact(Artifact artifact) {
- this.artifact = artifact;
- }
-
- @Override
- public void run() {
- ArtifactExplorer.revealArtifact(artifact);
- }
- }
+ private StatusLineContributionItem typeStatusItem;
+ private ShowInExplorerAction showInExplorerAction;
+
+ public ArtifactEditorContributor() {
+ super();
+ createActions();
+ }
+
+ @Override
+ public void setActiveEditor(IEditorPart part) {
+ super.setActiveEditor(part);
+ Artifact artifact = (Artifact) part.getAdapter(Artifact.class);
+ if (artifact != null) {
+ typeStatusItem.setText(artifact.getArtifactType().getName());
+ typeStatusItem.setImage(ArtifactImageManager.getImage(artifact));
+ showInExplorerAction.setArtifact(artifact);
+
+ RelationsComposite composite = (RelationsComposite) part.getAdapter(RelationsComposite.class);
+ if (composite != null) {
+ composite.getTreeViewer().addSelectionChangedListener(
+ new SelectionCountChangeListener(this.getActionBars().getStatusLineManager()));
+ }
+ }
+ }
+
+ @Override
+ public void setActivePage(IEditorPart part) {
+ }
+
+ private void createActions() {
+ typeStatusItem = new StatusLineContributionItem("skynet.artifactType", true, 25);
+ typeStatusItem.setToolTipText("The type of the artifact being edited.");
+
+ showInExplorerAction = new ShowInExplorerAction();
+ }
+
+ @Override
+ public void contributeToStatusLine(IStatusLineManager statusLineManager) {
+ statusLineManager.add(typeStatusItem);
+ OseeContributionItem.addTo(statusLineManager);
+ }
+
+ @Override
+ public void contributeToCoolBar(ICoolBarManager coolBarManager) {
+ coolBarManager.add(showInExplorerAction);
+ }
+
+ private static class ShowInExplorerAction extends Action {
+ private Artifact artifact;
+
+ public ShowInExplorerAction() {
+ setText("Show in Artifact Explorer");
+ setToolTipText("Show the Artifact being edited in the Artifact Explorer");
+ }
+
+ public void setArtifact(Artifact artifact) {
+ this.artifact = artifact;
+ }
+
+ @Override
+ public void run() {
+ ArtifactExplorer.revealArtifact(artifact);
+ }
+ }
}
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/editor/ArtifactEditorEventManager.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/editor/ArtifactEditorEventManager.java
index 8782844855..fabece8937 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/editor/ArtifactEditorEventManager.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/editor/ArtifactEditorEventManager.java
@@ -23,8 +23,8 @@ import org.eclipse.osee.framework.skynet.core.event2.artifact.EventBasicGuidArti
import org.eclipse.osee.framework.skynet.core.event2.artifact.EventModType;
import org.eclipse.osee.framework.skynet.core.event2.artifact.IArtifactEventListener;
import org.eclipse.osee.framework.skynet.core.event2.filter.IEventFilter;
-import org.eclipse.osee.framework.ui.plugin.util.Displays;
import org.eclipse.osee.framework.ui.skynet.ArtifactImageManager;
+import org.eclipse.osee.framework.ui.swt.Displays;
/**
* Common location for event handling for ArtifactExplorers in order to keep number of registrations and processing to a
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/editor/BaseArtifactEditorInput.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/editor/BaseArtifactEditorInput.java
index a28949539b..e655710d55 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/editor/BaseArtifactEditorInput.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/editor/BaseArtifactEditorInput.java
@@ -22,67 +22,73 @@ import org.eclipse.ui.IPersistableElement;
* @author Roberto E. Escobar
*/
public abstract class BaseArtifactEditorInput implements IEditorInput {
- private final Artifact artifact;
+ private final Artifact artifact;
- public BaseArtifactEditorInput(Artifact artifact) {
- this.artifact = artifact;
- }
+ public BaseArtifactEditorInput(Artifact artifact) {
+ this.artifact = artifact;
+ }
- @Override
- public boolean equals(Object obj) {
- boolean equals = false;
- if (obj instanceof BaseArtifactEditorInput) {
- BaseArtifactEditorInput otherEdInput = (BaseArtifactEditorInput) obj;
- equals = artifact == otherEdInput.artifact;
- }
- return equals;
- }
+ @Override
+ public boolean equals(Object obj) {
+ boolean equals = false;
+ if (obj instanceof BaseArtifactEditorInput) {
+ BaseArtifactEditorInput otherEdInput = (BaseArtifactEditorInput) obj;
+ equals = artifact == otherEdInput.artifact;
+ }
+ return equals;
+ }
- public boolean exists() {
- return true;
- }
+ @Override
+ public boolean exists() {
+ return true;
+ }
- public ImageDescriptor getImageDescriptor() {
- return ArtifactImageManager.getImageDescriptor(artifact);
- }
+ @Override
+ public ImageDescriptor getImageDescriptor() {
+ return ArtifactImageManager.getImageDescriptor(artifact);
+ }
- public Image getImage() {
- return ArtifactImageManager.getImage(artifact);
- }
+ public Image getImage() {
+ return ArtifactImageManager.getImage(artifact);
+ }
- public String getName() {
- if (artifact == null) {
- return "No Artifact Input Provided";
- }
- return String.format("%s%s", artifact.getVersionedName(), artifact.isReadOnly() ? " (Read-Only)" : "");
- }
+ @Override
+ public String getName() {
+ if (artifact == null) {
+ return "No Artifact Input Provided";
+ }
+ return String.format("%s%s", artifact.getVersionedName(), artifact.isReadOnly() ? " (Read-Only)" : "");
+ }
- public IPersistableElement getPersistable() {
- return null;
- }
+ @Override
+ public IPersistableElement getPersistable() {
+ return null;
+ }
- public String getToolTipText() {
- return getName();
- }
+ @Override
+ public String getToolTipText() {
+ return getName();
+ }
- @SuppressWarnings("unchecked")
- public Object getAdapter(Class adapter) {
- if (Artifact.class.equals(adapter)) {
- return getArtifact();
- }
- return null;
- }
+ @SuppressWarnings("rawtypes")
+ @Override
+ public Object getAdapter(Class adapter) {
+ if (Artifact.class.equals(adapter)) {
+ return getArtifact();
+ }
+ return null;
+ }
- public Artifact getArtifact() {
- return artifact;
- }
+ public Artifact getArtifact() {
+ return artifact;
+ }
- public boolean isReadOnly() {
- return artifact == null || artifact.isReadOnly();
- }
+ public boolean isReadOnly() {
+ return artifact == null || artifact.isReadOnly();
+ }
- @Override
- public int hashCode() {
- return this.artifact.hashCode();
- }
+ @Override
+ public int hashCode() {
+ return this.artifact.hashCode();
+ }
}
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/editor/pages/ArtifactFormPage.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/editor/pages/ArtifactFormPage.java
index 1d99fe24ef..2e0f30a622 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/editor/pages/ArtifactFormPage.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/editor/pages/ArtifactFormPage.java
@@ -28,6 +28,7 @@ import org.eclipse.osee.framework.ui.skynet.artifact.editor.sections.DetailsForm
import org.eclipse.osee.framework.ui.skynet.artifact.editor.sections.RelationsFormSection;
import org.eclipse.osee.framework.ui.skynet.util.FormsUtil;
import org.eclipse.osee.framework.ui.swt.ALayout;
+import org.eclipse.osee.framework.ui.swt.Displays;
import org.eclipse.osee.framework.ui.swt.ImageManager;
import org.eclipse.osee.framework.ui.swt.Widgets;
import org.eclipse.swt.SWT;
@@ -37,7 +38,6 @@ import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Label;
import org.eclipse.ui.forms.IManagedForm;
import org.eclipse.ui.forms.IMessage;
@@ -53,198 +53,198 @@ import org.eclipse.ui.forms.widgets.Section;
public class ArtifactFormPage extends FormPage {
- private enum SectionEnum {
- Attributes,
- Relations,
- Details;
- }
-
- private final Map<SectionEnum, SectionPart> sectionParts;
- private FormText infoText;
-
- public ArtifactFormPage(FormEditor editor, String id, String title) {
- super(editor, id, title);
- this.sectionParts = new LinkedHashMap<SectionEnum, SectionPart>();
- }
-
- @Override
- protected void createFormContent(IManagedForm managedForm) {
- super.createFormContent(managedForm);
- sectionParts.clear();
-
- final ScrolledForm form = managedForm.getForm();
- final FormToolkit toolkit = managedForm.getToolkit();
-
- GridLayout layout = new GridLayout();
- layout.numColumns = 1;
- layout.marginHeight = 10;
- layout.marginWidth = 6;
- layout.horizontalSpacing = 20;
- form.getBody().setLayout(layout);
- form.getBody().setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, true));
-
- updateTitle(form);
- updateImage(form);
- updateArtifactInfoArea(toolkit, form, true);
- addToolBar(toolkit, form, true);
- FormsUtil.addHeadingGradient(toolkit, form, true);
- addMessageDecoration(form);
-
- int sectionStyle = Section.TITLE_BAR | Section.TWISTIE;
-
- sectionParts.put(SectionEnum.Attributes, new AttributesFormSection(getEditor(), form.getBody(), toolkit,
- sectionStyle | Section.EXPANDED));
- sectionParts.put(SectionEnum.Relations, new RelationsFormSection(getEditor(), form.getBody(), toolkit,
- sectionStyle));
- sectionParts.put(SectionEnum.Details, new DetailsFormSection(getEditor(), form.getBody(), toolkit, sectionStyle));
-
- for (SectionPart part : sectionParts.values()) {
- managedForm.addPart(part);
- Section section = part.getSection();
- section.marginWidth = 0;
- section.marginHeight = 2;
- }
- form.layout();
- }
-
- @Override
- public ArtifactEditor getEditor() {
- return (ArtifactEditor) super.getEditor();
- }
-
- private void addMessageDecoration(ScrolledForm form) {
- form.getForm().addMessageHyperlinkListener(new HyperlinkAdapter() {
-
- @Override
- public void linkActivated(HyperlinkEvent e) {
- String title = e.getLabel();
- Object href = e.getHref();
- if (href instanceof IMessage[]) {
- Point noteLocation = ((Control) e.widget).toDisplay(0, 0);
- noteLocation.x += 10;
- noteLocation.y += 10;
-
- MessageSummaryNote note = new MessageSummaryNote(getManagedForm(), title, (IMessage[]) href);
- note.setLocation(noteLocation);
- note.open();
- }
- }
-
- });
- }
-
- private void addToolBar(FormToolkit toolkit, ScrolledForm form, boolean add) {
- IToolBarManager manager = form.getToolBarManager();
- if (add) {
- manager.add(new RefreshAction());
- manager.add(new Separator());
- getEditor().getActionBarContributor().contributeToToolBar(manager);
- manager.update(true);
- } else {
- manager.removeAll();
- }
- form.reflow(true);
- }
-
- private void updateTitle(ScrolledForm form) {
- form.setText(getEditorInput().getName());
- }
-
- private void updateImage(ScrolledForm form) {
- form.setImage(getEditor().getEditorInput().getImage());
- }
-
- private String getArtifactShortInfo() {
- String description;
- try {
- Artifact artifact = getEditor().getEditorInput().getArtifact();
- description =
- String.format("<form><p>%s<b>Branch:</b> %s <b>Type:</b> %s <b>GUID:</b> %s</p></form>",
- !artifact.isDeleted() ? "" : "<b>ARTIFACT DELETED - </b> ", artifact.getBranch().getShortName(),
- artifact.getArtifactTypeName(), artifact.getGuid());
- } catch (Exception ex) {
- description = Lib.exceptionToString(ex);
- }
- return description;
- }
-
- private void updateArtifactInfoArea(FormToolkit toolkit, ScrolledForm form, boolean add) {
- if (add) {
- Composite infoArea = toolkit.createComposite(form.getForm().getBody(), SWT.WRAP);
- infoArea.setLayout(ALayout.getZeroMarginLayout(2, false));
- infoArea.setLayoutData(new GridData(SWT.BEGINNING, SWT.FILL, true, false));
-
- Label label = toolkit.createLabel(infoArea, "", SWT.WRAP);
- Image image;
- try {
- Artifact artifact = getEditor().getEditorInput().getArtifact();
- if (artifact.isDeleted()) {
- image = ImageManager.getImage(FrameworkImage.TRASH);
- } else {
- image = MessageDialog.getImage(MessageDialog.DLG_IMG_MESSAGE_INFO);
- }
- } catch (Exception ex) {
- image = MessageDialog.getImage(MessageDialog.DLG_IMG_MESSAGE_ERROR);
- }
- label.setImage(image);
-
- infoText = toolkit.createFormText(infoArea, false);
- infoText.setText(getArtifactShortInfo(), true, false);
- infoText.setForeground(Display.getDefault().getSystemColor(SWT.COLOR_DARK_GRAY));
- infoText.setToolTipText("The human readable id and database id for this artifact");
- } else {
- infoText.setText(getArtifactShortInfo(), true, false);
- }
- }
-
- @Override
- public void dispose() {
- for (SectionPart part : sectionParts.values()) {
- part.dispose();
- }
- super.dispose();
- }
-
- public RelationsComposite getRelationsComposite() {
- SectionPart section = sectionParts.get(SectionEnum.Relations);
- if (section instanceof RelationsFormSection) {
- return ((RelationsFormSection) section).getRelationComposite();
- }
- return null;
- }
-
- public void refresh() {
- final ScrolledForm sForm = getManagedForm().getForm();
- updateTitle(sForm);
- updateImage(sForm);
- updateArtifactInfoArea(getManagedForm().getToolkit(), sForm, false);
- for (SectionPart part : sectionParts.values()) {
- part.refresh();
- }
- sForm.getBody().layout(true);
- sForm.reflow(true);
- getManagedForm().refresh();
- }
-
- @Override
- public void showBusy(boolean busy) {
- super.showBusy(busy);
- if (Widgets.isAccessible(getManagedForm().getForm())) {
- getManagedForm().getForm().getForm().setBusy(busy);
- }
- }
-
- private final class RefreshAction extends Action {
-
- public RefreshAction() {
- super();
- setImageDescriptor(ImageManager.getImageDescriptor(PluginUiImage.REFRESH));
- setToolTipText("Refresh Editor");
- }
-
- @Override
- public void run() {
- refresh();
- }
- }
+ private enum SectionEnum {
+ Attributes,
+ Relations,
+ Details;
+ }
+
+ private final Map<SectionEnum, SectionPart> sectionParts;
+ private FormText infoText;
+
+ public ArtifactFormPage(FormEditor editor, String id, String title) {
+ super(editor, id, title);
+ this.sectionParts = new LinkedHashMap<SectionEnum, SectionPart>();
+ }
+
+ @Override
+ protected void createFormContent(IManagedForm managedForm) {
+ super.createFormContent(managedForm);
+ sectionParts.clear();
+
+ final ScrolledForm form = managedForm.getForm();
+ final FormToolkit toolkit = managedForm.getToolkit();
+
+ GridLayout layout = new GridLayout();
+ layout.numColumns = 1;
+ layout.marginHeight = 10;
+ layout.marginWidth = 6;
+ layout.horizontalSpacing = 20;
+ form.getBody().setLayout(layout);
+ form.getBody().setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, true));
+
+ updateTitle(form);
+ updateImage(form);
+ updateArtifactInfoArea(toolkit, form, true);
+ addToolBar(toolkit, form, true);
+ FormsUtil.addHeadingGradient(toolkit, form, true);
+ addMessageDecoration(form);
+
+ int sectionStyle = Section.TITLE_BAR | Section.TWISTIE;
+
+ sectionParts.put(SectionEnum.Attributes, new AttributesFormSection(getEditor(), form.getBody(), toolkit,
+ sectionStyle | Section.EXPANDED));
+ sectionParts.put(SectionEnum.Relations, new RelationsFormSection(getEditor(), form.getBody(), toolkit,
+ sectionStyle));
+ sectionParts.put(SectionEnum.Details, new DetailsFormSection(getEditor(), form.getBody(), toolkit, sectionStyle));
+
+ for (SectionPart part : sectionParts.values()) {
+ managedForm.addPart(part);
+ Section section = part.getSection();
+ section.marginWidth = 0;
+ section.marginHeight = 2;
+ }
+ form.layout();
+ }
+
+ @Override
+ public ArtifactEditor getEditor() {
+ return (ArtifactEditor) super.getEditor();
+ }
+
+ private void addMessageDecoration(ScrolledForm form) {
+ form.getForm().addMessageHyperlinkListener(new HyperlinkAdapter() {
+
+ @Override
+ public void linkActivated(HyperlinkEvent e) {
+ String title = e.getLabel();
+ Object href = e.getHref();
+ if (href instanceof IMessage[]) {
+ Point noteLocation = ((Control) e.widget).toDisplay(0, 0);
+ noteLocation.x += 10;
+ noteLocation.y += 10;
+
+ MessageSummaryNote note = new MessageSummaryNote(getManagedForm(), title, (IMessage[]) href);
+ note.setLocation(noteLocation);
+ note.open();
+ }
+ }
+
+ });
+ }
+
+ private void addToolBar(FormToolkit toolkit, ScrolledForm form, boolean add) {
+ IToolBarManager manager = form.getToolBarManager();
+ if (add) {
+ manager.add(new RefreshAction());
+ manager.add(new Separator());
+ getEditor().getActionBarContributor().contributeToToolBar(manager);
+ manager.update(true);
+ } else {
+ manager.removeAll();
+ }
+ form.reflow(true);
+ }
+
+ private void updateTitle(ScrolledForm form) {
+ form.setText(getEditorInput().getName());
+ }
+
+ private void updateImage(ScrolledForm form) {
+ form.setImage(getEditor().getEditorInput().getImage());
+ }
+
+ private String getArtifactShortInfo() {
+ String description;
+ try {
+ Artifact artifact = getEditor().getEditorInput().getArtifact();
+ description =
+ String.format("<form><p>%s<b>Branch:</b> %s <b>Type:</b> %s <b>GUID:</b> %s</p></form>",
+ !artifact.isDeleted() ? "" : "<b>ARTIFACT DELETED - </b> ",
+ artifact.getBranch().getShortName(), artifact.getArtifactTypeName(), artifact.getGuid());
+ } catch (Exception ex) {
+ description = Lib.exceptionToString(ex);
+ }
+ return description;
+ }
+
+ private void updateArtifactInfoArea(FormToolkit toolkit, ScrolledForm form, boolean add) {
+ if (add) {
+ Composite infoArea = toolkit.createComposite(form.getForm().getBody(), SWT.WRAP);
+ infoArea.setLayout(ALayout.getZeroMarginLayout(2, false));
+ infoArea.setLayoutData(new GridData(SWT.BEGINNING, SWT.FILL, true, false));
+
+ Label label = toolkit.createLabel(infoArea, "", SWT.WRAP);
+ Image image;
+ try {
+ Artifact artifact = getEditor().getEditorInput().getArtifact();
+ if (artifact.isDeleted()) {
+ image = ImageManager.getImage(FrameworkImage.TRASH);
+ } else {
+ image = MessageDialog.getImage(MessageDialog.DLG_IMG_MESSAGE_INFO);
+ }
+ } catch (Exception ex) {
+ image = MessageDialog.getImage(MessageDialog.DLG_IMG_MESSAGE_ERROR);
+ }
+ label.setImage(image);
+
+ infoText = toolkit.createFormText(infoArea, false);
+ infoText.setText(getArtifactShortInfo(), true, false);
+ infoText.setForeground(Displays.getSystemColor(SWT.COLOR_DARK_GRAY));
+ infoText.setToolTipText("The human readable id and database id for this artifact");
+ } else {
+ infoText.setText(getArtifactShortInfo(), true, false);
+ }
+ }
+
+ @Override
+ public void dispose() {
+ for (SectionPart part : sectionParts.values()) {
+ part.dispose();
+ }
+ super.dispose();
+ }
+
+ public RelationsComposite getRelationsComposite() {
+ SectionPart section = sectionParts.get(SectionEnum.Relations);
+ if (section instanceof RelationsFormSection) {
+ return ((RelationsFormSection) section).getRelationComposite();
+ }
+ return null;
+ }
+
+ public void refresh() {
+ final ScrolledForm sForm = getManagedForm().getForm();
+ updateTitle(sForm);
+ updateImage(sForm);
+ updateArtifactInfoArea(getManagedForm().getToolkit(), sForm, false);
+ for (SectionPart part : sectionParts.values()) {
+ part.refresh();
+ }
+ sForm.getBody().layout(true);
+ sForm.reflow(true);
+ getManagedForm().refresh();
+ }
+
+ @Override
+ public void showBusy(boolean busy) {
+ super.showBusy(busy);
+ if (Widgets.isAccessible(getManagedForm().getForm())) {
+ getManagedForm().getForm().getForm().setBusy(busy);
+ }
+ }
+
+ private final class RefreshAction extends Action {
+
+ public RefreshAction() {
+ super();
+ setImageDescriptor(ImageManager.getImageDescriptor(PluginUiImage.REFRESH));
+ setToolTipText("Refresh Editor");
+ }
+
+ @Override
+ public void run() {
+ refresh();
+ }
+ }
}
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/editor/parts/AttributeFormPart.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/editor/parts/AttributeFormPart.java
index ff05fa8acf..100a7f587a 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/editor/parts/AttributeFormPart.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/editor/parts/AttributeFormPart.java
@@ -11,15 +11,10 @@
package org.eclipse.osee.framework.ui.skynet.artifact.editor.parts;
import java.util.Arrays;
-import java.util.Collections;
import java.util.List;
import org.eclipse.jface.dialogs.IMessageProvider;
-import org.eclipse.osee.framework.access.AccessControlManager;
import org.eclipse.osee.framework.core.enums.CoreAttributeTypes;
-import org.eclipse.osee.framework.core.enums.PermissionEnum;
-import org.eclipse.osee.framework.core.exception.OseeArgumentException;
import org.eclipse.osee.framework.core.exception.OseeCoreException;
-import org.eclipse.osee.framework.core.model.AccessData;
import org.eclipse.osee.framework.core.model.type.AttributeType;
import org.eclipse.osee.framework.logging.OseeLevel;
import org.eclipse.osee.framework.logging.OseeLog;
@@ -62,224 +57,224 @@ import org.eclipse.ui.forms.widgets.FormToolkit;
*/
public class AttributeFormPart extends AbstractFormPart {
- private final ArtifactEditor editor;
- private Composite composite;
-
- public AttributeFormPart(ArtifactEditor editor) {
- this.editor = editor;
- }
-
- public void createContents(Composite parent) {
- final FormToolkit toolkit = getManagedForm().getToolkit();
- composite = toolkit.createComposite(parent, SWT.WRAP);
- composite.setLayout(ALayout.getZeroMarginLayout(1, false));
- composite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
- composite.setVisible(false);
-
- try {
- Artifact artifact = editor.getEditorInput().getArtifact();
- boolean isEditable = true;//!artifact.isReadOnly();
-
- List<AttributeType> types = Arrays.asList(AttributeTypeUtil.getTypesWithData(artifact));
- boolean willHaveASection = hasWordAttribute(types);
- for (AttributeType attributeType : types) {
- if (AttributeTypeManager.isBaseTypeCompatible(WordAttribute.class, attributeType) || attributeType.equals(CoreAttributeTypes.RELATION_ORDER)) {
- createAttributeTypeControlsInSection(parent, toolkit, attributeType, willHaveASection, false);
- } else {
- createAttributeTypeControls(composite, toolkit, artifact, attributeType, willHaveASection, isEditable,
- false);
- }
- }
- setLabelFonts(composite, FontManager.getDefaultLabelFont());
- layoutControls(composite);
-
- for (XWidget xWidget : XWidgetUtility.findXWidgetsInControl(composite)) {
- xWidget.addXModifiedListener(new XWidgetValidationListener());
- }
- composite.setVisible(true);
-
- } catch (OseeCoreException ex) {
- OseeLog.log(SkynetGuiPlugin.class, OseeLevel.SEVERE_POPUP, "Unable to access attribute types", ex);
- }
-
- }
-
- // private void setPermissions(Composite parent) {
- // for (XWidget widget : XWidgetUtility.findXWidgetsInControl(parent)) {
- // IAttributeXWidgetProvider xWidgetProvider = AttributeXWidgetManager.getAttributeXWidgetProvider(attributeType);
- // List<DynamicXWidgetLayoutData> concreteWidgets = xWidgetProvider.getDynamicXWidgetLayoutData(attributeType);
- // setPermissions(artifact, attributeType, concreteWidgets);
- // }
- // }
-
- private boolean hasWordAttribute(List<AttributeType> types) throws OseeCoreException {
- for (AttributeType attributeType : types) {
- if (AttributeTypeManager.isBaseTypeCompatible(WordAttribute.class, attributeType)) {
- return true;
- }
- }
- return false;
- }
-
- @Override
- public void dispose() {
- Widgets.disposeWidget(composite);
- super.dispose();
- }
-
- private void setLabelFonts(Control parent, Font font) {
- if (parent instanceof Label) {
- Label label = (Label) parent;
- label.setFont(font);
- }
- if (parent instanceof Composite) {
- Composite container = (Composite) parent;
- for (Control child : container.getChildren()) {
- setLabelFonts(child, font);
- }
- container.layout();
- }
- }
-
- private void layoutControls(Control control) {
- if (control instanceof Label || control instanceof Button) {
- control.setLayoutData(new GridData(GridData.VERTICAL_ALIGN_BEGINNING));
- }
-
- if (control instanceof Composite) {
- Composite container = (Composite) control;
- for (Control child : container.getChildren()) {
- layoutControls(child);
- }
- }
- }
-
- private Composite createAttributeTypeControls(Composite parent, FormToolkit toolkit, Artifact artifact, AttributeType attributeType, boolean willHaveASection, boolean isEditable, boolean isExpandable) {
- Composite internalComposite = toolkit.createComposite(parent, SWT.WRAP);
- GridLayout layout = ALayout.getZeroMarginLayout(1, false);
- if (willHaveASection) {
- layout.marginLeft = 18;
- }
- internalComposite.setLayout(layout);
-
- internalComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
-
- try {
- IAttributeXWidgetProvider xWidgetProvider = AttributeXWidgetManager.getAttributeXWidgetProvider(attributeType);
- List<DynamicXWidgetLayoutData> concreteWidgets = xWidgetProvider.getDynamicXWidgetLayoutData(attributeType);
- if (isExpandable) {
- for (DynamicXWidgetLayoutData data : concreteWidgets) {
- data.getXOptionHandler().add(XOption.NO_LABEL);
- }
- }
- WorkPage workPage = new WorkPage(concreteWidgets, new DefaultXWidgetOptionResolver());
- workPage.createBody(getManagedForm(), internalComposite, artifact, null, isEditable);
-
- setPermissions(artifact, attributeType, concreteWidgets);
- } catch (OseeCoreException ex) {
- toolkit.createLabel(parent, String.format("Error creating controls for: [%s]", attributeType.getName()));
- }
- return internalComposite;
- }
-
- private void setPermissions(Artifact artifact, AttributeType attributeType, List<DynamicXWidgetLayoutData> concreteWidgets) throws OseeCoreException, OseeArgumentException {
- for (DynamicXWidgetLayoutData data : concreteWidgets) {
- if (data.getXWidget() != null && data.getXWidget().getControl() != null && !data.getXWidget().getControl().isDisposed()) {
- AccessData accessData = AccessControlManager.getAccessData(Collections.singletonList(artifact));
- data.getXWidget().setEditable(
- !accessData.getAttributeTypeMatches(artifact, attributeType, PermissionEnum.WRITE).isEmpty());
-
- // XWidgetValidateUtility.setStatus(new Status(Status.ERROR, SkynetGuiPlugin.PLUGIN_ID, ""), data.getXWidget());
- // data.getXWidget().setControlCausedMessage("1111", "No premission", 1);
- }
- }
- }
-
- private void createAttributeTypeControlsInSection(Composite parent, FormToolkit toolkit, AttributeType attributeType, boolean willHaveASection, boolean isEditable) {
- int style = ExpandableComposite.COMPACT | ExpandableComposite.TREE_NODE;
-
- Composite internalComposite = toolkit.createComposite(parent, SWT.WRAP);
- internalComposite.setLayout(new GridLayout());
- internalComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false));
-
- ExpandableComposite expandable = toolkit.createExpandableComposite(internalComposite, style);
- expandable.setText(attributeType.getName());
- expandable.setLayout(new GridLayout());
- expandable.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
-
- Artifact artifact = editor.getEditorInput().getArtifact();
-
- Composite composite =
- createAttributeTypeControls(expandable, toolkit, artifact, attributeType, willHaveASection, isEditable, true);
- expandable.setClient(composite);
-
- expandable.addExpansionListener(new IExpansionListener() {
-
- @Override
- public void expansionStateChanged(ExpansionEvent e) {
- getManagedForm().getForm().reflow(true);
- }
-
- @Override
- public void expansionStateChanging(ExpansionEvent e) {
- getManagedForm().getForm().reflow(false);
- }
-
- });
- toolkit.paintBordersFor(expandable);
- }
-
- @Override
- public void commit(boolean onSave) {
- int saveCount = 0;
- List<XWidget> widgets = XWidgetUtility.findXWidgetsInControl(composite);
- for (XWidget xWidget : widgets) {
- if (xWidget.isEditable()) {
- if (xWidget instanceof IArtifactWidget) {
- IArtifactWidget aWidget = (IArtifactWidget) xWidget;
- try {
- if (aWidget.isDirty().isTrue()) {
- aWidget.saveToArtifact();
- xWidget.removeControlCausedMessage("attribute.dirty");
- saveCount++;
- } else {
- saveCount++;
- }
- } catch (OseeCoreException ex) {
- ex.printStackTrace();
- }
- }
- } else {
- saveCount++;
- }
- }
-
- // Ensure all changes saved
- if (saveCount == widgets.size()) {
- super.commit(onSave);
- }
- }
-
- private final class XWidgetValidationListener implements XModifiedListener {
-
- @Override
- public void widgetModified(XWidget xWidget) {
- if (xWidget != null && xWidget instanceof IArtifactWidget) {
- IArtifactWidget aWidget = (IArtifactWidget) xWidget;
- try {
- Result result = aWidget.isDirty();
- if (result.isTrue()) {
- xWidget.setControlCausedMessage("attribute.dirty", "Dirty", IMessageProvider.WARNING);
- if (!isDirty()) {
- markDirty();
- }
- } else {
- xWidget.removeControlCausedMessage("attribute.dirty");
- }
- } catch (Exception ex) {
- xWidget.setControlCausedMessage("attribute.dirty", "Unable to compute isDirty", IMessageProvider.ERROR);
- }
- }
- }
- }
+ private final ArtifactEditor editor;
+ private Composite composite;
+
+ public AttributeFormPart(ArtifactEditor editor) {
+ this.editor = editor;
+ }
+
+ public void createContents(Composite parent) {
+ final FormToolkit toolkit = getManagedForm().getToolkit();
+ composite = toolkit.createComposite(parent, SWT.WRAP);
+ composite.setLayout(ALayout.getZeroMarginLayout(1, false));
+ composite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
+ composite.setVisible(false);
+
+ try {
+ Artifact artifact = editor.getEditorInput().getArtifact();
+ boolean isEditable = !artifact.isReadOnly();
+
+ List<AttributeType> types = Arrays.asList(AttributeTypeUtil.getTypesWithData(artifact));
+ boolean willHaveASection = hasWordAttribute(types);
+ for (AttributeType attributeType : types) {
+ if (AttributeTypeManager.isBaseTypeCompatible(WordAttribute.class, attributeType) || attributeType.equals(CoreAttributeTypes.RELATION_ORDER)) {
+ createAttributeTypeControlsInSection(parent, toolkit, attributeType, willHaveASection, false);
+ } else {
+ createAttributeTypeControls(composite, toolkit, artifact, attributeType, willHaveASection, isEditable,
+ false);
+ }
+ }
+ setLabelFonts(composite, FontManager.getDefaultLabelFont());
+ layoutControls(composite);
+
+ for (XWidget xWidget : XWidgetUtility.findXWidgetsInControl(composite)) {
+ xWidget.addXModifiedListener(new XWidgetValidationListener());
+ }
+ composite.setVisible(true);
+
+ } catch (OseeCoreException ex) {
+ OseeLog.log(SkynetGuiPlugin.class, OseeLevel.SEVERE_POPUP, "Unable to access attribute types", ex);
+ }
+
+ }
+
+ private boolean hasWordAttribute(List<AttributeType> types) throws OseeCoreException {
+ for (AttributeType attributeType : types) {
+ if (AttributeTypeManager.isBaseTypeCompatible(WordAttribute.class, attributeType)) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ @Override
+ public void dispose() {
+ Widgets.disposeWidget(composite);
+ super.dispose();
+ }
+
+ private void setLabelFonts(Control parent, Font font) {
+ if (parent instanceof Label) {
+ Label label = (Label) parent;
+ label.setFont(font);
+ }
+ if (parent instanceof Composite) {
+ Composite container = (Composite) parent;
+ for (Control child : container.getChildren()) {
+ setLabelFonts(child, font);
+ }
+ container.layout();
+ }
+ }
+
+ private void layoutControls(Control control) {
+ if (control instanceof Label || control instanceof Button) {
+ control.setLayoutData(new GridData(GridData.VERTICAL_ALIGN_BEGINNING));
+ }
+
+ if (control instanceof Composite) {
+ Composite container = (Composite) control;
+ for (Control child : container.getChildren()) {
+ layoutControls(child);
+ }
+ }
+ }
+
+ private Composite createAttributeTypeControls(Composite parent, FormToolkit toolkit, Artifact artifact, AttributeType attributeType, boolean willHaveASection, boolean isEditable, boolean isExpandable) {
+ Composite internalComposite = toolkit.createComposite(parent, SWT.WRAP);
+ GridLayout layout = ALayout.getZeroMarginLayout(1, false);
+ if (willHaveASection) {
+ layout.marginLeft = 18;
+ }
+ internalComposite.setLayout(layout);
+
+ internalComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
+
+ try {
+ IAttributeXWidgetProvider xWidgetProvider = AttributeXWidgetManager.getAttributeXWidgetProvider(attributeType);
+ List<DynamicXWidgetLayoutData> concreteWidgets = xWidgetProvider.getDynamicXWidgetLayoutData(attributeType);
+ if (isExpandable) {
+ for (DynamicXWidgetLayoutData data : concreteWidgets) {
+ data.getXOptionHandler().add(XOption.NO_LABEL);
+ }
+ }
+ WorkPage workPage = new WorkPage(concreteWidgets, new DefaultXWidgetOptionResolver());
+ workPage.createBody(getManagedForm(), internalComposite, artifact, null, isEditable);
+
+ } catch (OseeCoreException ex) {
+ toolkit.createLabel(parent, String.format("Error creating controls for: [%s]", attributeType.getName()));
+ }
+ return internalComposite;
+ }
+
+ // private void setPermissions(Artifact artifact, AttributeType attributeType, List<DynamicXWidgetLayoutData> concreteWidgets) throws OseeCoreException, OseeArgumentException {
+ // for (DynamicXWidgetLayoutData data : concreteWidgets) {
+ // if (data.getXWidget() != null && data.getXWidget().getControl() != null && !data.getXWidget().getControl().isDisposed()) {
+ // AccessData accessData = AccessControlManager.getAccessData(Collections.singletonList(artifact));
+ // data.getXWidget().setEditable(
+ // !accessData.getAttributeTypeMatches(artifact, attributeType, PermissionEnum.WRITE).isEmpty());
+ //
+ // XWidgetValidateUtility.setStatus(new Status(Status.ERROR, SkynetGuiPlugin.PLUGIN_ID, ""), data.getXWidget());
+ // // data.getXWidget().setControlCausedMessage("1111", "No premission", 1);
+ // }
+ // }
+ // }
+
+ // private void setPermissions(Composite parent) {
+ // for (XWidget widget : XWidgetUtility.findXWidgetsInControl(parent)) {
+ // IAttributeXWidgetProvider xWidgetProvider = AttributeXWidgetManager.getAttributeXWidgetProvider(attributeType);
+ // List<DynamicXWidgetLayoutData> concreteWidgets = xWidgetProvider.getDynamicXWidgetLayoutData(attributeType);
+ // setPermissions(artifact, attributeType, concreteWidgets);
+ // }
+ // }
+
+ private void createAttributeTypeControlsInSection(Composite parent, FormToolkit toolkit, AttributeType attributeType, boolean willHaveASection, boolean isEditable) {
+ int style = ExpandableComposite.COMPACT | ExpandableComposite.TREE_NODE;
+
+ Composite internalComposite = toolkit.createComposite(parent, SWT.WRAP);
+ internalComposite.setLayout(new GridLayout());
+ internalComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false));
+
+ ExpandableComposite expandable = toolkit.createExpandableComposite(internalComposite, style);
+ expandable.setText(attributeType.getName());
+ expandable.setLayout(new GridLayout());
+ expandable.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
+
+ Artifact artifact = editor.getEditorInput().getArtifact();
+
+ Composite composite =
+ createAttributeTypeControls(expandable, toolkit, artifact, attributeType, willHaveASection, isEditable,
+ true);
+ expandable.setClient(composite);
+
+ expandable.addExpansionListener(new IExpansionListener() {
+
+ @Override
+ public void expansionStateChanged(ExpansionEvent e) {
+ getManagedForm().getForm().reflow(true);
+ }
+
+ @Override
+ public void expansionStateChanging(ExpansionEvent e) {
+ getManagedForm().getForm().reflow(false);
+ }
+
+ });
+ toolkit.paintBordersFor(expandable);
+ }
+
+ @Override
+ public void commit(boolean onSave) {
+ int saveCount = 0;
+ List<XWidget> widgets = XWidgetUtility.findXWidgetsInControl(composite);
+ for (XWidget xWidget : widgets) {
+ if (xWidget.isEditable()) {
+ if (xWidget instanceof IArtifactWidget) {
+ IArtifactWidget aWidget = (IArtifactWidget) xWidget;
+ try {
+ if (aWidget.isDirty().isTrue()) {
+ aWidget.saveToArtifact();
+ xWidget.removeControlCausedMessage("attribute.dirty");
+ saveCount++;
+ } else {
+ saveCount++;
+ }
+ } catch (OseeCoreException ex) {
+ ex.printStackTrace();
+ }
+ }
+ } else {
+ saveCount++;
+ }
+ }
+
+ // Ensure all changes saved
+ if (saveCount == widgets.size()) {
+ super.commit(onSave);
+ }
+ }
+
+ private final class XWidgetValidationListener implements XModifiedListener {
+
+ @Override
+ public void widgetModified(XWidget xWidget) {
+ if (xWidget != null && xWidget instanceof IArtifactWidget) {
+ IArtifactWidget aWidget = (IArtifactWidget) xWidget;
+ try {
+ Result result = aWidget.isDirty();
+ if (result.isTrue()) {
+ xWidget.setControlCausedMessage("attribute.dirty", "Dirty", IMessageProvider.WARNING);
+ if (!isDirty()) {
+ markDirty();
+ }
+ } else {
+ xWidget.removeControlCausedMessage("attribute.dirty");
+ }
+ } catch (Exception ex) {
+ xWidget.setControlCausedMessage("attribute.dirty", "Unable to compute isDirty", IMessageProvider.ERROR);
+ }
+ }
+ }
+ }
}
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/editor/parts/MessageSummaryNote.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/editor/parts/MessageSummaryNote.java
index 761e0d356e..3d4ecb862a 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/editor/parts/MessageSummaryNote.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/editor/parts/MessageSummaryNote.java
@@ -38,104 +38,112 @@ import org.eclipse.ui.forms.widgets.ScrolledForm;
* @author Roberto E. Escobar
*/
public class MessageSummaryNote {
- private Shell shell;
+ private final Shell shell;
- public MessageSummaryNote(IManagedForm managedForm, String title, IMessage[] messages) {
- final ScrolledForm form = managedForm.getForm();
- final FormToolkit toolkit = managedForm.getToolkit();
+ public MessageSummaryNote(IManagedForm managedForm, String title, IMessage[] messages) {
+ final ScrolledForm form = managedForm.getForm();
+ final FormToolkit toolkit = managedForm.getToolkit();
- shell = new Shell(form.getShell(), SWT.ON_TOP | SWT.TOOL);
- shell.setImage(getImage(form.getMessageType()));
- shell.setText(title);
- shell.setLayout(new FillLayout());
+ shell = new Shell(form.getShell(), SWT.ON_TOP | SWT.TOOL);
+ shell.setImage(getImage(form.getMessageType()));
+ shell.setText(title);
+ shell.setLayout(new FillLayout());
- Composite composite = toolkit.createComposite(shell, toolkit.getBorderStyle());
- composite.setLayout(new GridLayout());
+ Composite composite = toolkit.createComposite(shell, toolkit.getBorderStyle());
+ composite.setLayout(new GridLayout());
- FormText text = toolkit.createFormText(composite, true);
- configureFormText(form.getForm(), text);
- text.setText(getMessageSummary(messages), true, false);
+ FormText text = toolkit.createFormText(composite, true);
+ configureFormText(form.getForm(), text);
+ text.setText(getMessageSummary(messages), true, false);
+ text.addFocusListener(new FocusAdapter() {
- text.addFocusListener(new FocusAdapter() {
+ @Override
+ public void focusLost(FocusEvent e) {
+ shell.close();
+ }
+ });
+ shell.setLocation(0, 0);
+ }
- @Override
- public void focusLost(FocusEvent e) {
- shell.close();
- }
- });
- shell.setLocation(0, 0);
- }
+ public void setLocation(Point point) {
+ shell.setLocation(point);
+ }
- public void setLocation(Point point) {
- shell.setLocation(point);
- }
+ public void open() {
+ shell.pack();
+ shell.open();
+ }
- public void open() {
- shell.pack();
- shell.open();
- }
+ private void configureFormText(final Form form, FormText text) {
+ text.addHyperlinkListener(new HyperlinkAdapter() {
+ @Override
+ public void linkActivated(HyperlinkEvent e) {
+ String is = (String) e.getHref();
+ try {
+ int index = Integer.parseInt(is);
+ IMessage[] messages = form.getChildrenMessages();
+ IMessage message = messages[index];
+ Control c = message.getControl();
+ ((FormText) e.widget).getShell().dispose();
+ if (c != null) {
+ c.setFocus();
+ }
+ } catch (NumberFormatException ex) {
+ }
+ }
+ });
+ text.setImage("error", getImage(IMessageProvider.ERROR));
+ text.setImage("warning", getImage(IMessageProvider.WARNING));
+ text.setImage("info", getImage(IMessageProvider.INFORMATION));
+ }
- private void configureFormText(final Form form, FormText text) {
- text.addHyperlinkListener(new HyperlinkAdapter() {
- public void linkActivated(HyperlinkEvent e) {
- String is = (String) e.getHref();
- try {
- int index = Integer.parseInt(is);
- IMessage[] messages = form.getChildrenMessages();
- IMessage message = messages[index];
- Control c = message.getControl();
- ((FormText) e.widget).getShell().dispose();
- if (c != null) {
- c.setFocus();
- }
- } catch (NumberFormatException ex) {
- }
- }
- });
- text.setImage("error", getImage(IMessageProvider.ERROR));
- text.setImage("warning", getImage(IMessageProvider.WARNING));
- text.setImage("info", getImage(IMessageProvider.INFORMATION));
- }
+ private Image getImage(int type) {
+ Image image = null;
+ switch (type) {
+ case IMessageProvider.ERROR:
+ image = PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_OBJS_ERROR_TSK);
+ break;
+ case IMessageProvider.WARNING:
+ image = PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_OBJS_WARN_TSK);
+ break;
+ case IMessageProvider.INFORMATION:
+ image = PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_OBJS_INFO_TSK);
+ break;
+ default:
+ break;
+ }
+ return image;
+ }
- private Image getImage(int type) {
- switch (type) {
- case IMessageProvider.ERROR:
- return PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_OBJS_ERROR_TSK);
- case IMessageProvider.WARNING:
- return PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_OBJS_WARN_TSK);
- case IMessageProvider.INFORMATION:
- return PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_OBJS_INFO_TSK);
- }
- return null;
- }
-
- private String getMessageSummary(IMessage[] messages) {
- StringWriter sw = new StringWriter();
- PrintWriter pw = new PrintWriter(sw);
- pw.println("<form>");
- for (int i = 0; i < messages.length; i++) {
- IMessage message = messages[i];
- pw.print("<li vspace=\"false\" style=\"image\" indent=\"16\" value=\"");
- switch (message.getMessageType()) {
- case IMessageProvider.ERROR:
- pw.print("error");
- break;
- case IMessageProvider.WARNING:
- pw.print("warning");
- break;
- case IMessageProvider.INFORMATION:
- pw.print("info");
- break;
- }
- pw.print("\"> <a href=\"");
- pw.print(i + "");
- pw.print("\">");
- if (message.getPrefix() != null) pw.print(message.getPrefix());
- pw.print(message.getMessage());
- pw.println("</a></li>");
- }
- pw.println("</form>");
- pw.flush();
- return sw.toString();
- }
+ private String getMessageSummary(IMessage[] messages) {
+ StringWriter sw = new StringWriter();
+ PrintWriter pw = new PrintWriter(sw);
+ pw.println("<form>");
+ for (int i = 0; i < messages.length; i++) {
+ IMessage message = messages[i];
+ pw.print("<li vspace=\"false\" style=\"image\" indent=\"16\" value=\"");
+ switch (message.getMessageType()) {
+ case IMessageProvider.ERROR:
+ pw.print("error");
+ break;
+ case IMessageProvider.WARNING:
+ pw.print("warning");
+ break;
+ case IMessageProvider.INFORMATION:
+ pw.print("info");
+ break;
+ }
+ pw.print("\"> <a href=\"");
+ pw.print(i + "");
+ pw.print("\">");
+ if (message.getPrefix() != null) {
+ pw.print(message.getPrefix());
+ }
+ pw.print(message.getMessage());
+ pw.println("</a></li>");
+ }
+ pw.println("</form>");
+ pw.flush();
+ return sw.toString();
+ }
}
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/editor/sections/AttributeActionContribution.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/editor/sections/AttributeActionContribution.java
index c6305ef4ee..0ab54a9b07 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/editor/sections/AttributeActionContribution.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/editor/sections/AttributeActionContribution.java
@@ -28,72 +28,73 @@ import org.eclipse.osee.framework.ui.swt.ImageManager;
*/
public class AttributeActionContribution implements IActionContributor {
- private final AttributeTypeEditPresenter attributeTypeEditor;
+ private final AttributeTypeEditPresenter attributeTypeEditor;
- public AttributeActionContribution(ArtifactEditor editor) {
- AttributeTypeEditPresenter.Display view = new AttributeTypeEditDisplay();
- attributeTypeEditor = new AttributeTypeEditPresenter(new Model(editor), view);
- }
+ public AttributeActionContribution(ArtifactEditor editor) {
+ AttributeTypeEditPresenter.Display view = new AttributeTypeEditDisplay();
+ attributeTypeEditor = new AttributeTypeEditPresenter(new Model(editor), view);
+ }
- private static final class Model implements AttributeTypeEditPresenter.Model {
- private final ArtifactEditor editor;
+ private static final class Model implements AttributeTypeEditPresenter.Model {
+ private final ArtifactEditor editor;
- public Model(ArtifactEditor editor) {
- this.editor = editor;
- }
+ public Model(ArtifactEditor editor) {
+ this.editor = editor;
+ }
- @Override
- public void doSave() {
- editor.doSave(new NullProgressMonitor());
- }
+ @Override
+ public void doSave() {
+ editor.doSave(new NullProgressMonitor());
+ }
- @Override
- public boolean isDirty() {
- return editor.isDirty();
- }
+ @Override
+ public boolean isDirty() {
+ return editor.isDirty();
+ }
- @Override
- public Artifact getArtifact() {
- return editor.getEditorInput().getArtifact();
- }
- }
+ @Override
+ public Artifact getArtifact() {
+ return editor.getEditorInput().getArtifact();
+ }
+ }
- public void contributeToToolBar(IToolBarManager manager) {
- manager.add(new OpenAddAttributeTypeDialogAction());
- manager.add(new OpenDeleteAttributeTypeDialogAction());
- }
+ @Override
+ public void contributeToToolBar(IToolBarManager manager) {
+ manager.add(new OpenAddAttributeTypeDialogAction());
+ manager.add(new OpenDeleteAttributeTypeDialogAction());
+ }
- private final class OpenAddAttributeTypeDialogAction extends Action {
- public OpenAddAttributeTypeDialogAction() {
- super();
- setImageDescriptor(ImageManager.getImageDescriptor(FrameworkImage.ADD_GREEN));
- setToolTipText("Opens a dialog to select which attribute type instances to create on the artifact");
- }
+ private final class OpenAddAttributeTypeDialogAction extends Action {
+ public OpenAddAttributeTypeDialogAction() {
+ super();
+ setImageDescriptor(ImageManager.getImageDescriptor(FrameworkImage.ADD_GREEN));
+ setToolTipText("Opens a dialog to select which attribute type instances to create on the artifact");
+ }
- @Override
- public void run() {
- try {
- attributeTypeEditor.onAddAttributeType();
- } catch (OseeCoreException ex) {
- OseeLog.log(SkynetGuiPlugin.class, OseeLevel.SEVERE_POPUP, ex);
- }
- }
- }
+ @Override
+ public void run() {
+ try {
+ attributeTypeEditor.onAddAttributeType();
+ } catch (OseeCoreException ex) {
+ OseeLog.log(SkynetGuiPlugin.class, OseeLevel.SEVERE_POPUP, ex);
+ }
+ }
+ }
- private final class OpenDeleteAttributeTypeDialogAction extends Action {
- public OpenDeleteAttributeTypeDialogAction() {
- super();
- setImageDescriptor(ImageManager.getImageDescriptor(FrameworkImage.DELETE));
- setToolTipText("Opens a dialog to select which attribute type instances to remove from the artifact");
- }
+ private final class OpenDeleteAttributeTypeDialogAction extends Action {
+ public OpenDeleteAttributeTypeDialogAction() {
+ super();
+ setImageDescriptor(ImageManager.getImageDescriptor(FrameworkImage.DELETE));
+ setToolTipText("Opens a dialog to select which attribute type instances to remove from the artifact");
+ }
- @Override
- public void run() {
- try {
- attributeTypeEditor.onRemoveAttributeType();
- } catch (OseeCoreException ex) {
- OseeLog.log(SkynetGuiPlugin.class, OseeLevel.SEVERE_POPUP, ex);
- }
- }
- }
+ @Override
+ public void run() {
+ try {
+ attributeTypeEditor.onRemoveAttributeType();
+ } catch (OseeCoreException ex) {
+ OseeLog.log(SkynetGuiPlugin.class, OseeLevel.SEVERE_POPUP, ex);
+ }
+ }
+ }
} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/editor/sections/AttributeTypeEditDisplay.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/editor/sections/AttributeTypeEditDisplay.java
index 13acf2e0ac..75563fb321 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/editor/sections/AttributeTypeEditDisplay.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/editor/sections/AttributeTypeEditDisplay.java
@@ -8,89 +8,90 @@
* Contributors:
* Boeing - initial API and implementation
*******************************************************************************/
-package org.eclipse.osee.framework.ui.skynet.artifact.editor.sections;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.List;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.window.Window;
-import org.eclipse.osee.framework.core.data.IAttributeType;
-import org.eclipse.osee.framework.ui.plugin.util.ArrayTreeContentProvider;
-import org.eclipse.osee.framework.ui.skynet.FrameworkImage;
-import org.eclipse.osee.framework.ui.skynet.SkynetGuiPlugin;
-import org.eclipse.osee.framework.ui.swt.ImageManager;
-import org.eclipse.osee.framework.ui.swt.KeyedImage;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.dialogs.CheckedTreeSelectionDialog;
-import org.eclipse.ui.dialogs.ISelectionStatusValidator;
-
-public final class AttributeTypeEditDisplay implements AttributeTypeEditPresenter.Display {
-
- public AttributeTypeEditDisplay() {
- super();
- }
-
- public void showInformation(String title, String message) {
- MessageDialog.openInformation(PlatformUI.getWorkbench().getDisplay().getActiveShell(), title, message);
- }
-
- private CheckedTreeSelectionDialog createDialog(String title, String message, KeyedImage keyedImage) {
- CheckedTreeSelectionDialog dialog =
- new CheckedTreeSelectionDialog(PlatformUI.getWorkbench().getDisplay().getActiveShell(),
- new LabelProvider(), new ArrayTreeContentProvider());
- dialog.setTitle(title);
- Image image = ImageManager.getImage(keyedImage);
- dialog.setImage(image);
- dialog.setMessage(message);
- dialog.setValidator(new ISelectionStatusValidator() {
-
- @Override
- public IStatus validate(Object[] selection) {
- if (selection.length == 0) {
- return new Status(IStatus.ERROR, SkynetGuiPlugin.PLUGIN_ID,
- "Select at least one item or click cancel to exit.");
- }
- return Status.OK_STATUS;
- }
- });
- return dialog;
- }
-
- @Override
- public Collection<IAttributeType> getSelections(OperationType operationType, String title, String message, List<? extends IAttributeType> input) {
- Collection<IAttributeType> toReturn = Collections.emptyList();
- CheckedTreeSelectionDialog dialog = createDialog(title, message, getImage(operationType));
- dialog.setInput(input);
- int result = dialog.open();
- if (result == Window.OK) {
- toReturn = new ArrayList<IAttributeType>();
- for (Object object : dialog.getResult()) {
- if (object instanceof IAttributeType) {
- toReturn.add((IAttributeType) object);
- }
- }
- }
- return toReturn;
- }
-
- private KeyedImage getImage(OperationType operationType) {
- KeyedImage toReturn = null;
- switch (operationType) {
- case ADD_ITEM:
- toReturn = FrameworkImage.ADD_GREEN;
- break;
- case REMOVE_ITEM:
- toReturn = FrameworkImage.DELETE;
- break;
- default:
- break;
- }
- return toReturn;
- }
+package org.eclipse.osee.framework.ui.skynet.artifact.editor.sections;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.List;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.jface.window.Window;
+import org.eclipse.osee.framework.core.data.IAttributeType;
+import org.eclipse.osee.framework.ui.plugin.util.ArrayTreeContentProvider;
+import org.eclipse.osee.framework.ui.skynet.FrameworkImage;
+import org.eclipse.osee.framework.ui.skynet.SkynetGuiPlugin;
+import org.eclipse.osee.framework.ui.swt.ImageManager;
+import org.eclipse.osee.framework.ui.swt.KeyedImage;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.dialogs.CheckedTreeSelectionDialog;
+import org.eclipse.ui.dialogs.ISelectionStatusValidator;
+
+public final class AttributeTypeEditDisplay implements AttributeTypeEditPresenter.Display {
+
+ public AttributeTypeEditDisplay() {
+ super();
+ }
+
+ @Override
+ public void showInformation(String title, String message) {
+ MessageDialog.openInformation(PlatformUI.getWorkbench().getDisplay().getActiveShell(), title, message);
+ }
+
+ private CheckedTreeSelectionDialog createDialog(String title, String message, KeyedImage keyedImage) {
+ CheckedTreeSelectionDialog dialog =
+ new CheckedTreeSelectionDialog(PlatformUI.getWorkbench().getDisplay().getActiveShell(),
+ new LabelProvider(), new ArrayTreeContentProvider());
+ dialog.setTitle(title);
+ Image image = ImageManager.getImage(keyedImage);
+ dialog.setImage(image);
+ dialog.setMessage(message);
+ dialog.setValidator(new ISelectionStatusValidator() {
+
+ @Override
+ public IStatus validate(Object[] selection) {
+ if (selection.length == 0) {
+ return new Status(IStatus.ERROR, SkynetGuiPlugin.PLUGIN_ID,
+ "Select at least one item or click cancel to exit.");
+ }
+ return Status.OK_STATUS;
+ }
+ });
+ return dialog;
+ }
+
+ @Override
+ public Collection<IAttributeType> getSelections(OperationType operationType, String title, String message, List<? extends IAttributeType> input) {
+ Collection<IAttributeType> toReturn = Collections.emptyList();
+ CheckedTreeSelectionDialog dialog = createDialog(title, message, getImage(operationType));
+ dialog.setInput(input);
+ int result = dialog.open();
+ if (result == Window.OK) {
+ toReturn = new ArrayList<IAttributeType>();
+ for (Object object : dialog.getResult()) {
+ if (object instanceof IAttributeType) {
+ toReturn.add((IAttributeType) object);
+ }
+ }
+ }
+ return toReturn;
+ }
+
+ private KeyedImage getImage(OperationType operationType) {
+ KeyedImage toReturn = null;
+ switch (operationType) {
+ case ADD_ITEM:
+ toReturn = FrameworkImage.ADD_GREEN;
+ break;
+ case REMOVE_ITEM:
+ toReturn = FrameworkImage.DELETE;
+ break;
+ default:
+ break;
+ }
+ return toReturn;
+ }
} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/editor/sections/DetailsFormSection.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/editor/sections/DetailsFormSection.java
index 1f9b511f17..69b4ea1481 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/editor/sections/DetailsFormSection.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/editor/sections/DetailsFormSection.java
@@ -30,72 +30,73 @@ import org.eclipse.ui.forms.widgets.Section;
*/
public class DetailsFormSection extends ArtifactEditorFormSection {
- private FormText formText;
- private boolean sectionCreated = false;
- private Section section;
+ private FormText formText;
+ private boolean sectionCreated = false;
+ private Section section;
- public DetailsFormSection(ArtifactEditor editor, Composite parent, FormToolkit toolkit, int style) {
- super(editor, parent, toolkit, style);
- }
+ public DetailsFormSection(ArtifactEditor editor, Composite parent, FormToolkit toolkit, int style) {
+ super(editor, parent, toolkit, style);
+ }
- @Override
- public void initialize(IManagedForm form) {
- super.initialize(form);
- section = getSection();
- section.setText("Details");
- section.setLayout(new GridLayout());
- section.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
- // Only load when users selects section
- section.addListener(SWT.Activate, new Listener() {
+ @Override
+ public void initialize(IManagedForm form) {
+ super.initialize(form);
+ section = getSection();
+ section.setText("Details");
+ section.setLayout(new GridLayout());
+ section.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
+ // Only load when users selects section
+ section.addListener(SWT.Activate, new Listener() {
- public void handleEvent(Event e) {
- createSection();
- }
- });
+ @Override
+ public void handleEvent(Event e) {
+ createSection();
+ }
+ });
- }
+ }
- private synchronized void createSection() {
- if (!sectionCreated) {
- final FormToolkit toolkit = getManagedForm().getToolkit();
- Composite composite = toolkit.createComposite(getSection(), toolkit.getBorderStyle() | SWT.WRAP);
- composite.setLayout(new GridLayout());
- composite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
+ private synchronized void createSection() {
+ if (!sectionCreated) {
+ final FormToolkit toolkit = getManagedForm().getToolkit();
+ Composite composite = toolkit.createComposite(getSection(), toolkit.getBorderStyle() | SWT.WRAP);
+ composite.setLayout(new GridLayout());
+ composite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
- formText = toolkit.createFormText(composite, false);
- GridData gd = new GridData(SWT.FILL, SWT.FILL, true, true);
- gd.widthHint = 200;
- formText.setLayoutData(gd);
+ formText = toolkit.createFormText(composite, false);
+ GridData gd = new GridData(SWT.FILL, SWT.FILL, true, true);
+ gd.widthHint = 200;
+ formText.setLayoutData(gd);
- getSection().setClient(composite);
- toolkit.paintBordersFor(composite);
- sectionCreated = true;
- }
+ getSection().setClient(composite);
+ toolkit.paintBordersFor(composite);
+ sectionCreated = true;
+ }
- if (Widgets.isAccessible(formText)) {
- try {
- formText.setText(
- Artifacts.getDetailsFormText(Artifacts.getDetailsKeyValues(getEditorInput().getArtifact())), true,
- true);
- } catch (Exception ex) {
- formText.setText(Lib.exceptionToString(ex), false, false);
- }
- getManagedForm().reflow(true);
- }
- }
+ if (Widgets.isAccessible(formText)) {
+ try {
+ formText.setText(
+ Artifacts.getDetailsFormText(Artifacts.getDetailsKeyValues(getEditorInput().getArtifact())), true,
+ true);
+ } catch (Exception ex) {
+ formText.setText(Lib.exceptionToString(ex), false, false);
+ }
+ getManagedForm().reflow(true);
+ }
+ }
- @Override
- public void dispose() {
- if (formText != null && !formText.isDisposed()) {
- formText.dispose();
- }
- super.dispose();
- }
+ @Override
+ public void dispose() {
+ if (formText != null && !formText.isDisposed()) {
+ formText.dispose();
+ }
+ super.dispose();
+ }
- @Override
- public void refresh() {
- super.refresh();
- createSection();
- }
+ @Override
+ public void refresh() {
+ super.refresh();
+ createSection();
+ }
}
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/editor/sections/RelationsFormSection.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/editor/sections/RelationsFormSection.java
index 201bd2ff66..665ede17b9 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/editor/sections/RelationsFormSection.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/editor/sections/RelationsFormSection.java
@@ -10,16 +10,13 @@
*******************************************************************************/
package org.eclipse.osee.framework.ui.skynet.artifact.editor.sections;
-import org.eclipse.osee.framework.core.exception.OseeCoreException;
-import org.eclipse.osee.framework.logging.OseeLevel;
-import org.eclipse.osee.framework.logging.OseeLog;
import org.eclipse.osee.framework.ui.skynet.RelationsComposite;
-import org.eclipse.osee.framework.ui.skynet.SkynetGuiPlugin;
import org.eclipse.osee.framework.ui.skynet.artifact.editor.AbstractArtifactEditor;
import org.eclipse.osee.framework.ui.skynet.artifact.editor.ArtifactEditor;
import org.eclipse.osee.framework.ui.skynet.artifact.editor.pages.ArtifactFormPage;
import org.eclipse.osee.framework.ui.skynet.util.ArtifactDragAndDrop;
import org.eclipse.osee.framework.ui.swt.ALayout;
+import org.eclipse.osee.framework.ui.swt.Displays;
import org.eclipse.osee.framework.ui.swt.Widgets;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.TreeEvent;
@@ -28,7 +25,6 @@ import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Listener;
@@ -41,109 +37,110 @@ import org.eclipse.ui.forms.widgets.Section;
*/
public class RelationsFormSection extends ArtifactEditorFormSection {
- private RelationsComposite relationComposite;
- private boolean sectionCreated = false;
-
- public RelationsFormSection(AbstractArtifactEditor editor, Composite parent, FormToolkit toolkit, int style) {
- super(editor, parent, toolkit, style);
- }
-
- @Override
- public void initialize(IManagedForm form) {
- super.initialize(form);
- final FormToolkit toolkit = form.getToolkit();
-
- final Section section = getSection();
- section.setText("Relations");
-
- section.setLayout(new GridLayout());
- section.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
- // Only load when users selects section
- section.addListener(SWT.Activate, new Listener() {
-
- public void handleEvent(Event e) {
- try {
- createSection(section, toolkit);
- } catch (OseeCoreException ex) {
- OseeLog.log(SkynetGuiPlugin.class, OseeLevel.SEVERE, ex);
- }
- }
- });
- }
-
- protected synchronized void createSection(Section section, FormToolkit toolkit) throws OseeCoreException {
- if (sectionCreated) return;
- Composite sectionBody = toolkit.createComposite(section, toolkit.getBorderStyle());
- sectionBody.setLayout(ALayout.getZeroMarginLayout());
- sectionBody.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
-
- Label dragDropLabel = new Label(sectionBody, SWT.BORDER);
- dragDropLabel.setText("Click here to drag this \"" + getEditorInput().getArtifact().getArtifactTypeName() + "\"");
- GridData gd = new GridData(GridData.FILL_BOTH);
- gd.heightHint = 25;
- dragDropLabel.setLayoutData(gd);
- addDragAndDrop(dragDropLabel);
- toolkit.adapt(dragDropLabel, true, true);
-
- relationComposite = new RelationsComposite(getEditor(), sectionBody, SWT.NONE, getEditorInput().getArtifact());
- relationComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
-
- section.setClient(sectionBody);
- toolkit.paintBordersFor(section);
-
- relationComposite.getTreeViewer().getTree().addTreeListener(new TreeListener() {
-
- @Override
- public void treeCollapsed(TreeEvent e) {
- redrawPage();
- }
-
- @Override
- public void treeExpanded(TreeEvent e) {
- redrawPage();
- }
-
- private void redrawPage() {
- Display.getDefault().asyncExec(new Runnable() {
- public void run() {
- getSection().getParent().layout();
- getManagedForm().reflow(true);
- }
- });
- }
- });
- sectionCreated = true;
- }
-
- protected void handleExpandAndCollapse() {
- ((ArtifactFormPage) getEditor().getSelectedPage()).refresh();
- }
-
- protected void addDragAndDrop(Control dropArea) {
- new ArtifactDragAndDrop(dropArea, getEditorInput().getArtifact(), ArtifactEditor.EDITOR_ID);
- }
-
- public RelationsComposite getRelationComposite() {
- return relationComposite;
- }
-
- @Override
- public void refresh() {
- super.refresh();
- Display.getDefault().asyncExec(new Runnable() {
- public void run() {
- if (Widgets.isAccessible(relationComposite)) {
- relationComposite.refresh();
- }
- }
- });
- }
-
- @Override
- public void dispose() {
- if (Widgets.isAccessible(relationComposite)) {
- relationComposite.dispose();
- }
- super.dispose();
- }
+ private RelationsComposite relationComposite;
+ private boolean sectionCreated = false;
+
+ public RelationsFormSection(AbstractArtifactEditor editor, Composite parent, FormToolkit toolkit, int style) {
+ super(editor, parent, toolkit, style);
+ }
+
+ @Override
+ public void initialize(IManagedForm form) {
+ super.initialize(form);
+ final FormToolkit toolkit = form.getToolkit();
+
+ final Section section = getSection();
+ section.setText("Relations");
+
+ section.setLayout(new GridLayout());
+ section.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
+ // Only load when users selects section
+ section.addListener(SWT.Activate, new Listener() {
+
+ @Override
+ public void handleEvent(Event e) {
+ createSection(section, toolkit);
+ }
+ });
+ }
+
+ protected synchronized void createSection(Section section, FormToolkit toolkit) {
+ if (sectionCreated) {
+ return;
+ }
+ Composite sectionBody = toolkit.createComposite(section, toolkit.getBorderStyle());
+ sectionBody.setLayout(ALayout.getZeroMarginLayout());
+ sectionBody.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
+
+ Label dragDropLabel = new Label(sectionBody, SWT.BORDER);
+ dragDropLabel.setText("Click here to drag this \"" + getEditorInput().getArtifact().getArtifactTypeName() + "\"");
+ GridData gd = new GridData(GridData.FILL_BOTH);
+ gd.heightHint = 25;
+ dragDropLabel.setLayoutData(gd);
+ addDragAndDrop(dragDropLabel);
+ toolkit.adapt(dragDropLabel, true, true);
+
+ relationComposite = new RelationsComposite(getEditor(), sectionBody, SWT.NONE, getEditorInput().getArtifact());
+ relationComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
+
+ section.setClient(sectionBody);
+ toolkit.paintBordersFor(section);
+
+ relationComposite.getTreeViewer().getTree().addTreeListener(new TreeListener() {
+
+ @Override
+ public void treeCollapsed(TreeEvent e) {
+ redrawPage();
+ }
+
+ @Override
+ public void treeExpanded(TreeEvent e) {
+ redrawPage();
+ }
+
+ private void redrawPage() {
+ Displays.ensureInDisplayThread(new Runnable() {
+ @Override
+ public void run() {
+ getSection().getParent().layout();
+ getManagedForm().reflow(true);
+ }
+ });
+ }
+ });
+ sectionCreated = true;
+ }
+
+ protected void handleExpandAndCollapse() {
+ ((ArtifactFormPage) getEditor().getSelectedPage()).refresh();
+ }
+
+ protected void addDragAndDrop(Control dropArea) {
+ new ArtifactDragAndDrop(dropArea, getEditorInput().getArtifact(), ArtifactEditor.EDITOR_ID);
+ }
+
+ public RelationsComposite getRelationComposite() {
+ return relationComposite;
+ }
+
+ @Override
+ public void refresh() {
+ super.refresh();
+ Displays.ensureInDisplayThread(new Runnable() {
+ @Override
+ public void run() {
+ if (Widgets.isAccessible(relationComposite)) {
+ relationComposite.refresh();
+ }
+ }
+ });
+ }
+
+ @Override
+ public void dispose() {
+ if (Widgets.isAccessible(relationComposite)) {
+ relationComposite.dispose();
+ }
+ super.dispose();
+ }
}
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/massEditor/MassArtifactEditor.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/massEditor/MassArtifactEditor.java
index 916d0d06c9..cd310b4b41 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/massEditor/MassArtifactEditor.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/massEditor/MassArtifactEditor.java
@@ -30,11 +30,11 @@ import org.eclipse.osee.framework.skynet.core.utility.Artifacts;
import org.eclipse.osee.framework.ui.plugin.OseeUiActions;
import org.eclipse.osee.framework.ui.plugin.PluginUiImage;
import org.eclipse.osee.framework.ui.plugin.util.AWorkbench;
-import org.eclipse.osee.framework.ui.plugin.util.Displays;
import org.eclipse.osee.framework.ui.plugin.xnavigate.XNavigateComposite.TableLoadOption;
import org.eclipse.osee.framework.ui.skynet.SkynetGuiPlugin;
import org.eclipse.osee.framework.ui.skynet.artifact.editor.AbstractArtifactEditor;
import org.eclipse.osee.framework.ui.swt.ALayout;
+import org.eclipse.osee.framework.ui.swt.Displays;
import org.eclipse.osee.framework.ui.swt.IDirtiableEditor;
import org.eclipse.osee.framework.ui.swt.ImageManager;
import org.eclipse.swt.SWT;
@@ -55,243 +55,245 @@ import org.eclipse.ui.PartInitException;
* @author Donald G. Dunne
*/
public class MassArtifactEditor extends AbstractArtifactEditor implements IActionable {
- public static final String EDITOR_ID = "org.eclipse.osee.framework.ui.skynet.massEditor.MassArtifactEditor";
- private int artifactsPageIndex;
- private MassXViewer xViewer;
- private Label branchLabel;
- private ToolBar toolBar;
-
- /**
- * @return the xViewer
- */
- public MassXViewer getXViewer() {
- return xViewer;
- }
-
- @Override
- public void doSave(IProgressMonitor monitor) {
- try {
- Artifacts.persistInTransaction(xViewer.getArtifacts());
- } catch (Exception ex) {
- OseeLog.log(SkynetGuiPlugin.class, OseeLevel.SEVERE_POPUP, ex);
- }
- onDirtied();
- }
-
- public static void editArtifacts(final String name, final Collection<? extends Artifact> artifacts, TableLoadOption... tableLoadOptions) {
- Set<TableLoadOption> options = new HashSet<TableLoadOption>();
- options.addAll(Arrays.asList(tableLoadOptions));
- Displays.ensureInDisplayThread(new Runnable() {
- public void run() {
- boolean accessControlFilteredResults = false;
- try {
- Set<Artifact> accessibleArts = new HashSet<Artifact>();
- for (Artifact artifact : artifacts) {
- if (!AccessControlManager.hasPermission(artifact, PermissionEnum.READ)) {
- OseeLog.log(SkynetGuiPlugin.class, Level.INFO,
- "The user " + UserManager.getUser() + " does not have read access to " + artifact);
- accessControlFilteredResults = true;
- } else {
- accessibleArts.add(artifact);
- }
- }
- if (accessibleArts.isEmpty()) {
- AWorkbench.popup("ERROR", "No Artifacts to edit");
- } else {
- AWorkbench.getActivePage().openEditor(
- new MassArtifactEditorInput(name, accessibleArts, new MassXViewerFactory(accessibleArts)),
- EDITOR_ID);
- }
- if (accessControlFilteredResults) {
- AWorkbench.popup("ERROR", "Some Artifacts not loaded due to access control limitations.");
- }
- } catch (Exception ex) {
- OseeLog.log(SkynetGuiPlugin.class, OseeLevel.SEVERE_POPUP, ex);
- }
- }
- }, options.contains(TableLoadOption.ForcePend));
- }
-
- public static void editArtifact(final Artifact artifact, TableLoadOption... tableLoadOptions) {
- editArtifacts("", Arrays.asList(artifact));
- }
-
- public void createTaskActionBar(Composite parent) {
-
- // Button composite for state transitions, etc
- Composite bComp = new Composite(parent, SWT.NONE);
- // bComp.setBackground(mainSComp.getDisplay().getSystemColor(SWT.COLOR_CYAN));
- bComp.setLayout(ALayout.getZeroMarginLayout(2, false));
- bComp.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
- Composite leftComp = new Composite(bComp, SWT.NONE);
- leftComp.setLayout(new GridLayout());
- leftComp.setLayoutData(new GridData(GridData.BEGINNING | GridData.FILL_HORIZONTAL));
-
- branchLabel = new Label(leftComp, SWT.NONE);
- branchLabel.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
- Composite rightComp = new Composite(bComp, SWT.NONE);
- rightComp.setLayout(new GridLayout());
- rightComp.setLayoutData(new GridData(GridData.END));
-
- toolBar = new ToolBar(rightComp, SWT.FLAT | SWT.RIGHT);
- GridData gd = new GridData(GridData.FILL_HORIZONTAL);
- toolBar.setLayoutData(gd);
- ToolItem item = null;
-
- item = new ToolItem(toolBar, SWT.PUSH);
- item.setImage(ImageManager.getImage(PluginUiImage.REFRESH));
- item.setToolTipText("Refresh");
- item.addSelectionListener(new SelectionAdapter() {
- @Override
- public void widgetSelected(SelectionEvent e) {
- xViewer.refresh();
- }
- });
-
- OseeUiActions.addButtonToEditorToolBar(this, SkynetGuiPlugin.getInstance(), toolBar, EDITOR_ID,
- "Mass Artifact Editor");
- }
-
- public static void editArtifacts(final MassArtifactEditorInput input) {
- Displays.ensureInDisplayThread(new Runnable() {
- @Override
- public void run() {
- IWorkbenchPage page = AWorkbench.getActivePage();
- try {
- page.openEditor(input, EDITOR_ID);
- } catch (PartInitException ex) {
- OseeLog.log(SkynetGuiPlugin.class, OseeLevel.SEVERE_POPUP, ex);
- }
- }
- });
-
- }
-
- @Override
- public boolean isSaveOnCloseNeeded() {
- return isDirty();
- }
-
- @Override
- public void dispose() {
- super.dispose();
-
- for (Artifact taskArt : xViewer.getArtifacts()) {
- try {
- if (taskArt != null && !taskArt.isDeleted() && taskArt.hasDirtyAttributes()) {
- taskArt.reloadAttributesAndRelations();
- }
- } catch (Exception ex) {
- OseeLog.log(SkynetGuiPlugin.class, Level.SEVERE, ex);
- }
- }
- }
-
- public ArrayList<Artifact> getLoadedArtifacts() {
- return xViewer.getLoadedArtifacts();
- }
-
- @Override
- public boolean isDirty() {
- for (Artifact taskArt : xViewer.getArtifacts()) {
- if (!taskArt.isDeleted() && taskArt.hasDirtyAttributes()) {
- return true;
- }
- }
- return false;
- }
-
- @Override
- public String toString() {
- return "MassArtifactEditor";
- }
-
- @Override
- protected void addPages() {
- IEditorInput editorInput = getEditorInput();
- if (!(editorInput instanceof MassArtifactEditorInput)) {
- throw new IllegalArgumentException("Editor Input not TaskEditorInput");
- }
-
- if (((MassArtifactEditorInput) editorInput).getName().equals("")) {
- setPartName("Mass Artifact Editor");
- } else {
- setPartName(((MassArtifactEditorInput) editorInput).getName());
- }
-
- SkynetGuiPlugin.getInstance().setHelp(getContainer(), "mass_artifact_editor",
- "org.eclipse.osee.framework.help.ui");
-
- Composite comp = new Composite(getContainer(), SWT.NONE);
- comp.setLayout(new GridLayout(1, true));
- comp.setLayoutData(new GridData(GridData.FILL_BOTH));
-
- createTaskActionBar(comp);
-
- xViewer = new MassXViewer(comp, SWT.MULTI | SWT.BORDER | SWT.FULL_SELECTION, this);
- xViewer.getTree().setLayoutData(new GridData(GridData.FILL_BOTH));
- xViewer.setContentProvider(new org.eclipse.osee.framework.ui.skynet.artifact.massEditor.MassContentProvider(
- xViewer));
- xViewer.setLabelProvider(new org.eclipse.osee.framework.ui.skynet.artifact.massEditor.MassLabelProvider(xViewer));
- branchLabel.setText("Branch: " + (getBranch() == null ? "No Artifacts Returned" : getBranch().getShortName()));
- artifactsPageIndex = addPage(comp);
- setPageText(artifactsPageIndex, "Artifacts");
-
- new ActionContributionItem(xViewer.getCustomizeAction()).fill(toolBar, -1);
-
- Tree tree = xViewer.getTree();
- GridData gridData = new GridData(GridData.FILL_BOTH | GridData.GRAB_VERTICAL | GridData.GRAB_HORIZONTAL);
- tree.setLayoutData(gridData);
- tree.setHeaderVisible(true);
- tree.setLinesVisible(true);
-
- setActivePage(artifactsPageIndex);
- try {
- xViewer.set(((MassArtifactEditorInput) editorInput).getArtifacts());
- } catch (Exception ex) {
- OseeLog.log(SkynetGuiPlugin.class, OseeLevel.SEVERE_POPUP, ex);
- }
- }
-
- public Branch getBranch() {
- if (((MassArtifactEditorInput) getEditorInput()).getArtifacts().isEmpty()) {
- return null;
- }
- return ((MassArtifactEditorInput) getEditorInput()).getArtifacts().iterator().next().getBranch();
- }
-
- @Override
- public void onDirtied() {
- Displays.ensureInDisplayThread(new Runnable() {
-
- public void run() {
- firePropertyChange(PROP_DIRTY);
- }
- });
- }
-
- public String getCurrentStateName() {
- return "";
- }
-
- public IDirtiableEditor getEditor() {
- return this;
- }
-
- public boolean isArtifactsEditable() {
- return true;
- }
-
- /**
- * @return the artifacts
- */
- public Collection<? extends Artifact> getArtifacts() {
- return xViewer.getArtifacts();
- }
-
- public String getActionDescription() {
- return "";
- }
+ public static final String EDITOR_ID = "org.eclipse.osee.framework.ui.skynet.massEditor.MassArtifactEditor";
+ private int artifactsPageIndex;
+ private MassXViewer xViewer;
+ private Label branchLabel;
+ private ToolBar toolBar;
+
+ /**
+ * @return the xViewer
+ */
+ public MassXViewer getXViewer() {
+ return xViewer;
+ }
+
+ @Override
+ public void doSave(IProgressMonitor monitor) {
+ try {
+ Artifacts.persistInTransaction(xViewer.getArtifacts());
+ } catch (Exception ex) {
+ OseeLog.log(SkynetGuiPlugin.class, OseeLevel.SEVERE_POPUP, ex);
+ }
+ onDirtied();
+ }
+
+ public static void editArtifacts(final String name, final Collection<? extends Artifact> artifacts, TableLoadOption... tableLoadOptions) {
+ Set<TableLoadOption> options = new HashSet<TableLoadOption>();
+ options.addAll(Arrays.asList(tableLoadOptions));
+ Displays.ensureInDisplayThread(new Runnable() {
+ @Override
+ public void run() {
+ boolean accessControlFilteredResults = false;
+ try {
+ Set<Artifact> accessibleArts = new HashSet<Artifact>();
+ for (Artifact artifact : artifacts) {
+ if (!AccessControlManager.hasPermission(artifact, PermissionEnum.READ)) {
+ OseeLog.log(SkynetGuiPlugin.class, Level.INFO,
+ "The user " + UserManager.getUser() + " does not have read access to " + artifact);
+ accessControlFilteredResults = true;
+ } else {
+ accessibleArts.add(artifact);
+ }
+ }
+ if (accessibleArts.isEmpty()) {
+ AWorkbench.popup("ERROR", "No Artifacts to edit");
+ } else {
+ AWorkbench.getActivePage().openEditor(
+ new MassArtifactEditorInput(name, accessibleArts, new MassXViewerFactory(accessibleArts)),
+ EDITOR_ID);
+ }
+ if (accessControlFilteredResults) {
+ AWorkbench.popup("ERROR", "Some Artifacts not loaded due to access control limitations.");
+ }
+ } catch (Exception ex) {
+ OseeLog.log(SkynetGuiPlugin.class, OseeLevel.SEVERE_POPUP, ex);
+ }
+ }
+ }, options.contains(TableLoadOption.ForcePend));
+ }
+
+ public static void editArtifact(final Artifact artifact, TableLoadOption... tableLoadOptions) {
+ editArtifacts("", Arrays.asList(artifact));
+ }
+
+ public void createTaskActionBar(Composite parent) {
+
+ // Button composite for state transitions, etc
+ Composite bComp = new Composite(parent, SWT.NONE);
+ // bComp.setBackground(mainSComp.getDisplay().getSystemColor(SWT.COLOR_CYAN));
+ bComp.setLayout(ALayout.getZeroMarginLayout(2, false));
+ bComp.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+
+ Composite leftComp = new Composite(bComp, SWT.NONE);
+ leftComp.setLayout(new GridLayout());
+ leftComp.setLayoutData(new GridData(GridData.BEGINNING | GridData.FILL_HORIZONTAL));
+
+ branchLabel = new Label(leftComp, SWT.NONE);
+ branchLabel.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+
+ Composite rightComp = new Composite(bComp, SWT.NONE);
+ rightComp.setLayout(new GridLayout());
+ rightComp.setLayoutData(new GridData(GridData.END));
+
+ toolBar = new ToolBar(rightComp, SWT.FLAT | SWT.RIGHT);
+ GridData gd = new GridData(GridData.FILL_HORIZONTAL);
+ toolBar.setLayoutData(gd);
+ ToolItem item = null;
+
+ item = new ToolItem(toolBar, SWT.PUSH);
+ item.setImage(ImageManager.getImage(PluginUiImage.REFRESH));
+ item.setToolTipText("Refresh");
+ item.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ xViewer.refresh();
+ }
+ });
+
+ OseeUiActions.addButtonToEditorToolBar(this, SkynetGuiPlugin.getInstance(), toolBar, EDITOR_ID,
+ "Mass Artifact Editor");
+ }
+
+ public static void editArtifacts(final MassArtifactEditorInput input) {
+ Displays.ensureInDisplayThread(new Runnable() {
+ @Override
+ public void run() {
+ IWorkbenchPage page = AWorkbench.getActivePage();
+ try {
+ page.openEditor(input, EDITOR_ID);
+ } catch (PartInitException ex) {
+ OseeLog.log(SkynetGuiPlugin.class, OseeLevel.SEVERE_POPUP, ex);
+ }
+ }
+ });
+
+ }
+
+ @Override
+ public boolean isSaveOnCloseNeeded() {
+ return isDirty();
+ }
+
+ @Override
+ public void dispose() {
+ super.dispose();
+
+ for (Artifact taskArt : xViewer.getArtifacts()) {
+ try {
+ if (taskArt != null && !taskArt.isDeleted() && taskArt.hasDirtyAttributes()) {
+ taskArt.reloadAttributesAndRelations();
+ }
+ } catch (Exception ex) {
+ OseeLog.log(SkynetGuiPlugin.class, Level.SEVERE, ex);
+ }
+ }
+ }
+
+ public ArrayList<Artifact> getLoadedArtifacts() {
+ return xViewer.getLoadedArtifacts();
+ }
+
+ @Override
+ public boolean isDirty() {
+ for (Artifact taskArt : xViewer.getArtifacts()) {
+ if (!taskArt.isDeleted() && taskArt.hasDirtyAttributes()) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ @Override
+ public String toString() {
+ return "MassArtifactEditor";
+ }
+
+ @Override
+ protected void addPages() {
+ IEditorInput editorInput = getEditorInput();
+ if (!(editorInput instanceof MassArtifactEditorInput)) {
+ throw new IllegalArgumentException("Editor Input not TaskEditorInput");
+ }
+
+ if (((MassArtifactEditorInput) editorInput).getName().equals("")) {
+ setPartName("Mass Artifact Editor");
+ } else {
+ setPartName(((MassArtifactEditorInput) editorInput).getName());
+ }
+
+ SkynetGuiPlugin.getInstance().setHelp(getContainer(), "mass_artifact_editor",
+ "org.eclipse.osee.framework.help.ui");
+
+ Composite comp = new Composite(getContainer(), SWT.NONE);
+ comp.setLayout(new GridLayout(1, true));
+ comp.setLayoutData(new GridData(GridData.FILL_BOTH));
+
+ createTaskActionBar(comp);
+
+ xViewer = new MassXViewer(comp, SWT.MULTI | SWT.BORDER | SWT.FULL_SELECTION, this);
+ xViewer.getTree().setLayoutData(new GridData(GridData.FILL_BOTH));
+ xViewer.setContentProvider(new org.eclipse.osee.framework.ui.skynet.artifact.massEditor.MassContentProvider(
+ xViewer));
+ xViewer.setLabelProvider(new org.eclipse.osee.framework.ui.skynet.artifact.massEditor.MassLabelProvider(xViewer));
+ branchLabel.setText("Branch: " + (getBranch() == null ? "No Artifacts Returned" : getBranch().getShortName()));
+ artifactsPageIndex = addPage(comp);
+ setPageText(artifactsPageIndex, "Artifacts");
+
+ new ActionContributionItem(xViewer.getCustomizeAction()).fill(toolBar, -1);
+
+ Tree tree = xViewer.getTree();
+ GridData gridData = new GridData(GridData.FILL_BOTH | GridData.GRAB_VERTICAL | GridData.GRAB_HORIZONTAL);
+ tree.setLayoutData(gridData);
+ tree.setHeaderVisible(true);
+ tree.setLinesVisible(true);
+
+ setActivePage(artifactsPageIndex);
+ try {
+ xViewer.set(((MassArtifactEditorInput) editorInput).getArtifacts());
+ } catch (Exception ex) {
+ OseeLog.log(SkynetGuiPlugin.class, OseeLevel.SEVERE_POPUP, ex);
+ }
+ }
+
+ public Branch getBranch() {
+ if (((MassArtifactEditorInput) getEditorInput()).getArtifacts().isEmpty()) {
+ return null;
+ }
+ return ((MassArtifactEditorInput) getEditorInput()).getArtifacts().iterator().next().getBranch();
+ }
+
+ @Override
+ public void onDirtied() {
+ Displays.ensureInDisplayThread(new Runnable() {
+ @Override
+ public void run() {
+ firePropertyChange(PROP_DIRTY);
+ }
+ });
+ }
+
+ public String getCurrentStateName() {
+ return "";
+ }
+
+ public IDirtiableEditor getEditor() {
+ return this;
+ }
+
+ public boolean isArtifactsEditable() {
+ return true;
+ }
+
+ /**
+ * @return the artifacts
+ */
+ public Collection<? extends Artifact> getArtifacts() {
+ return xViewer.getArtifacts();
+ }
+
+ @Override
+ public String getActionDescription() {
+ return "";
+ }
}
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/massEditor/MassArtifactEditorInput.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/massEditor/MassArtifactEditorInput.java
index 508368cc0c..00a77ed112 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/massEditor/MassArtifactEditorInput.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/massEditor/MassArtifactEditorInput.java
@@ -22,47 +22,53 @@ import org.eclipse.ui.IPersistableElement;
*/
public class MassArtifactEditorInput implements IEditorInput {
- private final Collection<? extends Artifact> artifacts;
- private final String name;
- private final SkynetXViewerFactory skynetXViewerFactory;
+ private final Collection<? extends Artifact> artifacts;
+ private final String name;
+ private final SkynetXViewerFactory skynetXViewerFactory;
- public SkynetXViewerFactory getXViewerFactory() {
- return skynetXViewerFactory;
- }
+ public SkynetXViewerFactory getXViewerFactory() {
+ return skynetXViewerFactory;
+ }
- public MassArtifactEditorInput(String name, Collection<? extends Artifact> artifacts, SkynetXViewerFactory skynetXViewerFactory) {
- this.name = name;
- this.artifacts = artifacts;
- this.skynetXViewerFactory = skynetXViewerFactory;
- }
+ public MassArtifactEditorInput(String name, Collection<? extends Artifact> artifacts, SkynetXViewerFactory skynetXViewerFactory) {
+ this.name = name;
+ this.artifacts = artifacts;
+ this.skynetXViewerFactory = skynetXViewerFactory;
+ }
- public Collection<? extends Artifact> getArtifacts() {
- return artifacts;
- }
+ public Collection<? extends Artifact> getArtifacts() {
+ return artifacts;
+ }
- public String getName() {
- return name;
- }
+ @Override
+ public String getName() {
+ return name;
+ }
- public boolean exists() {
- return false;
- }
+ @Override
+ public boolean exists() {
+ return false;
+ }
- public ImageDescriptor getImageDescriptor() {
- return null;
- }
+ @Override
+ public ImageDescriptor getImageDescriptor() {
+ return null;
+ }
- public IPersistableElement getPersistable() {
- return null;
- }
+ @Override
+ public IPersistableElement getPersistable() {
+ return null;
+ }
- public String getToolTipText() {
- return "";
- }
+ @Override
+ public String getToolTipText() {
+ return "";
+ }
- @SuppressWarnings("unchecked")
- public Object getAdapter(Class adapter) {
- return null;
- }
+ @SuppressWarnings("rawtypes")
+ @Override
+ public Object getAdapter(Class adapter) {
+ return null;
+ }
}
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/massEditor/MassContentProvider.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/massEditor/MassContentProvider.java
index e2f089a40f..44a2e9f804 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/massEditor/MassContentProvider.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/massEditor/MassContentProvider.java
@@ -17,114 +17,144 @@ import org.eclipse.jface.viewers.ITreeContentProvider;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
import org.eclipse.osee.framework.skynet.core.event2.artifact.EventBasicGuidArtifact;
-import org.eclipse.osee.framework.ui.plugin.util.Displays;
+import org.eclipse.osee.framework.ui.swt.Displays;
public class MassContentProvider implements ITreeContentProvider {
- protected Collection<Artifact> rootSet = new HashSet<Artifact>();
- private final MassXViewer xViewer;
- private static Object[] EMPTY_ARRAY = new Object[0];
-
- public MassContentProvider(MassXViewer xViewer) {
- super();
- this.xViewer = xViewer;
- }
-
- public void add(final Artifact item) {
- add(Arrays.asList(item));
- }
-
- public void add(final Collection<? extends Artifact> items) {
- Displays.ensureInDisplayThread(new Runnable() {
- public void run() {
- if (xViewer.getInput() == null) xViewer.setInput(rootSet);
- rootSet.addAll(items);
- xViewer.refresh();
- };
- });
- }
-
- public void set(final Collection<? extends Artifact> arts) {
- Displays.ensureInDisplayThread(new Runnable() {
- public void run() {
- if (xViewer.getInput() == null) xViewer.setInput(rootSet);
- clear();
- add(arts);
- };
- });
- }
-
- public void updateAll(final Collection<? extends Object> arts) {
- if (arts.isEmpty()) return;
- Displays.ensureInDisplayThread(new Runnable() {
- public void run() {
- if (xViewer.getInput() == null) xViewer.setInput(rootSet);
- for (Object art : arts) {
- xViewer.update(art, null);
- }
- };
- });
- }
-
- public void remove(final EventBasicGuidArtifact art) {
- removeAll(Arrays.asList(art));
- }
-
- public void removeAll(final Collection<? extends EventBasicGuidArtifact> arts) {
- Displays.ensureInDisplayThread(new Runnable() {
- public void run() {
- if (xViewer.getInput() == null) xViewer.setInput(rootSet);
- rootSet.removeAll(arts);
- xViewer.refresh();
- };
- });
- }
-
- public void removeAllArts(final Collection<? extends Artifact> arts) {
- Displays.ensureInDisplayThread(new Runnable() {
- public void run() {
- if (xViewer.getInput() == null) xViewer.setInput(rootSet);
- rootSet.removeAll(arts);
- xViewer.refresh();
- };
- });
- }
-
- public void clear() {
- Displays.ensureInDisplayThread(new Runnable() {
- public void run() {
- if (xViewer.getInput() == null) xViewer.setInput(rootSet);
- rootSet.clear();
- xViewer.refresh();
- };
- });
- }
-
- @SuppressWarnings("rawtypes")
- public Object[] getChildren(Object parentElement) {
- if (parentElement instanceof Collection) {
- return ((Collection) parentElement).toArray();
- }
- return EMPTY_ARRAY;
- }
-
- public Object getParent(Object element) {
- return null;
- }
-
- public boolean hasChildren(Object element) {
- if (element instanceof Collection) return true;
- return false;
- }
-
- public Object[] getElements(Object inputElement) {
- if (inputElement instanceof String) return new Object[] {inputElement};
- return getChildren(inputElement);
- }
-
- public void dispose() {
- }
-
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
- }
+ protected Collection<Artifact> rootSet = new HashSet<Artifact>();
+ private final MassXViewer xViewer;
+ private static Object[] EMPTY_ARRAY = new Object[0];
+
+ public MassContentProvider(MassXViewer xViewer) {
+ super();
+ this.xViewer = xViewer;
+ }
+
+ public void add(final Artifact item) {
+ add(Arrays.asList(item));
+ }
+
+ public void add(final Collection<? extends Artifact> items) {
+ Displays.ensureInDisplayThread(new Runnable() {
+ @Override
+ public void run() {
+ if (xViewer.getInput() == null) {
+ xViewer.setInput(rootSet);
+ }
+ rootSet.addAll(items);
+ xViewer.refresh();
+ };
+ });
+ }
+
+ public void set(final Collection<? extends Artifact> arts) {
+ Displays.ensureInDisplayThread(new Runnable() {
+ @Override
+ public void run() {
+ if (xViewer.getInput() == null) {
+ xViewer.setInput(rootSet);
+ }
+ clear();
+ add(arts);
+ };
+ });
+ }
+
+ public void updateAll(final Collection<? extends Object> arts) {
+ if (arts.isEmpty()) {
+ return;
+ }
+ Displays.ensureInDisplayThread(new Runnable() {
+ @Override
+ public void run() {
+ if (xViewer.getInput() == null) {
+ xViewer.setInput(rootSet);
+ }
+ for (Object art : arts) {
+ xViewer.update(art, null);
+ }
+ };
+ });
+ }
+
+ public void remove(final EventBasicGuidArtifact art) {
+ removeAll(Arrays.asList(art));
+ }
+
+ public void removeAll(final Collection<? extends EventBasicGuidArtifact> arts) {
+ Displays.ensureInDisplayThread(new Runnable() {
+ @Override
+ public void run() {
+ if (xViewer.getInput() == null) {
+ xViewer.setInput(rootSet);
+ }
+ rootSet.removeAll(arts);
+ xViewer.refresh();
+ };
+ });
+ }
+
+ public void removeAllArts(final Collection<? extends Artifact> arts) {
+ Displays.ensureInDisplayThread(new Runnable() {
+ @Override
+ public void run() {
+ if (xViewer.getInput() == null) {
+ xViewer.setInput(rootSet);
+ }
+ rootSet.removeAll(arts);
+ xViewer.refresh();
+ };
+ });
+ }
+
+ public void clear() {
+ Displays.ensureInDisplayThread(new Runnable() {
+ @Override
+ public void run() {
+ if (xViewer.getInput() == null) {
+ xViewer.setInput(rootSet);
+ }
+ rootSet.clear();
+ xViewer.refresh();
+ };
+ });
+ }
+
+ @SuppressWarnings("rawtypes")
+ @Override
+ public Object[] getChildren(Object parentElement) {
+ if (parentElement instanceof Collection) {
+ return ((Collection) parentElement).toArray();
+ }
+ return EMPTY_ARRAY;
+ }
+
+ @Override
+ public Object getParent(Object element) {
+ return null;
+ }
+
+ @Override
+ public boolean hasChildren(Object element) {
+ if (element instanceof Collection) {
+ return true;
+ }
+ return false;
+ }
+
+ @Override
+ public Object[] getElements(Object inputElement) {
+ if (inputElement instanceof String) {
+ return new Object[] {inputElement};
+ }
+ return getChildren(inputElement);
+ }
+
+ @Override
+ public void dispose() {
+ }
+
+ @Override
+ public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
+ }
}
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/massEditor/MassLabelProvider.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/massEditor/MassLabelProvider.java
index 0c11848726..c74dc0e0cf 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/massEditor/MassLabelProvider.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/massEditor/MassLabelProvider.java
@@ -24,88 +24,92 @@ import org.eclipse.swt.graphics.Image;
public class MassLabelProvider extends XViewerLabelProvider {
- private final MassXViewer xViewer;
+ private final MassXViewer xViewer;
- public MassLabelProvider(MassXViewer xViewer) {
- super(xViewer);
- this.xViewer = xViewer;
- }
+ public MassLabelProvider(MassXViewer xViewer) {
+ super(xViewer);
+ this.xViewer = xViewer;
+ }
- @Override
- public Image getColumnImage(Object element, XViewerColumn col, int columnIndex) throws XViewerException {
- if (col == null) {
- return null;
- }
- if (columnIndex != 0 && col instanceof XViewerValueColumn) {
- return ((XViewerValueColumn) col).getColumnImage(element, col, columnIndex);
- }
- Artifact artifact = (Artifact) element;
- if (artifact == null || artifact.isDeleted()) {
- return null;
- }
- if (columnIndex == 0) {
- return ArtifactImageManager.getImage(artifact);
- }
- return null;
- }
+ @Override
+ public Image getColumnImage(Object element, XViewerColumn col, int columnIndex) throws XViewerException {
+ if (col == null) {
+ return null;
+ }
+ if (columnIndex != 0 && col instanceof XViewerValueColumn) {
+ return ((XViewerValueColumn) col).getColumnImage(element, col, columnIndex);
+ }
+ Artifact artifact = (Artifact) element;
+ if (artifact == null || artifact.isDeleted()) {
+ return null;
+ }
+ if (columnIndex == 0) {
+ return ArtifactImageManager.getImage(artifact);
+ }
+ return null;
+ }
- @Override
- public String getColumnText(Object element, XViewerColumn col, int columnIndex) throws XViewerException {
- try {
- if (col == null) {
- return "";
- }
- if (col instanceof XViewerValueColumn) {
- return ((XViewerValueColumn) col).getColumnText(element, col, columnIndex);
- }
- if (element instanceof String) {
- if (columnIndex == 1) {
- return (String) element;
- } else {
- return "";
- }
- }
- Artifact artifact = (Artifact) element;
- if (artifact == null || artifact.isDeleted()) {
- return "";
- }
- // Handle case where columns haven't been loaded yet
- if (columnIndex > getTreeViewer().getTree().getColumns().length - 1) {
- return "";
- }
+ @Override
+ public String getColumnText(Object element, XViewerColumn col, int columnIndex) throws XViewerException {
+ try {
+ if (col == null) {
+ return "";
+ }
+ if (col instanceof XViewerValueColumn) {
+ return ((XViewerValueColumn) col).getColumnText(element, col, columnIndex);
+ }
+ if (element instanceof String) {
+ if (columnIndex == 1) {
+ return (String) element;
+ } else {
+ return "";
+ }
+ }
+ Artifact artifact = (Artifact) element;
+ if (artifact == null || artifact.isDeleted()) {
+ return "";
+ }
+ // Handle case where columns haven't been loaded yet
+ if (columnIndex > getTreeViewer().getTree().getColumns().length - 1) {
+ return "";
+ }
- String colName = col.getName();
- if (!artifact.isAttributeTypeValid(colName)) {
- return "";
- }
- if (AttributeTypeManager.isBaseTypeCompatible(DateAttribute.class, colName)) {
- try {
- return new DateAttribute().MMDDYYHHMM.format(artifact.getSoleAttributeValue(colName));
- } catch (OseeCoreException ex) {
- return "";
- }
- }
+ String colName = col.getName();
+ if (!artifact.isAttributeTypeValid(colName)) {
+ return "";
+ }
+ if (AttributeTypeManager.isBaseTypeCompatible(DateAttribute.class, colName)) {
+ try {
+ return new DateAttribute().MMDDYYHHMM.format(artifact.getSoleAttributeValue(colName));
+ } catch (OseeCoreException ex) {
+ return "";
+ }
+ }
- return artifact.getAttributesToString(colName);
- } catch (OseeCoreException ex) {
- throw new XViewerException(ex);
- }
- }
+ return artifact.getAttributesToString(colName);
+ } catch (OseeCoreException ex) {
+ throw new XViewerException(ex);
+ }
+ }
- public boolean isLabelProperty(Object element, String property) {
- return false;
- }
+ @Override
+ public boolean isLabelProperty(Object element, String property) {
+ return false;
+ }
- public void addListener(ILabelProviderListener listener) {
- }
+ @Override
+ public void addListener(ILabelProviderListener listener) {
+ }
- public void removeListener(ILabelProviderListener listener) {
- }
+ @Override
+ public void removeListener(ILabelProviderListener listener) {
+ }
- public MassXViewer getTreeViewer() {
- return xViewer;
- }
+ public MassXViewer getTreeViewer() {
+ return xViewer;
+ }
- public void dispose() {
- }
+ @Override
+ public void dispose() {
+ }
}
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/massEditor/MassXViewer.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/massEditor/MassXViewer.java
index 6125f757a1..66afd029e7 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/massEditor/MassXViewer.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/massEditor/MassXViewer.java
@@ -31,12 +31,12 @@ import org.eclipse.osee.framework.skynet.core.event.OseeEventManager;
import org.eclipse.osee.framework.skynet.core.event.Sender;
import org.eclipse.osee.framework.skynet.core.utility.LoadedArtifacts;
import org.eclipse.osee.framework.ui.plugin.util.AWorkbench;
-import org.eclipse.osee.framework.ui.plugin.util.Displays;
import org.eclipse.osee.framework.ui.skynet.SkynetGuiPlugin;
import org.eclipse.osee.framework.ui.skynet.artifact.ArtifactPromptChange;
import org.eclipse.osee.framework.ui.skynet.artifact.ArtifactTransfer;
import org.eclipse.osee.framework.ui.skynet.render.PresentationType;
import org.eclipse.osee.framework.ui.skynet.render.RendererManager;
+import org.eclipse.osee.framework.ui.swt.Displays;
import org.eclipse.osee.framework.ui.swt.IDirtiableEditor;
import org.eclipse.swt.dnd.DND;
import org.eclipse.swt.dnd.DragSource;
@@ -61,271 +61,273 @@ import org.eclipse.swt.widgets.TreeItem;
*/
public class MassXViewer extends XViewer implements IMassViewerEventHandler, IFrameworkTransactionEventListener, IArtifactsPurgedEventListener, IArtifactsChangeTypeEventListener {
- private String title;
- private final Set<Artifact> artifacts = new HashSet<Artifact>(50);
- private final IDirtiableEditor editor;
- private final List<String> EXTRA_COLUMNS = Arrays.asList(new String[] {"GUID", "HRID", "Artifact Type"});
- private final Composite parent;
-
- public MassXViewer(Composite parent, int style, MassArtifactEditor editor) {
- super(parent, style, ((MassArtifactEditorInput) editor.getEditorInput()).getXViewerFactory());
- this.parent = parent;
- this.editor = editor;
- OseeEventManager.addListener(this);
- MassXViewerEventManager.add(this);
- final MassXViewer fMassXViewer = this;
- parent.addDisposeListener(new DisposeListener() {
-
- @Override
- public void widgetDisposed(DisposeEvent e) {
- MassXViewerEventManager.remove(fMassXViewer);
- }
- });
- }
-
- @Override
- public void handleColumnMultiEdit(TreeColumn treeColumn, Collection<TreeItem> treeItems) {
- String colName = treeColumn.getText();
- Set<Artifact> useArts = new HashSet<Artifact>();
- for (TreeItem item : treeItems) {
- useArts.add((Artifact) item.getData());
- }
- if (ArtifactPromptChange.promptChangeAttribute(colName, colName, useArts, false)) {
- refresh();
- editor.onDirtied();
- }
- }
-
- @Override
- public boolean isColumnMultiEditable(TreeColumn treeColumn, Collection<TreeItem> treeItems) {
- if (EXTRA_COLUMNS.contains(treeColumn.getText())) {
- return false;
- }
- return super.isColumnMultiEditable(treeColumn, treeItems);
- }
-
- @Override
- public boolean isColumnMultiEditEnabled() {
- return true;
- }
-
- @Override
- public boolean handleAltLeftClick(TreeColumn treeColumn, TreeItem treeItem) {
- return handleAltLeftClick(treeColumn, treeItem, false);
- }
-
- public boolean handleAltLeftClick(TreeColumn treeColumn, TreeItem treeItem, boolean persist) {
- super.handleAltLeftClick(treeColumn, treeItem);
- String colName = treeColumn.getText();
- if (EXTRA_COLUMNS.contains(colName)) {
- AWorkbench.popup("ERROR", "Can't change the field " + colName);
- }
- Artifact useArt = ((Artifact) treeItem.getData());
- if (ArtifactPromptChange.promptChangeAttribute(colName, colName, Arrays.asList(useArt), persist)) {
- refresh();
- editor.onDirtied();
- return true;
- }
- return false;
- }
-
- @Override
- protected void createSupportWidgets(Composite parent) {
- super.createSupportWidgets(parent);
- setupDragAndDropSupport();
- }
-
- private void setupDragAndDropSupport() {
-
- // Do not allow drag if artifacts in this table are not on same branch as default branch
- DragSource source = new DragSource(getTree(), DND.DROP_COPY);
- source.setTransfer(new Transfer[] {ArtifactTransfer.getInstance()});
- source.addDragListener(new DragSourceListener() {
-
- public void dragFinished(DragSourceEvent event) {
- refresh();
- }
-
- public void dragSetData(DragSourceEvent event) {
- Collection<Artifact> arts = getSelectedArtifacts();
- if (arts.size() > 0) {
- event.data = new ArtifactData(arts.toArray(new Artifact[arts.size()]), "", MassArtifactEditor.EDITOR_ID);
-
- }
- }
-
- public void dragStart(DragSourceEvent event) {
- event.doit = false;
- Collection<Artifact> arts = getSelectedArtifacts();
- if (arts.size() > 0) {
- event.doit = true;
- }
- }
- });
-
- // Do not allow drop if default branch is not same as artifacts that reside in this table
- DropTarget target = new DropTarget(getTree(), DND.DROP_COPY);
- target.setTransfer(new Transfer[] {FileTransfer.getInstance(), TextTransfer.getInstance(),
- ArtifactTransfer.getInstance()});
- target.addDropListener(new DropTargetAdapter() {
-
- @Override
- public void drop(DropTargetEvent event) {
- performDrop(event);
- }
-
- @Override
- public void dragOver(DropTargetEvent event) {
- // if ((event.data instanceof ArtifactData) && ((ArtifactData)
- // event.data).getArtifacts().length > 0)
- event.detail = DND.DROP_COPY;
- }
-
- @Override
- public void dropAccept(DropTargetEvent event) {
- }
- });
- }
-
- private void performDrop(DropTargetEvent e) {
- try {
- if (e.data instanceof ArtifactData) {
- Artifact[] artsToAdd = ((ArtifactData) e.data).getArtifacts();
- add(Arrays.asList(artsToAdd));
- }
- refresh();
- } catch (Exception ex) {
- OseeLog.log(SkynetGuiPlugin.class, OseeLevel.SEVERE_POPUP, ex);
- }
- }
-
- @Override
- public void handleDoubleClick() {
- if (getSelectedArtifacts().isEmpty()) {
- return;
- }
- RendererManager.openInJob(getSelectedArtifacts(), PresentationType.GENERALIZED_EDIT);
- }
-
- public ArrayList<Artifact> getLoadedArtifacts() {
- ArrayList<Artifact> arts = new ArrayList<Artifact>();
- TreeItem items[] = getTree().getItems();
- if (items.length > 0) {
- for (TreeItem item : items) {
- arts.add((Artifact) item.getData());
- }
- }
- return arts;
- }
-
- @Override
- public void dispose() {
- OseeEventManager.removeListener(this);
- MassXViewerEventManager.remove(this);
- // Tell the label provider to release its resources
- getLabelProvider().dispose();
- }
-
- public ArrayList<Artifact> getSelectedArtifacts() {
- ArrayList<Artifact> arts = new ArrayList<Artifact>();
- TreeItem items[] = getTree().getSelection();
- if (items.length > 0) {
- for (TreeItem item : items) {
- arts.add((Artifact) item.getData());
- }
- }
- return arts;
- }
-
- public String getTitle() {
- return title;
- }
-
- public void add(Collection<? extends Artifact> artifacts) {
- if (xViewerFactory instanceof MassXViewerFactory) {
- ((MassXViewerFactory) xViewerFactory).registerAllAttributeColumnsForArtifacts(artifacts, true, true);
- }
- for (Artifact art : artifacts) {
- this.artifacts.add(art);
- }
- ((MassContentProvider) getContentProvider()).add(artifacts);
- }
-
- public void set(Collection<? extends Artifact> artifacts) {
- if (xViewerFactory instanceof MassXViewerFactory) {
- ((MassXViewerFactory) xViewerFactory).registerAllAttributeColumnsForArtifacts(artifacts, true, true);
- }
- this.artifacts.clear();
- for (Artifact art : artifacts) {
- this.artifacts.add(art);
- }
- ((MassContentProvider) getContentProvider()).set(artifacts);
- }
-
- public Collection<? extends Artifact> getArtifacts() {
- return artifacts;
- }
-
- @Override
- public void handleFrameworkTransactionEvent(Sender sender, final FrameworkTransactionData transData) throws OseeCoreException {
- Displays.ensureInDisplayThread(new Runnable() {
- @Override
- public void run() {
- if (getTree() == null || getTree().isDisposed()) {
- dispose();
- return;
- }
- if (transData.cacheDeletedArtifacts.size() > 0) {
- ((MassContentProvider) getContentProvider()).removeAllArts(transData.cacheDeletedArtifacts);
- }
- if (transData.cacheChangedArtifacts.size() > 0) {
- ((MassContentProvider) getContentProvider()).updateAll(transData.cacheChangedArtifacts);
- }
- refresh(transData.cacheRelationAddedArtifacts);
- refresh(transData.cacheRelationChangedArtifacts);
- refresh(transData.cacheRelationDeletedArtifacts);
- }
- });
- }
-
- @Override
- public void handleArtifactsPurgedEvent(Sender sender, final LoadedArtifacts loadedArtifacts) {
- Displays.ensureInDisplayThread(new Runnable() {
- @Override
- public void run() {
- try {
- if (getTree() != null && !getTree().isDisposed()) {
- remove(loadedArtifacts.getLoadedArtifacts().toArray());
- }
- } catch (OseeCoreException ex) {
- OseeLog.log(SkynetGuiPlugin.class, Level.SEVERE, ex);
- }
- }
- });
- }
-
- @Override
- public void handleArtifactsChangeTypeEvent(Sender sender, int toArtifactTypeId, final LoadedArtifacts loadedArtifacts) {
- Displays.ensureInDisplayThread(new Runnable() {
- @Override
- public void run() {
- try {
- remove(loadedArtifacts.getLoadedArtifacts().toArray());
- } catch (OseeCoreException ex) {
- OseeLog.log(SkynetGuiPlugin.class, Level.SEVERE, ex);
- }
- }
- });
- }
-
- @Override
- public MassXViewer getMassXViewer() {
- return this;
- }
-
- @Override
- public boolean isDisposed() {
- return parent == null || parent.isDisposed();
- }
+ private String title;
+ private final Set<Artifact> artifacts = new HashSet<Artifact>(50);
+ private final IDirtiableEditor editor;
+ private final List<String> EXTRA_COLUMNS = Arrays.asList(new String[] {"GUID", "HRID", "Artifact Type"});
+ private final Composite parent;
+
+ public MassXViewer(Composite parent, int style, MassArtifactEditor editor) {
+ super(parent, style, ((MassArtifactEditorInput) editor.getEditorInput()).getXViewerFactory());
+ this.parent = parent;
+ this.editor = editor;
+ OseeEventManager.addListener(this);
+ MassXViewerEventManager.add(this);
+ final MassXViewer fMassXViewer = this;
+ parent.addDisposeListener(new DisposeListener() {
+
+ @Override
+ public void widgetDisposed(DisposeEvent e) {
+ MassXViewerEventManager.remove(fMassXViewer);
+ }
+ });
+ }
+
+ @Override
+ public void handleColumnMultiEdit(TreeColumn treeColumn, Collection<TreeItem> treeItems) {
+ String colName = treeColumn.getText();
+ Set<Artifact> useArts = new HashSet<Artifact>();
+ for (TreeItem item : treeItems) {
+ useArts.add((Artifact) item.getData());
+ }
+ if (ArtifactPromptChange.promptChangeAttribute(colName, colName, useArts, false)) {
+ refresh();
+ editor.onDirtied();
+ }
+ }
+
+ @Override
+ public boolean isColumnMultiEditable(TreeColumn treeColumn, Collection<TreeItem> treeItems) {
+ if (EXTRA_COLUMNS.contains(treeColumn.getText())) {
+ return false;
+ }
+ return super.isColumnMultiEditable(treeColumn, treeItems);
+ }
+
+ @Override
+ public boolean isColumnMultiEditEnabled() {
+ return true;
+ }
+
+ @Override
+ public boolean handleAltLeftClick(TreeColumn treeColumn, TreeItem treeItem) {
+ return handleAltLeftClick(treeColumn, treeItem, false);
+ }
+
+ public boolean handleAltLeftClick(TreeColumn treeColumn, TreeItem treeItem, boolean persist) {
+ super.handleAltLeftClick(treeColumn, treeItem);
+ String colName = treeColumn.getText();
+ if (EXTRA_COLUMNS.contains(colName)) {
+ AWorkbench.popup("ERROR", "Can't change the field " + colName);
+ }
+ Artifact useArt = ((Artifact) treeItem.getData());
+ if (ArtifactPromptChange.promptChangeAttribute(colName, colName, Arrays.asList(useArt), persist)) {
+ refresh();
+ editor.onDirtied();
+ return true;
+ }
+ return false;
+ }
+
+ @Override
+ protected void createSupportWidgets(Composite parent) {
+ super.createSupportWidgets(parent);
+ setupDragAndDropSupport();
+ }
+
+ private void setupDragAndDropSupport() {
+
+ // Do not allow drag if artifacts in this table are not on same branch as default branch
+ DragSource source = new DragSource(getTree(), DND.DROP_COPY);
+ source.setTransfer(new Transfer[] {ArtifactTransfer.getInstance()});
+ source.addDragListener(new DragSourceListener() {
+ @Override
+ public void dragFinished(DragSourceEvent event) {
+ refresh();
+ }
+
+ @Override
+ public void dragSetData(DragSourceEvent event) {
+ Collection<Artifact> arts = getSelectedArtifacts();
+ if (arts.size() > 0) {
+ event.data = new ArtifactData(arts.toArray(new Artifact[arts.size()]), "", MassArtifactEditor.EDITOR_ID);
+
+ }
+ }
+
+ @Override
+ public void dragStart(DragSourceEvent event) {
+ event.doit = false;
+ Collection<Artifact> arts = getSelectedArtifacts();
+ if (arts.size() > 0) {
+ event.doit = true;
+ }
+ }
+ });
+
+ // Do not allow drop if default branch is not same as artifacts that reside in this table
+ DropTarget target = new DropTarget(getTree(), DND.DROP_COPY);
+ target.setTransfer(new Transfer[] {FileTransfer.getInstance(), TextTransfer.getInstance(),
+ ArtifactTransfer.getInstance()});
+ target.addDropListener(new DropTargetAdapter() {
+
+ @Override
+ public void drop(DropTargetEvent event) {
+ performDrop(event);
+ }
+
+ @Override
+ public void dragOver(DropTargetEvent event) {
+ // if ((event.data instanceof ArtifactData) && ((ArtifactData)
+ // event.data).getArtifacts().length > 0)
+ event.detail = DND.DROP_COPY;
+ }
+
+ @Override
+ public void dropAccept(DropTargetEvent event) {
+ }
+ });
+ }
+
+ private void performDrop(DropTargetEvent e) {
+ try {
+ if (e.data instanceof ArtifactData) {
+ Artifact[] artsToAdd = ((ArtifactData) e.data).getArtifacts();
+ add(Arrays.asList(artsToAdd));
+ }
+ refresh();
+ } catch (Exception ex) {
+ OseeLog.log(SkynetGuiPlugin.class, OseeLevel.SEVERE_POPUP, ex);
+ }
+ }
+
+ @Override
+ public void handleDoubleClick() {
+ if (getSelectedArtifacts().isEmpty()) {
+ return;
+ }
+ RendererManager.openInJob(getSelectedArtifacts(), PresentationType.GENERALIZED_EDIT);
+ }
+
+ public ArrayList<Artifact> getLoadedArtifacts() {
+ ArrayList<Artifact> arts = new ArrayList<Artifact>();
+ TreeItem items[] = getTree().getItems();
+ if (items.length > 0) {
+ for (TreeItem item : items) {
+ arts.add((Artifact) item.getData());
+ }
+ }
+ return arts;
+ }
+
+ @Override
+ public void dispose() {
+ OseeEventManager.removeListener(this);
+ MassXViewerEventManager.remove(this);
+ // Tell the label provider to release its resources
+ getLabelProvider().dispose();
+ }
+
+ public ArrayList<Artifact> getSelectedArtifacts() {
+ ArrayList<Artifact> arts = new ArrayList<Artifact>();
+ TreeItem items[] = getTree().getSelection();
+ if (items.length > 0) {
+ for (TreeItem item : items) {
+ arts.add((Artifact) item.getData());
+ }
+ }
+ return arts;
+ }
+
+ public String getTitle() {
+ return title;
+ }
+
+ public void add(Collection<? extends Artifact> artifacts) {
+ if (xViewerFactory instanceof MassXViewerFactory) {
+ ((MassXViewerFactory) xViewerFactory).registerAllAttributeColumnsForArtifacts(artifacts, true, true);
+ }
+ for (Artifact art : artifacts) {
+ this.artifacts.add(art);
+ }
+ ((MassContentProvider) getContentProvider()).add(artifacts);
+ }
+
+ public void set(Collection<? extends Artifact> artifacts) {
+ if (xViewerFactory instanceof MassXViewerFactory) {
+ ((MassXViewerFactory) xViewerFactory).registerAllAttributeColumnsForArtifacts(artifacts, true, true);
+ }
+ this.artifacts.clear();
+ for (Artifact art : artifacts) {
+ this.artifacts.add(art);
+ }
+ ((MassContentProvider) getContentProvider()).set(artifacts);
+ }
+
+ public Collection<? extends Artifact> getArtifacts() {
+ return artifacts;
+ }
+
+ @Override
+ public void handleFrameworkTransactionEvent(Sender sender, final FrameworkTransactionData transData) {
+ Displays.ensureInDisplayThread(new Runnable() {
+ @Override
+ public void run() {
+ if (getTree() == null || getTree().isDisposed()) {
+ dispose();
+ return;
+ }
+ if (transData.cacheDeletedArtifacts.size() > 0) {
+ ((MassContentProvider) getContentProvider()).removeAllArts(transData.cacheDeletedArtifacts);
+ }
+ if (transData.cacheChangedArtifacts.size() > 0) {
+ ((MassContentProvider) getContentProvider()).updateAll(transData.cacheChangedArtifacts);
+ }
+ refresh(transData.cacheRelationAddedArtifacts);
+ refresh(transData.cacheRelationChangedArtifacts);
+ refresh(transData.cacheRelationDeletedArtifacts);
+ }
+ });
+ }
+
+ @Override
+ public void handleArtifactsPurgedEvent(Sender sender, final LoadedArtifacts loadedArtifacts) {
+ Displays.ensureInDisplayThread(new Runnable() {
+ @Override
+ public void run() {
+ try {
+ if (getTree() != null && !getTree().isDisposed()) {
+ remove(loadedArtifacts.getLoadedArtifacts().toArray());
+ }
+ } catch (OseeCoreException ex) {
+ OseeLog.log(SkynetGuiPlugin.class, Level.SEVERE, ex);
+ }
+ }
+ });
+ }
+
+ @Override
+ public void handleArtifactsChangeTypeEvent(Sender sender, int toArtifactTypeId, final LoadedArtifacts loadedArtifacts) {
+ Displays.ensureInDisplayThread(new Runnable() {
+ @Override
+ public void run() {
+ try {
+ remove(loadedArtifacts.getLoadedArtifacts().toArray());
+ } catch (OseeCoreException ex) {
+ OseeLog.log(SkynetGuiPlugin.class, Level.SEVERE, ex);
+ }
+ }
+ });
+ }
+
+ @Override
+ public MassXViewer getMassXViewer() {
+ return this;
+ }
+
+ @Override
+ public boolean isDisposed() {
+ return parent == null || parent.isDisposed();
+ }
}
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/massEditor/MassXViewerEventManager.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/massEditor/MassXViewerEventManager.java
index 027cfbbf2e..4f8ca13c34 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/massEditor/MassXViewerEventManager.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/massEditor/MassXViewerEventManager.java
@@ -18,7 +18,7 @@ import org.eclipse.osee.framework.skynet.core.event2.artifact.EventBasicGuidArti
import org.eclipse.osee.framework.skynet.core.event2.artifact.EventModType;
import org.eclipse.osee.framework.skynet.core.event2.artifact.IArtifactEventListener;
import org.eclipse.osee.framework.skynet.core.event2.filter.IEventFilter;
-import org.eclipse.osee.framework.ui.plugin.util.Displays;
+import org.eclipse.osee.framework.ui.swt.Displays;
/**
* Common location for event handling for mass editor in order to keep number of registrations and processing to a
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/BlamEditor.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/BlamEditor.java
index 6d2a9bca63..fae35ce23a 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/BlamEditor.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/BlamEditor.java
@@ -20,9 +20,9 @@ import org.eclipse.osee.framework.logging.OseeLevel;
import org.eclipse.osee.framework.logging.OseeLog;
import org.eclipse.osee.framework.plugin.core.IActionable;
import org.eclipse.osee.framework.ui.plugin.util.AWorkbench;
-import org.eclipse.osee.framework.ui.plugin.util.Displays;
import org.eclipse.osee.framework.ui.skynet.OseeContributionItem;
import org.eclipse.osee.framework.ui.skynet.SkynetGuiPlugin;
+import org.eclipse.osee.framework.ui.swt.Displays;
import org.eclipse.osee.framework.ui.swt.IDirtiableEditor;
import org.eclipse.ui.PartInitException;
import org.eclipse.ui.forms.editor.FormEditor;
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/operation/ImageCaptureBlam.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/operation/ImageCaptureBlam.java
index c38a82365a..3507f41fc9 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/operation/ImageCaptureBlam.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/operation/ImageCaptureBlam.java
@@ -13,10 +13,10 @@ package org.eclipse.osee.framework.ui.skynet.blam.operation;
import java.util.Arrays;
import java.util.Collection;
import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.osee.framework.ui.plugin.util.Displays;
import org.eclipse.osee.framework.ui.skynet.blam.AbstractBlam;
import org.eclipse.osee.framework.ui.skynet.blam.VariableMap;
import org.eclipse.osee.framework.ui.skynet.widgets.dialog.ImageDialog;
+import org.eclipse.osee.framework.ui.swt.Displays;
import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.GC;
import org.eclipse.swt.graphics.Image;
@@ -31,60 +31,64 @@ import org.eclipse.swt.widgets.Listener;
*/
public class ImageCaptureBlam extends AbstractBlam {
- public Point topLeftPoint;
- public Point botRightPoint;
- public boolean listenerAdded = false;
+ public Point topLeftPoint;
+ public Point botRightPoint;
+ public boolean listenerAdded = false;
- @Override
- public String getName() {
- return "Image Capture";
- }
+ @Override
+ public String getName() {
+ return "Image Capture";
+ }
- public void runOperation(VariableMap variableMap, IProgressMonitor monitor) throws Exception {
+ @Override
+ public void runOperation(VariableMap variableMap, IProgressMonitor monitor) throws Exception {
- Displays.ensureInDisplayThread(new Runnable() {
- @Override
- public void run() {
- System.out.println("Starting Image Capture...");
- topLeftPoint = null;
- botRightPoint = null;
- Display.getDefault().addFilter(SWT.MouseUp, displayKeysListener);
- }
- });
- }
- Listener displayKeysListener = new Listener() {
- public void handleEvent(org.eclipse.swt.widgets.Event event) {
- if (event.type == SWT.MouseUp) {
- if (topLeftPoint == null) {
- topLeftPoint = event.display.getCursorLocation();
- print("\nFirst Mouse Event " + topLeftPoint + "\n");
- } else {
- botRightPoint = event.display.getCursorLocation();
- print("Second Mouse Event " + botRightPoint + "\n");
- GC gc = new GC(Display.getCurrent());
- Image image =
- new Image(Display.getCurrent(), botRightPoint.x - topLeftPoint.x, botRightPoint.y - topLeftPoint.y);
- gc.copyArea(image, topLeftPoint.x, topLeftPoint.y);
- gc.dispose();
- Display.getDefault().removeFilter(SWT.MouseUp, displayKeysListener);
- ImageDialog diag = new ImageDialog(image, Display.getCurrent().getActiveShell());
- diag.open();
- }
- }
- }
- };
+ Displays.ensureInDisplayThread(new Runnable() {
+ @Override
+ public void run() {
+ System.out.println("Starting Image Capture...");
+ topLeftPoint = null;
+ botRightPoint = null;
+ Display.getDefault().addFilter(SWT.MouseUp, displayKeysListener);
+ }
+ });
+ }
+ Listener displayKeysListener = new Listener() {
+ @Override
+ public void handleEvent(org.eclipse.swt.widgets.Event event) {
+ if (event.type == SWT.MouseUp) {
+ if (topLeftPoint == null) {
+ topLeftPoint = event.display.getCursorLocation();
+ print("\nFirst Mouse Event " + topLeftPoint + "\n");
+ } else {
+ botRightPoint = event.display.getCursorLocation();
+ print("Second Mouse Event " + botRightPoint + "\n");
+ GC gc = new GC(Display.getCurrent());
+ Image image =
+ new Image(Display.getCurrent(), botRightPoint.x - topLeftPoint.x,
+ botRightPoint.y - topLeftPoint.y);
+ gc.copyArea(image, topLeftPoint.x, topLeftPoint.y);
+ gc.dispose();
+ Display.getDefault().removeFilter(SWT.MouseUp, displayKeysListener);
+ ImageDialog diag = new ImageDialog(image, Display.getCurrent().getActiveShell());
+ diag.open();
+ }
+ }
+ }
+ };
- @Override
- public String getXWidgetsXml() {
- return "<xWidgets></xWidgets>";
- }
+ @Override
+ public String getXWidgetsXml() {
+ return "<xWidgets></xWidgets>";
+ }
- @Override
- public String getDescriptionUsage() {
- return "Mouse Down on top left location, Mouse Up on bottom right. Only works within bounds of workbench window.";
- }
+ @Override
+ public String getDescriptionUsage() {
+ return "Mouse Down on top left location, Mouse Up on bottom right. Only works within bounds of workbench window.";
+ }
- public Collection<String> getCategories() {
- return Arrays.asList("Util");
- }
+ @Override
+ public Collection<String> getCategories() {
+ return Arrays.asList("Util");
+ }
} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/operation/PurgeArchivedBranch.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/operation/PurgeArchivedBranch.java
index bfc8b9a498..1b6c0d2d78 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/operation/PurgeArchivedBranch.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/operation/PurgeArchivedBranch.java
@@ -29,11 +29,11 @@ import org.eclipse.osee.framework.logging.OseeLevel;
import org.eclipse.osee.framework.logging.OseeLog;
import org.eclipse.osee.framework.skynet.core.UserManager;
import org.eclipse.osee.framework.skynet.core.artifact.BranchManager;
-import org.eclipse.osee.framework.ui.plugin.util.Displays;
import org.eclipse.osee.framework.ui.skynet.SkynetGuiPlugin;
import org.eclipse.osee.framework.ui.skynet.blam.AbstractBlam;
import org.eclipse.osee.framework.ui.skynet.blam.VariableMap;
import org.eclipse.osee.framework.ui.skynet.results.XResultData;
+import org.eclipse.osee.framework.ui.swt.Displays;
import org.eclipse.swt.widgets.Display;
/**
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/operation/UpdateArtifactTypeImage.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/operation/UpdateArtifactTypeImage.java
index b999f8d4a3..957ee8cace 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/operation/UpdateArtifactTypeImage.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/operation/UpdateArtifactTypeImage.java
@@ -23,11 +23,11 @@ import org.eclipse.osee.framework.jdk.core.util.Lib;
import org.eclipse.osee.framework.jdk.core.util.Strings;
import org.eclipse.osee.framework.logging.OseeLevel;
import org.eclipse.osee.framework.logging.OseeLog;
-import org.eclipse.osee.framework.ui.plugin.util.Displays;
import org.eclipse.osee.framework.ui.skynet.ArtifactImageManager;
import org.eclipse.osee.framework.ui.skynet.SkynetGuiPlugin;
import org.eclipse.osee.framework.ui.skynet.blam.AbstractBlam;
import org.eclipse.osee.framework.ui.skynet.blam.VariableMap;
+import org.eclipse.osee.framework.ui.swt.Displays;
import org.eclipse.swt.widgets.Display;
/**
@@ -59,7 +59,7 @@ public class UpdateArtifactTypeImage extends AbstractBlam {
@Override
public void run() {
try {
- if (MessageDialog.openConfirm(Display.getDefault().getActiveShell(), "Clear Database Image?",
+ if (MessageDialog.openConfirm(Displays.getActiveShell(), "Clear Database Image?",
"No Image File Selected.\n\nSelect \"Ok\" to clear image from database (default image will be used).")) {
ArtifactImageManager.setArtifactTypeImageInDb(artifactSubtypeDescriptor, null);
}
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/sections/BlamOutputSection.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/sections/BlamOutputSection.java
index 657e855fa0..ea50f814f3 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/sections/BlamOutputSection.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/sections/BlamOutputSection.java
@@ -13,8 +13,8 @@ package org.eclipse.osee.framework.ui.skynet.blam.sections;
import java.io.IOException;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.action.ActionContributionItem;
-import org.eclipse.osee.framework.ui.plugin.util.Displays;
import org.eclipse.osee.framework.ui.skynet.blam.AbstractBlam;
+import org.eclipse.osee.framework.ui.swt.Displays;
import org.eclipse.osee.framework.ui.swt.Widgets;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridData;
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/change/view/ChangeReportPage.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/change/view/ChangeReportPage.java
index c06be856b7..d440dc2757 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/change/view/ChangeReportPage.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/change/view/ChangeReportPage.java
@@ -40,12 +40,12 @@ import org.eclipse.osee.framework.ui.skynet.change.operations.LoadChangesOperati
import org.eclipse.osee.framework.ui.skynet.change.operations.UpdateChangeUiData;
import org.eclipse.osee.framework.ui.skynet.change.presenter.ChangeReportInfoPresenter;
import org.eclipse.osee.framework.ui.skynet.widgets.xchange.ChangeXViewer;
+import org.eclipse.osee.framework.ui.swt.Displays;
import org.eclipse.osee.framework.ui.swt.Widgets;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Menu;
import org.eclipse.ui.IWorkbenchActionConstants;
import org.eclipse.ui.PlatformUI;
@@ -61,204 +61,205 @@ import org.eclipse.ui.progress.UIJob;
* @author Ryan D. Brooks
*/
public class ChangeReportPage extends FormPage implements IChangeReportPreferences.Listener {
- private static String HELP_CONTEXT_ID = "ChangeView";
-
- private ChangeReportTable changeReportTable;
- private ChangeReportInfoPresenter infoPresenter;
-
- public ChangeReportPage(ChangeReportEditor editor) {
- super(editor, "change.report", "Change Report");
- }
-
- @Override
- public void showBusy(boolean busy) {
- super.showBusy(busy);
- if (Widgets.isAccessible(getManagedForm().getForm())) {
- getManagedForm().getForm().getForm().setBusy(busy);
- }
- }
-
- @Override
- protected void createFormContent(IManagedForm managedForm) {
- super.createFormContent(managedForm);
-
- final ScrolledForm form = managedForm.getForm();
- final FormToolkit toolkit = managedForm.getToolkit();
-
- GridLayout layout = new GridLayout();
- layout.numColumns = 1;
- layout.marginHeight = 10;
- layout.marginWidth = 6;
- layout.horizontalSpacing = 20;
- form.getBody().setLayout(layout);
- form.getBody().setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
-
- updateTitle(form);
- updateImage(form);
-
- managedForm.getMessageManager().setAutoUpdate(false);
-
- ChangeUiData uiData = getEditorInput().getChangeData();
- this.changeReportTable = new ChangeReportTable(uiData);
- this.infoPresenter = new ChangeReportInfoPresenter(new ChangeReportInfo(), uiData);
-
- int sectionStyle = Section.TITLE_BAR | Section.EXPANDED | Section.TWISTIE;
-
- managedForm.addPart(new EditorSection(infoPresenter, "Info", form.getBody(), managedForm.getToolkit(),
- sectionStyle, false));
- // Can not place table in section or double scroll-bars and maintaining correct table size becomes an issue
- changeReportTable.onCreate(getManagedForm(), form.getBody());
-
- addToolBar(toolkit, form, true);
- form.reflow(true);
-
- PlatformUI.getWorkbench().getHelpSystem().setHelp(form.getBody(),
- "org.eclipse.osee.framework.help.ui." + HELP_CONTEXT_ID);
- bindMenu();
-
- getEditor().getPreferences().addListener(this);
- recomputeChangeReport(uiData.isLoadOnOpenEnabled());
- }
-
- private void bindMenu() {
- final ChangeXViewer xviewer = changeReportTable.getXViewer();
-
- MenuManager manager = xviewer.getMenuManager();
- manager.setRemoveAllWhenShown(true);
- manager.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
- manager.addMenuListener(new ChangeReportMenuListener());
-
- Control control = xviewer.getTree();
- Menu menu = manager.createContextMenu(control);
- control.setMenu(menu);
-
- getSite().registerContextMenu("org.eclipse.osee.framework.ui.skynet.widgets.xchange.ChangeView", manager, xviewer);
- getSite().setSelectionProvider(xviewer);
- }
-
- private static final class ChangeReportMenuListener implements IMenuListener {
- public void menuAboutToShow(IMenuManager manager) {
- MenuManager menuManager = (MenuManager) manager;
- menuManager.insertBefore(XViewer.MENU_GROUP_PRE, new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
- }
- }
-
- private void updateTitle(ScrolledForm form) {
- form.setText(Strings.escapeAmpersands(getEditorInput().getName()));
- }
-
- private void updateImage(ScrolledForm form) {
- form.setImage(getEditor().getEditorInput().getImage());
- }
-
- private void addToolBar(FormToolkit toolkit, ScrolledForm form, boolean add) {
- IToolBarManager manager = form.getToolBarManager();
- if (add) {
- getEditor().getActionBarContributor().contributeToToolBar(manager);
- manager.add(changeReportTable.getXViewer().getCustomizeAction());
- manager.update(true);
- } else {
- manager.removeAll();
- }
- form.reflow(true);
- }
-
- @Override
- public ChangeReportEditor getEditor() {
- return (ChangeReportEditor) super.getEditor();
- }
-
- @Override
- public ChangeReportEditorInput getEditorInput() {
- return (ChangeReportEditorInput) super.getEditorInput();
- }
-
- public void onLoad() {
- Display.getDefault().asyncExec(new Runnable() {
- public void run() {
- if (changeReportTable != null && infoPresenter != null) {
- changeReportTable.onLoading();
- infoPresenter.onLoading();
- }
- }
- });
- }
-
- public void refresh() {
- final ScrolledForm sForm = getManagedForm().getForm();
- for (IFormPart part : getManagedForm().getParts()) {
- part.refresh();
- }
- changeReportTable.onUpdate();
-
- updateTitle(sForm);
- updateImage(sForm);
-
- sForm.getBody().layout(true);
- sForm.reflow(true);
- getManagedForm().refresh();
- }
-
- @Override
- public void onDocumentOrderChange(boolean value) {
- if (changeReportTable != null) {
- changeReportTable.getXViewer().setShowDocumentOrderFilter(value);
- changeReportTable.getXViewer().refresh();
- }
- }
-
- public void recomputeChangeReport(boolean isReloadAllowed) {
- List<IOperation> ops = new ArrayList<IOperation>();
- ChangeUiData changeData = getEditorInput().getChangeData();
- ops.add(new UpdateChangeUiData(changeData));
- if (isReloadAllowed) {
- changeData.reset();
- onLoad();
- ops.add(new LoadChangesOperation(changeData));
- }
- ops.add(new LoadAssociatedArtifactOperation(changeData));
- IOperation operation = new CompositeOperation("Load Change Report Data", SkynetGuiPlugin.PLUGIN_ID, ops);
- Operations.executeAsJob(operation, true, Job.LONG, new ReloadJobChangeAdapter());
- }
-
- private final class ReloadJobChangeAdapter extends JobChangeAdapter {
- private long startTime = 0;
-
- @Override
- public void scheduled(IJobChangeEvent event) {
- super.scheduled(event);
- getEditor().getActionBarContributor().getReloadAction().setEnabled(false);
- showBusy(true);
- }
-
- @Override
- public void aboutToRun(IJobChangeEvent event) {
- super.aboutToRun(event);
- startTime = System.currentTimeMillis();
- }
-
- @Override
- public void done(IJobChangeEvent event) {
- super.done(event);
- String message = String.format("Change Report Load completed in [%s]", Lib.getElapseString(startTime));
- OseeLog.log(SkynetGuiPlugin.class, Level.INFO, message);
-
- Job job = new UIJob("Refresh Change Report") {
-
- @Override
- public IStatus runInUIThread(IProgressMonitor monitor) {
- getEditor().refresh();
- getEditor().getActionBarContributor().getReloadAction().setEnabled(true);
- getEditor().getActionBarContributor().getOpenAssociatedArtifactAction().updateEnablement();
- getManagedForm().getForm().getBody().layout(true);
- getManagedForm().getForm().reflow(true);
- getManagedForm().refresh();
- showBusy(false);
- return Status.OK_STATUS;
- }
- };
- Operations.scheduleJob(job, false, Job.SHORT, null);
- }
- }
+ private static String HELP_CONTEXT_ID = "ChangeView";
+
+ private ChangeReportTable changeReportTable;
+ private ChangeReportInfoPresenter infoPresenter;
+
+ public ChangeReportPage(ChangeReportEditor editor) {
+ super(editor, "change.report", "Change Report");
+ }
+
+ @Override
+ public void showBusy(boolean busy) {
+ super.showBusy(busy);
+ if (Widgets.isAccessible(getManagedForm().getForm())) {
+ getManagedForm().getForm().getForm().setBusy(busy);
+ }
+ }
+
+ @Override
+ protected void createFormContent(IManagedForm managedForm) {
+ super.createFormContent(managedForm);
+
+ final ScrolledForm form = managedForm.getForm();
+ final FormToolkit toolkit = managedForm.getToolkit();
+
+ GridLayout layout = new GridLayout();
+ layout.numColumns = 1;
+ layout.marginHeight = 10;
+ layout.marginWidth = 6;
+ layout.horizontalSpacing = 20;
+ form.getBody().setLayout(layout);
+ form.getBody().setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
+
+ updateTitle(form);
+ updateImage(form);
+
+ managedForm.getMessageManager().setAutoUpdate(false);
+
+ ChangeUiData uiData = getEditorInput().getChangeData();
+ this.changeReportTable = new ChangeReportTable(uiData);
+ this.infoPresenter = new ChangeReportInfoPresenter(new ChangeReportInfo(), uiData);
+
+ int sectionStyle = Section.TITLE_BAR | Section.EXPANDED | Section.TWISTIE;
+
+ managedForm.addPart(new EditorSection(infoPresenter, "Info", form.getBody(), managedForm.getToolkit(),
+ sectionStyle, false));
+ // Can not place table in section or double scroll-bars and maintaining correct table size becomes an issue
+ changeReportTable.onCreate(getManagedForm(), form.getBody());
+
+ addToolBar(toolkit, form, true);
+ form.reflow(true);
+
+ PlatformUI.getWorkbench().getHelpSystem().setHelp(form.getBody(),
+ "org.eclipse.osee.framework.help.ui." + HELP_CONTEXT_ID);
+ bindMenu();
+
+ getEditor().getPreferences().addListener(this);
+ recomputeChangeReport(uiData.isLoadOnOpenEnabled());
+ }
+
+ private void bindMenu() {
+ final ChangeXViewer xviewer = changeReportTable.getXViewer();
+
+ MenuManager manager = xviewer.getMenuManager();
+ manager.setRemoveAllWhenShown(true);
+ manager.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
+ manager.addMenuListener(new ChangeReportMenuListener());
+
+ Control control = xviewer.getTree();
+ Menu menu = manager.createContextMenu(control);
+ control.setMenu(menu);
+
+ getSite().registerContextMenu("org.eclipse.osee.framework.ui.skynet.widgets.xchange.ChangeView", manager, xviewer);
+ getSite().setSelectionProvider(xviewer);
+ }
+
+ private static final class ChangeReportMenuListener implements IMenuListener {
+ public void menuAboutToShow(IMenuManager manager) {
+ MenuManager menuManager = (MenuManager) manager;
+ menuManager.insertBefore(XViewer.MENU_GROUP_PRE, new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
+ }
+ }
+
+ private void updateTitle(ScrolledForm form) {
+ form.setText(Strings.escapeAmpersands(getEditorInput().getName()));
+ }
+
+ private void updateImage(ScrolledForm form) {
+ form.setImage(getEditor().getEditorInput().getImage());
+ }
+
+ private void addToolBar(FormToolkit toolkit, ScrolledForm form, boolean add) {
+ IToolBarManager manager = form.getToolBarManager();
+ if (add) {
+ getEditor().getActionBarContributor().contributeToToolBar(manager);
+ manager.add(changeReportTable.getXViewer().getCustomizeAction());
+ manager.update(true);
+ } else {
+ manager.removeAll();
+ }
+ form.reflow(true);
+ }
+
+ @Override
+ public ChangeReportEditor getEditor() {
+ return (ChangeReportEditor) super.getEditor();
+ }
+
+ @Override
+ public ChangeReportEditorInput getEditorInput() {
+ return (ChangeReportEditorInput) super.getEditorInput();
+ }
+
+ public void onLoad() {
+ Displays.ensureInDisplayThread(new Runnable() {
+ @Override
+ public void run() {
+ if (changeReportTable != null && infoPresenter != null) {
+ changeReportTable.onLoading();
+ infoPresenter.onLoading();
+ }
+ }
+ });
+ }
+
+ public void refresh() {
+ final ScrolledForm sForm = getManagedForm().getForm();
+ for (IFormPart part : getManagedForm().getParts()) {
+ part.refresh();
+ }
+ changeReportTable.onUpdate();
+
+ updateTitle(sForm);
+ updateImage(sForm);
+
+ sForm.getBody().layout(true);
+ sForm.reflow(true);
+ getManagedForm().refresh();
+ }
+
+ @Override
+ public void onDocumentOrderChange(boolean value) {
+ if (changeReportTable != null) {
+ changeReportTable.getXViewer().setShowDocumentOrderFilter(value);
+ changeReportTable.getXViewer().refresh();
+ }
+ }
+
+ public void recomputeChangeReport(boolean isReloadAllowed) {
+ List<IOperation> ops = new ArrayList<IOperation>();
+ ChangeUiData changeData = getEditorInput().getChangeData();
+ ops.add(new UpdateChangeUiData(changeData));
+ if (isReloadAllowed) {
+ changeData.reset();
+ onLoad();
+ ops.add(new LoadChangesOperation(changeData));
+ }
+ ops.add(new LoadAssociatedArtifactOperation(changeData));
+ IOperation operation = new CompositeOperation("Load Change Report Data", SkynetGuiPlugin.PLUGIN_ID, ops);
+ Operations.executeAsJob(operation, true, Job.LONG, new ReloadJobChangeAdapter());
+ }
+
+ private final class ReloadJobChangeAdapter extends JobChangeAdapter {
+ private long startTime = 0;
+
+ @Override
+ public void scheduled(IJobChangeEvent event) {
+ super.scheduled(event);
+ getEditor().getActionBarContributor().getReloadAction().setEnabled(false);
+ showBusy(true);
+ }
+
+ @Override
+ public void aboutToRun(IJobChangeEvent event) {
+ super.aboutToRun(event);
+ startTime = System.currentTimeMillis();
+ }
+
+ @Override
+ public void done(IJobChangeEvent event) {
+ super.done(event);
+ String message = String.format("Change Report Load completed in [%s]", Lib.getElapseString(startTime));
+ OseeLog.log(SkynetGuiPlugin.class, Level.INFO, message);
+
+ Job job = new UIJob("Refresh Change Report") {
+
+ @Override
+ public IStatus runInUIThread(IProgressMonitor monitor) {
+ getEditor().refresh();
+ getEditor().getActionBarContributor().getReloadAction().setEnabled(true);
+ getEditor().getActionBarContributor().getOpenAssociatedArtifactAction().updateEnablement();
+ getManagedForm().getForm().getBody().layout(true);
+ getManagedForm().getForm().reflow(true);
+ getManagedForm().refresh();
+ showBusy(false);
+ return Status.OK_STATUS;
+ }
+ };
+ Operations.scheduleJob(job, false, Job.SHORT, null);
+ }
+ }
} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/CompressWordAttributesHandler.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/CompressWordAttributesHandler.java
index 43df1251b2..b365dd2faa 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/CompressWordAttributesHandler.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/CompressWordAttributesHandler.java
@@ -29,8 +29,8 @@ import org.eclipse.osee.framework.plugin.core.util.Jobs;
import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
import org.eclipse.osee.framework.skynet.core.word.WordUtil;
import org.eclipse.osee.framework.ui.plugin.util.AWorkbench;
-import org.eclipse.osee.framework.ui.plugin.util.Displays;
import org.eclipse.osee.framework.ui.skynet.SkynetGuiPlugin;
+import org.eclipse.osee.framework.ui.swt.Displays;
import org.eclipse.ui.PlatformUI;
/**
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/branch/PurgeTransactionHandler.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/branch/PurgeTransactionHandler.java
index 37de652dc0..5206afd2d2 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/branch/PurgeTransactionHandler.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/branch/PurgeTransactionHandler.java
@@ -28,6 +28,7 @@ import org.eclipse.osee.framework.ui.plugin.util.AWorkbench;
import org.eclipse.osee.framework.ui.plugin.util.CommandHandler;
import org.eclipse.osee.framework.ui.skynet.SkynetGuiPlugin;
import org.eclipse.osee.framework.ui.skynet.commandHandlers.Handlers;
+import org.eclipse.osee.framework.ui.swt.Displays;
import org.eclipse.swt.widgets.Display;
/**
@@ -35,42 +36,43 @@ import org.eclipse.swt.widgets.Display;
*/
public class PurgeTransactionHandler extends CommandHandler {
- @Override
- public Object execute(ExecutionEvent arg0) throws ExecutionException {
- IStructuredSelection selection =
- (IStructuredSelection) AWorkbench.getActivePage().getActivePart().getSite().getSelectionProvider().getSelection();
+ @Override
+ public Object execute(ExecutionEvent arg0) throws ExecutionException {
+ IStructuredSelection selection =
+ (IStructuredSelection) AWorkbench.getActivePage().getActivePart().getSite().getSelectionProvider().getSelection();
- List<TransactionRecord> transactions = Handlers.getTransactionsFromStructuredSelection(selection);
- TransactionRecord selectedTransaction = transactions.iterator().next();
+ List<TransactionRecord> transactions = Handlers.getTransactionsFromStructuredSelection(selection);
+ TransactionRecord selectedTransaction = transactions.iterator().next();
- if (MessageDialog.openConfirm(Display.getCurrent().getActiveShell(), "Purge Transaction",
- "Are you sure you want to purge the transaction: " + selectedTransaction.getId())) {
- BranchManager.purgeTransactions(new JobChangeAdapter() {
+ if (MessageDialog.openConfirm(Display.getCurrent().getActiveShell(), "Purge Transaction",
+ "Are you sure you want to purge the transaction: " + selectedTransaction.getId())) {
+ BranchManager.purgeTransactions(new JobChangeAdapter() {
- @Override
- public void done(IJobChangeEvent event) {
- if (event.getResult().getSeverity() == IStatus.OK) {
- Display.getDefault().asyncExec(new Runnable() {
- public void run() {
- try {
- BranchManager.refreshBranches();
- } catch (OseeCoreException ex) {
- OseeLog.log(SkynetGuiPlugin.class, OseeLevel.SEVERE_POPUP, ex);
- }
- }
- });
- }
- }
+ @Override
+ public void done(IJobChangeEvent event) {
+ if (event.getResult().getSeverity() == IStatus.OK) {
+ Displays.ensureInDisplayThread(new Runnable() {
+ @Override
+ public void run() {
+ try {
+ BranchManager.refreshBranches();
+ } catch (OseeCoreException ex) {
+ OseeLog.log(SkynetGuiPlugin.class, OseeLevel.SEVERE_POPUP, ex);
+ }
+ }
+ });
+ }
+ }
- }, selectedTransaction.getId());
- }
+ }, selectedTransaction.getId());
+ }
- return null;
- }
+ return null;
+ }
- @Override
- public boolean isEnabledWithException(IStructuredSelection structuredSelection) throws OseeCoreException {
- List<TransactionRecord> transactions = Handlers.getTransactionsFromStructuredSelection(structuredSelection);
- return transactions.size() == 1 && AccessControlManager.isOseeAdmin();
- }
+ @Override
+ public boolean isEnabledWithException(IStructuredSelection structuredSelection) throws OseeCoreException {
+ List<TransactionRecord> transactions = Handlers.getTransactionsFromStructuredSelection(structuredSelection);
+ return transactions.size() == 1 && AccessControlManager.isOseeAdmin();
+ }
} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/branch/commit/CommitHandler.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/branch/commit/CommitHandler.java
index b5b4eed4f9..c757c8e454 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/branch/commit/CommitHandler.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/branch/commit/CommitHandler.java
@@ -35,6 +35,7 @@ import org.eclipse.osee.framework.ui.skynet.SkynetGuiPlugin;
import org.eclipse.osee.framework.ui.skynet.commandHandlers.Handlers;
import org.eclipse.osee.framework.ui.skynet.widgets.xBranch.BranchViewPresentationPreferences;
import org.eclipse.osee.framework.ui.skynet.widgets.xmerge.MergeView;
+import org.eclipse.osee.framework.ui.swt.Displays;
import org.eclipse.swt.widgets.Display;
/**
@@ -42,156 +43,158 @@ import org.eclipse.swt.widgets.Display;
* @author Ryan D. Brooks
*/
public abstract class CommitHandler extends CommandHandler {
- protected final boolean useParentBranch;
-
- public CommitHandler(boolean useParentBranch) {
- this.useParentBranch = useParentBranch;
- }
-
- public static boolean commitBranch(final ConflictManagerExternal conflictManager, boolean archiveSourceBranch) throws OseeCoreException {
- final Branch sourceBranch = conflictManager.getSourceBranch();
- final Branch destinationBranch = conflictManager.getDestinationBranch();
- final TransactionRecord transactionId = sourceBranch.getBaseTransaction();
- boolean branchCommitted = false;
-
- if (!conflictManager.getRemainingConflicts().isEmpty()) {
- String message =
- "Commit stopped due to unresolved conflicts\n\nPossible Resolutions:\n Cancel commit and resolve at a later time\n Launch the Merge Manager to resolve conflicts";
- final String fMessage;
- final String[] choices;
- if (AccessControlManager.isOseeAdmin()) {
- fMessage = message + "\n Force the commit";
- choices = new String[] {"Cancel", "Launch Merge Manager", "Force Commit (Admin Only)"};
- } else {
- fMessage = message;
- choices = new String[] {"Cancel", "Launch Merge Manager"};
- }
-
- final MutableInteger dialogResult = new MutableInteger(0);
- Display.getDefault().syncExec(new Runnable() {
- public void run() {
- MessageDialog dialog =
- new MessageDialog(Display.getCurrent().getActiveShell(), "Unresolved Conflicts", null, fMessage,
- MessageDialog.QUESTION, choices, 0);
- dialogResult.setValue(dialog.open());
- if (dialogResult.getValue() == 1) {
- MergeView.openView(sourceBranch, destinationBranch, transactionId);
- }
- }
- });
-
- if (dialogResult.getValue() == 2) {
- BranchManager.commitBranch(null, conflictManager, archiveSourceBranch, true);
- branchCommitted = true;
- }
- } else {
- final StringBuilder message =
- new StringBuilder(
- "Commit branch\n\n\"" + sourceBranch + "\"\n\n onto destination branch\n\n\"" + destinationBranch + "\"\n");
- int numOriginalConflicts = conflictManager.getOriginalConflicts().size();
- if (numOriginalConflicts > 0) {
- message.append("\nwith " + numOriginalConflicts + " conflicts resolved.\n");
- } else {
- message.append("\n(no conflicts found)\n");
- }
- message.append("\nCommit?");
-
- final MutableInteger dialogResult = new MutableInteger(0);
- Display.getDefault().syncExec(new Runnable() {
- public void run() {
- try {
- if (conflictManager.getOriginalConflicts().isEmpty()) {
- MessageDialog dialog =
- new MessageDialog(Display.getCurrent().getActiveShell(), "Commit Branch", null,
- message.toString(), MessageDialog.QUESTION, new String[] {"Ok", "Cancel"}, 0);
- dialogResult.setValue(dialog.open());
- } else {
- MessageDialog dialog =
- new MessageDialog(Display.getCurrent().getActiveShell(), "Commit Branch", null,
- message.toString(), MessageDialog.QUESTION, new String[] {"Ok",
- "Launch Merge Manager", "Cancel"}, 0);
- dialogResult.setValue(dialog.open());
- if (dialogResult.getValue() == 1) {
- MergeView.openView(sourceBranch, destinationBranch, transactionId);
- }
- }
- } catch (OseeCoreException ex) {
- OseeLog.log(SkynetGuiPlugin.class, OseeLevel.SEVERE_POPUP, ex);
- }
- }
- });
-
- if (dialogResult.getValue() == 0) {
- BranchManager.commitBranch(null, conflictManager, archiveSourceBranch, false);
- branchCommitted = true;
- }
- }
- return branchCommitted;
- }
-
- @Override
- public Object execute(ExecutionEvent event) throws ExecutionException {
- IStructuredSelection selection =
- (IStructuredSelection) AWorkbench.getActivePage().getActivePart().getSite().getSelectionProvider().getSelection();
-
- List<Branch> branches = Handlers.getBranchesFromStructuredSelection(selection);
- Branch sourceBranch = branches.iterator().next();
-
- try {
- Branch destinationBranch = null;
- if (useParentBranch) {
- destinationBranch = sourceBranch.getParentBranch();
- } else {
- destinationBranch =
- BranchManager.getBranch(Integer.parseInt(event.getParameter(BranchViewPresentationPreferences.BRANCH_ID)));
- }
- Jobs.startJob(new CommitJob(sourceBranch, destinationBranch,
- Boolean.parseBoolean(event.getParameter(CommitBranchParameter.ARCHIVE_PARENT_BRANCH))));
- } catch (OseeCoreException ex) {
- OseeLog.log(SkynetGuiPlugin.class, OseeLevel.SEVERE_POPUP, ex);
- }
- return null;
- }
-
- @Override
- public boolean isEnabledWithException(IStructuredSelection structuredSelection) throws OseeCoreException {
- List<Branch> branches = Handlers.getBranchesFromStructuredSelection(structuredSelection);
-
- if (branches.size() == 1) {
- Branch branch = branches.iterator().next();
- return useParentBranchValid(branch) || !useParentBranch && AccessControlManager.isOseeAdmin();
- }
- return false;
- }
-
- protected boolean useParentBranchValid(Branch branch) throws OseeCoreException {
- return branch.hasParentBranch() && useParentBranch && !BranchManager.isChangeManaged(branch) && !branch.getArchiveState().isArchived();
- }
- protected class CommitJob extends Job {
- private final Branch sourceBranch;
- private final Branch destinationBranch;
- private final boolean archiveSourceBranch;
-
- /**
- * @param name
- * @param destinationBranch
- * @param sourceBranch
- */
- public CommitJob(Branch sourceBranch, Branch destinationBranch, boolean archiveSourceBranch) {
- super("Commit Branch");
- this.destinationBranch = destinationBranch;
- this.sourceBranch = sourceBranch;
- this.archiveSourceBranch = archiveSourceBranch;
- }
-
- @Override
- protected IStatus run(IProgressMonitor monitor) {
- try {
- commitBranch(new ConflictManagerExternal(destinationBranch, sourceBranch), archiveSourceBranch);
- } catch (OseeCoreException ex) {
- return new Status(Status.ERROR, SkynetGuiPlugin.PLUGIN_ID, ex.getLocalizedMessage(), ex);
- }
- return Status.OK_STATUS;
- }
- }
+ protected final boolean useParentBranch;
+
+ public CommitHandler(boolean useParentBranch) {
+ this.useParentBranch = useParentBranch;
+ }
+
+ public static boolean commitBranch(final ConflictManagerExternal conflictManager, boolean archiveSourceBranch) throws OseeCoreException {
+ final Branch sourceBranch = conflictManager.getSourceBranch();
+ final Branch destinationBranch = conflictManager.getDestinationBranch();
+ final TransactionRecord transactionId = sourceBranch.getBaseTransaction();
+ boolean branchCommitted = false;
+
+ if (!conflictManager.getRemainingConflicts().isEmpty()) {
+ String message =
+ "Commit stopped due to unresolved conflicts\n\nPossible Resolutions:\n Cancel commit and resolve at a later time\n Launch the Merge Manager to resolve conflicts";
+ final String fMessage;
+ final String[] choices;
+ if (AccessControlManager.isOseeAdmin()) {
+ fMessage = message + "\n Force the commit";
+ choices = new String[] {"Cancel", "Launch Merge Manager", "Force Commit (Admin Only)"};
+ } else {
+ fMessage = message;
+ choices = new String[] {"Cancel", "Launch Merge Manager"};
+ }
+
+ final MutableInteger dialogResult = new MutableInteger(0);
+ Displays.pendInDisplayThread(new Runnable() {
+ @Override
+ public void run() {
+ MessageDialog dialog =
+ new MessageDialog(Display.getCurrent().getActiveShell(), "Unresolved Conflicts", null,
+ fMessage, MessageDialog.QUESTION, choices, 0);
+ dialogResult.setValue(dialog.open());
+ if (dialogResult.getValue() == 1) {
+ MergeView.openView(sourceBranch, destinationBranch, transactionId);
+ }
+ }
+ });
+
+ if (dialogResult.getValue() == 2) {
+ BranchManager.commitBranch(null, conflictManager, archiveSourceBranch, true);
+ branchCommitted = true;
+ }
+ } else {
+ final StringBuilder message =
+ new StringBuilder(
+ "Commit branch\n\n\"" + sourceBranch + "\"\n\n onto destination branch\n\n\"" + destinationBranch + "\"\n");
+ int numOriginalConflicts = conflictManager.getOriginalConflicts().size();
+ if (numOriginalConflicts > 0) {
+ message.append("\nwith " + numOriginalConflicts + " conflicts resolved.\n");
+ } else {
+ message.append("\n(no conflicts found)\n");
+ }
+ message.append("\nCommit?");
+
+ final MutableInteger dialogResult = new MutableInteger(0);
+ Displays.pendInDisplayThread(new Runnable() {
+ @Override
+ public void run() {
+ try {
+ if (conflictManager.getOriginalConflicts().isEmpty()) {
+ MessageDialog dialog =
+ new MessageDialog(Display.getCurrent().getActiveShell(), "Commit Branch", null,
+ message.toString(), MessageDialog.QUESTION, new String[] {"Ok", "Cancel"}, 0);
+ dialogResult.setValue(dialog.open());
+ } else {
+ MessageDialog dialog =
+ new MessageDialog(Display.getCurrent().getActiveShell(), "Commit Branch", null,
+ message.toString(), MessageDialog.QUESTION, new String[] {"Ok",
+ "Launch Merge Manager", "Cancel"}, 0);
+ dialogResult.setValue(dialog.open());
+ if (dialogResult.getValue() == 1) {
+ MergeView.openView(sourceBranch, destinationBranch, transactionId);
+ }
+ }
+ } catch (OseeCoreException ex) {
+ OseeLog.log(SkynetGuiPlugin.class, OseeLevel.SEVERE_POPUP, ex);
+ }
+ }
+ });
+
+ if (dialogResult.getValue() == 0) {
+ BranchManager.commitBranch(null, conflictManager, archiveSourceBranch, false);
+ branchCommitted = true;
+ }
+ }
+ return branchCommitted;
+ }
+
+ @Override
+ public Object execute(ExecutionEvent event) throws ExecutionException {
+ IStructuredSelection selection =
+ (IStructuredSelection) AWorkbench.getActivePage().getActivePart().getSite().getSelectionProvider().getSelection();
+
+ List<Branch> branches = Handlers.getBranchesFromStructuredSelection(selection);
+ Branch sourceBranch = branches.iterator().next();
+
+ try {
+ Branch destinationBranch = null;
+ if (useParentBranch) {
+ destinationBranch = sourceBranch.getParentBranch();
+ } else {
+ destinationBranch =
+ BranchManager.getBranch(Integer.parseInt(event.getParameter(BranchViewPresentationPreferences.BRANCH_ID)));
+ }
+ Jobs.startJob(new CommitJob(sourceBranch, destinationBranch,
+ Boolean.parseBoolean(event.getParameter(CommitBranchParameter.ARCHIVE_PARENT_BRANCH))));
+ } catch (OseeCoreException ex) {
+ OseeLog.log(SkynetGuiPlugin.class, OseeLevel.SEVERE_POPUP, ex);
+ }
+ return null;
+ }
+
+ @Override
+ public boolean isEnabledWithException(IStructuredSelection structuredSelection) throws OseeCoreException {
+ List<Branch> branches = Handlers.getBranchesFromStructuredSelection(structuredSelection);
+
+ if (branches.size() == 1) {
+ Branch branch = branches.iterator().next();
+ return useParentBranchValid(branch) || !useParentBranch && AccessControlManager.isOseeAdmin();
+ }
+ return false;
+ }
+
+ protected boolean useParentBranchValid(Branch branch) throws OseeCoreException {
+ return branch.hasParentBranch() && useParentBranch && !BranchManager.isChangeManaged(branch) && !branch.getArchiveState().isArchived();
+ }
+ protected class CommitJob extends Job {
+ private final Branch sourceBranch;
+ private final Branch destinationBranch;
+ private final boolean archiveSourceBranch;
+
+ /**
+ * @param name
+ * @param destinationBranch
+ * @param sourceBranch
+ */
+ public CommitJob(Branch sourceBranch, Branch destinationBranch, boolean archiveSourceBranch) {
+ super("Commit Branch");
+ this.destinationBranch = destinationBranch;
+ this.sourceBranch = sourceBranch;
+ this.archiveSourceBranch = archiveSourceBranch;
+ }
+
+ @Override
+ protected IStatus run(IProgressMonitor monitor) {
+ try {
+ commitBranch(new ConflictManagerExternal(destinationBranch, sourceBranch), archiveSourceBranch);
+ } catch (OseeCoreException ex) {
+ return new Status(Status.ERROR, SkynetGuiPlugin.PLUGIN_ID, ex.getLocalizedMessage(), ex);
+ }
+ return Status.OK_STATUS;
+ }
+ }
} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/dialogs/AuthenticationDialog.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/dialogs/AuthenticationDialog.java
index 175a503c55..19d5630c57 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/dialogs/AuthenticationDialog.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/dialogs/AuthenticationDialog.java
@@ -21,6 +21,7 @@ import org.eclipse.osee.framework.logging.OseeLog;
import org.eclipse.osee.framework.skynet.core.UserManager;
import org.eclipse.osee.framework.ui.skynet.FrameworkImage;
import org.eclipse.osee.framework.ui.skynet.panels.AuthenticationComposite;
+import org.eclipse.osee.framework.ui.swt.Displays;
import org.eclipse.osee.framework.ui.swt.ImageManager;
import org.eclipse.osee.framework.ui.swt.OseeMessageDialog;
import org.eclipse.swt.SWT;
@@ -29,7 +30,6 @@ import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.PlatformUI;
@@ -38,209 +38,209 @@ import org.eclipse.ui.PlatformUI;
*/
public class AuthenticationDialog extends OseeMessageDialog {
- private Button okButton;
- private Button cancelButton;
- protected AuthenticationComposite authenticationComposite;
- private boolean selectionOk;
- private static final int MAX_RETRIES = 3;
-
- public AuthenticationDialog(Shell parentShell) {
- super(parentShell, "OSEE Authenticate", null, "Enter your user id (email address), password, and domain.",
- ImageManager.getImage(FrameworkImage.LOCKED_KEY), new String[] {"Enter", "Cancel"}, 0);
-
- selectionOk = false;
- authenticationComposite = new AuthenticationComposite(parentShell, SWT.NONE, false);
- }
-
- @Override
- protected Control createCustomArea(Composite parent) {
- authenticationComposite.setParent(parent);
- return authenticationComposite;
- }
-
- @Override
- protected Control createButtonBar(Composite parent) {
- Control c = super.createButtonBar(parent);
- okButton = getButton(0);
- cancelButton = getButton(1);
-
- okButton.setEnabled(false);
- okButton.addSelectionListener(authenticationComposite.getAuthenticateListener());
- okButton.addSelectionListener(new SelectionAdapter() {
-
- @Override
- public void widgetSelected(SelectionEvent e) {
- selectionOk = true;
- }
- });
- authenticationComposite.getShell().setDefaultButton(okButton);
-
- cancelButton.addSelectionListener(new SelectionAdapter() {
- @Override
- public void widgetSelected(SelectionEvent e) {
- selectionOk = false;
- }
- });
- return c;
- }
-
- public boolean isValid() {
- return selectionOk;
- }
-
- private void setUserName(String user) {
- authenticationComposite.setUserName(user);
- }
-
- private void setPassword(String password) {
- authenticationComposite.setPassword(password);
- }
-
- private void setDomain(String domain) {
- authenticationComposite.setDomain(domain);
- }
-
- private void setStorageAllowed(boolean isStorageAllowed) {
- authenticationComposite.setStorageAllowed(isStorageAllowed);
- }
-
- private void setGuestLogin(boolean isGuestLogin) {
- authenticationComposite.setGuestLogin(isGuestLogin);
- }
-
- private void setProtocol(String protocol) {
- authenticationComposite.setProtocol(protocol);
- }
-
- private String getUserName() {
- return authenticationComposite.getUserName();
- }
-
- private String getDomain() {
- return authenticationComposite.getDomain();
- }
-
- private String getProtocol() {
- return authenticationComposite.getProtocol();
- }
-
- private boolean isStorageAllowed() {
- return authenticationComposite.isStorageAllowed();
- }
-
- private boolean isGuestLogin() {
- return authenticationComposite.isGuestLogin();
- }
-
- public static void openDialog() {
- Display.getDefault().syncExec(new Runnable() {
-
- private String getErrorMessage(AuthenticationErrorCode status) {
- String toReturn = "";
- if (status == null) {
- status = AuthenticationErrorCode.Unknown;
- }
- switch (status) {
- case UserNotFound:
- toReturn = "User Id not found.\n" + "Enter your user id.";
- break;
- case InvalidPassword:
- toReturn =
- "Invalid Password.\n" + "Make sure <CAPS LOCK> is not enabled.\n" + "Enter a valid password.";
- break;
- case NoResponse:
- toReturn = "Please enter a valid user id and password.";
- break;
- default:
- toReturn = "Unknown authentication error";
- break;
- }
- return toReturn;
- }
-
- public void run() {
- String dialogTitle = "Authentication Failed";
- String endMsg = "Shutting down the workbench.";
- String user = "";
- String domain = "";
- String message = "";
- String protocol = "";
- boolean isStorageAllowed = false;
- boolean isGuestLogin = false;
- boolean shutdown = false;
- Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();
-
- for (int numberOfTries = 0; numberOfTries < MAX_RETRIES; numberOfTries++) {
- AuthenticationDialog dialog = new AuthenticationDialog(shell);
- if (numberOfTries != 0) {
- dialog.setUserName(user);
- dialog.setPassword("");
- dialog.setDomain(domain);
- dialog.setProtocol(protocol);
- dialog.setStorageAllowed(isStorageAllowed);
- dialog.setGuestLogin(isGuestLogin);
- }
- int result = dialog.open();
-
- user = dialog.getUserName();
- protocol = dialog.getProtocol();
- domain = dialog.getDomain();
- isStorageAllowed = dialog.isStorageAllowed();
- isGuestLogin = dialog.isGuestLogin();
-
- if (result == Window.CANCEL) {
- // TODO This was added because ATS requires a user to be logged in
- // Non-Authentication is not an option --
- if (numberOfTries > MAX_RETRIES) {
- message = "Maximum number of Retries reached.\n" + endMsg;
- shutdown = true;
- } else {
- message =
- "Please log in as Guest or with your credentials.\n" + "A Log-in account is required to continue.";
- }
-
- MessageDialog.openError(shell, "Authentication Cancelled", message);
- }
- // else if (result != Window.OK ) {
- // numberOfTries = MAX_RETRIES;
- // }
- else {
- if (dialog.isValid()) {
- if (ClientSessionManager.isSessionValid()) {
- numberOfTries = MAX_RETRIES;
- String userText;
- try {
- userText = UserManager.getUser().toString();
- } catch (OseeCoreException ex) {
- userText = ex.getLocalizedMessage();
- }
- MessageDialog.openInformation(shell, "Authenticated", "Logged in as: " + userText);
- } else {
- if (numberOfTries >= MAX_RETRIES - 1) {
- message = "Maximum number of Retries reached.\n" + endMsg;
- shutdown = true;
- } else {
- IHealthStatus status = OseeLog.getStatusByName(ClientSessionManager.getStatusId());
- if (status != null && status.getException() != null) {
- Throwable ex = status.getException();
- if (ex instanceof OseeAuthenticationException) {
- message = getErrorMessage(((OseeAuthenticationException) ex).getCode());
- }
- message = ex.getLocalizedMessage();
- } else {
- message = "Authentication error";
- }
- }
- MessageDialog.openError(shell, dialogTitle, message);
- }
- }
- }
- }
-
- if (shutdown) {
- PlatformUI.getWorkbench().close();
- }
- }
- });
- }
+ private Button okButton;
+ private Button cancelButton;
+ protected AuthenticationComposite authenticationComposite;
+ private boolean selectionOk;
+ private static final int MAX_RETRIES = 3;
+
+ public AuthenticationDialog(Shell parentShell) {
+ super(parentShell, "OSEE Authenticate", null, "Enter your user id (email address), password, and domain.",
+ ImageManager.getImage(FrameworkImage.LOCKED_KEY), new String[] {"Enter", "Cancel"}, 0);
+
+ selectionOk = false;
+ authenticationComposite = new AuthenticationComposite(parentShell, SWT.NONE, false);
+ }
+
+ @Override
+ protected Control createCustomArea(Composite parent) {
+ authenticationComposite.setParent(parent);
+ return authenticationComposite;
+ }
+
+ @Override
+ protected Control createButtonBar(Composite parent) {
+ Control c = super.createButtonBar(parent);
+ okButton = getButton(0);
+ cancelButton = getButton(1);
+
+ okButton.setEnabled(false);
+ okButton.addSelectionListener(authenticationComposite.getAuthenticateListener());
+ okButton.addSelectionListener(new SelectionAdapter() {
+
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ selectionOk = true;
+ }
+ });
+ authenticationComposite.getShell().setDefaultButton(okButton);
+
+ cancelButton.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ selectionOk = false;
+ }
+ });
+ return c;
+ }
+
+ public boolean isValid() {
+ return selectionOk;
+ }
+
+ private void setUserName(String user) {
+ authenticationComposite.setUserName(user);
+ }
+
+ private void setPassword(String password) {
+ authenticationComposite.setPassword(password);
+ }
+
+ private void setDomain(String domain) {
+ authenticationComposite.setDomain(domain);
+ }
+
+ private void setStorageAllowed(boolean isStorageAllowed) {
+ authenticationComposite.setStorageAllowed(isStorageAllowed);
+ }
+
+ private void setGuestLogin(boolean isGuestLogin) {
+ authenticationComposite.setGuestLogin(isGuestLogin);
+ }
+
+ private void setProtocol(String protocol) {
+ authenticationComposite.setProtocol(protocol);
+ }
+
+ private String getUserName() {
+ return authenticationComposite.getUserName();
+ }
+
+ private String getDomain() {
+ return authenticationComposite.getDomain();
+ }
+
+ private String getProtocol() {
+ return authenticationComposite.getProtocol();
+ }
+
+ private boolean isStorageAllowed() {
+ return authenticationComposite.isStorageAllowed();
+ }
+
+ private boolean isGuestLogin() {
+ return authenticationComposite.isGuestLogin();
+ }
+
+ public static void openDialog() {
+ Displays.pendInDisplayThread(new Runnable() {
+
+ private String getErrorMessage(AuthenticationErrorCode status) {
+ String toReturn = "";
+ if (status == null) {
+ status = AuthenticationErrorCode.Unknown;
+ }
+ switch (status) {
+ case UserNotFound:
+ toReturn = "User Id not found.\n" + "Enter your user id.";
+ break;
+ case InvalidPassword:
+ toReturn =
+ "Invalid Password.\n" + "Make sure <CAPS LOCK> is not enabled.\n" + "Enter a valid password.";
+ break;
+ case NoResponse:
+ toReturn = "Please enter a valid user id and password.";
+ break;
+ default:
+ toReturn = "Unknown authentication error";
+ break;
+ }
+ return toReturn;
+ }
+
+ public void run() {
+ String dialogTitle = "Authentication Failed";
+ String endMsg = "Shutting down the workbench.";
+ String user = "";
+ String domain = "";
+ String message = "";
+ String protocol = "";
+ boolean isStorageAllowed = false;
+ boolean isGuestLogin = false;
+ boolean shutdown = false;
+ Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();
+
+ for (int numberOfTries = 0; numberOfTries < MAX_RETRIES; numberOfTries++) {
+ AuthenticationDialog dialog = new AuthenticationDialog(shell);
+ if (numberOfTries != 0) {
+ dialog.setUserName(user);
+ dialog.setPassword("");
+ dialog.setDomain(domain);
+ dialog.setProtocol(protocol);
+ dialog.setStorageAllowed(isStorageAllowed);
+ dialog.setGuestLogin(isGuestLogin);
+ }
+ int result = dialog.open();
+
+ user = dialog.getUserName();
+ protocol = dialog.getProtocol();
+ domain = dialog.getDomain();
+ isStorageAllowed = dialog.isStorageAllowed();
+ isGuestLogin = dialog.isGuestLogin();
+
+ if (result == Window.CANCEL) {
+ // TODO This was added because ATS requires a user to be logged in
+ // Non-Authentication is not an option --
+ if (numberOfTries > MAX_RETRIES) {
+ message = "Maximum number of Retries reached.\n" + endMsg;
+ shutdown = true;
+ } else {
+ message =
+ "Please log in as Guest or with your credentials.\n" + "A Log-in account is required to continue.";
+ }
+
+ MessageDialog.openError(shell, "Authentication Cancelled", message);
+ }
+ // else if (result != Window.OK ) {