Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/org.eclipse.osee.framework.ui.skynet/src/org')
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/AlphabeticalRelationComparator.java83
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/ArtifactContentProvider.java296
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/ArtifactDecorator.java808
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/ArtifactDecoratorPreferences.java132
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/ArtifactDoubleClick.java134
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/ArtifactDragDropSupport.java396
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/ArtifactExplorer.java3130
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/ArtifactImageManager.java670
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/ArtifactImageProvider.java1
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/ArtifactLabelProvider.java204
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/ArtifactValidationCheckOperation.java156
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/AttributeCellModifier.java270
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/AttributeLabelProvider.java134
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/AttributesComposite.java678
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/RelationCellModifier.java3
-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/XFormToolkit.java6
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/access/PolicyDialog.java426
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/access/PolicyLabelProvider.java188
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/access/PolicyTableCellModifier.java144
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/access/PolicyTableColumns.java112
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/access/PolicyTableViewer.java216
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/action/CollapseAllAction.java112
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/action/EditTransactionComment.java132
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/action/ExpandAllAction.java160
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/action/RefreshAction.java90
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/action/browser/BrowserPrintAction.java82
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/ArtifactNameConflictHandler.java92
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/ArtifactPasteOperation.java262
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/ArtifactSaveNotificationHandler.java194
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/EnumSelectionDialog.java4
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/NonBlankAndNotSameAsStartingValidator.java70
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/OpenArtifactEditorLoopbackCmd.java204
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/annotation/AnnotationComposite.java8
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/editor/AbstractEventArtifactEditor.java420
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/editor/ArtifactEditor.java504
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/editor/ArtifactEditorActionBarContributor.java554
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/editor/BaseArtifactEditorInput.java188
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/editor/IActionContributor.java42
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/editor/IArtifactEditorEventHandler.java46
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/editor/pages/ArtifactFormPage.java506
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/editor/parts/AttributeFormPart.java550
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/editor/parts/MessageSummaryNote.java306
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/editor/sections/ArtifactEditorFormSection.java74
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/editor/sections/AttributeTypeUtil.java148
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/editor/sections/AttributesFormSection.java264
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/editor/sections/DetailsFormSection.java202
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/editor/sections/RelationsFormSection.java304
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/massEditor/IMassViewerEventHandler.java24
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/massEditor/MassArtifactEditor.java598
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/massEditor/MassXViewer.java688
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/massEditor/MassXViewerEventManager.java166
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/massEditor/MassXViewerFactory.java106
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/ats/IOseeAtsService.java50
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/ats/OseeEditor.java38
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/AbstractBlam.java264
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/BlamContributionManager.java220
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/BlamEditorActionBarContributor.java158
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/BlamParameter.java5
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/operation/ChangeArtifactTypeBlam.java96
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/operation/CheckDefaulHierarchy.java126
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/operation/ConsolidateRelations.java100
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/operation/ConsolidateRelationsTxOperation.java8
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/operation/DatabaseHealth.java320
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/operation/ExperimentalBlam.java84
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/operation/ExtractReqPriority.java178
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/operation/FixTemplateContentArtifacts.java744
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/operation/ImageCaptureBlam.java184
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/operation/LoadAllArtifactsOnBranch.java92
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/operation/ParseWindowsDirectoryListing.java136
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/operation/PopulateTxsBranchIdColumn.java202
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/operation/PurgeArchivedBranch.java395
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/operation/PurgeTransactionBlam.java116
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/operation/ReportAttributeTypesUsageBlam.java132
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/operation/ResourceManipulation.java933
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/operation/SetRequirementCategory.java270
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/operation/ShowRevertTransactions.java138
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/operation/UnicodeConverter.java113
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/operation/UpdateArtifactTypeImage.java180
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/operation/ValidateArtifactsToDelete.java2
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/sections/BaseBlamSection.java87
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/sections/BlamInputSection.java276
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/sections/BlamOutputSection.java306
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/Handlers.java6
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/branch/commit/CommitHandler.java5
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/branch/commit/CommitIntoParentCompoundContributionItem.java3
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/dbHealth/ArtifactIdWithoutVersionsCheck.java7
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/dbHealth/BranchStateHealthCheck.java27
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/dbHealth/DuplicateAttributes.java31
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/dbHealth/DuplicateHRID.java12
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/dbHealth/HealthHelper.java23
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/dbHealth/ItemsDeletedWithNoOtherModification.java17
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/dbHealth/MultipleParentRelations.java33
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/dbHealth/RelationIntegrityCheck.java32
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/dbHealth/RepeatEnumerationAttributeValues.java6
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/dialogs/ListDialogSortable.java6
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/diffWizard/DiffWizardPage.java3
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/export/ArtifactExportJob.java3
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/export/ArtifactExportPage.java3
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/group/GroupTreeViewer.java3
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/internal/AccessPolicyHandlerServiceImpl.java3
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/menu/GlobalMenuListener.java4
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/menu/GlobalMenuPermissions.java3
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/mergeWizard/EditAttributeWizardPage.java3
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/mergeWizard/EditWFCAttributeWizardPage.java3
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/notify/OseeNotifyUsersJob.java7
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/panels/DetailsBrowserComposite.java4
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/relation/explorer/ArtifactModelList.java6
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/ITemplateRenderer.java3
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/RendererManager.java2
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/WordTemplateRenderer.java1
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/artifactElement/WordArtifactElementExtractor.java10
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/word/WordMLProducer.java4
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/word/WordTemplateProcessor.java6
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/word/template/AddTemplateText.java5
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/word/template/TemplateAttribute.java18
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/word/template/WordTemplateManager.java4
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/results/XResultData.java35
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/results/example/ResultsEditorExample.java15
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/results/example/XResultDataExample.java3
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/results/example/XViewerExample.java3
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/results/html/XResultPage.java1
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/results/html/XResultsComposite.java8
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/results/table/xresults/ResultsXViewer.java6
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/search/AbstractArtifactSearchResult.java3
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/search/filter/FilterModelList.java9
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/search/ui/IFilterListViewer.java3
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/skywalker/ArtifactGraphContentProvider.java3
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/skywalker/RelTypeContentProvider.java3
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/skywalker/SkyWalkerOptions.java4
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/skywalker/SkyWalkerTabOptions.java4
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/util/ArtifactClipboard.java10
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/util/DbConnectionExceptionComposite.java5
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/util/OseeEmail.java5
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/util/SkynetDragAndDrop.java11
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/util/WordUiUtil.java6
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/util/email/EmailWizard.java3
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/util/email/EmailWizardPage.java2
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/util/filteredTree/OSEECheckedFilteredTree.java5
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/util/filteredTree/OSEEFilteredTreeDialog.java3
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/DefaultBranchContentProvider.java3
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XDate.java2
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XFileTextWithSelectionDialog.java3
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XHyperlabelGroupSelection.java3
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XListDam.java3
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XListDropViewer.java1
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XListViewer.java3
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XText.java3
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XTextResourceDropDam.java7
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/cellEditor/DateValue.java3
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/cellEditor/EnumeratedValue.java3
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/cellEditor/StringValue.java3
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/cellEditor/UniversalCellEditor.java7
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/cellEditor/UniversalCellEditorValue.java3
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/dialog/ArtifactTypeFilteredTreeEntryDialog.java5
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/dialog/DateSelectionDialog.java3
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/dialog/Dialogs.java1
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/dialog/EntryDialog.java3
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/dialog/EntryDialogWithBranchSelect.java3
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/dialog/HtmlDialog.java1
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/workflow/DynamicXWidgetLayout.java5
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/workflow/IWorkDefinitionProvider.java1
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/workflow/WorkFlowDefinition.java9
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/workflow/WorkItemDefinition.java1
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/workflow/WorkItemDefinitionFactory.java2
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xBranch/XBranchTextFilter.java3
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xBranch/XBranchWidget.java21
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xHistory/HistoryView.java3
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xbargraph/XBarGraphLine.java2
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xmerge/MergeUtility.java3
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xmerge/MergeXViewer.java4
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xmerge/MergeXViewerSorter.java3
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xmerge/MergeXWidget.java3
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xnavigate/XNavigateItemBlam.java4
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xviewer/skynet/SkynetXViewerFactory.java4
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xviewer/skynet/column/XViewerArtifactNameColumn.java1
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xviewer/skynet/column/XViewerArtifactTypeColumn.java1
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xviewer/skynet/column/XViewerAttributeColumn.java1
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xviewer/skynet/column/XViewerGuidColumn.java1
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xviewer/skynet/column/XViewerHridColumn.java1
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xviewer/skynet/column/XViewerLastModifiedByColumn.java1
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xviewer/skynet/column/XViewerLastModifiedDateColumn.java1
182 files changed, 10860 insertions, 10976 deletions
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/AlphabeticalRelationComparator.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/AlphabeticalRelationComparator.java
index 51863744da0..5ab360a5268 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/AlphabeticalRelationComparator.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/AlphabeticalRelationComparator.java
@@ -1,43 +1,40 @@
-/*******************************************************************************
- * 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.skynet;
-
-import java.util.Comparator;
-import java.util.logging.Level;
-import org.eclipse.osee.framework.core.enums.RelationSide;
-import org.eclipse.osee.framework.core.exception.OseeCoreException;
-import org.eclipse.osee.framework.logging.OseeLog;
-import org.eclipse.osee.framework.skynet.core.relation.RelationLink;
-
-/**
- * @author Ryan D. Brooks
- */
-public class AlphabeticalRelationComparator implements Comparator<RelationLink> {
- private final RelationSide relationSide;
-
- /**
- * @param relationSide
- */
- public AlphabeticalRelationComparator(RelationSide relationSide) {
- super();
- this.relationSide = relationSide;
- }
-
- @Override
- public int compare(RelationLink relationLink1, RelationLink relationLink2) {
- try {
- return relationLink1.getArtifact(relationSide).compareTo(relationLink2.getArtifact(relationSide));
- } catch (OseeCoreException ex) {
- OseeLog.log(SkynetGuiPlugin.class, Level.SEVERE, ex);
- return 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.skynet;
+
+import java.util.Comparator;
+import java.util.logging.Level;
+import org.eclipse.osee.framework.core.enums.RelationSide;
+import org.eclipse.osee.framework.core.exception.OseeCoreException;
+import org.eclipse.osee.framework.logging.OseeLog;
+import org.eclipse.osee.framework.skynet.core.relation.RelationLink;
+
+/**
+ * @author Ryan D. Brooks
+ */
+public class AlphabeticalRelationComparator implements Comparator<RelationLink> {
+ private final RelationSide relationSide;
+
+ public AlphabeticalRelationComparator(RelationSide relationSide) {
+ super();
+ this.relationSide = relationSide;
+ }
+
+ @Override
+ public int compare(RelationLink relationLink1, RelationLink relationLink2) {
+ try {
+ return relationLink1.getArtifact(relationSide).compareTo(relationLink2.getArtifact(relationSide));
+ } catch (OseeCoreException ex) {
+ OseeLog.log(SkynetGuiPlugin.class, Level.SEVERE, ex);
+ return 0;
+ }
+ }
+}
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/ArtifactContentProvider.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/ArtifactContentProvider.java
index dade8c02274..7b37f8643ce 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/ArtifactContentProvider.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/ArtifactContentProvider.java
@@ -1,150 +1,150 @@
-/*******************************************************************************
- * 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.skynet;
-
-import java.util.Collection;
-import java.util.logging.Level;
-import org.eclipse.jface.viewers.IContentProvider;
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.osee.framework.access.AccessControlManager;
-import org.eclipse.osee.framework.core.enums.CoreRelationTypes;
-import org.eclipse.osee.framework.core.enums.PermissionEnum;
-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.skynet.core.artifact.ArtifactChangeListener;
-
-/**
- * The basis for the comments in this class can be found at
- * http://www.eclipse.org/articles/treeviewer-cg/TreeViewerArticle.htm
- *
- * @author Ryan D. Brooks
- */
-public class ArtifactContentProvider implements ITreeContentProvider, ArtifactChangeListener {
- private static Object[] EMPTY_ARRAY = new Object[0];
-
- @Override
- public void dispose() {
- // do nothing
- }
-
- /**
- * Notifies this content provider that the given viewer's input has been switched to a different element.
- * <p>
- * A typical use for this method is registering the content provider as a listener to changes on the new input (using
- * model-specific means), and deregistering the viewer from the old input. In response to these change notifications,
- * the content provider propagates the changes to the viewer.
- * </p>
- *
- * @param viewer the viewer
- * @param oldInput the old input element, or <code>null</code> if the viewer did not previously have an input
- * @param newInput the new input element, or <code>null</code> if the viewer does not have an input
- * @see IContentProvider#inputChanged(Viewer, Object, Object)
- */
- @Override
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
- // do nothing
- }
-
- /**
- * The tree viewer calls its content provider&#8217;s getChildren method when it needs to create or display the child
- * elements of the domain object, <b>parent </b>. This method should answer an array of domain objects that represent
- * the unfiltered children of <b>parent </b>
- *
- * @see ITreeContentProvider#getChildren(Object)
- */
- @Override
- public Object[] getChildren(Object parentElement) {
- if (parentElement instanceof Artifact) {
- Artifact parentItem = (Artifact) parentElement;
- try {
- if (AccessControlManager.hasPermission(parentItem, PermissionEnum.READ)) {
- Collection<Artifact> children = parentItem.getChildren();
- if (children != null) {
- return children.toArray();
- }
- }
- } catch (OseeCoreException ex) {
+/*******************************************************************************
+ * 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.skynet;
+
+import java.util.Collection;
+import java.util.logging.Level;
+import org.eclipse.jface.viewers.IContentProvider;
+import org.eclipse.jface.viewers.IStructuredContentProvider;
+import org.eclipse.jface.viewers.ITreeContentProvider;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.osee.framework.access.AccessControlManager;
+import org.eclipse.osee.framework.core.enums.CoreRelationTypes;
+import org.eclipse.osee.framework.core.enums.PermissionEnum;
+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.skynet.core.artifact.ArtifactChangeListener;
+
+/**
+ * The basis for the comments in this class can be found at
+ * http://www.eclipse.org/articles/treeviewer-cg/TreeViewerArticle.htm
+ *
+ * @author Ryan D. Brooks
+ */
+public class ArtifactContentProvider implements ITreeContentProvider, ArtifactChangeListener {
+ private static Object[] EMPTY_ARRAY = new Object[0];
+
+ @Override
+ public void dispose() {
+ // do nothing
+ }
+
+ /**
+ * Notifies this content provider that the given viewer's input has been switched to a different element.
+ * <p>
+ * A typical use for this method is registering the content provider as a listener to changes on the new input (using
+ * model-specific means), and deregistering the viewer from the old input. In response to these change notifications,
+ * the content provider propagates the changes to the viewer.
+ * </p>
+ *
+ * @param viewer the viewer
+ * @param oldInput the old input element, or <code>null</code> if the viewer did not previously have an input
+ * @param newInput the new input element, or <code>null</code> if the viewer does not have an input
+ * @see IContentProvider#inputChanged(Viewer, Object, Object)
+ */
+ @Override
+ public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
+ // do nothing
+ }
+
+ /**
+ * The tree viewer calls its content provider&#8217;s getChildren method when it needs to create or display the child
+ * elements of the domain object, <b>parent </b>. This method should answer an array of domain objects that represent
+ * the unfiltered children of <b>parent </b>
+ *
+ * @see ITreeContentProvider#getChildren(Object)
+ */
+ @Override
+ public Object[] getChildren(Object parentElement) {
+ if (parentElement instanceof Artifact) {
+ Artifact parentItem = (Artifact) parentElement;
+ try {
+ if (AccessControlManager.hasPermission(parentItem, PermissionEnum.READ)) {
+ Collection<Artifact> children = parentItem.getChildren();
+ if (children != null) {
+ return children.toArray();
+ }
+ }
+ } catch (OseeCoreException ex) {
OseeLog.log(SkynetGuiPlugin.class, OseeLevel.SEVERE_POPUP, ex);
- }
- } else if (parentElement instanceof Collection) {
- return ((Collection<?>) parentElement).toArray();
- }
- return EMPTY_ARRAY;
- }
-
- /*
- * @see ITreeContentProvider#getParent(Object)
- */
- @Override
- public Object getParent(Object element) {
- if (element instanceof Artifact) {
- try {
- return ((Artifact) element).getParent();
- } catch (OseeCoreException ex) {
- OseeLog.log(SkynetGuiPlugin.class, OseeLevel.SEVERE_POPUP, ex);
- }
- }
- return null;
- }
-
- /**
- * The tree viewer asks its content provider if the domain object represented by <b>element </b> has any children.
- * This method is used by the tree viewer to determine whether or not a plus or minus should appear on the tree
- * widget.
- *
- * @see ITreeContentProvider#hasChildren(Object)
- */
- @Override
- public boolean hasChildren(Object element) {
- /*
- * If the item is an artifact, then use it's optimized check. If it is not an artifact, then resort to asking the
- * general children
- */
- if (element instanceof Artifact) {
- Artifact artifact = (Artifact) element;
- try {
- if (AccessControlManager.hasPermission(artifact, PermissionEnum.READ)) {
- if (artifact.isDeleted()) {
- return false;
- }
- return artifact.getRelatedArtifactsCount(CoreRelationTypes.Default_Hierarchical__Child) > 0;
- } else {
- return false;
- }
- } catch (OseeCoreException ex) {
- OseeLog.log(SkynetGuiPlugin.class, Level.SEVERE, ex);
- // Assume it has children if an error happens
- return true;
- }
- } else {
- return getChildren(element).length > 0;
- }
- }
-
- /**
- * This is the method invoked by calling the <b>setInput </b> method on the tree viewer. In fact, the <b>getElements
- * </b> method is called only in response to the tree viewer's <b>setInput </b> method and should answer with the
- * appropriate domain objects of the inputElement. The <b>getElements </b> and <b>getChildren </b> methods operate in
- * a similar way. Depending on your domain objects, you may have the <b>getElements </b> simply return the result of
- * calling <b>getChildren </b>. The two methods are kept distinct because it provides a clean way to differentiate
- * between the root domain object and all other domain objects.
- *
- * @see IStructuredContentProvider#getElements(Object)
- */
- @Override
- public Object[] getElements(Object element) {
- return getChildren(element);
- }
+ }
+ } else if (parentElement instanceof Collection) {
+ return ((Collection<?>) parentElement).toArray();
+ }
+ return EMPTY_ARRAY;
+ }
+
+ /*
+ * @see ITreeContentProvider#getParent(Object)
+ */
+ @Override
+ public Object getParent(Object element) {
+ if (element instanceof Artifact) {
+ try {
+ return ((Artifact) element).getParent();
+ } catch (OseeCoreException ex) {
+ OseeLog.log(SkynetGuiPlugin.class, OseeLevel.SEVERE_POPUP, ex);
+ }
+ }
+ return null;
+ }
+
+ /**
+ * The tree viewer asks its content provider if the domain object represented by <b>element </b> has any children.
+ * This method is used by the tree viewer to determine whether or not a plus or minus should appear on the tree
+ * widget.
+ *
+ * @see ITreeContentProvider#hasChildren(Object)
+ */
+ @Override
+ public boolean hasChildren(Object element) {
+ /*
+ * If the item is an artifact, then use it's optimized check. If it is not an artifact, then resort to asking the
+ * general children
+ */
+ if (element instanceof Artifact) {
+ Artifact artifact = (Artifact) element;
+ try {
+ if (AccessControlManager.hasPermission(artifact, PermissionEnum.READ)) {
+ if (artifact.isDeleted()) {
+ return false;
+ }
+ return artifact.getRelatedArtifactsCount(CoreRelationTypes.Default_Hierarchical__Child) > 0;
+ } else {
+ return false;
+ }
+ } catch (OseeCoreException ex) {
+ OseeLog.log(SkynetGuiPlugin.class, Level.SEVERE, ex);
+ // Assume it has children if an error happens
+ return true;
+ }
+ } else {
+ return getChildren(element).length > 0;
+ }
+ }
+
+ /**
+ * This is the method invoked by calling the <b>setInput </b> method on the tree viewer. In fact, the <b>getElements
+ * </b> method is called only in response to the tree viewer's <b>setInput </b> method and should answer with the
+ * appropriate domain objects of the inputElement. The <b>getElements </b> and <b>getChildren </b> methods operate in
+ * a similar way. Depending on your domain objects, you may have the <b>getElements </b> simply return the result of
+ * calling <b>getChildren </b>. The two methods are kept distinct because it provides a clean way to differentiate
+ * between the root domain object and all other domain objects.
+ *
+ * @see IStructuredContentProvider#getElements(Object)
+ */
+ @Override
+ public Object[] getElements(Object element) {
+ return getChildren(element);
+ }
} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/ArtifactDecorator.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/ArtifactDecorator.java
index d56da746796..3c17ce8e991 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/ArtifactDecorator.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/ArtifactDecorator.java
@@ -1,404 +1,404 @@
-/*******************************************************************************
- * 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.skynet;
-
-import java.lang.ref.WeakReference;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-import java.util.concurrent.CopyOnWriteArrayList;
-import java.util.logging.Level;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.action.Separator;
-import org.eclipse.jface.viewers.StructuredViewer;
-import org.eclipse.jface.window.Window;
-import org.eclipse.osee.framework.access.AccessControlManager;
-import org.eclipse.osee.framework.core.data.IAttributeType;
-import org.eclipse.osee.framework.core.exception.OseeCoreException;
-import org.eclipse.osee.framework.core.model.Branch;
-import org.eclipse.osee.framework.core.model.type.AttributeType;
-import org.eclipse.osee.framework.core.util.Conditions;
-import org.eclipse.osee.framework.jdk.core.util.Collections;
-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.plugin.core.util.Jobs;
-import org.eclipse.osee.framework.skynet.core.UserManager;
-import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
-import org.eclipse.osee.framework.skynet.core.artifact.IBranchProvider;
-import org.eclipse.osee.framework.skynet.core.attribute.AttributeTypeManager;
-import org.eclipse.osee.framework.ui.skynet.widgets.dialog.AttributeTypeFilteredCheckTreeDialog;
-import org.eclipse.osee.framework.ui.swt.ImageManager;
-import org.eclipse.osee.framework.ui.swt.KeyedImage;
-import org.eclipse.ui.progress.UIJob;
-
-/**
- * @author Roberto E. Escobar
- */
-public class ArtifactDecorator implements IArtifactDecoratorPreferences {
-
- private static final Collection<WeakReference<ArtifactDecorator>> DECORATOR_INSTANCES =
- new CopyOnWriteArrayList<WeakReference<ArtifactDecorator>>();
-
- private DecoratorAction showArtIds;
- private DecoratorAction showArtType;
- private DecoratorAction showArtVersion;
- private DecoratorAction showArtBranch;
- private ShowAttributeAction attributesAction;
- private SetSettingsAsDefault saveSettingsAction;
- private StructuredViewer viewer;
-
- private final String storageKey;
-
- public ArtifactDecorator(String storageKey) {
- this.viewer = null;
- this.storageKey = storageKey;
- addDecoratorInstance(this);
- }
-
- public void setViewer(StructuredViewer viewer) {
- this.viewer = viewer;
- }
-
- private String asKey(String prefix, String name) {
- return String.format("%s.%s", prefix, name);
- }
-
- private void storeState() {
- try {
- saveAction(showArtIds, "artifact.decorator.show.artId");
- saveAction(showArtType, "artifact.decorator.show.artType");
- saveAction(showArtBranch, "artifact.decorator.show.artBranch");
- saveAction(showArtVersion, "artifact.decorator.show.artVersion");
- if (attributesAction != null) {
- Collection<String> items = attributesAction.getSelected();
- UserManager.setSetting(asKey(storageKey, "artifact.decorator.attrTypes"), Collections.toString(",", items));
- saveAction(attributesAction, "artifact.decorator.show.attrTypes");
- }
- } catch (OseeCoreException ex) {
- OseeLog.log(SkynetGuiPlugin.class, Level.SEVERE, ex);
- }
- }
-
- private void loadState() {
- try {
- loadAction(showArtIds, "artifact.decorator.show.artId");
- loadAction(showArtType, "artifact.decorator.show.artType");
- loadAction(showArtBranch, "artifact.decorator.show.artBranch");
- loadAction(showArtVersion, "artifact.decorator.show.artVersion");
- if (attributesAction != null) {
- String value = UserManager.getSetting("artifact.decorator.attrTypes");
- if (Strings.isValid(value)) {
- String[] entries = value.split(",");
- attributesAction.setSelected(Arrays.asList(entries));
- }
- loadAction(attributesAction, "artifact.decorator.show.attrTypes");
- }
- } catch (OseeCoreException ex) {
- OseeLog.log(SkynetGuiPlugin.class, Level.SEVERE, ex);
- }
- }
-
- private void loadAction(Action action, String key) throws OseeCoreException {
- if (action != null) {
- boolean isChecked = UserManager.getBooleanSetting(asKey(storageKey, key));
- action.setChecked(isChecked);
- }
- }
-
- private void saveAction(Action action, String key) throws OseeCoreException {
- boolean isChecked = action != null && action.isChecked();
- UserManager.setSetting(asKey(storageKey, key), String.valueOf(isChecked));
- }
-
- private void checkActionsCreated(IBranchProvider branchProvider) {
- if (showArtType == null) {
- showArtType = new DecoratorAction("Artifact Type", FrameworkImage.FILTERS);
- }
- if (showArtBranch == null) {
- showArtBranch = new DecoratorAction("Artifact Branch", FrameworkImage.FILTERS);
- }
- if (showArtVersion == null) {
- showArtVersion = new DecoratorAction("Artifact Version", FrameworkImage.FILTERS);
- }
-
- if (attributesAction == null && branchProvider != null) {
- attributesAction = new ShowAttributeAction(branchProvider, FrameworkImage.FILTERS);
- }
-
- if (showArtIds == null && isAdmin()) {
- showArtIds = new DecoratorAction("Artifact Ids", FrameworkImage.FILTERS);
- }
- if (saveSettingsAction == null) {
- saveSettingsAction = new SetSettingsAsDefault();
- }
- }
-
- private boolean isAdmin() {
- boolean result = false;
- try {
- if (AccessControlManager.isOseeAdmin()) {
- result = true;
- }
- } catch (Exception ex) {
- OseeLog.log(SkynetGuiPlugin.class, OseeLevel.SEVERE_POPUP, ex);
- result = false;
- }
- return result;
- }
-
- public void addActions(IMenuManager manager, IBranchProvider provider) {
- checkActionsCreated(provider);
-
- if (showArtIds != null && isAdmin()) {
- if (manager != null) {
- manager.add(showArtIds);
- }
- showArtIds.updateText();
- }
-
- if (manager != null) {
- manager.add(showArtVersion);
- manager.add(showArtType);
- manager.add(showArtBranch);
- }
- showArtType.updateText();
- showArtVersion.updateText();
- showArtBranch.updateText();
-
- if (manager != null) {
- manager.add(attributesAction);
- manager.add(new Separator());
- manager.add(saveSettingsAction);
- }
-
- loadState();
- }
-
- @Override
- public String getSelectedAttributeData(Artifact artifact) throws OseeCoreException {
- String toReturn = null;
- if (attributesAction != null) {
- Conditions.checkNotNull(artifact, "artifact");
- Collection<String> selectedItems = attributesAction.getSelected();
-
- List<String> info = new ArrayList<String>();
- for (IAttributeType attributeType : artifact.getAttributeTypes()) {
- if (selectedItems.contains(attributeType.getGuid())) {
- String value = artifact.getAttributesToString(attributeType);
- if (Strings.isValid(value)) {
- info.add(value);
- } else {
- info.add("?");
- }
- }
- }
- if (!info.isEmpty()) {
- toReturn = "[" + Collections.toString(" | ", info) + "]";
- }
- }
- return toReturn != null ? toReturn : "";
- }
-
- @Override
- public boolean showArtIds() {
- return showArtIds != null && showArtIds.isChecked();
- }
-
- @Override
- public boolean showArtType() {
- return showArtType != null && showArtType.isChecked();
- }
-
- @Override
- public boolean showArtBranch() {
- return showArtBranch != null && showArtBranch.isChecked();
- }
-
- @Override
- public boolean showArtVersion() {
- return showArtVersion != null && showArtVersion.isChecked();
- }
-
- public void setShowArtType(boolean set) {
- if (showArtType != null) {
- showArtType.setChecked(set);
- }
- }
-
- public void setShowArtBranch(boolean set) {
- if (showArtBranch != null) {
- showArtBranch.setChecked(set);
- }
- }
-
- private void refreshView() {
- if (viewer != null) {
- viewer.refresh();
- }
- }
-
- private final class DecoratorAction extends Action {
- private final String name;
- private boolean isSelected;
-
- public DecoratorAction(String name, KeyedImage image) {
- super(name, IAction.AS_PUSH_BUTTON);
- this.name = name;
- this.isSelected = false;
- if (image != null) {
- setImageDescriptor(ImageManager.getImageDescriptor(image));
- }
- updateText();
- }
-
- @Override
- public void run() {
- setChecked(!isChecked());
- refreshView();
- }
-
- @Override
- public boolean isChecked() {
- return isSelected;
- }
-
- @Override
- public void setChecked(boolean checked) {
- isSelected = checked;
- updateText();
- }
-
- public void updateText() {
- String message = String.format("%s %s", isChecked() ? "Hide" : "Show", name);
- setText(message);
- }
- }
-
- private final class ShowAttributeAction extends Action {
-
- private final Set<String> selectedTypes;
- private final IBranchProvider branchProvider;
-
- public ShowAttributeAction(IBranchProvider branchProvider, KeyedImage image) {
- super("Show Attributes", IAction.AS_PUSH_BUTTON);
- this.branchProvider = branchProvider;
- this.selectedTypes = new HashSet<String>();
- if (image != null) {
- setImageDescriptor(ImageManager.getImageDescriptor(image));
- }
- }
-
- @Override
- public void run() {
- if (branchProvider != null) {
- Job job = new UIJob("Select Attribute Types") {
-
- @Override
- public IStatus runInUIThread(IProgressMonitor monitor) {
- IStatus status = Status.OK_STATUS;
- try {
- Branch branch = branchProvider.getBranch(monitor);
- if (branch == null) {
- status = new Status(IStatus.ERROR, SkynetGuiPlugin.PLUGIN_ID, "Branch not selected");
- } else {
- Collection<AttributeType> selectableTypes = AttributeTypeManager.getValidAttributeTypes(branch);
- AttributeTypeFilteredCheckTreeDialog dialog =
- new AttributeTypeFilteredCheckTreeDialog("Select Attribute Types",
- "Select attribute types to display.");
- dialog.setSelectableTypes(selectableTypes);
-
- List<IAttributeType> initSelection = new ArrayList<IAttributeType>();
- for (String entry : selectedTypes) {
- for (AttributeType type : selectableTypes) {
- if (type.getGuid().equals(entry)) {
- initSelection.add(type);
- }
- }
- }
- dialog.setInitialSelections(initSelection);
-
- int result = dialog.open();
- if (result == Window.OK) {
- selectedTypes.clear();
- for (Object object : dialog.getResult()) {
- if (object instanceof IAttributeType) {
- selectedTypes.add(((IAttributeType) object).getGuid());
- }
- }
- refreshView();
- }
- }
- } catch (OseeCoreException ex) {
- status =
- new Status(IStatus.ERROR, SkynetGuiPlugin.PLUGIN_ID, "Error opening attribute types dialog", ex);
- }
- return status;
- }
- };
- Jobs.startJob(job);
- }
- }
-
- public Collection<String> getSelected() {
- return selectedTypes;
- }
-
- public void setSelected(Collection<String> selected) {
- selectedTypes.clear();
- selectedTypes.addAll(selected);
- }
- }
-
- private final class SetSettingsAsDefault extends Action {
-
- public SetSettingsAsDefault() {
- super("Store Label Settings", IAction.AS_PUSH_BUTTON);
- setImageDescriptor(ImageManager.getImageDescriptor(FrameworkImage.SAVE));
- }
-
- @Override
- public void run() {
- storeState();
- notifySettingsChanged(ArtifactDecorator.this);
- }
- }
-
- private static void addDecoratorInstance(ArtifactDecorator source) {
- DECORATOR_INSTANCES.add(new WeakReference<ArtifactDecorator>(source));
- }
-
- private static void notifySettingsChanged(ArtifactDecorator source) {
- List<Object> toRemove = new ArrayList<Object>();
-
- for (WeakReference<ArtifactDecorator> ref : DECORATOR_INSTANCES) {
- ArtifactDecorator decorator = ref.get();
- if (decorator != null) {
- if (!source.equals(decorator)) {
- decorator.loadState();
- decorator.refreshView();
- }
- } else {
- toRemove.add(ref);
- }
- }
- DECORATOR_INSTANCES.removeAll(toRemove);
- }
-}
+/*******************************************************************************
+ * 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.skynet;
+
+import java.lang.ref.WeakReference;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+import java.util.concurrent.CopyOnWriteArrayList;
+import java.util.logging.Level;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.action.IMenuManager;
+import org.eclipse.jface.action.Separator;
+import org.eclipse.jface.viewers.StructuredViewer;
+import org.eclipse.jface.window.Window;
+import org.eclipse.osee.framework.access.AccessControlManager;
+import org.eclipse.osee.framework.core.data.IAttributeType;
+import org.eclipse.osee.framework.core.exception.OseeCoreException;
+import org.eclipse.osee.framework.core.model.Branch;
+import org.eclipse.osee.framework.core.model.type.AttributeType;
+import org.eclipse.osee.framework.core.util.Conditions;
+import org.eclipse.osee.framework.jdk.core.util.Collections;
+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.plugin.core.util.Jobs;
+import org.eclipse.osee.framework.skynet.core.UserManager;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.skynet.core.artifact.IBranchProvider;
+import org.eclipse.osee.framework.skynet.core.attribute.AttributeTypeManager;
+import org.eclipse.osee.framework.ui.skynet.widgets.dialog.AttributeTypeFilteredCheckTreeDialog;
+import org.eclipse.osee.framework.ui.swt.ImageManager;
+import org.eclipse.osee.framework.ui.swt.KeyedImage;
+import org.eclipse.ui.progress.UIJob;
+
+/**
+ * @author Roberto E. Escobar
+ */
+public class ArtifactDecorator implements IArtifactDecoratorPreferences {
+
+ private static final Collection<WeakReference<ArtifactDecorator>> DECORATOR_INSTANCES =
+ new CopyOnWriteArrayList<WeakReference<ArtifactDecorator>>();
+
+ private DecoratorAction showArtIds;
+ private DecoratorAction showArtType;
+ private DecoratorAction showArtVersion;
+ private DecoratorAction showArtBranch;
+ private ShowAttributeAction attributesAction;
+ private SetSettingsAsDefault saveSettingsAction;
+ private StructuredViewer viewer;
+
+ private final String storageKey;
+
+ public ArtifactDecorator(String storageKey) {
+ this.viewer = null;
+ this.storageKey = storageKey;
+ addDecoratorInstance(this);
+ }
+
+ public void setViewer(StructuredViewer viewer) {
+ this.viewer = viewer;
+ }
+
+ private String asKey(String prefix, String name) {
+ return String.format("%s.%s", prefix, name);
+ }
+
+ private void storeState() {
+ try {
+ saveAction(showArtIds, "artifact.decorator.show.artId");
+ saveAction(showArtType, "artifact.decorator.show.artType");
+ saveAction(showArtBranch, "artifact.decorator.show.artBranch");
+ saveAction(showArtVersion, "artifact.decorator.show.artVersion");
+ if (attributesAction != null) {
+ Collection<String> items = attributesAction.getSelected();
+ UserManager.setSetting(asKey(storageKey, "artifact.decorator.attrTypes"), Collections.toString(",", items));
+ saveAction(attributesAction, "artifact.decorator.show.attrTypes");
+ }
+ } catch (OseeCoreException ex) {
+ OseeLog.log(SkynetGuiPlugin.class, Level.SEVERE, ex);
+ }
+ }
+
+ private void loadState() {
+ try {
+ loadAction(showArtIds, "artifact.decorator.show.artId");
+ loadAction(showArtType, "artifact.decorator.show.artType");
+ loadAction(showArtBranch, "artifact.decorator.show.artBranch");
+ loadAction(showArtVersion, "artifact.decorator.show.artVersion");
+ if (attributesAction != null) {
+ String value = UserManager.getSetting("artifact.decorator.attrTypes");
+ if (Strings.isValid(value)) {
+ String[] entries = value.split(",");
+ attributesAction.setSelected(Arrays.asList(entries));
+ }
+ loadAction(attributesAction, "artifact.decorator.show.attrTypes");
+ }
+ } catch (OseeCoreException ex) {
+ OseeLog.log(SkynetGuiPlugin.class, Level.SEVERE, ex);
+ }
+ }
+
+ private void loadAction(Action action, String key) throws OseeCoreException {
+ if (action != null) {
+ boolean isChecked = UserManager.getBooleanSetting(asKey(storageKey, key));
+ action.setChecked(isChecked);
+ }
+ }
+
+ private void saveAction(Action action, String key) throws OseeCoreException {
+ boolean isChecked = action != null && action.isChecked();
+ UserManager.setSetting(asKey(storageKey, key), String.valueOf(isChecked));
+ }
+
+ private void checkActionsCreated(IBranchProvider branchProvider) {
+ if (showArtType == null) {
+ showArtType = new DecoratorAction("Artifact Type", FrameworkImage.FILTERS);
+ }
+ if (showArtBranch == null) {
+ showArtBranch = new DecoratorAction("Artifact Branch", FrameworkImage.FILTERS);
+ }
+ if (showArtVersion == null) {
+ showArtVersion = new DecoratorAction("Artifact Version", FrameworkImage.FILTERS);
+ }
+
+ if (attributesAction == null && branchProvider != null) {
+ attributesAction = new ShowAttributeAction(branchProvider, FrameworkImage.FILTERS);
+ }
+
+ if (showArtIds == null && isAdmin()) {
+ showArtIds = new DecoratorAction("Artifact Ids", FrameworkImage.FILTERS);
+ }
+ if (saveSettingsAction == null) {
+ saveSettingsAction = new SetSettingsAsDefault();
+ }
+ }
+
+ private boolean isAdmin() {
+ boolean result = false;
+ try {
+ if (AccessControlManager.isOseeAdmin()) {
+ result = true;
+ }
+ } catch (Exception ex) {
+ OseeLog.log(SkynetGuiPlugin.class, OseeLevel.SEVERE_POPUP, ex);
+ result = false;
+ }
+ return result;
+ }
+
+ public void addActions(IMenuManager manager, IBranchProvider provider) {
+ checkActionsCreated(provider);
+
+ if (showArtIds != null && isAdmin()) {
+ if (manager != null) {
+ manager.add(showArtIds);
+ }
+ showArtIds.updateText();
+ }
+
+ if (manager != null) {
+ manager.add(showArtVersion);
+ manager.add(showArtType);
+ manager.add(showArtBranch);
+ }
+ showArtType.updateText();
+ showArtVersion.updateText();
+ showArtBranch.updateText();
+
+ if (manager != null) {
+ manager.add(attributesAction);
+ manager.add(new Separator());
+ manager.add(saveSettingsAction);
+ }
+
+ loadState();
+ }
+
+ @Override
+ public String getSelectedAttributeData(Artifact artifact) throws OseeCoreException {
+ String toReturn = null;
+ if (attributesAction != null) {
+ Conditions.checkNotNull(artifact, "artifact");
+ Collection<String> selectedItems = attributesAction.getSelected();
+
+ List<String> info = new ArrayList<String>();
+ for (IAttributeType attributeType : artifact.getAttributeTypes()) {
+ if (selectedItems.contains(attributeType.getGuid())) {
+ String value = artifact.getAttributesToString(attributeType);
+ if (Strings.isValid(value)) {
+ info.add(value);
+ } else {
+ info.add("?");
+ }
+ }
+ }
+ if (!info.isEmpty()) {
+ toReturn = "[" + Collections.toString(" | ", info) + "]";
+ }
+ }
+ return toReturn != null ? toReturn : "";
+ }
+
+ @Override
+ public boolean showArtIds() {
+ return showArtIds != null && showArtIds.isChecked();
+ }
+
+ @Override
+ public boolean showArtType() {
+ return showArtType != null && showArtType.isChecked();
+ }
+
+ @Override
+ public boolean showArtBranch() {
+ return showArtBranch != null && showArtBranch.isChecked();
+ }
+
+ @Override
+ public boolean showArtVersion() {
+ return showArtVersion != null && showArtVersion.isChecked();
+ }
+
+ public void setShowArtType(boolean set) {
+ if (showArtType != null) {
+ showArtType.setChecked(set);
+ }
+ }
+
+ public void setShowArtBranch(boolean set) {
+ if (showArtBranch != null) {
+ showArtBranch.setChecked(set);
+ }
+ }
+
+ private void refreshView() {
+ if (viewer != null) {
+ viewer.refresh();
+ }
+ }
+
+ private final class DecoratorAction extends Action {
+ private final String name;
+ private boolean isSelected;
+
+ public DecoratorAction(String name, KeyedImage image) {
+ super(name, IAction.AS_PUSH_BUTTON);
+ this.name = name;
+ this.isSelected = false;
+ if (image != null) {
+ setImageDescriptor(ImageManager.getImageDescriptor(image));
+ }
+ updateText();
+ }
+
+ @Override
+ public void run() {
+ setChecked(!isChecked());
+ refreshView();
+ }
+
+ @Override
+ public boolean isChecked() {
+ return isSelected;
+ }
+
+ @Override
+ public void setChecked(boolean checked) {
+ isSelected = checked;
+ updateText();
+ }
+
+ public void updateText() {
+ String message = String.format("%s %s", isChecked() ? "Hide" : "Show", name);
+ setText(message);
+ }
+ }
+
+ private final class ShowAttributeAction extends Action {
+
+ private final Set<String> selectedTypes;
+ private final IBranchProvider branchProvider;
+
+ public ShowAttributeAction(IBranchProvider branchProvider, KeyedImage image) {
+ super("Show Attributes", IAction.AS_PUSH_BUTTON);
+ this.branchProvider = branchProvider;
+ this.selectedTypes = new HashSet<String>();
+ if (image != null) {
+ setImageDescriptor(ImageManager.getImageDescriptor(image));
+ }
+ }
+
+ @Override
+ public void run() {
+ if (branchProvider != null) {
+ Job job = new UIJob("Select Attribute Types") {
+
+ @Override
+ public IStatus runInUIThread(IProgressMonitor monitor) {
+ IStatus status = Status.OK_STATUS;
+ try {
+ Branch branch = branchProvider.getBranch(monitor);
+ if (branch == null) {
+ status = new Status(IStatus.ERROR, SkynetGuiPlugin.PLUGIN_ID, "Branch not selected");
+ } else {
+ Collection<AttributeType> selectableTypes = AttributeTypeManager.getValidAttributeTypes(branch);
+ AttributeTypeFilteredCheckTreeDialog dialog =
+ new AttributeTypeFilteredCheckTreeDialog("Select Attribute Types",
+ "Select attribute types to display.");
+ dialog.setSelectableTypes(selectableTypes);
+
+ List<IAttributeType> initSelection = new ArrayList<IAttributeType>();
+ for (String entry : selectedTypes) {
+ for (AttributeType type : selectableTypes) {
+ if (type.getGuid().equals(entry)) {
+ initSelection.add(type);
+ }
+ }
+ }
+ dialog.setInitialSelections(initSelection);
+
+ int result = dialog.open();
+ if (result == Window.OK) {
+ selectedTypes.clear();
+ for (Object object : dialog.getResult()) {
+ if (object instanceof IAttributeType) {
+ selectedTypes.add(((IAttributeType) object).getGuid());
+ }
+ }
+ refreshView();
+ }
+ }
+ } catch (OseeCoreException ex) {
+ status =
+ new Status(IStatus.ERROR, SkynetGuiPlugin.PLUGIN_ID, "Error opening attribute types dialog", ex);
+ }
+ return status;
+ }
+ };
+ Jobs.startJob(job);
+ }
+ }
+
+ public Collection<String> getSelected() {
+ return selectedTypes;
+ }
+
+ public void setSelected(Collection<String> selected) {
+ selectedTypes.clear();
+ selectedTypes.addAll(selected);
+ }
+ }
+
+ private final class SetSettingsAsDefault extends Action {
+
+ public SetSettingsAsDefault() {
+ super("Store Label Settings", IAction.AS_PUSH_BUTTON);
+ setImageDescriptor(ImageManager.getImageDescriptor(FrameworkImage.SAVE));
+ }
+
+ @Override
+ public void run() {
+ storeState();
+ notifySettingsChanged(ArtifactDecorator.this);
+ }
+ }
+
+ private static void addDecoratorInstance(ArtifactDecorator source) {
+ DECORATOR_INSTANCES.add(new WeakReference<ArtifactDecorator>(source));
+ }
+
+ private static void notifySettingsChanged(ArtifactDecorator source) {
+ List<Object> toRemove = new ArrayList<Object>();
+
+ for (WeakReference<ArtifactDecorator> ref : DECORATOR_INSTANCES) {
+ ArtifactDecorator decorator = ref.get();
+ if (decorator != null) {
+ if (!source.equals(decorator)) {
+ decorator.loadState();
+ decorator.refreshView();
+ }
+ } else {
+ toRemove.add(ref);
+ }
+ }
+ DECORATOR_INSTANCES.removeAll(toRemove);
+ }
+}
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/ArtifactDecoratorPreferences.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/ArtifactDecoratorPreferences.java
index 7c7c3106818..e27133f69bb 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/ArtifactDecoratorPreferences.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/ArtifactDecoratorPreferences.java
@@ -1,66 +1,66 @@
-/*******************************************************************************
- * 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.skynet;
-
-import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
-
-/**
- * @author Roberto E. Escobar
- */
-public class ArtifactDecoratorPreferences implements IArtifactDecoratorPreferences {
-
- private boolean isShowArtIdsAllowed;
- private boolean isShowArtTypeAllowed;
- private boolean isShowBranchAllowed;
- private boolean isShowArtVersionAllowed;
-
- @Override
- public String getSelectedAttributeData(Artifact artifact) {
- return "";
- }
-
- public void setShowArtIds(boolean isShowArtIdsAllowed) {
- this.isShowArtIdsAllowed = isShowArtIdsAllowed;
- }
-
- public void setShowArtType(boolean isShowArtTypeAllowed) {
- this.isShowArtTypeAllowed = isShowArtTypeAllowed;
- }
-
- public void setShowArtBranch(boolean isShowBranchAllowed) {
- this.isShowBranchAllowed = isShowBranchAllowed;
- }
-
- public void setShowArtVersion(boolean isShowArtVersionAllowed) {
- this.isShowArtVersionAllowed = isShowArtVersionAllowed;
- }
-
- @Override
- public boolean showArtIds() {
- return isShowArtIdsAllowed;
- }
-
- @Override
- public boolean showArtType() {
- return isShowArtTypeAllowed;
- }
-
- @Override
- public boolean showArtBranch() {
- return isShowBranchAllowed;
- }
-
- @Override
- public boolean showArtVersion() {
- return isShowArtVersionAllowed;
- }
-
-}
+/*******************************************************************************
+ * 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.skynet;
+
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+
+/**
+ * @author Roberto E. Escobar
+ */
+public class ArtifactDecoratorPreferences implements IArtifactDecoratorPreferences {
+
+ private boolean isShowArtIdsAllowed;
+ private boolean isShowArtTypeAllowed;
+ private boolean isShowBranchAllowed;
+ private boolean isShowArtVersionAllowed;
+
+ @Override
+ public String getSelectedAttributeData(Artifact artifact) {
+ return "";
+ }
+
+ public void setShowArtIds(boolean isShowArtIdsAllowed) {
+ this.isShowArtIdsAllowed = isShowArtIdsAllowed;
+ }
+
+ public void setShowArtType(boolean isShowArtTypeAllowed) {
+ this.isShowArtTypeAllowed = isShowArtTypeAllowed;
+ }
+
+ public void setShowArtBranch(boolean isShowBranchAllowed) {
+ this.isShowBranchAllowed = isShowBranchAllowed;
+ }
+
+ public void setShowArtVersion(boolean isShowArtVersionAllowed) {
+ this.isShowArtVersionAllowed = isShowArtVersionAllowed;
+ }
+
+ @Override
+ public boolean showArtIds() {
+ return isShowArtIdsAllowed;
+ }
+
+ @Override
+ public boolean showArtType() {
+ return isShowArtTypeAllowed;
+ }
+
+ @Override
+ public boolean showArtBranch() {
+ return isShowBranchAllowed;
+ }
+
+ @Override
+ public boolean showArtVersion() {
+ return isShowArtVersionAllowed;
+ }
+
+}
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/ArtifactDoubleClick.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/ArtifactDoubleClick.java
index 3a8748678c2..47d16afc263 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/ArtifactDoubleClick.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/ArtifactDoubleClick.java
@@ -1,68 +1,68 @@
-/*******************************************************************************
- * 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.skynet;
-
-import java.util.logging.Level;
-import org.eclipse.jface.viewers.DoubleClickEvent;
-import org.eclipse.jface.viewers.IDoubleClickListener;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.osee.framework.access.AccessControlManager;
-import org.eclipse.osee.framework.core.enums.PermissionEnum;
-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.UserManager;
-import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
-import org.eclipse.osee.framework.ui.skynet.render.PresentationType;
-import org.eclipse.osee.framework.ui.skynet.render.RendererManager;
-import org.eclipse.search.ui.text.Match;
-
-/**
- * @author Ryan D. Brooks
- */
-public class ArtifactDoubleClick implements IDoubleClickListener {
- @Override
- public void doubleClick(DoubleClickEvent event) {
- openArtifact(event.getSelection());
- }
-
- public static void openArtifact(ISelection selection) {
- IStructuredSelection structSel = (IStructuredSelection) selection;
- Object object = structSel.getFirstElement();
- Artifact artifact = null;
- if (object instanceof Artifact) {
- artifact = (Artifact) structSel.getFirstElement();
- } else if (object instanceof Match) {
- Match match = (Match) object;
-
- if (match.getElement() instanceof Artifact) {
- artifact = (Artifact) match.getElement();
- }
- }
-
- if (artifact == null) {
- OseeLog.log(SkynetGuiPlugin.class, Level.SEVERE, "The artifact associated with the double-click was null");
- } else {
- try {
- if (AccessControlManager.hasPermission(artifact, PermissionEnum.READ)) {
- RendererManager.openInJob(artifact, PresentationType.DEFAULT_OPEN);
- } else {
- OseeLog.log(SkynetGuiPlugin.class, OseeLevel.SEVERE_POPUP,
- "The user " + UserManager.getUser() + " does not have read access to " + artifact);
- }
- } catch (OseeCoreException ex) {
- OseeLog.log(SkynetGuiPlugin.class, Level.SEVERE, ex);
- }
- }
- }
+/*******************************************************************************
+ * 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.skynet;
+
+import java.util.logging.Level;
+import org.eclipse.jface.viewers.DoubleClickEvent;
+import org.eclipse.jface.viewers.IDoubleClickListener;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.osee.framework.access.AccessControlManager;
+import org.eclipse.osee.framework.core.enums.PermissionEnum;
+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.UserManager;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.ui.skynet.render.PresentationType;
+import org.eclipse.osee.framework.ui.skynet.render.RendererManager;
+import org.eclipse.search.ui.text.Match;
+
+/**
+ * @author Ryan D. Brooks
+ */
+public class ArtifactDoubleClick implements IDoubleClickListener {
+ @Override
+ public void doubleClick(DoubleClickEvent event) {
+ openArtifact(event.getSelection());
+ }
+
+ public static void openArtifact(ISelection selection) {
+ IStructuredSelection structSel = (IStructuredSelection) selection;
+ Object object = structSel.getFirstElement();
+ Artifact artifact = null;
+ if (object instanceof Artifact) {
+ artifact = (Artifact) structSel.getFirstElement();
+ } else if (object instanceof Match) {
+ Match match = (Match) object;
+
+ if (match.getElement() instanceof Artifact) {
+ artifact = (Artifact) match.getElement();
+ }
+ }
+
+ if (artifact == null) {
+ OseeLog.log(SkynetGuiPlugin.class, Level.SEVERE, "The artifact associated with the double-click was null");
+ } else {
+ try {
+ if (AccessControlManager.hasPermission(artifact, PermissionEnum.READ)) {
+ RendererManager.openInJob(artifact, PresentationType.DEFAULT_OPEN);
+ } else {
+ OseeLog.log(SkynetGuiPlugin.class, OseeLevel.SEVERE_POPUP,
+ "The user " + UserManager.getUser() + " does not have read access to " + artifact);
+ }
+ } catch (OseeCoreException ex) {
+ OseeLog.log(SkynetGuiPlugin.class, Level.SEVERE, ex);
+ }
+ }
+ }
} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/ArtifactDragDropSupport.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/ArtifactDragDropSupport.java
index 90215e662f2..845bca4c493 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/ArtifactDragDropSupport.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/ArtifactDragDropSupport.java
@@ -1,202 +1,202 @@
-/*******************************************************************************
- * 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.skynet;
-
-import java.io.File;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.util.Collection;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.window.Window;
-import org.eclipse.osee.framework.core.enums.CoreAttributeTypes;
-import org.eclipse.osee.framework.core.enums.RelationSide;
-import org.eclipse.osee.framework.core.exception.ArtifactDoesNotExist;
-import org.eclipse.osee.framework.core.exception.OseeArgumentException;
-import org.eclipse.osee.framework.core.exception.OseeCoreException;
-import org.eclipse.osee.framework.core.model.Branch;
-import org.eclipse.osee.framework.core.model.type.ArtifactType;
-import org.eclipse.osee.framework.core.model.type.RelationType;
-import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
-import org.eclipse.osee.framework.skynet.core.artifact.ArtifactData;
-import org.eclipse.osee.framework.skynet.core.artifact.ArtifactTypeManager;
-import org.eclipse.osee.framework.skynet.core.artifact.WorkspaceURL;
-import org.eclipse.osee.framework.skynet.core.artifact.search.ArtifactQuery;
-import org.eclipse.osee.framework.skynet.core.relation.RelationManager;
-import org.eclipse.osee.framework.skynet.core.relation.RelationTypeSideSorter;
-import org.eclipse.osee.framework.ui.skynet.artifact.ArtifactTransfer;
-import org.eclipse.osee.framework.ui.skynet.branch.BranchSelectionDialog;
-import org.eclipse.osee.framework.ui.skynet.relation.explorer.RelationExplorerWindow;
-import org.eclipse.osee.framework.ui.ws.AWorkspace;
-import org.eclipse.swt.dnd.DropTargetEvent;
-import org.eclipse.swt.widgets.Shell;
-
-/**
- * @author Michael S. Rodgers
- */
-public class ArtifactDragDropSupport {
-
- public static void performDragDrop(DropTargetEvent e, RelationExplorerWindow window, Shell shell) throws OseeCoreException {
- performDragDrop(e, null, window, shell);
- }
-
- private static void performDragDrop(DropTargetEvent e, Artifact[] artifacts, RelationExplorerWindow window, Shell shell) throws OseeCoreException {
-
- if (ArtifactTransfer.getInstance().isSupportedType(e.currentDataType)) {
-
- if (artifacts != null) {
- addArtifacts(artifacts, window);
- } else {
- ArtifactData artData = ArtifactTransfer.getInstance().nativeToJava(e.currentDataType);
- addArtifacts(artData.getArtifacts(), window);
- }
- } else if (e.data instanceof String[]) {
- addFiles((String[]) e.data, window, shell);
-
- } else if (e.data instanceof String) {
- addURL((String) e.data, window, shell);
- }
- }
-
- private static void ensureLinkValidity(RelationTypeSideSorter group, Artifact artifact) throws OseeCoreException {
- RelationType relationType = group.getRelationType();
- Artifact otherArtifact = group.getArtifact();
-
- Artifact artifactA = group.getSide() == RelationSide.SIDE_A ? artifact : otherArtifact;
- Artifact artifactB = group.getSide() == RelationSide.SIDE_A ? otherArtifact : artifact;
- RelationManager.ensureRelationCanBeAdded(relationType, artifactA, artifactB);
- }
-
- private static void addArtifacts(Artifact[] artifacts, RelationExplorerWindow window) throws OseeCoreException {
- RelationTypeSideSorter group = window.getRelationGroup();
- RelationSide relationSide = group.getSide();
- RelationType relationType = group.getRelationType();
-
- try {
- for (Artifact artifact : artifacts) {
- try {
- Artifact artA = null;
- Artifact artB = null;
- if (relationSide == RelationSide.SIDE_A) {
- artA = artifact;
- artB = group.getArtifact();
- } else {
- artA = group.getArtifact();
- artB = artifact;
- }
- RelationManager.ensureRelationCanBeAdded(relationType, artA, artB);
-
- window.addValid(artifact);
- } catch (IllegalArgumentException ex) {
- window.addInvalidArtifact(artifact, ex.getMessage());
- }
- }
- } catch (OseeArgumentException ex) {
- window.addInvalid("All", ex.getMessage());
- }
- }
-
- private static void addFiles(String[] fileNames, RelationExplorerWindow window, Shell shell) {
- RelationTypeSideSorter group = window.getRelationGroup();
- IFile iFile;
- Artifact artifact;
-
- for (int i = 0; i < fileNames.length; i++) {
- iFile = AWorkspace.getIFile(fileNames[i]);
- String location;
-
- if (iFile == null) {
- try {
- location = new File(fileNames[i]).toURI().toURL().toString();
- } catch (MalformedURLException e) {
- window.addInvalid(fileNames[i], "Malformed URL exception: " + e.getMessage());
- continue;
- }
- } else {
- location = WorkspaceURL.getURL(iFile);
- }
-
- try {
- artifact = getArtifactFromWorkspaceFile(location, shell);
- } catch (Exception ex) {
- window.addInvalid(location, "Runtime exception: " + ex.getMessage());
- continue;
- }
-
- if (artifact == null) {
- window.addInvalid(location, "Artifact has been cancelled");
- } else {
- try {
- ensureLinkValidity(group, artifact);
- window.addValid(artifact);
- } catch (OseeCoreException ex) {
- window.addInvalid(artifact.getName(), ex.getMessage());
- }
-
- }
- }
- }
-
- private static void addURL(String url, RelationExplorerWindow window, Shell shell) {
- RelationTypeSideSorter group = window.getRelationGroup();
- Artifact artifact;
- String location;
-
- try {
- location = new URL(url).toString();
- } catch (MalformedURLException e) {
- window.addInvalid(url, "Malformed Exception : " + e.getLocalizedMessage());
- return;
- }
-
- try {
- artifact = getArtifactFromWorkspaceFile(location, shell);
- } catch (Exception ex) {
- window.addInvalid(location, "Runtime exception: " + ex.getLocalizedMessage());
- return;
- }
-
- if (artifact == null) {
- window.addInvalid(location, "Artifact has been cancelled");
- }
- try {
- ensureLinkValidity(group, artifact);
- window.addValid(artifact);
- } catch (OseeCoreException ex) {
- window.addInvalid(artifact.getName(), ex.getMessage());
- }
- }
-
- public static Artifact getArtifactFromWorkspaceFile(String location, Shell shell) throws OseeCoreException {
- Artifact artifact = null;
- Branch branch = BranchSelectionDialog.getBranchFromUser();
- if (branch != null) {
- try {
+/*******************************************************************************
+ * 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.skynet;
+
+import java.io.File;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.Collection;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.window.Window;
+import org.eclipse.osee.framework.core.enums.CoreAttributeTypes;
+import org.eclipse.osee.framework.core.enums.RelationSide;
+import org.eclipse.osee.framework.core.exception.ArtifactDoesNotExist;
+import org.eclipse.osee.framework.core.exception.OseeArgumentException;
+import org.eclipse.osee.framework.core.exception.OseeCoreException;
+import org.eclipse.osee.framework.core.model.Branch;
+import org.eclipse.osee.framework.core.model.type.ArtifactType;
+import org.eclipse.osee.framework.core.model.type.RelationType;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.skynet.core.artifact.ArtifactData;
+import org.eclipse.osee.framework.skynet.core.artifact.ArtifactTypeManager;
+import org.eclipse.osee.framework.skynet.core.artifact.WorkspaceURL;
+import org.eclipse.osee.framework.skynet.core.artifact.search.ArtifactQuery;
+import org.eclipse.osee.framework.skynet.core.relation.RelationManager;
+import org.eclipse.osee.framework.skynet.core.relation.RelationTypeSideSorter;
+import org.eclipse.osee.framework.ui.skynet.artifact.ArtifactTransfer;
+import org.eclipse.osee.framework.ui.skynet.branch.BranchSelectionDialog;
+import org.eclipse.osee.framework.ui.skynet.relation.explorer.RelationExplorerWindow;
+import org.eclipse.osee.framework.ui.ws.AWorkspace;
+import org.eclipse.swt.dnd.DropTargetEvent;
+import org.eclipse.swt.widgets.Shell;
+
+/**
+ * @author Michael S. Rodgers
+ */
+public class ArtifactDragDropSupport {
+
+ public static void performDragDrop(DropTargetEvent e, RelationExplorerWindow window, Shell shell) throws OseeCoreException {
+ performDragDrop(e, null, window, shell);
+ }
+
+ private static void performDragDrop(DropTargetEvent e, Artifact[] artifacts, RelationExplorerWindow window, Shell shell) throws OseeCoreException {
+
+ if (ArtifactTransfer.getInstance().isSupportedType(e.currentDataType)) {
+
+ if (artifacts != null) {
+ addArtifacts(artifacts, window);
+ } else {
+ ArtifactData artData = ArtifactTransfer.getInstance().nativeToJava(e.currentDataType);
+ addArtifacts(artData.getArtifacts(), window);
+ }
+ } else if (e.data instanceof String[]) {
+ addFiles((String[]) e.data, window, shell);
+
+ } else if (e.data instanceof String) {
+ addURL((String) e.data, window, shell);
+ }
+ }
+
+ private static void ensureLinkValidity(RelationTypeSideSorter group, Artifact artifact) throws OseeCoreException {
+ RelationType relationType = group.getRelationType();
+ Artifact otherArtifact = group.getArtifact();
+
+ Artifact artifactA = group.getSide() == RelationSide.SIDE_A ? artifact : otherArtifact;
+ Artifact artifactB = group.getSide() == RelationSide.SIDE_A ? otherArtifact : artifact;
+ RelationManager.ensureRelationCanBeAdded(relationType, artifactA, artifactB);
+ }
+
+ private static void addArtifacts(Artifact[] artifacts, RelationExplorerWindow window) throws OseeCoreException {
+ RelationTypeSideSorter group = window.getRelationGroup();
+ RelationSide relationSide = group.getSide();
+ RelationType relationType = group.getRelationType();
+
+ try {
+ for (Artifact artifact : artifacts) {
+ try {
+ Artifact artA = null;
+ Artifact artB = null;
+ if (relationSide == RelationSide.SIDE_A) {
+ artA = artifact;
+ artB = group.getArtifact();
+ } else {
+ artA = group.getArtifact();
+ artB = artifact;
+ }
+ RelationManager.ensureRelationCanBeAdded(relationType, artA, artB);
+
+ window.addValid(artifact);
+ } catch (IllegalArgumentException ex) {
+ window.addInvalidArtifact(artifact, ex.getMessage());
+ }
+ }
+ } catch (OseeArgumentException ex) {
+ window.addInvalid("All", ex.getMessage());
+ }
+ }
+
+ private static void addFiles(String[] fileNames, RelationExplorerWindow window, Shell shell) {
+ RelationTypeSideSorter group = window.getRelationGroup();
+ IFile iFile;
+ Artifact artifact;
+
+ for (int i = 0; i < fileNames.length; i++) {
+ iFile = AWorkspace.getIFile(fileNames[i]);
+ String location;
+
+ if (iFile == null) {
+ try {
+ location = new File(fileNames[i]).toURI().toURL().toString();
+ } catch (MalformedURLException e) {
+ window.addInvalid(fileNames[i], "Malformed URL exception: " + e.getMessage());
+ continue;
+ }
+ } else {
+ location = WorkspaceURL.getURL(iFile);
+ }
+
+ try {
+ artifact = getArtifactFromWorkspaceFile(location, shell);
+ } catch (Exception ex) {
+ window.addInvalid(location, "Runtime exception: " + ex.getMessage());
+ continue;
+ }
+
+ if (artifact == null) {
+ window.addInvalid(location, "Artifact has been cancelled");
+ } else {
+ try {
+ ensureLinkValidity(group, artifact);
+ window.addValid(artifact);
+ } catch (OseeCoreException ex) {
+ window.addInvalid(artifact.getName(), ex.getMessage());
+ }
+
+ }
+ }
+ }
+
+ private static void addURL(String url, RelationExplorerWindow window, Shell shell) {
+ RelationTypeSideSorter group = window.getRelationGroup();
+ Artifact artifact;
+ String location;
+
+ try {
+ location = new URL(url).toString();
+ } catch (MalformedURLException e) {
+ window.addInvalid(url, "Malformed Exception : " + e.getLocalizedMessage());
+ return;
+ }
+
+ try {
+ artifact = getArtifactFromWorkspaceFile(location, shell);
+ } catch (Exception ex) {
+ window.addInvalid(location, "Runtime exception: " + ex.getLocalizedMessage());
+ return;
+ }
+
+ if (artifact == null) {
+ window.addInvalid(location, "Artifact has been cancelled");
+ }
+ try {
+ ensureLinkValidity(group, artifact);
+ window.addValid(artifact);
+ } catch (OseeCoreException ex) {
+ window.addInvalid(artifact.getName(), ex.getMessage());
+ }
+ }
+
+ public static Artifact getArtifactFromWorkspaceFile(String location, Shell shell) throws OseeCoreException {
+ Artifact artifact = null;
+ Branch branch = BranchSelectionDialog.getBranchFromUser();
+ if (branch != null) {
+ try {
artifact = ArtifactQuery.getArtifactFromAttribute(CoreAttributeTypes.ContentUrl, location, branch);
- } catch (ArtifactDoesNotExist ex) {
- Collection<ArtifactType> artifactTypes =
+ } catch (ArtifactDoesNotExist ex) {
+ Collection<ArtifactType> artifactTypes =
ArtifactTypeManager.getArtifactTypesFromAttributeType(CoreAttributeTypes.ContentUrl, branch);
- ArtifactTypeDialog dialog =
- new ArtifactTypeDialog(shell, "Artifact Types", null,
- "No Artifact could be found for this file. To create one, please select an artfact type.",
- MessageDialog.QUESTION, new String[] {"OK", "Cancel"}, 0, artifactTypes);
-
- if (dialog.open() == Window.OK) {
- artifact = ArtifactTypeManager.makeNewArtifact(dialog.getArtifactType(), branch);
+ ArtifactTypeDialog dialog =
+ new ArtifactTypeDialog(shell, "Artifact Types", null,
+ "No Artifact could be found for this file. To create one, please select an artfact type.",
+ MessageDialog.QUESTION, new String[] {"OK", "Cancel"}, 0, artifactTypes);
+
+ if (dialog.open() == Window.OK) {
+ artifact = ArtifactTypeManager.makeNewArtifact(dialog.getArtifactType(), branch);
artifact.setSoleAttributeValue(CoreAttributeTypes.ContentUrl, location);
artifact.setName(new File(location).getName());
- }
- }
- }
-
- return artifact;
- }
-}
+ }
+ }
+ }
+
+ return artifact;
+ }
+}
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 e28cec23c1a..f5ed7cda888 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
@@ -1,1566 +1,1564 @@
-/*******************************************************************************
- * 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.skynet;
-
-import static org.eclipse.osee.framework.core.enums.CoreArtifactTypes.RootArtifact;
-import static org.eclipse.osee.framework.skynet.core.artifact.DeletionFlag.EXCLUDE_DELETED;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Set;
-import java.util.logging.Level;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.jobs.IJobChangeEvent;
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.core.runtime.jobs.JobChangeAdapter;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.IToolBarManager;
-import org.eclipse.jface.viewers.AbstractTreeViewer;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.ISelectionProvider;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.jface.window.Window;
-import org.eclipse.osee.framework.access.AccessControlManager;
-import org.eclipse.osee.framework.core.enums.CoreRelationTypes;
-import org.eclipse.osee.framework.core.exception.OseeCoreException;
-import org.eclipse.osee.framework.core.exception.OseeStateException;
-import org.eclipse.osee.framework.core.model.Branch;
-import org.eclipse.osee.framework.core.model.type.ArtifactType;
-import org.eclipse.osee.framework.core.operation.AbstractOperation;
-import org.eclipse.osee.framework.core.operation.IOperation;
-import org.eclipse.osee.framework.core.operation.Operations;
-import org.eclipse.osee.framework.core.util.Conditions;
-import org.eclipse.osee.framework.jdk.core.type.HashCollection;
-import org.eclipse.osee.framework.jdk.core.util.GUID;
-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.plugin.core.util.Jobs;
-import org.eclipse.osee.framework.skynet.core.OseeSystemArtifacts;
-import org.eclipse.osee.framework.skynet.core.UserManager;
-import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
-import org.eclipse.osee.framework.skynet.core.artifact.ArtifactTypeManager;
-import org.eclipse.osee.framework.skynet.core.artifact.BranchManager;
-import org.eclipse.osee.framework.skynet.core.artifact.IBranchProvider;
-import org.eclipse.osee.framework.skynet.core.artifact.search.ArtifactQuery;
-import org.eclipse.osee.framework.skynet.core.event.AccessControlEventType;
-import org.eclipse.osee.framework.skynet.core.event.BranchEventType;
-import org.eclipse.osee.framework.skynet.core.event.FrameworkTransactionData;
-import org.eclipse.osee.framework.skynet.core.event.FrameworkTransactionData.ChangeType;
-import org.eclipse.osee.framework.skynet.core.event.IAccessControlEventListener;
-import org.eclipse.osee.framework.skynet.core.event.IArtifactsChangeTypeEventListener;
-import org.eclipse.osee.framework.skynet.core.event.IArtifactsPurgedEventListener;
-import org.eclipse.osee.framework.skynet.core.event.IBranchEventListener;
-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.skynet.core.event2.AccessControlEvent;
-import org.eclipse.osee.framework.skynet.core.event2.BranchEvent;
-import org.eclipse.osee.framework.skynet.core.event2.filter.IEventFilter;
-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.OseeUiActivator;
-import org.eclipse.osee.framework.ui.plugin.util.AWorkbench;
-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;
-import org.eclipse.osee.framework.ui.skynet.artifact.ArtifactNameConflictHandler;
-import org.eclipse.osee.framework.ui.skynet.artifact.ArtifactPasteOperation;
-import org.eclipse.osee.framework.ui.skynet.artifact.massEditor.MassArtifactEditor;
-import org.eclipse.osee.framework.ui.skynet.branch.BranchSelectionDialog;
-import org.eclipse.osee.framework.ui.skynet.change.ChangeUiUtil;
-import org.eclipse.osee.framework.ui.skynet.dialogs.ArtifactPasteSpecialDialog;
-import org.eclipse.osee.framework.ui.skynet.listener.IRebuildMenuListener;
-import org.eclipse.osee.framework.ui.skynet.menu.ArtifactTreeViewerGlobalMenuHelper;
-import org.eclipse.osee.framework.ui.skynet.menu.GlobalMenu;
-import org.eclipse.osee.framework.ui.skynet.menu.GlobalMenuPermissions;
-import org.eclipse.osee.framework.ui.skynet.menu.IGlobalMenuHelper;
-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.search.QuickSearchView;
-import org.eclipse.osee.framework.ui.skynet.skywalker.SkyWalkerView;
-import org.eclipse.osee.framework.ui.skynet.util.ArtifactClipboard;
-import org.eclipse.osee.framework.ui.skynet.util.ArtifactPasteConfiguration;
-import org.eclipse.osee.framework.ui.skynet.util.DbConnectionExceptionComposite;
-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;
-import org.eclipse.osee.framework.ui.swt.Widgets;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.StackLayout;
-import org.eclipse.swt.custom.TreeEditor;
-import org.eclipse.swt.events.DisposeEvent;
-import org.eclipse.swt.events.DisposeListener;
-import org.eclipse.swt.events.FocusAdapter;
-import org.eclipse.swt.events.FocusEvent;
-import org.eclipse.swt.events.KeyAdapter;
-import org.eclipse.swt.events.KeyEvent;
-import org.eclipse.swt.events.MenuEvent;
-import org.eclipse.swt.events.MenuListener;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.graphics.Font;
-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.Event;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Listener;
-import org.eclipse.swt.widgets.Menu;
-import org.eclipse.swt.widgets.MenuItem;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.swt.widgets.Tree;
-import org.eclipse.swt.widgets.TreeItem;
-import org.eclipse.ui.IMemento;
-import org.eclipse.ui.ISharedImages;
-import org.eclipse.ui.IViewPart;
-import org.eclipse.ui.IViewReference;
-import org.eclipse.ui.IViewSite;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.actions.ExportResourcesAction;
-import org.eclipse.ui.actions.ImportResourcesAction;
-import org.eclipse.ui.part.ViewPart;
-import org.eclipse.ui.progress.UIJob;
-
-/**
- * <REM2>
- *
- * @author Ryan D. Brooks
- */
-public class ArtifactExplorer extends ViewPart implements IArtifactExplorerEventHandler, IRebuildMenuListener, IAccessControlEventListener, IFrameworkTransactionEventListener, IBranchEventListener, IArtifactsPurgedEventListener, IArtifactsChangeTypeEventListener, IActionable, ISelectionProvider, IBranchProvider {
- public static final String VIEW_ID = "org.eclipse.osee.framework.ui.skynet.ArtifactExplorer";
- private static final String ROOT_GUID = "artifact.explorer.last.root_guid";
- private static final String ROOT_BRANCH = "artifact.explorer.last.root_branch";
- private static final ArtifactClipboard artifactClipboard = new ArtifactClipboard(VIEW_ID);
- private static final LinkedList<Tree> trees = new LinkedList<Tree>();
-
- private TreeViewer treeViewer;
- private Action upAction;
- private Artifact explorerRoot;
- private MenuItem openMenuItem;
- private MenuItem massEditMenuItem;
- private MenuItem skywalkerMenuItem;
- private MenuItem createMenuItem;
- private MenuItem openWithMenuItem;
- private MenuItem accessControlMenuItem;
- private MenuItem lockMenuItem;
- private MenuItem goIntoMenuItem;
- private MenuItem copyMenuItem;
- private MenuItem pasteMenuItem;
- private MenuItem pasteSpecialMenuItem;
- private MenuItem renameArtifactMenuItem;
- private MenuItem refreshMenuItem;
- private MenuItem findOnAnotherBranch;
- private NeedArtifactMenuListener needArtifactListener;
- private NeedProjectMenuListener needProjectListener;
- private Tree myTree;
- private TreeEditor myTreeEditor;
- private Text myTextBeingRenamed;
- private Action newArtifactExplorer;
- private Action collapseAllAction;
- private Action showChangeReport;
- private XBranchSelectWidget branchSelect;
- private Branch branch;
- private IGlobalMenuHelper globalMenuHelper;
-
- private Composite stackComposite;
- private Control branchUnreadableWarning;
- private StackLayout stackLayout;
- private final ArtifactDecorator artifactDecorator = new ArtifactDecorator(
- SkynetGuiPlugin.ARTIFACT_EXPLORER_ATTRIBUTES_PREF);
-
- public static void explore(Collection<Artifact> artifacts) {
- explore(artifacts, AWorkbench.getActivePage());
- }
-
- public static void explore(Collection<Artifact> artifacts, IWorkbenchPage page) {
- Artifact sampleArtifact = null;
- Branch inputBranch = null;
- if (artifacts != null && !artifacts.isEmpty()) {
- sampleArtifact = artifacts.iterator().next();
- inputBranch = sampleArtifact.getBranch();
- }
- ArtifactExplorer artifactExplorer = findView(inputBranch, page);
-
- artifactExplorer.setPartName("Artifacts");
- artifactExplorer.setContentDescription("These artifacts could not be handled");
- artifactExplorer.treeViewer.setInput(artifacts);
- artifactExplorer.initializeSelectionBox();
- }
-
- private static ArtifactExplorer findView(Branch inputBranch, IWorkbenchPage page) {
- for (IViewReference view : page.getViewReferences()) {
- if (view.getId().equals(ArtifactExplorer.VIEW_ID)) {
- if (view.getView(false) != null && inputBranch.equals(((ArtifactExplorer) view.getView(false)).branch)) {
- try {
- return (ArtifactExplorer) page.showView(view.getId(), view.getSecondaryId(),
- IWorkbenchPage.VIEW_ACTIVATE);
- } catch (Exception ex) {
- throw new RuntimeException(ex);
- }
- }
- }
- }
- try {
- ArtifactExplorer explorer =
- (ArtifactExplorer) page.showView(ArtifactExplorer.VIEW_ID, GUID.create(), IWorkbenchPage.VIEW_ACTIVATE);
- explorer.explore(OseeSystemArtifacts.getDefaultHierarchyRootArtifact(inputBranch));
- return explorer;
- } catch (Exception ex) {
- throw new RuntimeException(ex);
- }
- }
-
- private Control createDefaultWarning(Composite parent) {
- Composite composite = new Composite(parent, SWT.BORDER);
- composite.setLayout(new GridLayout(2, false));
- composite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
- composite.setBackground(Displays.getSystemColor(SWT.COLOR_INFO_BACKGROUND));
-
- Label image = new Label(composite, SWT.NONE);
- image.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, true));
- image.setImage(ImageManager.getImage(FrameworkImage.LOCKED_KEY));
- image.setBackground(Displays.getSystemColor(SWT.COLOR_INFO_BACKGROUND));
-
- Label label = new Label(composite, SWT.NONE);
- Font font = new Font(PlatformUI.getWorkbench().getDisplay(), "Courier New", 10, SWT.BOLD);
- label.setFont(font);
- label.setForeground(Displays.getSystemColor(SWT.COLOR_DARK_RED));
- label.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, true));
- label.setText("Branch Read Access Denied.\nContact your administrator.");
- label.setBackground(Displays.getSystemColor(SWT.COLOR_INFO_BACKGROUND));
-
- return composite;
- }
-
- private void checkBranchReadable() throws OseeCoreException {
- if (treeViewer == null) {
- return;
- }
- Control control = branchUnreadableWarning;
- if (branch == null || new GlobalMenuPermissions(globalMenuHelper).isBranchReadable(branch)) {
- control = treeViewer.getTree();
- }
- stackLayout.topControl = control;
- stackComposite.layout();
- stackComposite.getParent().layout();
- }
-
- @Override
- public void createPartControl(Composite parent) {
- try {
- if (!DbConnectionExceptionComposite.dbConnectionIsOk(parent)) {
- return;
- }
-
- GridData gridData = new GridData(SWT.FILL, SWT.FILL, true, true);
- gridData.heightHint = 1000;
- gridData.widthHint = 1000;
-
- parent.setLayout(new GridLayout(1, false));
- parent.setLayoutData(gridData);
-
- branchSelect = new XBranchSelectWidget("");
- branchSelect.setDisplayLabel(false);
- branchSelect.setSelection(branch);
- branchSelect.createWidgets(parent, 1);
-
- branchSelect.addListener(new Listener() {
- @Override
- public void handleEvent(Event event) {
- try {
- Branch selectedBranch = branchSelect.getData();
- if (selectedBranch != null) {
- branch = selectedBranch;
- explore(OseeSystemArtifacts.getDefaultHierarchyRootArtifact(branch));
- }
- } catch (Exception ex) {
- OseeLog.log(getClass(), Level.SEVERE, ex);
- }
- }
-
- });
-
- stackComposite = new Composite(parent, SWT.NONE);
- stackLayout = new StackLayout();
- stackComposite.setLayout(stackLayout);
- stackComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
-
- branchUnreadableWarning = createDefaultWarning(stackComposite);
-
- treeViewer = new TreeViewer(stackComposite);
- myTree = treeViewer.getTree();
- Tree tree = treeViewer.getTree();
- final ArtifactExplorer fArtExplorere = this;
- tree.addDisposeListener(new DisposeListener() {
-
- @Override
- public void widgetDisposed(DisposeEvent e) {
- ArtifactExplorerEventManager.remove(fArtExplorere);
- }
- });
- treeViewer.setContentProvider(new ArtifactContentProvider());
-
- treeViewer.setLabelProvider(new ArtifactLabelProvider(artifactDecorator));
- treeViewer.addDoubleClickListener(new ArtifactDoubleClick());
- treeViewer.getControl().setLayoutData(gridData);
-
- // We can not use the hash lookup because an artifact may not have a
- // good equals.
- // This can be added back once the content provider is converted over to
- // use job node.
- treeViewer.setUseHashlookup(false);
-
- treeViewer.addSelectionChangedListener(new SelectionCountChangeListener(getViewSite()));
- globalMenuHelper = new ArtifactTreeViewerGlobalMenuHelper(treeViewer);
-
- IToolBarManager toolbarManager = getViewSite().getActionBars().getToolBarManager();
- createCollapseAllAction(toolbarManager);
- createUpAction(toolbarManager);
- createNewArtifactExplorerAction(toolbarManager);
- createShowChangeReportAction(toolbarManager);
- addOpenQuickSearchAction(toolbarManager);
- toolbarManager.add(new OpenAssociatedArtifactFromBranchProvider(this));
-
- artifactDecorator.setViewer(treeViewer);
- artifactDecorator.addActions(getViewSite().getActionBars().getMenuManager(), this);
-
- getSite().setSelectionProvider(treeViewer);
- addExploreSelection();
-
- setupPopupMenu();
-
- myTreeEditor = new TreeEditor(myTree);
- myTreeEditor.horizontalAlignment = SWT.LEFT;
- myTreeEditor.grabHorizontal = true;
- myTreeEditor.minimumWidth = 50;
-
- new ArtifactExplorerDragAndDrop(treeViewer, VIEW_ID, this);
-
- OseeUiActions.addBugToViewToolbar(this, this, SkynetGuiPlugin.getInstance(), VIEW_ID, "Artifact Explorer");
-
- OseeContributionItem.addTo(this, false);
-
- updateEnablementsEtAl();
- trees.add(tree);
- setHelpContexts();
-
- checkBranchReadable();
- getViewSite().getActionBars().updateActionBars();
-
- } catch (Exception ex) {
- OseeLog.log(SkynetGuiPlugin.class, OseeLevel.SEVERE_POPUP, ex);
- }
-
- OseeEventManager.addListener(this);
- ArtifactExplorerEventManager.add(this);
- }
-
- /**
- * Reveal an artifact in the viewer and select it.
- *
- * @param artifact
- */
- public static void exploreBranch(Branch branch) {
- if (branch != null) {
- IWorkbenchPage page = AWorkbench.getActivePage();
- findView(branch, page);
- }
- }
-
- public void setupPopupMenu() {
-
- Menu popupMenu = new Menu(treeViewer.getTree().getParent());
- needArtifactListener = new NeedArtifactMenuListener();
- needProjectListener = new NeedProjectMenuListener();
- popupMenu.addMenuListener(needArtifactListener);
- popupMenu.addMenuListener(needProjectListener);
-
- createOpenMenuItem(popupMenu);
- createOpenWithMenuItem(popupMenu);
- new MenuItem(popupMenu, SWT.SEPARATOR);
- createFindOnDifferentBranchItem(popupMenu);
- new MenuItem(popupMenu, SWT.SEPARATOR);
- createNewChildMenuItem(popupMenu);
- createGoIntoMenuItem(popupMenu);
- createMassEditMenuItem(popupMenu);
- createSkywalkerMenuItem(popupMenu);
- new MenuItem(popupMenu, SWT.SEPARATOR);
- new GlobalMenu(popupMenu, globalMenuHelper);
- createRenameArtifactMenuItem(popupMenu);
- createRefreshMenuItem(popupMenu);
- new MenuItem(popupMenu, SWT.SEPARATOR);
- createHistoryMenuItem(popupMenu);
- new MenuItem(popupMenu, SWT.SEPARATOR);
- createImportExportMenuItems(popupMenu);
- new MenuItem(popupMenu, SWT.SEPARATOR);
- createLockMenuItem(popupMenu);
- new MenuItem(popupMenu, SWT.SEPARATOR);
- createCopyMenuItem(popupMenu);
- createPasteMenuItem(popupMenu);
- createPasteSpecialMenuItem(popupMenu);
- createExpandAllMenuItem(popupMenu);
- createSelectAllMenuItem(popupMenu);
- new MenuItem(popupMenu, SWT.SEPARATOR);
- createAccessControlMenuItem(popupMenu);
- treeViewer.getTree().setMenu(popupMenu);
- }
-
- private void addOpenQuickSearchAction(IToolBarManager toolbarManager) {
- Action openQuickSearch =
- new Action("Quick Search", ImageManager.getImageDescriptor(FrameworkImage.ARTIFACT_SEARCH)) {
- @Override
- public void run() {
- Job job = new UIJob("Open Quick Search") {
-
- @Override
- public IStatus runInUIThread(IProgressMonitor monitor) {
- IStatus status = Status.OK_STATUS;
- try {
- IViewPart viewPart =
- PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().showView(
- QuickSearchView.VIEW_ID);
- if (viewPart != null) {
- Branch branch = getBranch(monitor);
- if (branch != null) {
- ((QuickSearchView) viewPart).setBranch(branch);
- }
- }
- } catch (Exception ex) {
- status = new Status(IStatus.ERROR, SkynetGuiPlugin.PLUGIN_ID, "Error opening quick search", ex);
- }
- return status;
- }
- };
- Jobs.startJob(job);
- }
- };
- openQuickSearch.setToolTipText("Open Quick Search View");
- toolbarManager.add(openQuickSearch);
- }
-
- protected void createUpAction(IToolBarManager toolbarManager) {
- upAction = new Action("View Parent") {
- @Override
- public void run() {
- try {
- Artifact parent = explorerRoot.getParent();
-
- if (parent == null) {
- return;
- }
-
- Object[] expanded = treeViewer.getExpandedElements();
- Object[] expandedPlus = new Object[expanded.length + 1];
- for (int i = 0; i < expanded.length; i++) {
- expandedPlus[i] = expanded[i];
- }
- expandedPlus[expandedPlus.length - 1] = explorerRoot;
-
- explore(parent);
-
- treeViewer.setExpandedElements(expandedPlus);
- } catch (Exception ex) {
- OseeLog.log(SkynetGuiPlugin.class, OseeLevel.SEVERE_POPUP, ex);
- }
- }
- };
-
- upAction.setImageDescriptor(ImageManager.getImageDescriptor(FrameworkImage.ARROW_UP_YELLOW));
- upAction.setToolTipText("View Parent");
- updateEnablementsEtAl();
- toolbarManager.add(upAction);
- }
-
- private void createNewArtifactExplorerAction(IToolBarManager toolbarManager) {
-
- newArtifactExplorer = new Action("New Artifact Explorer") {
- @Override
- public void run() {
- IWorkbenchPage page = AWorkbench.getActivePage();
- ArtifactExplorer artifactExplorer;
- try {
- artifactExplorer =
- (ArtifactExplorer) page.showView(ArtifactExplorer.VIEW_ID, GUID.create(),
- IWorkbenchPage.VIEW_ACTIVATE);
- artifactExplorer.explore(OseeSystemArtifacts.getDefaultHierarchyRootArtifact(branch));
- artifactExplorer.setExpandedArtifacts(treeViewer.getExpandedElements());
- } catch (Exception ex) {
- throw new RuntimeException(ex);
- }
- }
- };
-
- newArtifactExplorer.setImageDescriptor(ImageManager.getImageDescriptor(FrameworkImage.ARTIFACT_EXPLORER));
- toolbarManager.add(newArtifactExplorer);
- }
-
- private void createShowChangeReportAction(IToolBarManager toolbarManager) {
- showChangeReport = new Action("Show Change Report") {
- @Override
- public void run() {
- try {
- ChangeUiUtil.open(branch);
- } catch (OseeCoreException ex) {
- OseeLog.log(SkynetGuiPlugin.class, Level.SEVERE, ex);
- }
- }
- };
-
- showChangeReport.setImageDescriptor(ImageManager.getImageDescriptor(FrameworkImage.BRANCH_CHANGE));
- toolbarManager.add(showChangeReport);
- }
-
- private void createCollapseAllAction(IToolBarManager toolbarManager) {
- collapseAllAction = new Action("Collapse All") {
- @Override
- public void run() {
- if (treeViewer != null) {
- treeViewer.collapseAll();
- }
- }
- };
-
- collapseAllAction.setImageDescriptor(ImageManager.getImageDescriptor(FrameworkImage.COLLAPSE_ALL));
- toolbarManager.add(collapseAllAction);
- }
-
- private void createOpenWithMenuItem(Menu parentMenu) {
- openWithMenuItem = new MenuItem(parentMenu, SWT.CASCADE);
- openWithMenuItem.setText("&Open With");
- final Menu submenu = new Menu(openWithMenuItem);
- openWithMenuItem.setMenu(submenu);
- parentMenu.addMenuListener(new OpenWithMenuListener(submenu, treeViewer, this));
- }
-
- private void createNewChildMenuItem(Menu parentMenu) {
- createMenuItem = new MenuItem(parentMenu, SWT.PUSH);
- needProjectListener.add(createMenuItem);
- createMenuItem.setText("&New Child");
- createMenuItem.addSelectionListener(new SelectionAdapter() {
- @Override
- public void widgetSelected(SelectionEvent e) {
- super.widgetSelected(e);
- try {
- ArtifactTypeFilteredTreeEntryDialog dialog = getDialog();
- Artifact parent = getParent();
-
- if (dialog.open() == Window.OK) {
- ArtifactType type = dialog.getSelection();
- String name = dialog.getEntryValue();
-
- SkynetTransaction transaction =
- new SkynetTransaction(branch, String.format("Created new %s \"%s\" in artifact explorer",
- type.getName(), name));
- parent.addNewChild(null, type, name);
- parent.persist(transaction);
- transaction.execute();
-
- treeViewer.refresh();
- treeViewer.refresh(false);
- }
- } catch (Exception ex) {
- OseeLog.log(SkynetGuiPlugin.class, OseeLevel.SEVERE_POPUP, ex);
- }
- }
-
- private ArtifactTypeFilteredTreeEntryDialog getDialog() throws OseeCoreException {
- Collection<ArtifactType> artifactTypes =
- ArtifactTypeManager.getConcreteArtifactTypes(branchSelect.getData());
-
- // IAccessPolicyHandlerService policyHandlerService = SkynetGuiPlugin.getInstance().getPolicyHandlerService();
- // policyHandlerService.
-
- ArtifactType rootArtifactType = ArtifactTypeManager.getType(RootArtifact);
- artifactTypes.remove(rootArtifactType);
-
- ArtifactTypeFilteredTreeEntryDialog dialog =
- new ArtifactTypeFilteredTreeEntryDialog("New Child", "Enter name and select Artifact type to create",
- "Artifact Name");
- dialog.setInput(artifactTypes);
- return dialog;
- }
-
- private Artifact getParent() throws OseeCoreException {
- IStructuredSelection selection = (IStructuredSelection) treeViewer.getSelection();
-
- if (selection.size() > 1) {
- throw new OseeCoreException("Please select a single artifact to create a new child.");
- }
-
- Iterator<?> itemsIter = selection.iterator();
- Artifact parent;
- if (!itemsIter.hasNext()) {
- parent = explorerRoot;
- } else {
- parent = (Artifact) itemsIter.next();
- }
-
- return parent;
- }
- });
- }
-
- private void createGoIntoMenuItem(Menu parentMenu) {
- goIntoMenuItem = new MenuItem(parentMenu, SWT.PUSH);
- goIntoMenuItem.setText("&Go Into");
- needArtifactListener.add(goIntoMenuItem);
-
- ArtifactMenuListener listener = new ArtifactMenuListener();
- parentMenu.addMenuListener(listener);
- goIntoMenuItem.addSelectionListener(new SelectionAdapter() {
-
- @Override
- public void widgetSelected(SelectionEvent ev) {
-
- IStructuredSelection selection = (IStructuredSelection) treeViewer.getSelection();
- Iterator<?> itemsIter = selection.iterator();
- if (itemsIter.hasNext()) {
- try {
- Object[] expanded = treeViewer.getExpandedElements();
- explore((Artifact) itemsIter.next());
- treeViewer.setExpandedElements(expanded);
- } catch (Exception ex) {
- OseeLog.log(SkynetGuiPlugin.class, Level.SEVERE, ex);
- }
- }
- }
- });
- }
-
- private void createOpenMenuItem(Menu parentMenu) {
- openMenuItem = new MenuItem(parentMenu, SWT.PUSH);
- openMenuItem.setText("&Open");
- needArtifactListener.add(openMenuItem);
-
- ArtifactMenuListener listener = new ArtifactMenuListener();
- parentMenu.addMenuListener(listener);
- openMenuItem.addSelectionListener(new SelectionAdapter() {
-
- @Override
- public void widgetSelected(SelectionEvent ev) {
- LinkedList<Artifact> selectedItems = new LinkedList<Artifact>();
- TreeViewerUtility.getPreorderSelection(treeViewer, selectedItems);
- RendererManager.openInJob(selectedItems, PresentationType.DEFAULT_OPEN);
- }
- });
- }
-
- private void createFindOnDifferentBranchItem(Menu parentMenu) {
- findOnAnotherBranch = new MenuItem(parentMenu, SWT.PUSH);
- findOnAnotherBranch.setText("Reveal On Another Branch");
- needArtifactListener.add(findOnAnotherBranch);
-
- ArtifactMenuListener listener = new ArtifactMenuListener();
- parentMenu.addMenuListener(listener);
- findOnAnotherBranch.addSelectionListener(new SelectionAdapter() {
-
- @Override
- public void widgetSelected(SelectionEvent ev) {
- LinkedList<Artifact> selectedItems = new LinkedList<Artifact>();
- TreeViewerUtility.getPreorderSelection(treeViewer, selectedItems);
- Branch branch = BranchSelectionDialog.getBranchFromUser();
- if (branch != null) {
- for (Artifact artifact : selectedItems) {
- try {
- ArtifactExplorer.revealArtifact(ArtifactQuery.getArtifactFromId(artifact.getArtId(), branch));
- } catch (OseeCoreException ex) {
- OseeLog.log(
- SkynetGuiPlugin.class,
- OseeLevel.SEVERE_POPUP,
- String.format("Could not find Artifact \'%s\' on Branch \'%s\'", artifact.getName(),
- branch.getName()));
- }
- }
-
- }
- }
- });
- }
-
- private void createMassEditMenuItem(Menu parentMenu) {
- massEditMenuItem = new MenuItem(parentMenu, SWT.PUSH);
- massEditMenuItem.setText("Mass Edit");
- needArtifactListener.add(massEditMenuItem);
-
- ArtifactMenuListener listener = new ArtifactMenuListener();
- parentMenu.addMenuListener(listener);
- massEditMenuItem.addSelectionListener(new SelectionAdapter() {
-
- @Override
- public void widgetSelected(SelectionEvent ev) {
- LinkedList<Artifact> selectedItems = new LinkedList<Artifact>();
- TreeViewerUtility.getPreorderSelection(treeViewer, selectedItems);
- MassArtifactEditor.editArtifacts("", selectedItems);
- }
- });
- }
-
- private void createRefreshMenuItem(Menu parentMenu) {
- refreshMenuItem = new MenuItem(parentMenu, SWT.PUSH);
- refreshMenuItem.setText("Refresh");
- needArtifactListener.add(refreshMenuItem);
-
- ArtifactMenuListener listener = new ArtifactMenuListener();
- parentMenu.addMenuListener(listener);
- refreshMenuItem.addSelectionListener(new SelectionAdapter() {
-
- @Override
- public void widgetSelected(SelectionEvent mySelectionEvent) {
- LinkedList<Artifact> selectedItems = new LinkedList<Artifact>();
- TreeViewerUtility.getPreorderSelection(treeViewer, selectedItems);
- for (Artifact artifact : selectedItems) {
- treeViewer.refresh(artifact);
- }
- }
- });
- }
-
- private void createRenameArtifactMenuItem(Menu parentMenu) {
- renameArtifactMenuItem = new MenuItem(parentMenu, SWT.PUSH);
- renameArtifactMenuItem.setText("Rename Artifact");
- needArtifactListener.add(renameArtifactMenuItem);
-
- ArtifactMenuListener listener = new ArtifactMenuListener();
- parentMenu.addMenuListener(listener);
- renameArtifactMenuItem.addSelectionListener(new SelectionAdapter() {
-
- @Override
- public void widgetSelected(SelectionEvent mySelectionEvent) {
- handleRenameArtifactSelectionEvent(mySelectionEvent);
- }
- });
- }
-
- private void handleRenameArtifactSelectionEvent(SelectionEvent mySelectionEvent) {
- // Clean up any previous editor control
- Control oldEditor = myTreeEditor.getEditor();
-
- if (oldEditor != null) {
- oldEditor.dispose();
- }
-
- // Identify the selected row, only allow input if there is a single
- // selected row
- TreeItem[] selection = myTree.getSelection();
-
- if (selection.length != 1) {
- return;
- }
-
- final TreeItem myTreeItem = selection[0];
-
- if (myTreeItem == null) {
- return;
- }
- myTextBeingRenamed = new Text(myTree, SWT.BORDER);
- Object myTreeItemObject = myTreeItem.getData();
- myTextBeingRenamed.setText(((Artifact) myTreeItemObject).getName());
- myTextBeingRenamed.addFocusListener(new FocusAdapter() {
- @Override
- public void focusLost(FocusEvent e) {
- updateText(myTextBeingRenamed.getText(), myTreeItem);
- myTextBeingRenamed.dispose();
-
- }
-
- @Override
- public void focusGained(FocusEvent e) {
- // do nothing
- }
- });
-
- myTextBeingRenamed.addKeyListener(new KeyAdapter() {
- @Override
- public void keyReleased(KeyEvent e) {
- if (e.character == SWT.CR) {
- updateText(myTextBeingRenamed.getText(), myTreeItem);
- myTextBeingRenamed.dispose();
- } else if (e.keyCode == SWT.ESC) {
- myTextBeingRenamed.dispose();
- }
- }
- });
- myTextBeingRenamed.selectAll();
- myTextBeingRenamed.setFocus();
- myTreeEditor.setEditor(myTextBeingRenamed, myTreeItem);
- }
-
- private void updateText(String newLabel, TreeItem item) {
- myTreeEditor.getItem().setText(newLabel);
- Object myTreeItemObject = item.getData();
- if (myTreeItemObject instanceof Artifact) {
- Artifact myArtifact = (Artifact) myTreeItemObject;
- try {
- myArtifact.setName(newLabel);
- myArtifact.persist();
- } catch (Exception ex) {
- OseeLog.log(SkynetGuiPlugin.class, OseeLevel.SEVERE_POPUP, ex);
- }
- }
- treeViewer.refresh();
- }
-
- private void createSkywalkerMenuItem(Menu parentMenu) {
- skywalkerMenuItem = new MenuItem(parentMenu, SWT.PUSH);
- skywalkerMenuItem.setText("Sky Walker");
- needArtifactListener.add(skywalkerMenuItem);
-
- ArtifactMenuListener listener = new ArtifactMenuListener();
- parentMenu.addMenuListener(listener);
- skywalkerMenuItem.addSelectionListener(new SelectionAdapter() {
-
- @Override
- public void widgetSelected(SelectionEvent ev) {
- LinkedList<Artifact> selectedItems = new LinkedList<Artifact>();
- TreeViewerUtility.getPreorderSelection(treeViewer, selectedItems);
- SkyWalkerView.exploreArtifact(selectedItems.getFirst());
- }
- });
- }
-
- private void createSelectAllMenuItem(Menu parentMenu) {
- MenuItem menuItem = new MenuItem(parentMenu, SWT.PUSH);
- menuItem.setText("&Select All\tCtrl+A");
- menuItem.addListener(SWT.Selection, new Listener() {
- @Override
- public void handleEvent(org.eclipse.swt.widgets.Event event) {
- treeViewer.getTree().selectAll();
- }
- });
- }
-
- private void createHistoryMenuItem(Menu parentMenu) {
- MenuItem revisionMenuItem = new MenuItem(parentMenu, SWT.PUSH);
- revisionMenuItem.setText("&Show Resource History ");
- revisionMenuItem.addSelectionListener(new SelectionAdapter() {
-
- @Override
- public void widgetSelected(SelectionEvent e) {
- IStructuredSelection selection = (IStructuredSelection) treeViewer.getSelection();
- Artifact selectedArtifact = (Artifact) selection.getFirstElement();
-
- try {
- HistoryView.open(selectedArtifact);
- } catch (Exception ex) {
- OseeLog.log(SkynetGuiPlugin.class, Level.SEVERE, ex);
- }
- }
- });
- }
-
- private void createImportExportMenuItems(Menu parentMenu) {
- MenuItems.createMenuItem(parentMenu, SWT.PUSH, new ImportResourcesAction(getViewSite().getWorkbenchWindow()));
- MenuItems.createMenuItem(parentMenu, SWT.PUSH, new ExportResourcesAction(getViewSite().getWorkbenchWindow()));
- }
-
- private void createAccessControlMenuItem(Menu parentMenu) {
- accessControlMenuItem = new MenuItem(parentMenu, SWT.PUSH);
- accessControlMenuItem.setImage(ImageManager.getImage(FrameworkImage.AUTHENTICATED));
- accessControlMenuItem.setText("&Access Control ");
- // accessControlMenuItem.setEnabled(false);
- accessControlMenuItem.addSelectionListener(new SelectionAdapter() {
-
- @Override
- public void widgetSelected(SelectionEvent e) {
- IStructuredSelection selection = (IStructuredSelection) treeViewer.getSelection();
- Artifact selectedArtifact = (Artifact) selection.getFirstElement();
- try {
- if (selectedArtifact != null) {
- PolicyDialog pd = new PolicyDialog(Displays.getActiveShell(), selectedArtifact);
- pd.open();
- checkBranchReadable();
- }
- } catch (Exception ex) {
- OseeLog.log(SkynetGuiPlugin.class, Level.SEVERE, ex);
- }
- }
- });
- }
-
- private void createLockMenuItem(Menu parentMenu) {
- lockMenuItem = new MenuItem(parentMenu, SWT.PUSH);
- lockMenuItem.addSelectionListener(new SelectionAdapter() {
-
- @Override
- public void widgetSelected(SelectionEvent e) {
- IStructuredSelection selection = (IStructuredSelection) treeViewer.getSelection();
- Iterator<?> iterator = selection.iterator();
- Set<Artifact> lockArtifacts = new HashSet<Artifact>();
- Set<Artifact> unlockArtifacts = new HashSet<Artifact>();
- while (iterator.hasNext()) {
- try {
- Artifact object = (Artifact) iterator.next();
- if (new GlobalMenuPermissions(object).isLocked()) {
- unlockArtifacts.add(object);
- } else {
- lockArtifacts.add(object);
- }
- } catch (Exception ex) {
- OseeLog.log(SkynetGuiPlugin.class, OseeLevel.SEVERE_POPUP, ex);
- }
- }
-
- try {
- AccessControlManager.unLockObjects(unlockArtifacts, UserManager.getUser());
- AccessControlManager.lockObjects(lockArtifacts, UserManager.getUser());
- } catch (Exception ex) {
- OseeLog.log(SkynetGuiPlugin.class, OseeLevel.SEVERE_POPUP, ex);
- }
- }
-
- });
- }
-
- private void createCopyMenuItem(Menu parentMenu) {
- copyMenuItem = new MenuItem(parentMenu, SWT.PUSH);
- copyMenuItem.setImage(PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_TOOL_COPY));
- copyMenuItem.setText("Copy \tCtrl+C");
- copyMenuItem.addSelectionListener(new SelectionAdapter() {
-
- @Override
- public void widgetSelected(SelectionEvent e) {
- performCopy();
- }
- });
- }
-
- private void performCopy() {
- IStructuredSelection selection = (IStructuredSelection) treeViewer.getSelection();
- ArrayList<Artifact> artifactTransferData = new ArrayList<Artifact>();
- ArrayList<String> textTransferData = new ArrayList<String>();
- Artifact artifact;
-
- if (selection != null && !selection.isEmpty()) {
- for (Object object : selection.toArray()) {
- if (object instanceof Artifact) {
- artifact = (Artifact) object;
-
- artifactTransferData.add(artifact);
- textTransferData.add(artifact.getName());
- }
- }
- artifactClipboard.setArtifactsToClipboard(artifactTransferData, textTransferData);
- }
- }
-
- private void createPasteMenuItem(Menu parentMenu) {
- pasteMenuItem = new MenuItem(parentMenu, SWT.PUSH);
- pasteMenuItem.setImage(PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_TOOL_PASTE));
- pasteMenuItem.setText("Paste \tCtrl+V");
- pasteMenuItem.addSelectionListener(new SelectionAdapter() {
-
- @Override
- public void widgetSelected(SelectionEvent e) {
- performPasteOperation(false);
- }
- });
- }
-
- private void createPasteSpecialMenuItem(Menu parentMenu) {
- pasteSpecialMenuItem = new MenuItem(parentMenu, SWT.PUSH);
- pasteSpecialMenuItem.setImage(PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_TOOL_PASTE));
- pasteSpecialMenuItem.setText("Paste Special... \tCtrl+S");
- pasteSpecialMenuItem.addSelectionListener(new SelectionAdapter() {
-
- @Override
- public void widgetSelected(SelectionEvent e) {
- performPasteOperation(true);
- }
-
- });
- }
-
- private void performPasteOperation(boolean isPasteSpecial) {
- boolean performPaste = true;
- Artifact destinationArtifact = null;
- IStructuredSelection selection = (IStructuredSelection) treeViewer.getSelection();
- if (selection != null && !selection.isEmpty()) {
- Object object = selection.getFirstElement();
-
- if (object instanceof Artifact) {
- destinationArtifact = (Artifact) object;
- }
- }
-
- ArtifactPasteConfiguration config = new ArtifactPasteConfiguration();
-
- if (isPasteSpecial) {
- Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();
- List<Artifact> copiedArtifacts = artifactClipboard.getCopiedContents();
- ArtifactPasteSpecialDialog dialog =
- new ArtifactPasteSpecialDialog(shell, config, destinationArtifact, copiedArtifacts);
- performPaste = dialog.open() == Window.OK;
- }
-
- if (performPaste) {
- Operations.executeAsJob(
- new ArtifactPasteOperation(config, destinationArtifact, artifactClipboard.getCopiedContents(),
- new ArtifactNameConflictHandler()), true);
- }
- }
-
- private void createExpandAllMenuItem(Menu parentMenu) {
- MenuItem menuItem = new MenuItem(parentMenu, SWT.PUSH);
- menuItem.setImage(ImageManager.getImage(FrameworkImage.EXPAND_ALL));
- menuItem.setText("Expand All\tCtrl++");
- menuItem.addSelectionListener(new ExpandListener());
- }
-
- public class ExpandListener extends SelectionAdapter {
- @Override
- public void widgetSelected(SelectionEvent event) {
- expandAll((IStructuredSelection) treeViewer.getSelection());
- }
- }
-
- private void expandAll(IStructuredSelection selection) {
- Iterator<?> iter = selection.iterator();
- while (iter.hasNext()) {
- treeViewer.expandToLevel(iter.next(), AbstractTreeViewer.ALL_LEVELS);
- }
- }
-
- @Override
- public void setFocus() {
- if (treeViewer != null) {
- treeViewer.getControl().setFocus();
- }
- }
-
- public void explore(Artifact artifact) {
- if (artifact == null) {
- throw new IllegalArgumentException("Can not explore a null artifact.");
- }
-
- setPartName("Artifact Explorer: " + artifact.getBranch().getShortName());
- if (branch != null && branch != artifact.getBranch()) {
- explore(Arrays.asList(artifact));
- return;
- }
- try {
- checkBranchReadable();
- } catch (OseeCoreException ex) {
- OseeLog.log(SkynetGuiPlugin.class, Level.SEVERE, ex);
- }
- explorerRoot = artifact;
- branch = artifact.getBranch();
-
- initializeSelectionBox();
-
- if (treeViewer != null) {
- Object objects[] = treeViewer.getExpandedElements();
- treeViewer.setInput(explorerRoot);
- setupPopupMenu();
- updateEnablementsEtAl();
- // Attempt to re-expand what was expanded
- treeViewer.setExpandedElements(objects);
- }
- }
-
- public void setExpandedArtifacts(Object... artifacts) {
- if (treeViewer != null) {
- treeViewer.setExpandedElements(artifacts);
- }
- }
-
- private void updateEnablementsEtAl() {
- // The upAction may be null if this viewpart has not been layed out yet
- if (upAction != null) {
- try {
- upAction.setEnabled(explorerRoot != null && explorerRoot.hasParent());
- } catch (OseeCoreException ex) {
- upAction.setEnabled(false);
- OseeLog.log(SkynetGuiPlugin.class, OseeLevel.SEVERE_POPUP, ex);
- }
- }
- }
-
- private class NeedArtifactMenuListener implements MenuListener {
- private final HashCollection<Class<? extends Artifact>, MenuItem> menuItemMap;
-
- public NeedArtifactMenuListener() {
- this.menuItemMap = new HashCollection<Class<? extends Artifact>, MenuItem>();
- }
-
- public void add(MenuItem item) {
- menuItemMap.put(Artifact.class, item);
- }
-
- @Override
- public void menuHidden(MenuEvent e) {
- // do nothing
- }
-
- @Override
- public void menuShown(MenuEvent e) {
- IStructuredSelection selection = (IStructuredSelection) treeViewer.getSelection();
-
- Object obj = selection.getFirstElement();
- if (obj != null) {
- Class<? extends Artifact> selectedClass = obj.getClass().asSubclass(Artifact.class);
-
- for (Class<? extends Artifact> artifactClass : menuItemMap.keySet()) {
- boolean valid = artifactClass.isAssignableFrom(selectedClass);
-
- for (MenuItem item : menuItemMap.getValues(artifactClass)) {
- if (!(item.getData() instanceof Exception)) {
- // Only modify enabling if no error is associated
- item.setEnabled(valid);
- }
- }
- }
- }
- }
- }
-
- private class NeedProjectMenuListener implements MenuListener {
- Collection<MenuItem> items;
-
- public NeedProjectMenuListener() {
- this.items = new LinkedList<MenuItem>();
- }
-
- public void add(MenuItem item) {
- items.add(item);
- }
-
- @Override
- public void menuHidden(MenuEvent e) {
- // do nothing
- }
-
- @Override
- public void menuShown(MenuEvent e) {
- boolean valid = treeViewer.getInput() != null;
- for (MenuItem item : items) {
- if (!(item.getData() instanceof Exception)) {
- // Only modify
- // enabling if no
- // error is
- // associated
- item.setEnabled(valid);
- }
- }
- }
- }
-
- /**
- * Add the selection from the define explorer
- */
- private void addExploreSelection() {
- if (explorerRoot != null) {
- try {
- treeViewer.setInput(explorerRoot);
- initializeSelectionBox();
- } catch (IllegalArgumentException ex) {
- OseeLog.log(SkynetGuiPlugin.class, Level.SEVERE, ex);
- }
- }
- }
-
- /**
- * @author Jeff C. Phillips
- */
- public class ArtifactMenuListener implements MenuListener {
-
- @Override
- public void menuHidden(MenuEvent e) {
- // do nothing
- }
-
- @Override
- public void menuShown(MenuEvent e) {
- // Use this menu listener until all menu items can be moved to
- // GlobaMenu
- try {
- GlobalMenuPermissions permiss = new GlobalMenuPermissions(globalMenuHelper);
-
- lockMenuItem.setText((permiss.isLocked() ? "Unlock: (" + permiss.getSubjectFromLockedObjectName() + ")" : "Lock"));
-
- lockMenuItem.setEnabled(permiss.isWritePermission() && (!permiss.isLocked() || permiss.isAccessToRemoveLock()));
- openMenuItem.setEnabled(permiss.isReadPermission());
- createMenuItem.setEnabled(permiss.isWritePermission());
- openWithMenuItem.setEnabled(permiss.isReadPermission());
- goIntoMenuItem.setEnabled(permiss.isReadPermission());
- copyMenuItem.setEnabled(permiss.isReadPermission());
- pasteMenuItem.setEnabled(permiss.isWritePermission());
- renameArtifactMenuItem.setEnabled(permiss.isWritePermission());
-
- } catch (Exception ex) {
- OseeLog.log(SkynetGuiPlugin.class, OseeLevel.SEVERE_POPUP, ex);
- }
-
- }
- }
-
- @Override
- public void init(IViewSite site, IMemento memento) throws PartInitException {
- super.init(site, memento);
-
- if (OseeUiActivator.areOSEEServicesAvailable().isFalse()) {
- return;
- }
-
- try {
- if (memento != null && memento.getString(ROOT_GUID) != null && memento.getString(ROOT_BRANCH) != null) {
- Branch branch = BranchManager.getBranch(Integer.parseInt(memento.getString(ROOT_BRANCH)));
-
- if (!branch.getArchiveState().isArchived() || AccessControlManager.isOseeAdmin()) {
- Artifact previousArtifact = ArtifactQuery.checkArtifactFromId(memento.getString(ROOT_GUID), branch);
- if (previousArtifact != null) {
- explore(previousArtifact);
- } else {
- /*
- * simply means that the previous artifact that was used as the root for the artiactExplorer does not
- * exist because it was deleted or this workspace was last used with a different branch or database,
- * so let the logic below get the default hierarchy root artifact
- */
- }
- return;
- }
- }
- } catch (Exception ex) {
- OseeLog.log(SkynetGuiPlugin.class, Level.SEVERE, ex);
- }
- }
-
- @Override
- public void saveState(IMemento memento) {
- super.saveState(memento);
- if (explorerRoot != null) {
- memento.putString(ROOT_GUID, explorerRoot.getGuid());
- memento.putString(ROOT_BRANCH, String.valueOf(explorerRoot.getBranch().getId()));
- }
- }
-
- @Override
- public void dispose() {
- OseeEventManager.removeListener(this);
- ArtifactExplorerEventManager.remove(this);
- super.dispose();
- }
-
- @Override
- public String getActionDescription() {
- return "";
- }
-
- @Override
- public void addSelectionChangedListener(ISelectionChangedListener listener) {
- treeViewer.addSelectionChangedListener(listener);
- }
-
- @Override
- public ISelection getSelection() {
- return treeViewer.getSelection();
- }
-
- @Override
- public void removeSelectionChangedListener(ISelectionChangedListener listener) {
- treeViewer.removeSelectionChangedListener(listener);
- }
-
- @Override
- public void setSelection(ISelection selection) {
- treeViewer.setSelection(selection);
- }
-
- private void setHelpContexts() {
- SkynetGuiPlugin.getInstance().setHelp(treeViewer.getControl(), "artifact_explorer_tree_viewer",
- "org.eclipse.osee.framework.help.ui");
- }
-
- @Override
- public void handleArtifactsPurgedEvent(Sender sender, LoadedArtifacts loadedArtifacts) {
- try {
- if (loadedArtifacts.isNotForBranch(branch)) {
- return;
- }
- } catch (Exception ex) {
- OseeLog.log(SkynetGuiPlugin.class, Level.SEVERE, ex);
- }
- Displays.ensureInDisplayThread(new Runnable() {
- @Override
- public void run() {
- treeViewer.refresh();
- }
- });
- }
-
- @Override
- public void handleArtifactsChangeTypeEvent(Sender sender, int toArtifactTypeId, final LoadedArtifacts loadedArtifacts) {
- try {
- if (loadedArtifacts.isNotForBranch(branch)) {
- return;
- }
- } catch (Exception ex) {
- OseeLog.log(SkynetGuiPlugin.class, Level.SEVERE, ex);
- }
- Displays.ensureInDisplayThread(new Runnable() {
- @Override
- public void run() {
- try {
- Set<Artifact> parents = new HashSet<Artifact>();
- for (Artifact art : loadedArtifacts.getLoadedArtifacts()) {
- if (art.getParent() != null) {
- parents.add(art.getParent());
- }
- }
- for (Artifact art : parents) {
- treeViewer.refresh(art);
- }
- } catch (Exception ex) {
- OseeLog.log(SkynetGuiPlugin.class, Level.SEVERE, ex);
- }
- }
- });
- }
-
- @Override
- public void handleFrameworkTransactionEvent(Sender sender, final FrameworkTransactionData transData) {
- if (branch == null || transData.branchId != branch.getId()) {
- return;
- }
-
- Displays.ensureInDisplayThread(new Runnable() {
- @Override
- public void run() {
- if (treeViewer != null && Widgets.isAccessible(treeViewer.getTree())) {
- for (Artifact art : transData.cacheDeletedArtifacts) {
- treeViewer.remove(art);
- }
- try {
- if (!transData.cacheDeletedArtifacts.isEmpty()) {
- getTreeViewer().remove(
- transData.cacheDeletedArtifacts.toArray(new Object[transData.cacheDeletedArtifacts.size()]));
- }
- for (Artifact artifact : transData.cacheChangedArtifacts) {
- // Don't refresh deleted artifacts
- if (artifact.isDeleted()) {
- continue;
- }
- getTreeViewer().update(artifact, null);
- }
-
- treeViewer.update(
- transData.getArtifactsInRelations(ChangeType.Changed,
- CoreRelationTypes.Default_Hierarchical__Child).toArray(), null);
- } catch (Exception ex) {
- OseeLog.log(SkynetGuiPlugin.class, Level.SEVERE, ex);
- }
- try {
- for (Artifact art : transData.getArtifactsInRelations(ChangeType.Added,
- CoreRelationTypes.Default_Hierarchical__Child)) {
- if (!art.isDeleted() && art.getParent() != null) {
- treeViewer.refresh(art.getParent());
- }
- }
- } catch (Exception ex) {
- OseeLog.log(SkynetGuiPlugin.class, Level.SEVERE, ex);
- }
- }
- }
- });
- }
-
- @Override
- public void handleBranchEventREM1(Sender sender, BranchEventType branchModType, final int branchId) {
- if (branchModType == BranchEventType.Committed && branch != null && branch.getId() == branchId) {
- SkynetViews.closeView(VIEW_ID, getViewSite().getSecondaryId());
- }
- }
-
- @Override
- public void handleAccessControlArtifactsEvent(Sender sender, AccessControlEvent accessControlEvent) {
- try {
- if (!accessControlEvent.isForBranch(branch)) {
- return;
- }
- if (accessControlEvent.getEventType() == AccessControlEventType.UserAuthenticated ||
- //
- accessControlEvent.getEventType() == AccessControlEventType.ArtifactsUnlocked ||
- //
- accessControlEvent.getEventType() == AccessControlEventType.ArtifactsLocked) {
- Displays.ensureInDisplayThread(new Runnable() {
- @Override
- public void run() {
- treeViewer.refresh();
- }
- });
- }
- } catch (Exception ex) {
- OseeLog.log(SkynetGuiPlugin.class, Level.SEVERE, ex);
- }
- }
-
- @Override
- public void rebuildMenu() {
- setupPopupMenu();
- }
-
- public void setBranch(Branch branch) {
- this.branch = branch;
- }
-
- public void initializeSelectionBox() {
- if (branch != null && branchSelect != null && !branch.equals(branchSelect.getData())) {
- branchSelect.setSelection(branch);
- try {
- checkBranchReadable();
- } catch (OseeCoreException ex) {
- OseeLog.log(SkynetGuiPlugin.class, Level.SEVERE, ex);
- }
- }
- }
-
- @Override
- public Branch getBranch(IProgressMonitor monitor) {
- return branch;
- }
-
- /**
- * Reveal an artifact in the viewer and select it.
- *
- * @param artifact
- */
- public static void revealArtifact(Artifact artifact) {
- final ArtifactData data = new ArtifactData(artifact);
- IOperation operation = new CheckArtifactBeforeReveal(data);
- Operations.executeAsJob(operation, true, Job.SHORT, new JobChangeAdapter() {
-
- @Override
- public void done(IJobChangeEvent event) {
- IStatus status = event.getResult();
- if (status.isOK()) {
- Job uiJob = new UIJob("Reveal in Artifact Explorer") {
-
- @Override
- public IStatus runInUIThread(IProgressMonitor monitor) {
- Artifact artifact = data.getArtifact();
- IWorkbenchPage page = AWorkbench.getActivePage();
- ArtifactExplorer artifactExplorer = findView(artifact.getBranch(), page);
- artifactExplorer.treeViewer.setSelection(new StructuredSelection(artifact), true);
- return Status.OK_STATUS;
- }
- };
- Jobs.startJob(uiJob);
- }
- }
- });
- }
-
- private static final class ArtifactData {
- private Artifact artifact;
-
- ArtifactData(Artifact artifact) {
- this.artifact = artifact;
- }
-
- Artifact getArtifact() {
- return artifact;
- }
-
- void setArtifact(Artifact artifact) {
- this.artifact = artifact;
- }
- }
-
- private static final class CheckArtifactBeforeReveal extends AbstractOperation {
-
- private final ArtifactData artifactData;
-
- public CheckArtifactBeforeReveal(ArtifactData artifactData) {
- super("Check Artifact Before Reveal", SkynetGuiPlugin.PLUGIN_ID);
- this.artifactData = artifactData;
- }
-
- @Override
- protected void doWork(IProgressMonitor monitor) throws Exception {
- Conditions.checkNotNull(artifactData, "artifact data");
-
- Artifact artifact = artifactData.getArtifact();
- Conditions.checkNotNull(artifactData, "artifact");
- if (artifact.isDeleted()) {
- throw new OseeStateException("The artifact " + artifact.getName() + " has been deleted.");
- } else {
- if (artifact.isHistorical()) {
- artifactData.setArtifact(ArtifactQuery.getArtifactFromId(artifact.getArtId(), artifact.getBranch(),
- EXCLUDE_DELETED));
- }
-
- Artifact root = OseeSystemArtifacts.getDefaultHierarchyRootArtifact(artifact.getBranch());
- Artifact artifactRoot = artifact.getArtifactRoot();
-
- if (!root.equals(artifactRoot)) {
- String artifactRootName = artifactRoot != null ? artifactRoot.getName() : artifact.getName();
- throw new OseeStateException(
- "The artifact " + artifact.getName() + " is rooted on an orphan tree at " + artifactRootName);
- }
- }
- }
- }
-
- @Override
- public void handleBranchEvent(Sender sender, final BranchEvent branchEvent) {
- if (branchEvent.getEventType() == BranchEventType.Committed && branch != null && branch.getGuid().equals(
- branchEvent.getBranchGuid())) {
- SkynetViews.closeView(VIEW_ID, getViewSite().getSecondaryId());
- }
- }
-
- public TreeViewer getTreeViewer() {
- return treeViewer;
- }
-
- public void setTreeViewer(TreeViewer treeViewer) {
- this.treeViewer = treeViewer;
- }
-
- @Override
- public ArtifactExplorer getArtifactExplorer() {
- return this;
- }
-
- @Override
- public boolean isDisposed() {
- return treeViewer.getTree() == null || treeViewer.getTree().isDisposed();
- }
-
- @Override
- public List<? extends IEventFilter> getEventFilters() {
- if (branch != null) {
- return OseeEventManager.getEventFiltersForBranch(branch);
- }
- return null;
- }
-
-}
+/*******************************************************************************
+ * 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.skynet;
+
+import static org.eclipse.osee.framework.core.enums.CoreArtifactTypes.RootArtifact;
+import static org.eclipse.osee.framework.skynet.core.artifact.DeletionFlag.EXCLUDE_DELETED;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Set;
+import java.util.logging.Level;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.IJobChangeEvent;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.core.runtime.jobs.JobChangeAdapter;
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.IToolBarManager;
+import org.eclipse.jface.viewers.AbstractTreeViewer;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.ISelectionProvider;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.jface.window.Window;
+import org.eclipse.osee.framework.access.AccessControlManager;
+import org.eclipse.osee.framework.core.enums.CoreRelationTypes;
+import org.eclipse.osee.framework.core.exception.OseeCoreException;
+import org.eclipse.osee.framework.core.exception.OseeStateException;
+import org.eclipse.osee.framework.core.model.Branch;
+import org.eclipse.osee.framework.core.model.type.ArtifactType;
+import org.eclipse.osee.framework.core.operation.AbstractOperation;
+import org.eclipse.osee.framework.core.operation.IOperation;
+import org.eclipse.osee.framework.core.operation.Operations;
+import org.eclipse.osee.framework.core.util.Conditions;
+import org.eclipse.osee.framework.jdk.core.type.HashCollection;
+import org.eclipse.osee.framework.jdk.core.util.GUID;
+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.plugin.core.util.Jobs;
+import org.eclipse.osee.framework.skynet.core.OseeSystemArtifacts;
+import org.eclipse.osee.framework.skynet.core.UserManager;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.skynet.core.artifact.ArtifactTypeManager;
+import org.eclipse.osee.framework.skynet.core.artifact.BranchManager;
+import org.eclipse.osee.framework.skynet.core.artifact.IBranchProvider;
+import org.eclipse.osee.framework.skynet.core.artifact.search.ArtifactQuery;
+import org.eclipse.osee.framework.skynet.core.event.AccessControlEventType;
+import org.eclipse.osee.framework.skynet.core.event.BranchEventType;
+import org.eclipse.osee.framework.skynet.core.event.FrameworkTransactionData;
+import org.eclipse.osee.framework.skynet.core.event.FrameworkTransactionData.ChangeType;
+import org.eclipse.osee.framework.skynet.core.event.IAccessControlEventListener;
+import org.eclipse.osee.framework.skynet.core.event.IArtifactsChangeTypeEventListener;
+import org.eclipse.osee.framework.skynet.core.event.IArtifactsPurgedEventListener;
+import org.eclipse.osee.framework.skynet.core.event.IBranchEventListener;
+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.skynet.core.event2.AccessControlEvent;
+import org.eclipse.osee.framework.skynet.core.event2.BranchEvent;
+import org.eclipse.osee.framework.skynet.core.event2.filter.IEventFilter;
+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.OseeUiActivator;
+import org.eclipse.osee.framework.ui.plugin.util.AWorkbench;
+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;
+import org.eclipse.osee.framework.ui.skynet.artifact.ArtifactNameConflictHandler;
+import org.eclipse.osee.framework.ui.skynet.artifact.ArtifactPasteOperation;
+import org.eclipse.osee.framework.ui.skynet.artifact.massEditor.MassArtifactEditor;
+import org.eclipse.osee.framework.ui.skynet.branch.BranchSelectionDialog;
+import org.eclipse.osee.framework.ui.skynet.change.ChangeUiUtil;
+import org.eclipse.osee.framework.ui.skynet.dialogs.ArtifactPasteSpecialDialog;
+import org.eclipse.osee.framework.ui.skynet.listener.IRebuildMenuListener;
+import org.eclipse.osee.framework.ui.skynet.menu.ArtifactTreeViewerGlobalMenuHelper;
+import org.eclipse.osee.framework.ui.skynet.menu.GlobalMenu;
+import org.eclipse.osee.framework.ui.skynet.menu.GlobalMenuPermissions;
+import org.eclipse.osee.framework.ui.skynet.menu.IGlobalMenuHelper;
+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.search.QuickSearchView;
+import org.eclipse.osee.framework.ui.skynet.skywalker.SkyWalkerView;
+import org.eclipse.osee.framework.ui.skynet.util.ArtifactClipboard;
+import org.eclipse.osee.framework.ui.skynet.util.ArtifactPasteConfiguration;
+import org.eclipse.osee.framework.ui.skynet.util.DbConnectionExceptionComposite;
+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;
+import org.eclipse.osee.framework.ui.swt.Widgets;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.StackLayout;
+import org.eclipse.swt.custom.TreeEditor;
+import org.eclipse.swt.events.DisposeEvent;
+import org.eclipse.swt.events.DisposeListener;
+import org.eclipse.swt.events.FocusAdapter;
+import org.eclipse.swt.events.FocusEvent;
+import org.eclipse.swt.events.KeyAdapter;
+import org.eclipse.swt.events.KeyEvent;
+import org.eclipse.swt.events.MenuEvent;
+import org.eclipse.swt.events.MenuListener;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.graphics.Font;
+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.Event;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Listener;
+import org.eclipse.swt.widgets.Menu;
+import org.eclipse.swt.widgets.MenuItem;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.swt.widgets.Tree;
+import org.eclipse.swt.widgets.TreeItem;
+import org.eclipse.ui.IMemento;
+import org.eclipse.ui.ISharedImages;
+import org.eclipse.ui.IViewPart;
+import org.eclipse.ui.IViewReference;
+import org.eclipse.ui.IViewSite;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.actions.ExportResourcesAction;
+import org.eclipse.ui.actions.ImportResourcesAction;
+import org.eclipse.ui.part.ViewPart;
+import org.eclipse.ui.progress.UIJob;
+
+/**
+ * <REM2>
+ *
+ * @author Ryan D. Brooks
+ */
+public class ArtifactExplorer extends ViewPart implements IArtifactExplorerEventHandler, IRebuildMenuListener, IAccessControlEventListener, IFrameworkTransactionEventListener, IBranchEventListener, IArtifactsPurgedEventListener, IArtifactsChangeTypeEventListener, IActionable, ISelectionProvider, IBranchProvider {
+ public static final String VIEW_ID = "org.eclipse.osee.framework.ui.skynet.ArtifactExplorer";
+ private static final String ROOT_GUID = "artifact.explorer.last.root_guid";
+ private static final String ROOT_BRANCH = "artifact.explorer.last.root_branch";
+ private static final ArtifactClipboard artifactClipboard = new ArtifactClipboard(VIEW_ID);
+ private static final LinkedList<Tree> trees = new LinkedList<Tree>();
+
+ private TreeViewer treeViewer;
+ private Action upAction;
+ private Artifact explorerRoot;
+ private MenuItem openMenuItem;
+ private MenuItem massEditMenuItem;
+ private MenuItem skywalkerMenuItem;
+ private MenuItem createMenuItem;
+ private MenuItem openWithMenuItem;
+ private MenuItem accessControlMenuItem;
+ private MenuItem lockMenuItem;
+ private MenuItem goIntoMenuItem;
+ private MenuItem copyMenuItem;
+ private MenuItem pasteMenuItem;
+ private MenuItem pasteSpecialMenuItem;
+ private MenuItem renameArtifactMenuItem;
+ private MenuItem refreshMenuItem;
+ private MenuItem findOnAnotherBranch;
+ private NeedArtifactMenuListener needArtifactListener;
+ private NeedProjectMenuListener needProjectListener;
+ private Tree myTree;
+ private TreeEditor myTreeEditor;
+ private Text myTextBeingRenamed;
+ private Action newArtifactExplorer;
+ private Action collapseAllAction;
+ private Action showChangeReport;
+ private XBranchSelectWidget branchSelect;
+ private Branch branch;
+ private IGlobalMenuHelper globalMenuHelper;
+
+ private Composite stackComposite;
+ private Control branchUnreadableWarning;
+ private StackLayout stackLayout;
+ private final ArtifactDecorator artifactDecorator = new ArtifactDecorator(
+ SkynetGuiPlugin.ARTIFACT_EXPLORER_ATTRIBUTES_PREF);
+
+ public static void explore(Collection<Artifact> artifacts) {
+ explore(artifacts, AWorkbench.getActivePage());
+ }
+
+ public static void explore(Collection<Artifact> artifacts, IWorkbenchPage page) {
+ Artifact sampleArtifact = null;
+ Branch inputBranch = null;
+ if (artifacts != null && !artifacts.isEmpty()) {
+ sampleArtifact = artifacts.iterator().next();
+ inputBranch = sampleArtifact.getBranch();
+ }
+ ArtifactExplorer artifactExplorer = findView(inputBranch, page);
+
+ artifactExplorer.setPartName("Artifacts");
+ artifactExplorer.setContentDescription("These artifacts could not be handled");
+ artifactExplorer.treeViewer.setInput(artifacts);
+ artifactExplorer.initializeSelectionBox();
+ }
+
+ private static ArtifactExplorer findView(Branch inputBranch, IWorkbenchPage page) {
+ for (IViewReference view : page.getViewReferences()) {
+ if (view.getId().equals(ArtifactExplorer.VIEW_ID)) {
+ if (view.getView(false) != null && inputBranch.equals(((ArtifactExplorer) view.getView(false)).branch)) {
+ try {
+ return (ArtifactExplorer) page.showView(view.getId(), view.getSecondaryId(),
+ IWorkbenchPage.VIEW_ACTIVATE);
+ } catch (Exception ex) {
+ throw new RuntimeException(ex);
+ }
+ }
+ }
+ }
+ try {
+ ArtifactExplorer explorer =
+ (ArtifactExplorer) page.showView(ArtifactExplorer.VIEW_ID, GUID.create(), IWorkbenchPage.VIEW_ACTIVATE);
+ explorer.explore(OseeSystemArtifacts.getDefaultHierarchyRootArtifact(inputBranch));
+ return explorer;
+ } catch (Exception ex) {
+ throw new RuntimeException(ex);
+ }
+ }
+
+ private Control createDefaultWarning(Composite parent) {
+ Composite composite = new Composite(parent, SWT.BORDER);
+ composite.setLayout(new GridLayout(2, false));
+ composite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
+ composite.setBackground(Displays.getSystemColor(SWT.COLOR_INFO_BACKGROUND));
+
+ Label image = new Label(composite, SWT.NONE);
+ image.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, true));
+ image.setImage(ImageManager.getImage(FrameworkImage.LOCKED_KEY));
+ image.setBackground(Displays.getSystemColor(SWT.COLOR_INFO_BACKGROUND));
+
+ Label label = new Label(composite, SWT.NONE);
+ Font font = new Font(PlatformUI.getWorkbench().getDisplay(), "Courier New", 10, SWT.BOLD);
+ label.setFont(font);
+ label.setForeground(Displays.getSystemColor(SWT.COLOR_DARK_RED));
+ label.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, true));
+ label.setText("Branch Read Access Denied.\nContact your administrator.");
+ label.setBackground(Displays.getSystemColor(SWT.COLOR_INFO_BACKGROUND));
+
+ return composite;
+ }
+
+ private void checkBranchReadable() throws OseeCoreException {
+ if (treeViewer == null) {
+ return;
+ }
+ Control control = branchUnreadableWarning;
+ if (branch == null || new GlobalMenuPermissions(globalMenuHelper).isBranchReadable(branch)) {
+ control = treeViewer.getTree();
+ }
+ stackLayout.topControl = control;
+ stackComposite.layout();
+ stackComposite.getParent().layout();
+ }
+
+ @Override
+ public void createPartControl(Composite parent) {
+ try {
+ if (!DbConnectionExceptionComposite.dbConnectionIsOk(parent)) {
+ return;
+ }
+
+ GridData gridData = new GridData(SWT.FILL, SWT.FILL, true, true);
+ gridData.heightHint = 1000;
+ gridData.widthHint = 1000;
+
+ parent.setLayout(new GridLayout(1, false));
+ parent.setLayoutData(gridData);
+
+ branchSelect = new XBranchSelectWidget("");
+ branchSelect.setDisplayLabel(false);
+ branchSelect.setSelection(branch);
+ branchSelect.createWidgets(parent, 1);
+
+ branchSelect.addListener(new Listener() {
+ @Override
+ public void handleEvent(Event event) {
+ try {
+ Branch selectedBranch = branchSelect.getData();
+ if (selectedBranch != null) {
+ branch = selectedBranch;
+ explore(OseeSystemArtifacts.getDefaultHierarchyRootArtifact(branch));
+ }
+ } catch (Exception ex) {
+ OseeLog.log(getClass(), Level.SEVERE, ex);
+ }
+ }
+
+ });
+
+ stackComposite = new Composite(parent, SWT.NONE);
+ stackLayout = new StackLayout();
+ stackComposite.setLayout(stackLayout);
+ stackComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
+
+ branchUnreadableWarning = createDefaultWarning(stackComposite);
+
+ treeViewer = new TreeViewer(stackComposite);
+ myTree = treeViewer.getTree();
+ Tree tree = treeViewer.getTree();
+ final ArtifactExplorer fArtExplorere = this;
+ tree.addDisposeListener(new DisposeListener() {
+
+ @Override
+ public void widgetDisposed(DisposeEvent e) {
+ ArtifactExplorerEventManager.remove(fArtExplorere);
+ }
+ });
+ treeViewer.setContentProvider(new ArtifactContentProvider());
+
+ treeViewer.setLabelProvider(new ArtifactLabelProvider(artifactDecorator));
+ treeViewer.addDoubleClickListener(new ArtifactDoubleClick());
+ treeViewer.getControl().setLayoutData(gridData);
+
+ // We can not use the hash lookup because an artifact may not have a
+ // good equals.
+ // This can be added back once the content provider is converted over to
+ // use job node.
+ treeViewer.setUseHashlookup(false);
+
+ treeViewer.addSelectionChangedListener(new SelectionCountChangeListener(getViewSite()));
+ globalMenuHelper = new ArtifactTreeViewerGlobalMenuHelper(treeViewer);
+
+ IToolBarManager toolbarManager = getViewSite().getActionBars().getToolBarManager();
+ createCollapseAllAction(toolbarManager);
+ createUpAction(toolbarManager);
+ createNewArtifactExplorerAction(toolbarManager);
+ createShowChangeReportAction(toolbarManager);
+ addOpenQuickSearchAction(toolbarManager);
+ toolbarManager.add(new OpenAssociatedArtifactFromBranchProvider(this));
+
+ artifactDecorator.setViewer(treeViewer);
+ artifactDecorator.addActions(getViewSite().getActionBars().getMenuManager(), this);
+
+ getSite().setSelectionProvider(treeViewer);
+ addExploreSelection();
+
+ setupPopupMenu();
+
+ myTreeEditor = new TreeEditor(myTree);
+ myTreeEditor.horizontalAlignment = SWT.LEFT;
+ myTreeEditor.grabHorizontal = true;
+ myTreeEditor.minimumWidth = 50;
+
+ new ArtifactExplorerDragAndDrop(treeViewer, VIEW_ID, this);
+
+ OseeUiActions.addBugToViewToolbar(this, this, SkynetGuiPlugin.getInstance(), VIEW_ID, "Artifact Explorer");
+
+ OseeContributionItem.addTo(this, false);
+
+ updateEnablementsEtAl();
+ trees.add(tree);
+ setHelpContexts();
+
+ checkBranchReadable();
+ getViewSite().getActionBars().updateActionBars();
+
+ } catch (Exception ex) {
+ OseeLog.log(SkynetGuiPlugin.class, OseeLevel.SEVERE_POPUP, ex);
+ }
+
+ OseeEventManager.addListener(this);
+ ArtifactExplorerEventManager.add(this);
+ }
+
+ /**
+ * Reveal an artifact in the viewer and select it.
+ *
+ */
+ public static void exploreBranch(Branch branch) {
+ if (branch != null) {
+ IWorkbenchPage page = AWorkbench.getActivePage();
+ findView(branch, page);
+ }
+ }
+
+ public void setupPopupMenu() {
+
+ Menu popupMenu = new Menu(treeViewer.getTree().getParent());
+ needArtifactListener = new NeedArtifactMenuListener();
+ needProjectListener = new NeedProjectMenuListener();
+ popupMenu.addMenuListener(needArtifactListener);
+ popupMenu.addMenuListener(needProjectListener);
+
+ createOpenMenuItem(popupMenu);
+ createOpenWithMenuItem(popupMenu);
+ new MenuItem(popupMenu, SWT.SEPARATOR);
+ createFindOnDifferentBranchItem(popupMenu);
+ new MenuItem(popupMenu, SWT.SEPARATOR);
+ createNewChildMenuItem(popupMenu);
+ createGoIntoMenuItem(popupMenu);
+ createMassEditMenuItem(popupMenu);
+ createSkywalkerMenuItem(popupMenu);
+ new MenuItem(popupMenu, SWT.SEPARATOR);
+ new GlobalMenu(popupMenu, globalMenuHelper);
+ createRenameArtifactMenuItem(popupMenu);
+ createRefreshMenuItem(popupMenu);
+ new MenuItem(popupMenu, SWT.SEPARATOR);
+ createHistoryMenuItem(popupMenu);
+ new MenuItem(popupMenu, SWT.SEPARATOR);
+ createImportExportMenuItems(popupMenu);
+ new MenuItem(popupMenu, SWT.SEPARATOR);
+ createLockMenuItem(popupMenu);
+ new MenuItem(popupMenu, SWT.SEPARATOR);
+ createCopyMenuItem(popupMenu);
+ createPasteMenuItem(popupMenu);
+ createPasteSpecialMenuItem(popupMenu);
+ createExpandAllMenuItem(popupMenu);
+ createSelectAllMenuItem(popupMenu);
+ new MenuItem(popupMenu, SWT.SEPARATOR);
+ createAccessControlMenuItem(popupMenu);
+ treeViewer.getTree().setMenu(popupMenu);
+ }
+
+ private void addOpenQuickSearchAction(IToolBarManager toolbarManager) {
+ Action openQuickSearch =
+ new Action("Quick Search", ImageManager.getImageDescriptor(FrameworkImage.ARTIFACT_SEARCH)) {
+ @Override
+ public void run() {
+ Job job = new UIJob("Open Quick Search") {
+
+ @Override
+ public IStatus runInUIThread(IProgressMonitor monitor) {
+ IStatus status = Status.OK_STATUS;
+ try {
+ IViewPart viewPart =
+ PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().showView(
+ QuickSearchView.VIEW_ID);
+ if (viewPart != null) {
+ Branch branch = getBranch(monitor);
+ if (branch != null) {
+ ((QuickSearchView) viewPart).setBranch(branch);
+ }
+ }
+ } catch (Exception ex) {
+ status = new Status(IStatus.ERROR, SkynetGuiPlugin.PLUGIN_ID, "Error opening quick search", ex);
+ }
+ return status;
+ }
+ };
+ Jobs.startJob(job);
+ }
+ };
+ openQuickSearch.setToolTipText("Open Quick Search View");
+ toolbarManager.add(openQuickSearch);
+ }
+
+ protected void createUpAction(IToolBarManager toolbarManager) {
+ upAction = new Action("View Parent") {
+ @Override
+ public void run() {
+ try {
+ Artifact parent = explorerRoot.getParent();
+
+ if (parent == null) {
+ return;
+ }
+
+ Object[] expanded = treeViewer.getExpandedElements();
+ Object[] expandedPlus = new Object[expanded.length + 1];
+ for (int i = 0; i < expanded.length; i++) {
+ expandedPlus[i] = expanded[i];
+ }
+ expandedPlus[expandedPlus.length - 1] = explorerRoot;
+
+ explore(parent);
+
+ treeViewer.setExpandedElements(expandedPlus);
+ } catch (Exception ex) {
+ OseeLog.log(SkynetGuiPlugin.class, OseeLevel.SEVERE_POPUP, ex);
+ }
+ }
+ };
+
+ upAction.setImageDescriptor(ImageManager.getImageDescriptor(FrameworkImage.ARROW_UP_YELLOW));
+ upAction.setToolTipText("View Parent");
+ updateEnablementsEtAl();
+ toolbarManager.add(upAction);
+ }
+
+ private void createNewArtifactExplorerAction(IToolBarManager toolbarManager) {
+
+ newArtifactExplorer = new Action("New Artifact Explorer") {
+ @Override
+ public void run() {
+ IWorkbenchPage page = AWorkbench.getActivePage();
+ ArtifactExplorer artifactExplorer;
+ try {
+ artifactExplorer =
+ (ArtifactExplorer) page.showView(ArtifactExplorer.VIEW_ID, GUID.create(),
+ IWorkbenchPage.VIEW_ACTIVATE);
+ artifactExplorer.explore(OseeSystemArtifacts.getDefaultHierarchyRootArtifact(branch));
+ artifactExplorer.setExpandedArtifacts(treeViewer.getExpandedElements());
+ } catch (Exception ex) {
+ throw new RuntimeException(ex);
+ }
+ }
+ };
+
+ newArtifactExplorer.setImageDescriptor(ImageManager.getImageDescriptor(FrameworkImage.ARTIFACT_EXPLORER));
+ toolbarManager.add(newArtifactExplorer);
+ }
+
+ private void createShowChangeReportAction(IToolBarManager toolbarManager) {
+ showChangeReport = new Action("Show Change Report") {
+ @Override
+ public void run() {
+ try {
+ ChangeUiUtil.open(branch);
+ } catch (OseeCoreException ex) {
+ OseeLog.log(SkynetGuiPlugin.class, Level.SEVERE, ex);
+ }
+ }
+ };
+
+ showChangeReport.setImageDescriptor(ImageManager.getImageDescriptor(FrameworkImage.BRANCH_CHANGE));
+ toolbarManager.add(showChangeReport);
+ }
+
+ private void createCollapseAllAction(IToolBarManager toolbarManager) {
+ collapseAllAction = new Action("Collapse All") {
+ @Override
+ public void run() {
+ if (treeViewer != null) {
+ treeViewer.collapseAll();
+ }
+ }
+ };
+
+ collapseAllAction.setImageDescriptor(ImageManager.getImageDescriptor(FrameworkImage.COLLAPSE_ALL));
+ toolbarManager.add(collapseAllAction);
+ }
+
+ private void createOpenWithMenuItem(Menu parentMenu) {
+ openWithMenuItem = new MenuItem(parentMenu, SWT.CASCADE);
+ openWithMenuItem.setText("&Open With");
+ final Menu submenu = new Menu(openWithMenuItem);
+ openWithMenuItem.setMenu(submenu);
+ parentMenu.addMenuListener(new OpenWithMenuListener(submenu, treeViewer, this));
+ }
+
+ private void createNewChildMenuItem(Menu parentMenu) {
+ createMenuItem = new MenuItem(parentMenu, SWT.PUSH);
+ needProjectListener.add(createMenuItem);
+ createMenuItem.setText("&New Child");
+ createMenuItem.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ super.widgetSelected(e);
+ try {
+ ArtifactTypeFilteredTreeEntryDialog dialog = getDialog();
+ Artifact parent = getParent();
+
+ if (dialog.open() == Window.OK) {
+ ArtifactType type = dialog.getSelection();
+ String name = dialog.getEntryValue();
+
+ SkynetTransaction transaction =
+ new SkynetTransaction(branch, String.format("Created new %s \"%s\" in artifact explorer",
+ type.getName(), name));
+ parent.addNewChild(null, type, name);
+ parent.persist(transaction);
+ transaction.execute();
+
+ treeViewer.refresh();
+ treeViewer.refresh(false);
+ }
+ } catch (Exception ex) {
+ OseeLog.log(SkynetGuiPlugin.class, OseeLevel.SEVERE_POPUP, ex);
+ }
+ }
+
+ private ArtifactTypeFilteredTreeEntryDialog getDialog() throws OseeCoreException {
+ Collection<ArtifactType> artifactTypes =
+ ArtifactTypeManager.getConcreteArtifactTypes(branchSelect.getData());
+
+ // IAccessPolicyHandlerService policyHandlerService = SkynetGuiPlugin.getInstance().getPolicyHandlerService();
+ // policyHandlerService.
+
+ ArtifactType rootArtifactType = ArtifactTypeManager.getType(RootArtifact);
+ artifactTypes.remove(rootArtifactType);
+
+ ArtifactTypeFilteredTreeEntryDialog dialog =
+ new ArtifactTypeFilteredTreeEntryDialog("New Child", "Enter name and select Artifact type to create",
+ "Artifact Name");
+ dialog.setInput(artifactTypes);
+ return dialog;
+ }
+
+ private Artifact getParent() throws OseeCoreException {
+ IStructuredSelection selection = (IStructuredSelection) treeViewer.getSelection();
+
+ if (selection.size() > 1) {
+ throw new OseeCoreException("Please select a single artifact to create a new child.");
+ }
+
+ Iterator<?> itemsIter = selection.iterator();
+ Artifact parent;
+ if (!itemsIter.hasNext()) {
+ parent = explorerRoot;
+ } else {
+ parent = (Artifact) itemsIter.next();
+ }
+
+ return parent;
+ }
+ });
+ }
+
+ private void createGoIntoMenuItem(Menu parentMenu) {
+ goIntoMenuItem = new MenuItem(parentMenu, SWT.PUSH);
+ goIntoMenuItem.setText("&Go Into");
+ needArtifactListener.add(goIntoMenuItem);
+
+ ArtifactMenuListener listener = new ArtifactMenuListener();
+ parentMenu.addMenuListener(listener);
+ goIntoMenuItem.addSelectionListener(new SelectionAdapter() {
+
+ @Override
+ public void widgetSelected(SelectionEvent ev) {
+
+ IStructuredSelection selection = (IStructuredSelection) treeViewer.getSelection();
+ Iterator<?> itemsIter = selection.iterator();
+ if (itemsIter.hasNext()) {
+ try {
+ Object[] expanded = treeViewer.getExpandedElements();
+ explore((Artifact) itemsIter.next());
+ treeViewer.setExpandedElements(expanded);
+ } catch (Exception ex) {
+ OseeLog.log(SkynetGuiPlugin.class, Level.SEVERE, ex);
+ }
+ }
+ }
+ });
+ }
+
+ private void createOpenMenuItem(Menu parentMenu) {
+ openMenuItem = new MenuItem(parentMenu, SWT.PUSH);
+ openMenuItem.setText("&Open");
+ needArtifactListener.add(openMenuItem);
+
+ ArtifactMenuListener listener = new ArtifactMenuListener();
+ parentMenu.addMenuListener(listener);
+ openMenuItem.addSelectionListener(new SelectionAdapter() {
+
+ @Override
+ public void widgetSelected(SelectionEvent ev) {
+ LinkedList<Artifact> selectedItems = new LinkedList<Artifact>();
+ TreeViewerUtility.getPreorderSelection(treeViewer, selectedItems);
+ RendererManager.openInJob(selectedItems, PresentationType.DEFAULT_OPEN);
+ }
+ });
+ }
+
+ private void createFindOnDifferentBranchItem(Menu parentMenu) {
+ findOnAnotherBranch = new MenuItem(parentMenu, SWT.PUSH);
+ findOnAnotherBranch.setText("Reveal On Another Branch");
+ needArtifactListener.add(findOnAnotherBranch);
+
+ ArtifactMenuListener listener = new ArtifactMenuListener();
+ parentMenu.addMenuListener(listener);
+ findOnAnotherBranch.addSelectionListener(new SelectionAdapter() {
+
+ @Override
+ public void widgetSelected(SelectionEvent ev) {
+ LinkedList<Artifact> selectedItems = new LinkedList<Artifact>();
+ TreeViewerUtility.getPreorderSelection(treeViewer, selectedItems);
+ Branch branch = BranchSelectionDialog.getBranchFromUser();
+ if (branch != null) {
+ for (Artifact artifact : selectedItems) {
+ try {
+ ArtifactExplorer.revealArtifact(ArtifactQuery.getArtifactFromId(artifact.getArtId(), branch));
+ } catch (OseeCoreException ex) {
+ OseeLog.log(
+ SkynetGuiPlugin.class,
+ OseeLevel.SEVERE_POPUP,
+ String.format("Could not find Artifact \'%s\' on Branch \'%s\'", artifact.getName(),
+ branch.getName()));
+ }
+ }
+
+ }
+ }
+ });
+ }
+
+ private void createMassEditMenuItem(Menu parentMenu) {
+ massEditMenuItem = new MenuItem(parentMenu, SWT.PUSH);
+ massEditMenuItem.setText("Mass Edit");
+ needArtifactListener.add(massEditMenuItem);
+
+ ArtifactMenuListener listener = new ArtifactMenuListener();
+ parentMenu.addMenuListener(listener);
+ massEditMenuItem.addSelectionListener(new SelectionAdapter() {
+
+ @Override
+ public void widgetSelected(SelectionEvent ev) {
+ LinkedList<Artifact> selectedItems = new LinkedList<Artifact>();
+ TreeViewerUtility.getPreorderSelection(treeViewer, selectedItems);
+ MassArtifactEditor.editArtifacts("", selectedItems);
+ }
+ });
+ }
+
+ private void createRefreshMenuItem(Menu parentMenu) {
+ refreshMenuItem = new MenuItem(parentMenu, SWT.PUSH);
+ refreshMenuItem.setText("Refresh");
+ needArtifactListener.add(refreshMenuItem);
+
+ ArtifactMenuListener listener = new ArtifactMenuListener();
+ parentMenu.addMenuListener(listener);
+ refreshMenuItem.addSelectionListener(new SelectionAdapter() {
+
+ @Override
+ public void widgetSelected(SelectionEvent mySelectionEvent) {
+ LinkedList<Artifact> selectedItems = new LinkedList<Artifact>();
+ TreeViewerUtility.getPreorderSelection(treeViewer, selectedItems);
+ for (Artifact artifact : selectedItems) {
+ treeViewer.refresh(artifact);
+ }
+ }
+ });
+ }
+
+ private void createRenameArtifactMenuItem(Menu parentMenu) {
+ renameArtifactMenuItem = new MenuItem(parentMenu, SWT.PUSH);
+ renameArtifactMenuItem.setText("Rename Artifact");
+ needArtifactListener.add(renameArtifactMenuItem);
+
+ ArtifactMenuListener listener = new ArtifactMenuListener();
+ parentMenu.addMenuListener(listener);
+ renameArtifactMenuItem.addSelectionListener(new SelectionAdapter() {
+
+ @Override
+ public void widgetSelected(SelectionEvent mySelectionEvent) {
+ handleRenameArtifactSelectionEvent(mySelectionEvent);
+ }
+ });
+ }
+
+ private void handleRenameArtifactSelectionEvent(SelectionEvent mySelectionEvent) {
+ // Clean up any previous editor control
+ Control oldEditor = myTreeEditor.getEditor();
+
+ if (oldEditor != null) {
+ oldEditor.dispose();
+ }
+
+ // Identify the selected row, only allow input if there is a single
+ // selected row
+ TreeItem[] selection = myTree.getSelection();
+
+ if (selection.length != 1) {
+ return;
+ }
+
+ final TreeItem myTreeItem = selection[0];
+
+ if (myTreeItem == null) {
+ return;
+ }
+ myTextBeingRenamed = new Text(myTree, SWT.BORDER);
+ Object myTreeItemObject = myTreeItem.getData();
+ myTextBeingRenamed.setText(((Artifact) myTreeItemObject).getName());
+ myTextBeingRenamed.addFocusListener(new FocusAdapter() {
+ @Override
+ public void focusLost(FocusEvent e) {
+ updateText(myTextBeingRenamed.getText(), myTreeItem);
+ myTextBeingRenamed.dispose();
+
+ }
+
+ @Override
+ public void focusGained(FocusEvent e) {
+ // do nothing
+ }
+ });
+
+ myTextBeingRenamed.addKeyListener(new KeyAdapter() {
+ @Override
+ public void keyReleased(KeyEvent e) {
+ if (e.character == SWT.CR) {
+ updateText(myTextBeingRenamed.getText(), myTreeItem);
+ myTextBeingRenamed.dispose();
+ } else if (e.keyCode == SWT.ESC) {
+ myTextBeingRenamed.dispose();
+ }
+ }
+ });
+ myTextBeingRenamed.selectAll();
+ myTextBeingRenamed.setFocus();
+ myTreeEditor.setEditor(myTextBeingRenamed, myTreeItem);
+ }
+
+ private void updateText(String newLabel, TreeItem item) {
+ myTreeEditor.getItem().setText(newLabel);
+ Object myTreeItemObject = item.getData();
+ if (myTreeItemObject instanceof Artifact) {
+ Artifact myArtifact = (Artifact) myTreeItemObject;
+ try {
+ myArtifact.setName(newLabel);
+ myArtifact.persist();
+ } catch (Exception ex) {
+ OseeLog.log(SkynetGuiPlugin.class, OseeLevel.SEVERE_POPUP, ex);
+ }
+ }
+ treeViewer.refresh();
+ }
+
+ private void createSkywalkerMenuItem(Menu parentMenu) {
+ skywalkerMenuItem = new MenuItem(parentMenu, SWT.PUSH);
+ skywalkerMenuItem.setText("Sky Walker");
+ needArtifactListener.add(skywalkerMenuItem);
+
+ ArtifactMenuListener listener = new ArtifactMenuListener();
+ parentMenu.addMenuListener(listener);
+ skywalkerMenuItem.addSelectionListener(new SelectionAdapter() {
+
+ @Override
+ public void widgetSelected(SelectionEvent ev) {
+ LinkedList<Artifact> selectedItems = new LinkedList<Artifact>();
+ TreeViewerUtility.getPreorderSelection(treeViewer, selectedItems);
+ SkyWalkerView.exploreArtifact(selectedItems.getFirst());
+ }
+ });
+ }
+
+ private void createSelectAllMenuItem(Menu parentMenu) {
+ MenuItem menuItem = new MenuItem(parentMenu, SWT.PUSH);
+ menuItem.setText("&Select All\tCtrl+A");
+ menuItem.addListener(SWT.Selection, new Listener() {
+ @Override
+ public void handleEvent(org.eclipse.swt.widgets.Event event) {
+ treeViewer.getTree().selectAll();
+ }
+ });
+ }
+
+ private void createHistoryMenuItem(Menu parentMenu) {
+ MenuItem revisionMenuItem = new MenuItem(parentMenu, SWT.PUSH);
+ revisionMenuItem.setText("&Show Resource History ");
+ revisionMenuItem.addSelectionListener(new SelectionAdapter() {
+
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ IStructuredSelection selection = (IStructuredSelection) treeViewer.getSelection();
+ Artifact selectedArtifact = (Artifact) selection.getFirstElement();
+
+ try {
+ HistoryView.open(selectedArtifact);
+ } catch (Exception ex) {
+ OseeLog.log(SkynetGuiPlugin.class, Level.SEVERE, ex);
+ }
+ }
+ });
+ }
+
+ private void createImportExportMenuItems(Menu parentMenu) {
+ MenuItems.createMenuItem(parentMenu, SWT.PUSH, new ImportResourcesAction(getViewSite().getWorkbenchWindow()));
+ MenuItems.createMenuItem(parentMenu, SWT.PUSH, new ExportResourcesAction(getViewSite().getWorkbenchWindow()));
+ }
+
+ private void createAccessControlMenuItem(Menu parentMenu) {
+ accessControlMenuItem = new MenuItem(parentMenu, SWT.PUSH);
+ accessControlMenuItem.setImage(ImageManager.getImage(FrameworkImage.AUTHENTICATED));
+ accessControlMenuItem.setText("&Access Control ");
+ // accessControlMenuItem.setEnabled(false);
+ accessControlMenuItem.addSelectionListener(new SelectionAdapter() {
+
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ IStructuredSelection selection = (IStructuredSelection) treeViewer.getSelection();
+ Artifact selectedArtifact = (Artifact) selection.getFirstElement();
+ try {
+ if (selectedArtifact != null) {
+ PolicyDialog pd = new PolicyDialog(Displays.getActiveShell(), selectedArtifact);
+ pd.open();
+ checkBranchReadable();
+ }
+ } catch (Exception ex) {
+ OseeLog.log(SkynetGuiPlugin.class, Level.SEVERE, ex);
+ }
+ }
+ });
+ }
+
+ private void createLockMenuItem(Menu parentMenu) {
+ lockMenuItem = new MenuItem(parentMenu, SWT.PUSH);
+ lockMenuItem.addSelectionListener(new SelectionAdapter() {
+
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ IStructuredSelection selection = (IStructuredSelection) treeViewer.getSelection();
+ Iterator<?> iterator = selection.iterator();
+ Set<Artifact> lockArtifacts = new HashSet<Artifact>();
+ Set<Artifact> unlockArtifacts = new HashSet<Artifact>();
+ while (iterator.hasNext()) {
+ try {
+ Artifact object = (Artifact) iterator.next();
+ if (new GlobalMenuPermissions(object).isLocked()) {
+ unlockArtifacts.add(object);
+ } else {
+ lockArtifacts.add(object);
+ }
+ } catch (Exception ex) {
+ OseeLog.log(SkynetGuiPlugin.class, OseeLevel.SEVERE_POPUP, ex);
+ }
+ }
+
+ try {
+ AccessControlManager.unLockObjects(unlockArtifacts, UserManager.getUser());
+ AccessControlManager.lockObjects(lockArtifacts, UserManager.getUser());
+ } catch (Exception ex) {
+ OseeLog.log(SkynetGuiPlugin.class, OseeLevel.SEVERE_POPUP, ex);
+ }
+ }
+
+ });
+ }
+
+ private void createCopyMenuItem(Menu parentMenu) {
+ copyMenuItem = new MenuItem(parentMenu, SWT.PUSH);
+ copyMenuItem.setImage(PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_TOOL_COPY));
+ copyMenuItem.setText("Copy \tCtrl+C");
+ copyMenuItem.addSelectionListener(new SelectionAdapter() {
+
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ performCopy();
+ }
+ });
+ }
+
+ private void performCopy() {
+ IStructuredSelection selection = (IStructuredSelection) treeViewer.getSelection();
+ ArrayList<Artifact> artifactTransferData = new ArrayList<Artifact>();
+ ArrayList<String> textTransferData = new ArrayList<String>();
+ Artifact artifact;
+
+ if (selection != null && !selection.isEmpty()) {
+ for (Object object : selection.toArray()) {
+ if (object instanceof Artifact) {
+ artifact = (Artifact) object;
+
+ artifactTransferData.add(artifact);
+ textTransferData.add(artifact.getName());
+ }
+ }
+ artifactClipboard.setArtifactsToClipboard(artifactTransferData, textTransferData);
+ }
+ }
+
+ private void createPasteMenuItem(Menu parentMenu) {
+ pasteMenuItem = new MenuItem(parentMenu, SWT.PUSH);
+ pasteMenuItem.setImage(PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_TOOL_PASTE));
+ pasteMenuItem.setText("Paste \tCtrl+V");
+ pasteMenuItem.addSelectionListener(new SelectionAdapter() {
+
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ performPasteOperation(false);
+ }
+ });
+ }
+
+ private void createPasteSpecialMenuItem(Menu parentMenu) {
+ pasteSpecialMenuItem = new MenuItem(parentMenu, SWT.PUSH);
+ pasteSpecialMenuItem.setImage(PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_TOOL_PASTE));
+ pasteSpecialMenuItem.setText("Paste Special... \tCtrl+S");
+ pasteSpecialMenuItem.addSelectionListener(new SelectionAdapter() {
+
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ performPasteOperation(true);
+ }
+
+ });
+ }
+
+ private void performPasteOperation(boolean isPasteSpecial) {
+ boolean performPaste = true;
+ Artifact destinationArtifact = null;
+ IStructuredSelection selection = (IStructuredSelection) treeViewer.getSelection();
+ if (selection != null && !selection.isEmpty()) {
+ Object object = selection.getFirstElement();
+
+ if (object instanceof Artifact) {
+ destinationArtifact = (Artifact) object;
+ }
+ }
+
+ ArtifactPasteConfiguration config = new ArtifactPasteConfiguration();
+
+ if (isPasteSpecial) {
+ Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();
+ List<Artifact> copiedArtifacts = artifactClipboard.getCopiedContents();
+ ArtifactPasteSpecialDialog dialog =
+ new ArtifactPasteSpecialDialog(shell, config, destinationArtifact, copiedArtifacts);
+ performPaste = dialog.open() == Window.OK;
+ }
+
+ if (performPaste) {
+ Operations.executeAsJob(
+ new ArtifactPasteOperation(config, destinationArtifact, artifactClipboard.getCopiedContents(),
+ new ArtifactNameConflictHandler()), true);
+ }
+ }
+
+ private void createExpandAllMenuItem(Menu parentMenu) {
+ MenuItem menuItem = new MenuItem(parentMenu, SWT.PUSH);
+ menuItem.setImage(ImageManager.getImage(FrameworkImage.EXPAND_ALL));
+ menuItem.setText("Expand All\tCtrl++");
+ menuItem.addSelectionListener(new ExpandListener());
+ }
+
+ public class ExpandListener extends SelectionAdapter {
+ @Override
+ public void widgetSelected(SelectionEvent event) {
+ expandAll((IStructuredSelection) treeViewer.getSelection());
+ }
+ }
+
+ private void expandAll(IStructuredSelection selection) {
+ Iterator<?> iter = selection.iterator();
+ while (iter.hasNext()) {
+ treeViewer.expandToLevel(iter.next(), AbstractTreeViewer.ALL_LEVELS);
+ }
+ }
+
+ @Override
+ public void setFocus() {
+ if (treeViewer != null) {
+ treeViewer.getControl().setFocus();
+ }
+ }
+
+ public void explore(Artifact artifact) {
+ if (artifact == null) {
+ throw new IllegalArgumentException("Can not explore a null artifact.");
+ }
+
+ setPartName("Artifact Explorer: " + artifact.getBranch().getShortName());
+ if (branch != null && branch != artifact.getBranch()) {
+ explore(Arrays.asList(artifact));
+ return;
+ }
+ try {
+ checkBranchReadable();
+ } catch (OseeCoreException ex) {
+ OseeLog.log(SkynetGuiPlugin.class, Level.SEVERE, ex);
+ }
+ explorerRoot = artifact;
+ branch = artifact.getBranch();
+
+ initializeSelectionBox();
+
+ if (treeViewer != null) {
+ Object objects[] = treeViewer.getExpandedElements();
+ treeViewer.setInput(explorerRoot);
+ setupPopupMenu();
+ updateEnablementsEtAl();
+ // Attempt to re-expand what was expanded
+ treeViewer.setExpandedElements(objects);
+ }
+ }
+
+ public void setExpandedArtifacts(Object... artifacts) {
+ if (treeViewer != null) {
+ treeViewer.setExpandedElements(artifacts);
+ }
+ }
+
+ private void updateEnablementsEtAl() {
+ // The upAction may be null if this viewpart has not been layed out yet
+ if (upAction != null) {
+ try {
+ upAction.setEnabled(explorerRoot != null && explorerRoot.hasParent());
+ } catch (OseeCoreException ex) {
+ upAction.setEnabled(false);
+ OseeLog.log(SkynetGuiPlugin.class, OseeLevel.SEVERE_POPUP, ex);
+ }
+ }
+ }
+
+ private class NeedArtifactMenuListener implements MenuListener {
+ private final HashCollection<Class<? extends Artifact>, MenuItem> menuItemMap;
+
+ public NeedArtifactMenuListener() {
+ this.menuItemMap = new HashCollection<Class<? extends Artifact>, MenuItem>();
+ }
+
+ public void add(MenuItem item) {
+ menuItemMap.put(Artifact.class, item);
+ }
+
+ @Override
+ public void menuHidden(MenuEvent e) {
+ // do nothing
+ }
+
+ @Override
+ public void menuShown(MenuEvent e) {
+ IStructuredSelection selection = (IStructuredSelection) treeViewer.getSelection();
+
+ Object obj = selection.getFirstElement();
+ if (obj != null) {
+ Class<? extends Artifact> selectedClass = obj.getClass().asSubclass(Artifact.class);
+
+ for (Class<? extends Artifact> artifactClass : menuItemMap.keySet()) {
+ boolean valid = artifactClass.isAssignableFrom(selectedClass);
+
+ for (MenuItem item : menuItemMap.getValues(artifactClass)) {
+ if (!(item.getData() instanceof Exception)) {
+ // Only modify enabling if no error is associated
+ item.setEnabled(valid);
+ }
+ }
+ }
+ }
+ }
+ }
+
+ private class NeedProjectMenuListener implements MenuListener {
+ Collection<MenuItem> items;
+
+ public NeedProjectMenuListener() {
+ this.items = new LinkedList<MenuItem>();
+ }
+
+ public void add(MenuItem item) {
+ items.add(item);
+ }
+
+ @Override
+ public void menuHidden(MenuEvent e) {
+ // do nothing
+ }
+
+ @Override
+ public void menuShown(MenuEvent e) {
+ boolean valid = treeViewer.getInput() != null;
+ for (MenuItem item : items) {
+ if (!(item.getData() instanceof Exception)) {
+ // Only modify
+ // enabling if no
+ // error is
+ // associated
+ item.setEnabled(valid);
+ }
+ }
+ }
+ }
+
+ /**
+ * Add the selection from the define explorer
+ */
+ private void addExploreSelection() {
+ if (explorerRoot != null) {
+ try {
+ treeViewer.setInput(explorerRoot);
+ initializeSelectionBox();
+ } catch (IllegalArgumentException ex) {
+ OseeLog.log(SkynetGuiPlugin.class, Level.SEVERE, ex);
+ }
+ }
+ }
+
+ /**
+ * @author Jeff C. Phillips
+ */
+ public class ArtifactMenuListener implements MenuListener {
+
+ @Override
+ public void menuHidden(MenuEvent e) {
+ // do nothing
+ }
+
+ @Override
+ public void menuShown(MenuEvent e) {
+ // Use this menu listener until all menu items can be moved to
+ // GlobaMenu
+ try {
+ GlobalMenuPermissions permiss = new GlobalMenuPermissions(globalMenuHelper);
+
+ lockMenuItem.setText((permiss.isLocked() ? "Unlock: (" + permiss.getSubjectFromLockedObjectName() + ")" : "Lock"));
+
+ lockMenuItem.setEnabled(permiss.isWritePermission() && (!permiss.isLocked() || permiss.isAccessToRemoveLock()));
+ openMenuItem.setEnabled(permiss.isReadPermission());
+ createMenuItem.setEnabled(permiss.isWritePermission());
+ openWithMenuItem.setEnabled(permiss.isReadPermission());
+ goIntoMenuItem.setEnabled(permiss.isReadPermission());
+ copyMenuItem.setEnabled(permiss.isReadPermission());
+ pasteMenuItem.setEnabled(permiss.isWritePermission());
+ renameArtifactMenuItem.setEnabled(permiss.isWritePermission());
+
+ } catch (Exception ex) {
+ OseeLog.log(SkynetGuiPlugin.class, OseeLevel.SEVERE_POPUP, ex);
+ }
+
+ }
+ }
+
+ @Override
+ public void init(IViewSite site, IMemento memento) throws PartInitException {
+ super.init(site, memento);
+
+ if (OseeUiActivator.areOSEEServicesAvailable().isFalse()) {
+ return;
+ }
+
+ try {
+ if (memento != null && memento.getString(ROOT_GUID) != null && memento.getString(ROOT_BRANCH) != null) {
+ Branch branch = BranchManager.getBranch(Integer.parseInt(memento.getString(ROOT_BRANCH)));
+
+ if (!branch.getArchiveState().isArchived() || AccessControlManager.isOseeAdmin()) {
+ Artifact previousArtifact = ArtifactQuery.checkArtifactFromId(memento.getString(ROOT_GUID), branch);
+ if (previousArtifact != null) {
+ explore(previousArtifact);
+ } else {
+ /*
+ * simply means that the previous artifact that was used as the root for the artiactExplorer does not
+ * exist because it was deleted or this workspace was last used with a different branch or database,
+ * so let the logic below get the default hierarchy root artifact
+ */
+ }
+ return;
+ }
+ }
+ } catch (Exception ex) {
+ OseeLog.log(SkynetGuiPlugin.class, Level.SEVERE, ex);
+ }
+ }
+
+ @Override
+ public void saveState(IMemento memento) {
+ super.saveState(memento);
+ if (explorerRoot != null) {
+ memento.putString(ROOT_GUID, explorerRoot.getGuid());
+ memento.putString(ROOT_BRANCH, String.valueOf(explorerRoot.getBranch().getId()));
+ }
+ }
+
+ @Override
+ public void dispose() {
+ OseeEventManager.removeListener(this);
+ ArtifactExplorerEventManager.remove(this);
+ super.dispose();
+ }
+
+ @Override
+ public String getActionDescription() {
+ return "";
+ }
+
+ @Override
+ public void addSelectionChangedListener(ISelectionChangedListener listener) {
+ treeViewer.addSelectionChangedListener(listener);
+ }
+
+ @Override
+ public ISelection getSelection() {
+ return treeViewer.getSelection();
+ }
+
+ @Override
+ public void removeSelectionChangedListener(ISelectionChangedListener listener) {
+ treeViewer.removeSelectionChangedListener(listener);
+ }
+
+ @Override
+ public void setSelection(ISelection selection) {
+ treeViewer.setSelection(selection);
+ }
+
+ private void setHelpContexts() {
+ SkynetGuiPlugin.getInstance().setHelp(treeViewer.getControl(), "artifact_explorer_tree_viewer",
+ "org.eclipse.osee.framework.help.ui");
+ }
+
+ @Override
+ public void handleArtifactsPurgedEvent(Sender sender, LoadedArtifacts loadedArtifacts) {
+ try {
+ if (loadedArtifacts.isNotForBranch(branch)) {
+ return;
+ }
+ } catch (Exception ex) {
+ OseeLog.log(SkynetGuiPlugin.class, Level.SEVERE, ex);
+ }
+ Displays.ensureInDisplayThread(new Runnable() {
+ @Override
+ public void run() {
+ treeViewer.refresh();
+ }
+ });
+ }
+
+ @Override
+ public void handleArtifactsChangeTypeEvent(Sender sender, int toArtifactTypeId, final LoadedArtifacts loadedArtifacts) {
+ try {
+ if (loadedArtifacts.isNotForBranch(branch)) {
+ return;
+ }
+ } catch (Exception ex) {
+ OseeLog.log(SkynetGuiPlugin.class, Level.SEVERE, ex);
+ }
+ Displays.ensureInDisplayThread(new Runnable() {
+ @Override
+ public void run() {
+ try {
+ Set<Artifact> parents = new HashSet<Artifact>();
+ for (Artifact art : loadedArtifacts.getLoadedArtifacts()) {
+ if (art.getParent() != null) {
+ parents.add(art.getParent());
+ }
+ }
+ for (Artifact art : parents) {
+ treeViewer.refresh(art);
+ }
+ } catch (Exception ex) {
+ OseeLog.log(SkynetGuiPlugin.class, Level.SEVERE, ex);
+ }
+ }
+ });
+ }
+
+ @Override
+ public void handleFrameworkTransactionEvent(Sender sender, final FrameworkTransactionData transData) {
+ if (branch == null || transData.branchId != branch.getId()) {
+ return;
+ }
+
+ Displays.ensureInDisplayThread(new Runnable() {
+ @Override
+ public void run() {
+ if (treeViewer != null && Widgets.isAccessible(treeViewer.getTree())) {
+ for (Artifact art : transData.cacheDeletedArtifacts) {
+ treeViewer.remove(art);
+ }
+ try {
+ if (!transData.cacheDeletedArtifacts.isEmpty()) {
+ getTreeViewer().remove(
+ transData.cacheDeletedArtifacts.toArray(new Object[transData.cacheDeletedArtifacts.size()]));
+ }
+ for (Artifact artifact : transData.cacheChangedArtifacts) {
+ // Don't refresh deleted artifacts
+ if (artifact.isDeleted()) {
+ continue;
+ }
+ getTreeViewer().update(artifact, null);
+ }
+
+ treeViewer.update(
+ transData.getArtifactsInRelations(ChangeType.Changed,
+ CoreRelationTypes.Default_Hierarchical__Child).toArray(), null);
+ } catch (Exception ex) {
+ OseeLog.log(SkynetGuiPlugin.class, Level.SEVERE, ex);
+ }
+ try {
+ for (Artifact art : transData.getArtifactsInRelations(ChangeType.Added,
+ CoreRelationTypes.Default_Hierarchical__Child)) {
+ if (!art.isDeleted() && art.getParent() != null) {
+ treeViewer.refresh(art.getParent());
+ }
+ }
+ } catch (Exception ex) {
+ OseeLog.log(SkynetGuiPlugin.class, Level.SEVERE, ex);
+ }
+ }
+ }
+ });
+ }
+
+ @Override
+ public void handleBranchEventREM1(Sender sender, BranchEventType branchModType, final int branchId) {
+ if (branchModType == BranchEventType.Committed && branch != null && branch.getId() == branchId) {
+ SkynetViews.closeView(VIEW_ID, getViewSite().getSecondaryId());
+ }
+ }
+
+ @Override
+ public void handleAccessControlArtifactsEvent(Sender sender, AccessControlEvent accessControlEvent) {
+ try {
+ if (!accessControlEvent.isForBranch(branch)) {
+ return;
+ }
+ if (accessControlEvent.getEventType() == AccessControlEventType.UserAuthenticated ||
+ //
+ accessControlEvent.getEventType() == AccessControlEventType.ArtifactsUnlocked ||
+ //
+ accessControlEvent.getEventType() == AccessControlEventType.ArtifactsLocked) {
+ Displays.ensureInDisplayThread(new Runnable() {
+ @Override
+ public void run() {
+ treeViewer.refresh();
+ }
+ });
+ }
+ } catch (Exception ex) {
+ OseeLog.log(SkynetGuiPlugin.class, Level.SEVERE, ex);
+ }
+ }
+
+ @Override
+ public void rebuildMenu() {
+ setupPopupMenu();
+ }
+
+ public void setBranch(Branch branch) {
+ this.branch = branch;
+ }
+
+ public void initializeSelectionBox() {
+ if (branch != null && branchSelect != null && !branch.equals(branchSelect.getData())) {
+ branchSelect.setSelection(branch);
+ try {
+ checkBranchReadable();
+ } catch (OseeCoreException ex) {
+ OseeLog.log(SkynetGuiPlugin.class, Level.SEVERE, ex);
+ }
+ }
+ }
+
+ @Override
+ public Branch getBranch(IProgressMonitor monitor) {
+ return branch;
+ }
+
+ /**
+ * Reveal an artifact in the viewer and select it.
+ *
+ */
+ public static void revealArtifact(Artifact artifact) {
+ final ArtifactData data = new ArtifactData(artifact);
+ IOperation operation = new CheckArtifactBeforeReveal(data);
+ Operations.executeAsJob(operation, true, Job.SHORT, new JobChangeAdapter() {
+
+ @Override
+ public void done(IJobChangeEvent event) {
+ IStatus status = event.getResult();
+ if (status.isOK()) {
+ Job uiJob = new UIJob("Reveal in Artifact Explorer") {
+
+ @Override
+ public IStatus runInUIThread(IProgressMonitor monitor) {
+ Artifact artifact = data.getArtifact();
+ IWorkbenchPage page = AWorkbench.getActivePage();
+ ArtifactExplorer artifactExplorer = findView(artifact.getBranch(), page);
+ artifactExplorer.treeViewer.setSelection(new StructuredSelection(artifact), true);
+ return Status.OK_STATUS;
+ }
+ };
+ Jobs.startJob(uiJob);
+ }
+ }
+ });
+ }
+
+ private static final class ArtifactData {
+ private Artifact artifact;
+
+ ArtifactData(Artifact artifact) {
+ this.artifact = artifact;
+ }
+
+ Artifact getArtifact() {
+ return artifact;
+ }
+
+ void setArtifact(Artifact artifact) {
+ this.artifact = artifact;
+ }
+ }
+
+ private static final class CheckArtifactBeforeReveal extends AbstractOperation {
+
+ private final ArtifactData artifactData;
+
+ public CheckArtifactBeforeReveal(ArtifactData artifactData) {
+ super("Check Artifact Before Reveal", SkynetGuiPlugin.PLUGIN_ID);
+ this.artifactData = artifactData;
+ }
+
+ @Override
+ protected void doWork(IProgressMonitor monitor) throws Exception {
+ Conditions.checkNotNull(artifactData, "artifact data");
+
+ Artifact artifact = artifactData.getArtifact();
+ Conditions.checkNotNull(artifactData, "artifact");
+ if (artifact.isDeleted()) {
+ throw new OseeStateException("The artifact " + artifact.getName() + " has been deleted.");
+ } else {
+ if (artifact.isHistorical()) {
+ artifactData.setArtifact(ArtifactQuery.getArtifactFromId(artifact.getArtId(), artifact.getBranch(),
+ EXCLUDE_DELETED));
+ }
+
+ Artifact root = OseeSystemArtifacts.getDefaultHierarchyRootArtifact(artifact.getBranch());
+ Artifact artifactRoot = artifact.getArtifactRoot();
+
+ if (!root.equals(artifactRoot)) {
+ String artifactRootName = artifactRoot != null ? artifactRoot.getName() : artifact.getName();
+ throw new OseeStateException(
+ "The artifact " + artifact.getName() + " is rooted on an orphan tree at " + artifactRootName);
+ }
+ }
+ }
+ }
+
+ @Override
+ public void handleBranchEvent(Sender sender, final BranchEvent branchEvent) {
+ if (branchEvent.getEventType() == BranchEventType.Committed && branch != null && branch.getGuid().equals(
+ branchEvent.getBranchGuid())) {
+ SkynetViews.closeView(VIEW_ID, getViewSite().getSecondaryId());
+ }
+ }
+
+ public TreeViewer getTreeViewer() {
+ return treeViewer;
+ }
+
+ public void setTreeViewer(TreeViewer treeViewer) {
+ this.treeViewer = treeViewer;
+ }
+
+ @Override
+ public ArtifactExplorer getArtifactExplorer() {
+ return this;
+ }
+
+ @Override
+ public boolean isDisposed() {
+ return treeViewer.getTree() == null || treeViewer.getTree().isDisposed();
+ }
+
+ @Override
+ public List<? extends IEventFilter> getEventFilters() {
+ if (branch != null) {
+ return OseeEventManager.getEventFiltersForBranch(branch);
+ }
+ return null;
+ }
+
+}
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/ArtifactImageManager.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/ArtifactImageManager.java
index 3576ee2bbc1..5c7473a771e 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/ArtifactImageManager.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/ArtifactImageManager.java
@@ -1,335 +1,335 @@
-/*******************************************************************************
- * Copyright (c) 2009 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.skynet;
-
-import java.io.ByteArrayInputStream;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.logging.Level;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.osee.framework.access.AccessControlManager;
-import org.eclipse.osee.framework.core.data.IArtifactType;
-import org.eclipse.osee.framework.core.enums.ModificationType;
-import org.eclipse.osee.framework.core.exception.OseeArgumentException;
-import org.eclipse.osee.framework.core.exception.OseeCoreException;
-import org.eclipse.osee.framework.core.exception.OseeDataStoreException;
-import org.eclipse.osee.framework.core.model.type.ArtifactType;
-import org.eclipse.osee.framework.database.core.ConnectionHandler;
-import org.eclipse.osee.framework.database.core.IOseeStatement;
-import org.eclipse.osee.framework.database.core.SQL3DataType;
-import org.eclipse.osee.framework.jdk.core.util.Lib;
-import org.eclipse.osee.framework.logging.OseeLog;
-import org.eclipse.osee.framework.plugin.core.util.ExtensionDefinedObjects;
-import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
-import org.eclipse.osee.framework.skynet.core.artifact.ArtifactTypeManager;
-import org.eclipse.osee.framework.skynet.core.artifact.annotation.ArtifactAnnotation;
-import org.eclipse.osee.framework.skynet.core.change.Change;
-import org.eclipse.osee.framework.skynet.core.conflict.ArtifactConflict;
-import org.eclipse.osee.framework.skynet.core.conflict.AttributeConflict;
-import org.eclipse.osee.framework.skynet.core.conflict.Conflict;
-import org.eclipse.osee.framework.skynet.core.types.IArtifact;
-import org.eclipse.osee.framework.ui.swt.ImageManager;
-import org.eclipse.osee.framework.ui.swt.KeyedImage;
-import org.eclipse.osee.framework.ui.swt.OverlayImage.Location;
-import org.eclipse.swt.graphics.Image;
-
-/**
- * @author Ryan D. Brooks
- */
-public final class ArtifactImageManager {
- private static final String EXTENSION_ELEMENT = "ArtifactImageProvider";
- private static final String EXTENSION_ID = SkynetGuiPlugin.PLUGIN_ID + "." + EXTENSION_ELEMENT;
-
- private static final String SELECT_ARTIFACT_TYPES_IMAGE_QUERY =
- "SELECT art_type_id, image FROM osee_artifact_type where image is not null";
- private static final String UPDATE_ARTIFACT_TYPE_IMAGE =
- "UPDATE osee_artifact_type SET image = ? where art_type_id = ?";
-
- private static final Map<String, ArtifactImageProvider> providersOverrideImageMap =
- Collections.synchronizedMap(new HashMap<String, ArtifactImageProvider>());
- private static final Map<String, KeyedImage> artifactTypeImageMap =
- Collections.synchronizedMap(new HashMap<String, KeyedImage>());
- private static final Map<String, String> artifactTypeImageProviderMap =
- Collections.synchronizedMap(new HashMap<String, String>());
-
- private static final String OSEE_DATABASE_PROVIDER = "OSEE Database Provider";
-
- private static boolean artifactTypeImagesLoaded;
- private static KeyedImage overrideImageEnum;
-
- static {
- loadCache();
- }
-
- public synchronized static void loadCache() {
- artifactTypeImagesLoaded = false;
-
- Set<String> imageKeys = new HashSet<String>();
- imageKeys.addAll(providersOverrideImageMap.keySet());
- imageKeys.addAll(artifactTypeImageMap.keySet());
- imageKeys.addAll(artifactTypeImageProviderMap.keySet());
-
- for (String imageKey : imageKeys) {
- ImageManager.removeFromRegistry(imageKey);
- }
-
- providersOverrideImageMap.clear();
- artifactTypeImageMap.clear();
- artifactTypeImageProviderMap.clear();
-
- List<ArtifactImageProvider> providers =
- new ExtensionDefinedObjects<ArtifactImageProvider>(EXTENSION_ID, EXTENSION_ELEMENT, "class").getObjects();
-
- for (ArtifactImageProvider imageProvider : providers) {
- try {
- imageProvider.init();
- } catch (Exception ex) {
- // prevent an exception in one provider from affecting the initialization of other providers
- OseeLog.log(SkynetGuiPlugin.class, Level.SEVERE, ex);
- }
- }
- }
-
- private synchronized static void ensureArtifactTypeImagesLoaded() throws OseeDataStoreException {
- if (!artifactTypeImagesLoaded) {
- artifactTypeImagesLoaded = true;
- // Load base images from database (which can override the ImageManager.registerImage() calls provided
- // through the ArtifactImageProviders
- IOseeStatement chStmt = ConnectionHandler.getStatement();
- try {
- chStmt.runPreparedQuery(SELECT_ARTIFACT_TYPES_IMAGE_QUERY);
-
- while (chStmt.next()) {
- try {
- ArtifactType artifactType = ArtifactTypeManager.getType(chStmt.getInt("art_type_id"));
- artifactTypeImageMap.put(artifactType.getName(),
- BaseImage.getBaseImageEnum(artifactType, Lib.inputStreamToBytes(chStmt.getBinaryStream("image"))));
- artifactTypeImageProviderMap.put(artifactType.getName(), OSEE_DATABASE_PROVIDER);
- } catch (Exception ex) {
- OseeLog.log(SkynetGuiPlugin.class, Level.SEVERE, ex);
- }
- }
- } finally {
- chStmt.close();
- }
- }
- }
-
- public static Image getConflictImage(Conflict conflict) throws OseeCoreException {
- if (conflict instanceof AttributeConflict) {
- return ImageManager.getImage(FrameworkImage.ATTRIBUTE_MOLECULE);
- }
- if (conflict instanceof ArtifactConflict) {
- return getImage(conflict.getArtifact());
- }
- throw new OseeArgumentException("Conflict not of supported type");
- }
-
- public static Image getChangeTypeImage(Change change) {
- return getChangeImage(change, ChangeImageType.CHANGE_TYPE);
- }
-
- public static Image getChangeKindImage(Change change) {
- return getChangeImage(change, ChangeImageType.CHANGE_KIND);
- }
-
- private static enum ChangeImageType {
- CHANGE_KIND,
- CHANGE_TYPE;
- }
-
- private static Image getChangeImage(Change change, ChangeImageType changeImageType) {
- Image toReturn = null;
- KeyedImage keyedImage = null;
- ModificationType modType = null;
- if (change.getItemKind().equals("Artifact")) {
- modType = change.getModificationType();
- keyedImage = BaseImage.getBaseImageEnum(change.getArtifactType());
- }
- if (change.getItemKind().equals("Attribute")) {
- if (ChangeImageType.CHANGE_TYPE == changeImageType) {
- modType = change.getModificationType();
- keyedImage = FrameworkImage.ATTRIBUTE_MOLECULE;
- } else {
- modType = change.getModificationType();
- keyedImage = BaseImage.getBaseImageEnum(change.getArtifactType());
- }
- }
- if (change.getItemKind().equals("Relation")) {
- keyedImage = FrameworkImage.RELATION;
- modType = change.getModificationType();
- }
- if (keyedImage != null && modType != null) {
- KeyedImage overlay = FrameworkImage.valueOf("OUTGOING_" + modType.toString());
- toReturn = ImageManager.getImage(ImageManager.setupImageWithOverlay(keyedImage, overlay, Location.TOP_LEFT));
- }
- return toReturn;
- }
-
- public static Image getImage(IArtifactType artifactType) {
- try {
- return getImage(ArtifactTypeManager.getType(artifactType));
- } catch (OseeCoreException ex) {
- OseeLog.log(SkynetGuiPlugin.class, Level.SEVERE, ex);
- }
- return ImageManager.getImage(ImageManager.MISSING);
- }
-
- public static Image getImage(ArtifactType artifactType) {
- try {
- if (overrideImageEnum != null) {
- return ImageManager.getImage(overrideImageEnum);
- }
-
- // Check if image provider provides override for this image
- ArtifactImageProvider imageProvider = providersOverrideImageMap.get(artifactType.getName());
- if (imageProvider != null) {
- String imageKey = imageProvider.setupImage(artifactType);
- if (imageKey != null) {
- return ImageManager.getImage(imageKey);
- }
- }
-
- // Return image for the base image
- return ImageManager.getImage(BaseImage.getBaseImageEnum(artifactType));
- } catch (OseeCoreException ex) {
- OseeLog.log(SkynetGuiPlugin.class, Level.SEVERE, ex);
- }
- return ImageManager.getImage(ImageManager.MISSING);
- }
-
- public static Image getImage(Artifact artifact, KeyedImage overlay, Location location) {
- return ImageManager.getImage(ImageManager.setupImageWithOverlay(BaseImage.getBaseImageEnum(artifact), overlay,
- location));
- }
-
- public synchronized static String setupImage(KeyedImage imageEnum) {
- return ImageManager.setupImage(imageEnum);
- }
-
- public static String setupImage(Artifact artifact, KeyedImage overlay, Location location) {
- return ImageManager.setupImageWithOverlay(BaseImage.getBaseImageEnum(artifact), overlay, location).getImageKey();
- }
-
- public static void registerOverrideImageProvider(ArtifactImageProvider imageProvider, String artifactTypeName) {
- providersOverrideImageMap.put(artifactTypeName, imageProvider);
- }
-
- public synchronized static void registerBaseImage(IArtifactType artifactType, KeyedImage oseeImage, ArtifactImageProvider provider) throws OseeDataStoreException {
- registerBaseImage(artifactType.getName(), oseeImage, provider);
- }
-
- public synchronized static void registerBaseImage(String artifactTypeName, KeyedImage oseeImage, ArtifactImageProvider provider) throws OseeDataStoreException {
- ensureArtifactTypeImagesLoaded();
-
- boolean alreadyProvided = artifactTypeImageMap.containsKey(artifactTypeName);
- boolean providedByOseeDatabase =
- artifactTypeImageProviderMap.get(artifactTypeName) != null && artifactTypeImageProviderMap.get(
- artifactTypeName).equals(OSEE_DATABASE_PROVIDER);
-
- // Database can override other providers, don't display error in that cases
- if (alreadyProvided && !providedByOseeDatabase) {
- OseeLog.log(SkynetGuiPlugin.class, Level.SEVERE, String.format(
- "Two ArtifactImageProviders [%s][%s] specify image for same artifact type [%s]",
- provider.getClass().getSimpleName(), artifactTypeImageProviderMap.get(artifactTypeName), artifactTypeName));
- }
- // Regardless of error, register image if not already provided
- if (!alreadyProvided) {
- artifactTypeImageMap.put(artifactTypeName, oseeImage);
- artifactTypeImageProviderMap.put(artifactTypeName, provider.getClass().getSimpleName());
- }
- }
-
- public static Image getAnnotationImage(ArtifactAnnotation.Type annotationType) {
- if (annotationType == ArtifactAnnotation.Type.Warning) {
- return ImageManager.getImage(FrameworkImage.WARNING);
- }
- return ImageManager.getImage(FrameworkImage.INFO_LG);
- }
-
- public synchronized static Image getImage(IArtifact artifact) {
- return ImageManager.getImage(setupImage(artifact));
- }
-
- public synchronized static ImageDescriptor getImageDescriptor(IArtifact artifact) {
- return ImageManager.getImageDescriptor(setupImage(artifact));
- }
-
- private synchronized static String setupImage(IArtifact artifact) {
- try {
- Artifact castedArtifact = artifact.getFullArtifact();
- ArtifactImageProvider imageProvider = providersOverrideImageMap.get(artifact.getArtifactType().getName());
- if (imageProvider != null) {
- return imageProvider.setupImage(castedArtifact);
- }
- } catch (OseeCoreException ex) {
- OseeLog.log(SkynetGuiPlugin.class, Level.SEVERE, ex);
- }
-
- return setupImageNoProviders(artifact);
- }
-
- protected synchronized static String setupImageNoProviders(IArtifact artifact) {
- KeyedImage baseImageEnum = null;
- try {
- Artifact castedArtifact = artifact.getFullArtifact();
- baseImageEnum = BaseImage.getBaseImageEnum(castedArtifact);
-
- if (AccessControlManager.hasLock(castedArtifact)) {
- KeyedImage overlay =
- AccessControlManager.hasLockAccess(castedArtifact) ? FrameworkImage.LOCKED_WITH_ACCESS : FrameworkImage.LOCKED_NO_ACCESS;
- return ImageManager.setupImageWithOverlay(baseImageEnum, overlay, Location.TOP_LEFT).getImageKey();
- }
-
- if (castedArtifact.isAnnotationWarning()) {
- return ImageManager.setupImageWithOverlay(baseImageEnum, FrameworkImage.WARNING_OVERLAY, Location.BOT_LEFT).getImageKey();
- }
- } catch (OseeCoreException ex) {
- OseeLog.log(SkynetGuiPlugin.class, Level.SEVERE, ex);
- }
- return ImageManager.setupImage(baseImageEnum);
- }
-
- public static void setArtifactTypeImageInDb(IArtifactType artifactType, ByteArrayInputStream byteInput) throws OseeCoreException {
- setArtifactTypeImageInDb(ArtifactTypeManager.getType(artifactType), byteInput);
- }
-
- public static void setArtifactTypeImageInDb(ArtifactType artifactType, ByteArrayInputStream byteInput) throws OseeDataStoreException {
- Object imageData = byteInput != null ? byteInput : SQL3DataType.BLOB;
- ConnectionHandler.runPreparedUpdate(UPDATE_ARTIFACT_TYPE_IMAGE, imageData, artifactType.getId());
- loadCache();
-
- // TODO Need remote event kick to tell other clients of artifact type image changes
- }
-
- public static KeyedImage getArtifactTypeImage(String artifactTypeName) {
- return artifactTypeImageMap.get(artifactTypeName);
- }
-
- /**
- * @param overrideImageEnum the overrideImageEnum to set
- */
- public static void setOverrideImageEnum(KeyedImage overrideImageEnum) {
- ArtifactImageManager.overrideImageEnum = overrideImageEnum;
- }
-
- /**
- * @return the overrideImageEnum
- */
- public static KeyedImage getOverrideImageEnum() {
- return overrideImageEnum;
- }
-
-}
+/*******************************************************************************
+ * Copyright (c) 2009 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.skynet;
+
+import java.io.ByteArrayInputStream;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.logging.Level;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.osee.framework.access.AccessControlManager;
+import org.eclipse.osee.framework.core.data.IArtifactType;
+import org.eclipse.osee.framework.core.enums.ModificationType;
+import org.eclipse.osee.framework.core.exception.OseeArgumentException;
+import org.eclipse.osee.framework.core.exception.OseeCoreException;
+import org.eclipse.osee.framework.core.exception.OseeDataStoreException;
+import org.eclipse.osee.framework.core.model.type.ArtifactType;
+import org.eclipse.osee.framework.database.core.ConnectionHandler;
+import org.eclipse.osee.framework.database.core.IOseeStatement;
+import org.eclipse.osee.framework.database.core.SQL3DataType;
+import org.eclipse.osee.framework.jdk.core.util.Lib;
+import org.eclipse.osee.framework.logging.OseeLog;
+import org.eclipse.osee.framework.plugin.core.util.ExtensionDefinedObjects;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.skynet.core.artifact.ArtifactTypeManager;
+import org.eclipse.osee.framework.skynet.core.artifact.annotation.ArtifactAnnotation;
+import org.eclipse.osee.framework.skynet.core.change.Change;
+import org.eclipse.osee.framework.skynet.core.conflict.ArtifactConflict;
+import org.eclipse.osee.framework.skynet.core.conflict.AttributeConflict;
+import org.eclipse.osee.framework.skynet.core.conflict.Conflict;
+import org.eclipse.osee.framework.skynet.core.types.IArtifact;
+import org.eclipse.osee.framework.ui.swt.ImageManager;
+import org.eclipse.osee.framework.ui.swt.KeyedImage;
+import org.eclipse.osee.framework.ui.swt.OverlayImage.Location;
+import org.eclipse.swt.graphics.Image;
+
+/**
+ * @author Ryan D. Brooks
+ */
+public final class ArtifactImageManager {
+ private static final String EXTENSION_ELEMENT = "ArtifactImageProvider";
+ private static final String EXTENSION_ID = SkynetGuiPlugin.PLUGIN_ID + "." + EXTENSION_ELEMENT;
+
+ private static final String SELECT_ARTIFACT_TYPES_IMAGE_QUERY =
+ "SELECT art_type_id, image FROM osee_artifact_type where image is not null";
+ private static final String UPDATE_ARTIFACT_TYPE_IMAGE =
+ "UPDATE osee_artifact_type SET image = ? where art_type_id = ?";
+
+ private static final Map<String, ArtifactImageProvider> providersOverrideImageMap =
+ Collections.synchronizedMap(new HashMap<String, ArtifactImageProvider>());
+ private static final Map<String, KeyedImage> artifactTypeImageMap =
+ Collections.synchronizedMap(new HashMap<String, KeyedImage>());
+ private static final Map<String, String> artifactTypeImageProviderMap =
+ Collections.synchronizedMap(new HashMap<String, String>());
+
+ private static final String OSEE_DATABASE_PROVIDER = "OSEE Database Provider";
+
+ private static boolean artifactTypeImagesLoaded;
+ private static KeyedImage overrideImageEnum;
+
+ static {
+ loadCache();
+ }
+
+ public synchronized static void loadCache() {
+ artifactTypeImagesLoaded = false;
+
+ Set<String> imageKeys = new HashSet<String>();
+ imageKeys.addAll(providersOverrideImageMap.keySet());
+ imageKeys.addAll(artifactTypeImageMap.keySet());
+ imageKeys.addAll(artifactTypeImageProviderMap.keySet());
+
+ for (String imageKey : imageKeys) {
+ ImageManager.removeFromRegistry(imageKey);
+ }
+
+ providersOverrideImageMap.clear();
+ artifactTypeImageMap.clear();
+ artifactTypeImageProviderMap.clear();
+
+ List<ArtifactImageProvider> providers =
+ new ExtensionDefinedObjects<ArtifactImageProvider>(EXTENSION_ID, EXTENSION_ELEMENT, "class").getObjects();
+
+ for (ArtifactImageProvider imageProvider : providers) {
+ try {
+ imageProvider.init();
+ } catch (Exception ex) {
+ // prevent an exception in one provider from affecting the initialization of other providers
+ OseeLog.log(SkynetGuiPlugin.class, Level.SEVERE, ex);
+ }
+ }
+ }
+
+ private synchronized static void ensureArtifactTypeImagesLoaded() throws OseeDataStoreException {
+ if (!artifactTypeImagesLoaded) {
+ artifactTypeImagesLoaded = true;
+ // Load base images from database (which can override the ImageManager.registerImage() calls provided
+ // through the ArtifactImageProviders
+ IOseeStatement chStmt = ConnectionHandler.getStatement();
+ try {
+ chStmt.runPreparedQuery(SELECT_ARTIFACT_TYPES_IMAGE_QUERY);
+
+ while (chStmt.next()) {
+ try {
+ ArtifactType artifactType = ArtifactTypeManager.getType(chStmt.getInt("art_type_id"));
+ artifactTypeImageMap.put(artifactType.getName(),
+ BaseImage.getBaseImageEnum(artifactType, Lib.inputStreamToBytes(chStmt.getBinaryStream("image"))));
+ artifactTypeImageProviderMap.put(artifactType.getName(), OSEE_DATABASE_PROVIDER);
+ } catch (Exception ex) {
+ OseeLog.log(SkynetGuiPlugin.class, Level.SEVERE, ex);
+ }
+ }
+ } finally {
+ chStmt.close();
+ }
+ }
+ }
+
+ public static Image getConflictImage(Conflict conflict) throws OseeCoreException {
+ if (conflict instanceof AttributeConflict) {
+ return ImageManager.getImage(FrameworkImage.ATTRIBUTE_MOLECULE);
+ }
+ if (conflict instanceof ArtifactConflict) {
+ return getImage(conflict.getArtifact());
+ }
+ throw new OseeArgumentException("Conflict not of supported type");
+ }
+
+ public static Image getChangeTypeImage(Change change) {
+ return getChangeImage(change, ChangeImageType.CHANGE_TYPE);
+ }
+
+ public static Image getChangeKindImage(Change change) {
+ return getChangeImage(change, ChangeImageType.CHANGE_KIND);
+ }
+
+ private static enum ChangeImageType {
+ CHANGE_KIND,
+ CHANGE_TYPE;
+ }
+
+ private static Image getChangeImage(Change change, ChangeImageType changeImageType) {
+ Image toReturn = null;
+ KeyedImage keyedImage = null;
+ ModificationType modType = null;
+ if (change.getItemKind().equals("Artifact")) {
+ modType = change.getModificationType();
+ keyedImage = BaseImage.getBaseImageEnum(change.getArtifactType());
+ }
+ if (change.getItemKind().equals("Attribute")) {
+ if (ChangeImageType.CHANGE_TYPE == changeImageType) {
+ modType = change.getModificationType();
+ keyedImage = FrameworkImage.ATTRIBUTE_MOLECULE;
+ } else {
+ modType = change.getModificationType();
+ keyedImage = BaseImage.getBaseImageEnum(change.getArtifactType());
+ }
+ }
+ if (change.getItemKind().equals("Relation")) {
+ keyedImage = FrameworkImage.RELATION;
+ modType = change.getModificationType();
+ }
+ if (keyedImage != null && modType != null) {
+ KeyedImage overlay = FrameworkImage.valueOf("OUTGOING_" + modType.toString());
+ toReturn = ImageManager.getImage(ImageManager.setupImageWithOverlay(keyedImage, overlay, Location.TOP_LEFT));
+ }
+ return toReturn;
+ }
+
+ public static Image getImage(IArtifactType artifactType) {
+ try {
+ return getImage(ArtifactTypeManager.getType(artifactType));
+ } catch (OseeCoreException ex) {
+ OseeLog.log(SkynetGuiPlugin.class, Level.SEVERE, ex);
+ }
+ return ImageManager.getImage(ImageManager.MISSING);
+ }
+
+ public static Image getImage(ArtifactType artifactType) {
+ try {
+ if (overrideImageEnum != null) {
+ return ImageManager.getImage(overrideImageEnum);
+ }
+
+ // Check if image provider provides override for this image
+ ArtifactImageProvider imageProvider = providersOverrideImageMap.get(artifactType.getName());
+ if (imageProvider != null) {
+ String imageKey = imageProvider.setupImage(artifactType);
+ if (imageKey != null) {
+ return ImageManager.getImage(imageKey);
+ }
+ }
+
+ // Return image for the base image
+ return ImageManager.getImage(BaseImage.getBaseImageEnum(artifactType));
+ } catch (OseeCoreException ex) {
+ OseeLog.log(SkynetGuiPlugin.class, Level.SEVERE, ex);
+ }
+ return ImageManager.getImage(ImageManager.MISSING);
+ }
+
+ public static Image getImage(Artifact artifact, KeyedImage overlay, Location location) {
+ return ImageManager.getImage(ImageManager.setupImageWithOverlay(BaseImage.getBaseImageEnum(artifact), overlay,
+ location));
+ }
+
+ public synchronized static String setupImage(KeyedImage imageEnum) {
+ return ImageManager.setupImage(imageEnum);
+ }
+
+ public static String setupImage(Artifact artifact, KeyedImage overlay, Location location) {
+ return ImageManager.setupImageWithOverlay(BaseImage.getBaseImageEnum(artifact), overlay, location).getImageKey();
+ }
+
+ public static void registerOverrideImageProvider(ArtifactImageProvider imageProvider, String artifactTypeName) {
+ providersOverrideImageMap.put(artifactTypeName, imageProvider);
+ }
+
+ public synchronized static void registerBaseImage(IArtifactType artifactType, KeyedImage oseeImage, ArtifactImageProvider provider) throws OseeDataStoreException {
+ registerBaseImage(artifactType.getName(), oseeImage, provider);
+ }
+
+ public synchronized static void registerBaseImage(String artifactTypeName, KeyedImage oseeImage, ArtifactImageProvider provider) throws OseeDataStoreException {
+ ensureArtifactTypeImagesLoaded();
+
+ boolean alreadyProvided = artifactTypeImageMap.containsKey(artifactTypeName);
+ boolean providedByOseeDatabase =
+ artifactTypeImageProviderMap.get(artifactTypeName) != null && artifactTypeImageProviderMap.get(
+ artifactTypeName).equals(OSEE_DATABASE_PROVIDER);
+
+ // Database can override other providers, don't display error in that cases
+ if (alreadyProvided && !providedByOseeDatabase) {
+ OseeLog.log(SkynetGuiPlugin.class, Level.SEVERE, String.format(
+ "Two ArtifactImageProviders [%s][%s] specify image for same artifact type [%s]",
+ provider.getClass().getSimpleName(), artifactTypeImageProviderMap.get(artifactTypeName), artifactTypeName));
+ }
+ // Regardless of error, register image if not already provided
+ if (!alreadyProvided) {
+ artifactTypeImageMap.put(artifactTypeName, oseeImage);
+ artifactTypeImageProviderMap.put(artifactTypeName, provider.getClass().getSimpleName());
+ }
+ }
+
+ public static Image getAnnotationImage(ArtifactAnnotation.Type annotationType) {
+ if (annotationType == ArtifactAnnotation.Type.Warning) {
+ return ImageManager.getImage(FrameworkImage.WARNING);
+ }
+ return ImageManager.getImage(FrameworkImage.INFO_LG);
+ }
+
+ public synchronized static Image getImage(IArtifact artifact) {
+ return ImageManager.getImage(setupImage(artifact));
+ }
+
+ public synchronized static ImageDescriptor getImageDescriptor(IArtifact artifact) {
+ return ImageManager.getImageDescriptor(setupImage(artifact));
+ }
+
+ private synchronized static String setupImage(IArtifact artifact) {
+ try {
+ Artifact castedArtifact = artifact.getFullArtifact();
+ ArtifactImageProvider imageProvider = providersOverrideImageMap.get(artifact.getArtifactType().getName());
+ if (imageProvider != null) {
+ return imageProvider.setupImage(castedArtifact);
+ }
+ } catch (OseeCoreException ex) {
+ OseeLog.log(SkynetGuiPlugin.class, Level.SEVERE, ex);
+ }
+
+ return setupImageNoProviders(artifact);
+ }
+
+ protected synchronized static String setupImageNoProviders(IArtifact artifact) {
+ KeyedImage baseImageEnum = null;
+ try {
+ Artifact castedArtifact = artifact.getFullArtifact();
+ baseImageEnum = BaseImage.getBaseImageEnum(castedArtifact);
+
+ if (AccessControlManager.hasLock(castedArtifact)) {
+ KeyedImage overlay =
+ AccessControlManager.hasLockAccess(castedArtifact) ? FrameworkImage.LOCKED_WITH_ACCESS : FrameworkImage.LOCKED_NO_ACCESS;
+ return ImageManager.setupImageWithOverlay(baseImageEnum, overlay, Location.TOP_LEFT).getImageKey();
+ }
+
+ if (castedArtifact.isAnnotationWarning()) {
+ return ImageManager.setupImageWithOverlay(baseImageEnum, FrameworkImage.WARNING_OVERLAY, Location.BOT_LEFT).getImageKey();
+ }
+ } catch (OseeCoreException ex) {
+ OseeLog.log(SkynetGuiPlugin.class, Level.SEVERE, ex);
+ }
+ return ImageManager.setupImage(baseImageEnum);
+ }
+
+ public static void setArtifactTypeImageInDb(IArtifactType artifactType, ByteArrayInputStream byteInput) throws OseeCoreException {
+ setArtifactTypeImageInDb(ArtifactTypeManager.getType(artifactType), byteInput);
+ }
+
+ public static void setArtifactTypeImageInDb(ArtifactType artifactType, ByteArrayInputStream byteInput) throws OseeDataStoreException {
+ Object imageData = byteInput != null ? byteInput : SQL3DataType.BLOB;
+ ConnectionHandler.runPreparedUpdate(UPDATE_ARTIFACT_TYPE_IMAGE, imageData, artifactType.getId());
+ loadCache();
+
+ // TODO Need remote event kick to tell other clients of artifact type image changes
+ }
+
+ public static KeyedImage getArtifactTypeImage(String artifactTypeName) {
+ return artifactTypeImageMap.get(artifactTypeName);
+ }
+
+ /**
+ * @param overrideImageEnum the overrideImageEnum to set
+ */
+ public static void setOverrideImageEnum(KeyedImage overrideImageEnum) {
+ ArtifactImageManager.overrideImageEnum = overrideImageEnum;
+ }
+
+ /**
+ * @return the overrideImageEnum
+ */
+ public static KeyedImage getOverrideImageEnum() {
+ return overrideImageEnum;
+ }
+
+}
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/ArtifactImageProvider.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/ArtifactImageProvider.java
index 4ab1bf23fb2..62c6d3a16fb 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/ArtifactImageProvider.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/ArtifactImageProvider.java
@@ -28,7 +28,6 @@ public abstract class ArtifactImageProvider {
* call. Alternatively, providers that wish to defer to the basic implementation should call return
* super.setupImage()
*
- * @param artifact
* @throws OseeCoreException
*/
@SuppressWarnings("unused")
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/ArtifactLabelProvider.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/ArtifactLabelProvider.java
index 15d85cb80c9..5f32f084038 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/ArtifactLabelProvider.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/ArtifactLabelProvider.java
@@ -1,103 +1,103 @@
-/*******************************************************************************
- * 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.skynet;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.logging.Level;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.osee.framework.core.exception.OseeCoreException;
-import org.eclipse.osee.framework.jdk.core.util.Collections;
-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.swt.ImageManager;
-import org.eclipse.search.ui.text.Match;
-import org.eclipse.swt.graphics.Image;
-
-public class ArtifactLabelProvider extends LabelProvider { //StyledCellLabelProvider {
-
- private final IArtifactDecoratorPreferences decorationProvider;
-
- public ArtifactLabelProvider(IArtifactDecoratorPreferences decorationProvider) {
- super();
- this.decorationProvider = decorationProvider;
- }
-
- public ArtifactLabelProvider() {
- this(null);
- }
-
- /*
- * @see ILabelProvider#getImage(Object)
- */
- @Override
- public Image getImage(Object element) {
- if (element instanceof Artifact) {
- return ArtifactImageManager.getImage((Artifact) element);
- } else if (element instanceof Match && ((Match) element).getElement() instanceof Artifact) {
- return ArtifactImageManager.getImage((Artifact) ((Match) element).getElement());
- }
- return ImageManager.getImage(ImageManager.MISSING);
- }
-
- /*
- * @see ILabelProvider#getText(Object)
- */
- @Override
- public String getText(Object element) {
- if (element instanceof Match) {
- element = ((Match) element).getElement();
- }
-
- if (element instanceof Artifact) {
- Artifact artifact = (Artifact) element;
-
- List<String> extraInfo = new ArrayList<String>();
- String name = artifact.getName();
- extraInfo.add(name != null ? name : "");
- if (artifact.isDeleted()) {
- extraInfo.add("<Deleted>");
- }
- if (decorationProvider != null) {
-
- if (decorationProvider.showArtIds() && decorationProvider.showArtVersion()) {
- extraInfo.add(String.format("[%s rev.%s]", artifact.getArtId(), artifact.getGammaId()));
- } else if (decorationProvider.showArtIds() && !decorationProvider.showArtVersion()) {
- extraInfo.add(String.format("[id %s]", artifact.getArtId()));
- } else if (!decorationProvider.showArtIds() && decorationProvider.showArtVersion()) {
- extraInfo.add(String.format("[rev.%s]", artifact.getGammaId()));
- }
-
- if (decorationProvider.showArtType()) {
- extraInfo.add("<" + artifact.getArtifactTypeName() + ">");
- }
-
- if (decorationProvider.showArtBranch()) {
- extraInfo.add("[" + artifact.getBranch().getShortName() + "]");
- }
-
- try {
- String selectedAttributes = decorationProvider.getSelectedAttributeData(artifact);
- if (Strings.isValid(selectedAttributes)) {
- extraInfo.add(selectedAttributes);
- }
- } catch (OseeCoreException ex) {
- OseeLog.log(SkynetGuiPlugin.class, Level.SEVERE, ex);
- extraInfo.add(ex.toString());
- }
- }
+/*******************************************************************************
+ * 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.skynet;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.logging.Level;
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.osee.framework.core.exception.OseeCoreException;
+import org.eclipse.osee.framework.jdk.core.util.Collections;
+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.swt.ImageManager;
+import org.eclipse.search.ui.text.Match;
+import org.eclipse.swt.graphics.Image;
+
+public class ArtifactLabelProvider extends LabelProvider { //StyledCellLabelProvider {
+
+ private final IArtifactDecoratorPreferences decorationProvider;
+
+ public ArtifactLabelProvider(IArtifactDecoratorPreferences decorationProvider) {
+ super();
+ this.decorationProvider = decorationProvider;
+ }
+
+ public ArtifactLabelProvider() {
+ this(null);
+ }
+
+ /*
+ * @see ILabelProvider#getImage(Object)
+ */
+ @Override
+ public Image getImage(Object element) {
+ if (element instanceof Artifact) {
+ return ArtifactImageManager.getImage((Artifact) element);
+ } else if (element instanceof Match && ((Match) element).getElement() instanceof Artifact) {
+ return ArtifactImageManager.getImage((Artifact) ((Match) element).getElement());
+ }
+ return ImageManager.getImage(ImageManager.MISSING);
+ }
+
+ /*
+ * @see ILabelProvider#getText(Object)
+ */
+ @Override
+ public String getText(Object element) {
+ if (element instanceof Match) {
+ element = ((Match) element).getElement();
+ }
+
+ if (element instanceof Artifact) {
+ Artifact artifact = (Artifact) element;
+
+ List<String> extraInfo = new ArrayList<String>();
+ String name = artifact.getName();
+ extraInfo.add(name != null ? name : "");
+ if (artifact.isDeleted()) {
+ extraInfo.add("<Deleted>");
+ }
+ if (decorationProvider != null) {
+
+ if (decorationProvider.showArtIds() && decorationProvider.showArtVersion()) {
+ extraInfo.add(String.format("[%s rev.%s]", artifact.getArtId(), artifact.getGammaId()));
+ } else if (decorationProvider.showArtIds() && !decorationProvider.showArtVersion()) {
+ extraInfo.add(String.format("[id %s]", artifact.getArtId()));
+ } else if (!decorationProvider.showArtIds() && decorationProvider.showArtVersion()) {
+ extraInfo.add(String.format("[rev.%s]", artifact.getGammaId()));
+ }
+
+ if (decorationProvider.showArtType()) {
+ extraInfo.add("<" + artifact.getArtifactTypeName() + ">");
+ }
+
+ if (decorationProvider.showArtBranch()) {
+ extraInfo.add("[" + artifact.getBranch().getShortName() + "]");
+ }
+
+ try {
+ String selectedAttributes = decorationProvider.getSelectedAttributeData(artifact);
+ if (Strings.isValid(selectedAttributes)) {
+ extraInfo.add(selectedAttributes);
+ }
+ } catch (OseeCoreException ex) {
+ OseeLog.log(SkynetGuiPlugin.class, Level.SEVERE, ex);
+ extraInfo.add(ex.toString());
+ }
+ }
return Collections.toString(" ", extraInfo);
- } else {
- return element.toString();
- }
- }
-}
+ } else {
+ return element.toString();
+ }
+ }
+}
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/ArtifactValidationCheckOperation.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/ArtifactValidationCheckOperation.java
index ff21fc0a3fc..d10b61ed794 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/ArtifactValidationCheckOperation.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/ArtifactValidationCheckOperation.java
@@ -1,78 +1,78 @@
-/*******************************************************************************
- * 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.skynet;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.osee.framework.core.operation.AbstractOperation;
-import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
-import org.eclipse.osee.framework.skynet.core.validation.IOseeValidator;
-import org.eclipse.osee.framework.skynet.core.validation.OseeValidator;
-import org.eclipse.osee.framework.ui.skynet.results.XResultData;
-
-/**
- * @author Roberto E. Escobar
- */
-public class ArtifactValidationCheckOperation extends AbstractOperation {
- private final List<Artifact> itemsToCheck;
- private final boolean stopOnFirstError;
-
- public ArtifactValidationCheckOperation(final Collection<Artifact> itemsToCheck, boolean stopOnFirstError) {
- super("Validate Artifact(s)", SkynetGuiPlugin.PLUGIN_ID);
- this.stopOnFirstError = stopOnFirstError;
- this.itemsToCheck = new ArrayList<Artifact>(itemsToCheck);
- if (itemsToCheck != null) {
- this.itemsToCheck.addAll(itemsToCheck);
- }
- }
-
- public boolean isStopOnFirstError() {
- return stopOnFirstError;
- }
-
- private void handleStatus(Artifact itemChecked, IStatus status) throws Exception {
- if (!status.isOK()) {
- String link =
- XResultData.getHyperlink(
- String.format("%s:[%s]", itemChecked.getArtifactTypeName(), itemChecked.getName()),
- itemChecked.getHumanReadableId(), itemChecked.getBranch().getId());
- String message = String.format("%s: %s", link, status.getMessage());
- status =
- new Status(status.getSeverity(), status.getPlugin(), status.getCode(), message, status.getException());
- setStatus(status);
- }
- }
-
- @Override
- protected void doWork(IProgressMonitor monitor) throws Exception {
- monitor.setTaskName(getName());
- if (!itemsToCheck.isEmpty()) {
- int totalArts = itemsToCheck.size();
- double workAmountPercentage = 1 / itemsToCheck.size();
- int workAmount = calculateWork(workAmountPercentage);
- for (int index = 0; index < totalArts; index++) {
- monitor.setTaskName(String.format("Validating Artifact(s): [%s of %s]", index + 1, totalArts));
- Artifact itemChecked = itemsToCheck.get(index);
- IStatus status = OseeValidator.getInstance().validate(IOseeValidator.LONG, itemChecked);
- handleStatus(itemChecked, status);
- monitor.worked(workAmount);
- if (isStopOnFirstError()) {
- break;
- }
- checkForCancelledStatus(monitor);
- }
- }
- }
-}
+/*******************************************************************************
+ * 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.skynet;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.osee.framework.core.operation.AbstractOperation;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.skynet.core.validation.IOseeValidator;
+import org.eclipse.osee.framework.skynet.core.validation.OseeValidator;
+import org.eclipse.osee.framework.ui.skynet.results.XResultData;
+
+/**
+ * @author Roberto E. Escobar
+ */
+public class ArtifactValidationCheckOperation extends AbstractOperation {
+ private final List<Artifact> itemsToCheck;
+ private final boolean stopOnFirstError;
+
+ public ArtifactValidationCheckOperation(final Collection<Artifact> itemsToCheck, boolean stopOnFirstError) {
+ super("Validate Artifact(s)", SkynetGuiPlugin.PLUGIN_ID);
+ this.stopOnFirstError = stopOnFirstError;
+ this.itemsToCheck = new ArrayList<Artifact>(itemsToCheck);
+ if (itemsToCheck != null) {
+ this.itemsToCheck.addAll(itemsToCheck);
+ }
+ }
+
+ public boolean isStopOnFirstError() {
+ return stopOnFirstError;
+ }
+
+ private void handleStatus(Artifact itemChecked, IStatus status) throws Exception {
+ if (!status.isOK()) {
+ String link =
+ XResultData.getHyperlink(
+ String.format("%s:[%s]", itemChecked.getArtifactTypeName(), itemChecked.getName()),
+ itemChecked.getHumanReadableId(), itemChecked.getBranch().getId());
+ String message = String.format("%s: %s", link, status.getMessage());
+ status =
+ new Status(status.getSeverity(), status.getPlugin(), status.getCode(), message, status.getException());
+ setStatus(status);
+ }
+ }
+
+ @Override
+ protected void doWork(IProgressMonitor monitor) throws Exception {
+ monitor.setTaskName(getName());
+ if (!itemsToCheck.isEmpty()) {
+ int totalArts = itemsToCheck.size();
+ double workAmountPercentage = 1 / itemsToCheck.size();
+ int workAmount = calculateWork(workAmountPercentage);
+ for (int index = 0; index < totalArts; index++) {
+ monitor.setTaskName(String.format("Validating Artifact(s): [%s of %s]", index + 1, totalArts));
+ Artifact itemChecked = itemsToCheck.get(index);
+ IStatus status = OseeValidator.getInstance().validate(IOseeValidator.LONG, itemChecked);
+ handleStatus(itemChecked, status);
+ monitor.worked(workAmount);
+ if (isStopOnFirstError()) {
+ break;
+ }
+ checkForCancelledStatus(monitor);
+ }
+ }
+ }
+}
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/AttributeCellModifier.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/AttributeCellModifier.java
index 2099d6bf11f..04ecc19909a 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/AttributeCellModifier.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/AttributeCellModifier.java
@@ -1,135 +1,135 @@
-/*******************************************************************************
- * 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.skynet;
-
-import java.util.Date;
-import java.util.GregorianCalendar;
-import org.eclipse.jface.viewers.ICellModifier;
-import org.eclipse.jface.viewers.TableViewer;
-import org.eclipse.osee.framework.core.exception.OseeCoreException;
-import org.eclipse.osee.framework.jdk.core.util.Lib;
-import org.eclipse.osee.framework.logging.OseeLevel;
-import org.eclipse.osee.framework.logging.OseeLog;
-import org.eclipse.osee.framework.skynet.core.artifact.Attribute;
-import org.eclipse.osee.framework.skynet.core.attribute.AttributeTypeManager;
-import org.eclipse.osee.framework.skynet.core.attribute.BinaryAttribute;
-import org.eclipse.osee.framework.skynet.core.attribute.BooleanAttribute;
-import org.eclipse.osee.framework.skynet.core.attribute.DateAttribute;
-import org.eclipse.osee.framework.skynet.core.attribute.EnumeratedAttribute;
-import org.eclipse.osee.framework.skynet.core.attribute.WordAttribute;
-import org.eclipse.osee.framework.ui.skynet.widgets.cellEditor.DateValue;
-import org.eclipse.osee.framework.ui.skynet.widgets.cellEditor.EnumeratedValue;
-import org.eclipse.osee.framework.ui.skynet.widgets.cellEditor.StringValue;
-import org.eclipse.osee.framework.ui.swt.IDirtiableEditor;
-import org.eclipse.swt.widgets.Item;
-
-/**
- * @author Ryan D. Brooks
- */
-public class AttributeCellModifier implements ICellModifier {
- private final TableViewer tableViewer;
- private final DateValue dateValue;
- private final EnumeratedValue enumeratedValue;
- private final StringValue stringValue;
- private final IDirtiableEditor editor;
-
- private final AttributesComposite attrComp;
-
- public AttributeCellModifier(IDirtiableEditor editor, TableViewer tableViewer, AttributesComposite attrComp) {
- super();
- this.tableViewer = tableViewer;
- this.attrComp = attrComp;
- this.dateValue = new DateValue();
- this.enumeratedValue = new EnumeratedValue();
- this.stringValue = new StringValue();
- this.editor = editor;
-
- // this.pList = new PermissionList();
- // pList.addPermission(Permission.PermissionEnum.EDITREQUIREMENT);
- }
-
- @Override
- public boolean canModify(Object element, String property) {
- attrComp.updateLabel("");
- if (element != null) {
- if (element instanceof Item) {
- element = ((Item) element).getData();
- }
- try {
- Attribute<?> attribute = (Attribute<?>) element;
-
- if (attribute instanceof WordAttribute) {
- return false;
- }
- } catch (Exception ex) {
- OseeLog.log(SkynetGuiPlugin.class, OseeLevel.SEVERE_POPUP, ex);
- }
- }
- return property.equals("value");
- }
-
- @Override
- public Object getValue(Object element, String property) {
- try {
- Attribute<?> attribute = (Attribute<?>) element;
- Object object = attribute.getValue();
- if (attribute instanceof EnumeratedAttribute) {
- enumeratedValue.setValue(attribute.getDisplayableString());
-
- String[] choices =
- AttributeTypeManager.getEnumerationValues(attribute.getAttributeType()).toArray(new String[0]);
- enumeratedValue.setChoices(choices);
- return enumeratedValue;
- } else if (attribute instanceof BooleanAttribute) {
- enumeratedValue.setValue(attribute.getDisplayableString());
- enumeratedValue.setChoices(BooleanAttribute.booleanChoices);
- return enumeratedValue;
- } else if (attribute instanceof DateAttribute) {
- dateValue.setValue((Date) object);
- return dateValue;
- } else {
- stringValue.setValue(attribute.getDisplayableString() != null ? attribute.getDisplayableString() : "");
- return stringValue;
- }
- } catch (OseeCoreException ex) {
- return Lib.exceptionToString(ex);
- }
- }
-
- @Override
- public void modify(Object element, String property, Object value) {
- if (element != null) {
- // Note that it is possible for an SWT Item to be passed instead of the model element.
- if (element instanceof Item) {
- element = ((Item) element).getData();
- }
- try {
- Attribute<?> attribute = (Attribute<?>) element;
-
- if (attribute instanceof DateAttribute) {
- if (value instanceof GregorianCalendar) {
- ((DateAttribute) attribute).setValue(new Date(((GregorianCalendar) value).getTimeInMillis()));
- } else {
- ((DateAttribute) attribute).setValue((Date) value);
- }
- } else if (!(attribute instanceof BinaryAttribute<?>)) {
- //binary attributes should not be changed.
- attribute.setFromString((String) value);
- }
- } catch (Exception ex) {
- OseeLog.log(SkynetGuiPlugin.class, OseeLevel.SEVERE_POPUP, ex);
- }
- tableViewer.update(element, null);
- editor.onDirtied();
- attrComp.notifyModifyAttribuesListeners();
- }
- }
-}
+/*******************************************************************************
+ * 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.skynet;
+
+import java.util.Date;
+import java.util.GregorianCalendar;
+import org.eclipse.jface.viewers.ICellModifier;
+import org.eclipse.jface.viewers.TableViewer;
+import org.eclipse.osee.framework.core.exception.OseeCoreException;
+import org.eclipse.osee.framework.jdk.core.util.Lib;
+import org.eclipse.osee.framework.logging.OseeLevel;
+import org.eclipse.osee.framework.logging.OseeLog;
+import org.eclipse.osee.framework.skynet.core.artifact.Attribute;
+import org.eclipse.osee.framework.skynet.core.attribute.AttributeTypeManager;
+import org.eclipse.osee.framework.skynet.core.attribute.BinaryAttribute;
+import org.eclipse.osee.framework.skynet.core.attribute.BooleanAttribute;
+import org.eclipse.osee.framework.skynet.core.attribute.DateAttribute;
+import org.eclipse.osee.framework.skynet.core.attribute.EnumeratedAttribute;
+import org.eclipse.osee.framework.skynet.core.attribute.WordAttribute;
+import org.eclipse.osee.framework.ui.skynet.widgets.cellEditor.DateValue;
+import org.eclipse.osee.framework.ui.skynet.widgets.cellEditor.EnumeratedValue;
+import org.eclipse.osee.framework.ui.skynet.widgets.cellEditor.StringValue;
+import org.eclipse.osee.framework.ui.swt.IDirtiableEditor;
+import org.eclipse.swt.widgets.Item;
+
+/**
+ * @author Ryan D. Brooks
+ */
+public class AttributeCellModifier implements ICellModifier {
+ private final TableViewer tableViewer;
+ private final DateValue dateValue;
+ private final EnumeratedValue enumeratedValue;
+ private final StringValue stringValue;
+ private final IDirtiableEditor editor;
+
+ private final AttributesComposite attrComp;
+
+ public AttributeCellModifier(IDirtiableEditor editor, TableViewer tableViewer, AttributesComposite attrComp) {
+ super();
+ this.tableViewer = tableViewer;
+ this.attrComp = attrComp;
+ this.dateValue = new DateValue();
+ this.enumeratedValue = new EnumeratedValue();
+ this.stringValue = new StringValue();
+ this.editor = editor;
+
+ // this.pList = new PermissionList();
+ // pList.addPermission(Permission.PermissionEnum.EDITREQUIREMENT);
+ }
+
+ @Override
+ public boolean canModify(Object element, String property) {
+ attrComp.updateLabel("");
+ if (element != null) {
+ if (element instanceof Item) {
+ element = ((Item) element).getData();
+ }
+ try {
+ Attribute<?> attribute = (Attribute<?>) element;
+
+ if (attribute instanceof WordAttribute) {
+ return false;
+ }
+ } catch (Exception ex) {
+ OseeLog.log(SkynetGuiPlugin.class, OseeLevel.SEVERE_POPUP, ex);
+ }
+ }
+ return property.equals("value");
+ }
+
+ @Override
+ public Object getValue(Object element, String property) {
+ try {
+ Attribute<?> attribute = (Attribute<?>) element;
+ Object object = attribute.getValue();
+ if (attribute instanceof EnumeratedAttribute) {
+ enumeratedValue.setValue(attribute.getDisplayableString());
+
+ String[] choices =
+ AttributeTypeManager.getEnumerationValues(attribute.getAttributeType()).toArray(new String[0]);
+ enumeratedValue.setChoices(choices);
+ return enumeratedValue;
+ } else if (attribute instanceof BooleanAttribute) {
+ enumeratedValue.setValue(attribute.getDisplayableString());
+ enumeratedValue.setChoices(BooleanAttribute.booleanChoices);
+ return enumeratedValue;
+ } else if (attribute instanceof DateAttribute) {
+ dateValue.setValue((Date) object);
+ return dateValue;
+ } else {
+ stringValue.setValue(attribute.getDisplayableString() != null ? attribute.getDisplayableString() : "");
+ return stringValue;
+ }
+ } catch (OseeCoreException ex) {
+ return Lib.exceptionToString(ex);
+ }
+ }
+
+ @Override
+ public void modify(Object element, String property, Object value) {
+ if (element != null) {
+ // Note that it is possible for an SWT Item to be passed instead of the model element.
+ if (element instanceof Item) {
+ element = ((Item) element).getData();
+ }
+ try {
+ Attribute<?> attribute = (Attribute<?>) element;
+
+ if (attribute instanceof DateAttribute) {
+ if (value instanceof GregorianCalendar) {
+ ((DateAttribute) attribute).setValue(new Date(((GregorianCalendar) value).getTimeInMillis()));
+ } else {
+ ((DateAttribute) attribute).setValue((Date) value);
+ }
+ } else if (!(attribute instanceof BinaryAttribute<?>)) {
+ //binary attributes should not be changed.
+ attribute.setFromString((String) value);
+ }
+ } catch (Exception ex) {
+ OseeLog.log(SkynetGuiPlugin.class, OseeLevel.SEVERE_POPUP, ex);
+ }
+ tableViewer.update(element, null);
+ editor.onDirtied();
+ attrComp.notifyModifyAttribuesListeners();
+ }
+ }
+}
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/AttributeLabelProvider.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/AttributeLabelProvider.java
index 42024043f71..e8f1b74e80b 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/AttributeLabelProvider.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/AttributeLabelProvider.java
@@ -1,67 +1,67 @@
-/*******************************************************************************
- * 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.skynet;
-
-import org.eclipse.jface.viewers.ILabelProviderListener;
-import org.eclipse.jface.viewers.ITableLabelProvider;
-import org.eclipse.osee.framework.core.exception.OseeCoreException;
-import org.eclipse.osee.framework.jdk.core.util.Lib;
-import org.eclipse.osee.framework.skynet.core.artifact.Attribute;
-import org.eclipse.swt.graphics.Image;
-
-/**
- * @author Ryan D. Brooks
- */
-public class AttributeLabelProvider implements ITableLabelProvider {
-
- public AttributeLabelProvider() {
- super();
- }
-
- @Override
- public Image getColumnImage(Object element, int columnIndex) {
- return null;
- }
-
- @Override
- public String getColumnText(Object element, int columnIndex) {
- Attribute<?> attribute = (Attribute<?>) element;
- if (columnIndex == 0) {
- return attribute.getAttributeType().getName();
- }
- try {
- return attribute.getDisplayableString();
- } catch (OseeCoreException ex) {
- return Lib.exceptionToString(ex);
- }
- }
-
- @Override
- public void addListener(ILabelProviderListener listener) {
- // do nothing
- }
-
- @Override
- public void dispose() {
- // do nothing
- }
-
- @Override
- public boolean isLabelProperty(Object element, String property) {
- return false;
- }
-
- @Override
- public void removeListener(ILabelProviderListener listener) {
- // do nothing
- }
-
-}
+/*******************************************************************************
+ * 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.skynet;
+
+import org.eclipse.jface.viewers.ILabelProviderListener;
+import org.eclipse.jface.viewers.ITableLabelProvider;
+import org.eclipse.osee.framework.core.exception.OseeCoreException;
+import org.eclipse.osee.framework.jdk.core.util.Lib;
+import org.eclipse.osee.framework.skynet.core.artifact.Attribute;
+import org.eclipse.swt.graphics.Image;
+
+/**
+ * @author Ryan D. Brooks
+ */
+public class AttributeLabelProvider implements ITableLabelProvider {
+
+ public AttributeLabelProvider() {
+ super();
+ }
+
+ @Override
+ public Image getColumnImage(Object element, int columnIndex) {
+ return null;
+ }
+
+ @Override
+ public String getColumnText(Object element, int columnIndex) {
+ Attribute<?> attribute = (Attribute<?>) element;
+ if (columnIndex == 0) {
+ return attribute.getAttributeType().getName();
+ }
+ try {
+ return attribute.getDisplayableString();
+ } catch (OseeCoreException ex) {
+ return Lib.exceptionToString(ex);
+ }
+ }
+
+ @Override
+ public void addListener(ILabelProviderListener listener) {
+ // do nothing
+ }
+
+ @Override
+ public void dispose() {
+ // do nothing
+ }
+
+ @Override
+ public boolean isLabelProperty(Object element, String property) {
+ return false;
+ }
+
+ @Override
+ public void removeListener(ILabelProviderListener listener) {
+ // do nothing
+ }
+
+}
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/AttributesComposite.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/AttributesComposite.java
index b2999605990..4e86e0be769 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/AttributesComposite.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/AttributesComposite.java
@@ -1,339 +1,339 @@
-/*******************************************************************************
- * 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.skynet;
-
-import java.util.ArrayList;
-import java.util.logging.Level;
-import org.eclipse.jface.viewers.CellEditor;
-import org.eclipse.jface.viewers.ColumnViewerEditor;
-import org.eclipse.jface.viewers.ColumnViewerEditorActivationStrategy;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.TableViewer;
-import org.eclipse.jface.viewers.TableViewerEditor;
-import org.eclipse.osee.framework.core.exception.OseeCoreException;
-import org.eclipse.osee.framework.core.model.type.AttributeType;
-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.skynet.core.artifact.Attribute;
-import org.eclipse.osee.framework.ui.skynet.widgets.cellEditor.UniversalCellEditor;
-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.custom.SashForm;
-import org.eclipse.swt.events.ArmEvent;
-import org.eclipse.swt.events.ArmListener;
-import org.eclipse.swt.events.MenuEvent;
-import org.eclipse.swt.events.MenuListener;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Menu;
-import org.eclipse.swt.widgets.MenuItem;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.TableColumn;
-import org.eclipse.swt.widgets.TableItem;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.swt.widgets.ToolBar;
-
-public class AttributesComposite extends Composite {
- private TableViewer tableViewer;
- private Table table;
- private Text helpText;
- private static final String[] columnNames = new String[] {"name", "value"};
- private static final Integer[] columnWidths = new Integer[] {200, 600};
- private Artifact artifact;
- private final IDirtiableEditor editor;
- private Label warningLabel;
- private final ArrayList<ModifyAttributesListener> modifyAttrListeners = new ArrayList<ModifyAttributesListener>();
- private MenuItem deleteItem;
- private final ToolBar toolBar;
-
- public static final int NAME_COLUMN_INDEX = 0;
- public static final int VALUE_COLUMN_INDEX = 1;
-
- public AttributesComposite(IDirtiableEditor editor, Composite parent, int style, Artifact artifact) {
- this(editor, parent, style, artifact, null);
- }
-
- public AttributesComposite(IDirtiableEditor editor, Composite parent, int style, Artifact artifact, ToolBar toolBar) {
- super(parent, style);
- this.artifact = artifact;
- this.editor = editor;
-
- create(this);
- Menu popupMenu = new Menu(parent);
- createAddMenuItem(popupMenu);
- createDeleteMenuItem(popupMenu);
- popupMenu.addMenuListener(new AttributeMenuListener());
- tableViewer.getTable().setMenu(popupMenu);
-
- this.toolBar = toolBar;
- }
-
- public void updateLabel(String msg) {
- warningLabel.setText(msg);
- layout();
- }
-
- private void create(Composite parent) {
- this.setLayout(new GridLayout());
- this.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
-
- SashForm mainSash = new SashForm(this, SWT.NONE);
- mainSash.setLayout(new GridLayout());
- mainSash.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
- mainSash.setOrientation(SWT.VERTICAL);
-
- createTableArea(mainSash);
-
- SashForm sashForm = new SashForm(mainSash, SWT.NONE);
- sashForm.setLayout(new GridLayout());
- sashForm.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
- sashForm.setOrientation(SWT.HORIZONTAL);
-
- createWarningArea(sashForm);
- createHelpArea(sashForm);
-
- mainSash.setWeights(new int[] {8, 2});
- sashForm.setWeights(new int[] {5, 5});
-
- setHelpContexts();
- }
-
- private void createTableArea(Composite parent) {
- Group composite = new Group(parent, SWT.NONE);
- composite.setLayout(new GridLayout());
- composite.setLayoutData(new GridData(SWT.CENTER, SWT.CENTER, true, true));
- composite.setText("Attributes");
-
- createTable(composite);
- createColumns();
- createTableViewer(composite);
-
- tableViewer.refresh();
- attachTableListeners();
- }
-
- private void createTable(Composite parent) {
- table =
- new Table(parent,
- SWT.SINGLE | SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL | SWT.FULL_SELECTION | SWT.HIDE_SELECTION);
- table.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
- table.setLinesVisible(true);
- table.setHeaderVisible(true);
- }
-
- private void attachTableListeners() {
- tableViewer.addPostSelectionChangedListener(new ISelectionChangedListener() {
-
- @Override
- public void selectionChanged(SelectionChangedEvent event) {
- IStructuredSelection selection = (IStructuredSelection) event.getSelection();
- Object selected = selection.getFirstElement();
-
- if (selected instanceof Attribute<?>) {
- Attribute<?> attribute = (Attribute<?>) selected;
- String tipText = attribute.getAttributeType().getDescription();
- if (tipText != null && !tipText.equals("null")) {
- helpText.setText(tipText);
- } else {
- helpText.setText("");
- }
- }
- }
- });
- }
-
- private void createTableViewer(Composite parent) {
- tableViewer = new TableViewer(table);
-
- TableViewerEditor.create(
- tableViewer,
- new ColumnViewerEditorActivationStrategy(tableViewer),
- ColumnViewerEditor.TABBING_HORIZONTAL | ColumnViewerEditor.TABBING_MOVE_TO_ROW_NEIGHBOR | ColumnViewerEditor.TABBING_VERTICAL | ColumnViewerEditor.KEYBOARD_ACTIVATION);
- tableViewer.setUseHashlookup(true);
- tableViewer.setColumnProperties(columnNames);
-
- if (!artifact.isReadOnly()) {
- CellEditor[] editors = new CellEditor[columnNames.length];
- editors[VALUE_COLUMN_INDEX] = new UniversalCellEditor(table, SWT.NONE);
-
- tableViewer.setCellEditors(editors);
- tableViewer.setCellModifier(new AttributeCellModifier(editor, tableViewer, this));
- }
- tableViewer.setContentProvider(new AttributeContentProvider());
- tableViewer.setLabelProvider(new AttributeLabelProvider());
- tableViewer.setInput(artifact);
- }
-
- private void createColumns() {
- for (int index = 0; index < columnNames.length; index++) {
- TableColumn column = new TableColumn(table, SWT.LEFT, index);
- column.setText(columnNames[index]);
- column.setWidth(columnWidths[index]);
- }
- }
-
- private void createHelpArea(Composite parent) {
- Group composite = new Group(parent, SWT.NONE);
- composite.setLayout(new GridLayout());
- composite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
- composite.setText("Tips");
-
- helpText = new Text(composite, SWT.WRAP | SWT.READ_ONLY);
- helpText.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
- }
-
- private void createWarningArea(Composite parent) {
- Group composite = new Group(parent, SWT.NONE);
- composite.setLayout(new GridLayout());
- composite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
- composite.setText("Warnings");
-
- warningLabel = new Label(composite, SWT.NONE);
- warningLabel.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
- warningLabel.setForeground(Displays.getSystemColor(SWT.COLOR_RED));
- updateLabel("");
- }
-
- private void createAddMenuItem(Menu parentMenu) {
- MenuItem addItem = new MenuItem(parentMenu, SWT.CASCADE);
- addItem.setText("Add");
- addItem.setEnabled(true && !artifact.isReadOnly());
-
- // Update the enabled values for the popup menu each time it comes up
- addItem.addArmListener(new ArmListener() {
-
- @Override
- public void widgetArmed(ArmEvent e) {
- MenuItem addItem = (MenuItem) e.getSource();
- for (MenuItem attrItem : addItem.getMenu().getItems()) {
- try {
- attrItem.setEnabled(artifact.getRemainingAttributeCount((AttributeType) attrItem.getData()) > 0);
- } catch (OseeCoreException ex) {
- OseeLog.log(SkynetGuiPlugin.class, Level.SEVERE, ex);
- }
- }
- }
- });
-
- Menu attributesMenu = new Menu(parentMenu);
-
- try {
- SelectionAdapter listener = new AttributeMenuSelectionListener(this, tableViewer, editor);
- for (AttributeType attributeType : artifact.getAttributeTypes()) {
- MenuItem item = new MenuItem(attributesMenu, SWT.CASCADE);
- item.setText(attributeType.getName() + " Attribute");
- item.setData(attributeType);
- item.addSelectionListener(listener);
- }
- } catch (OseeCoreException ex) {
- OseeLog.log(SkynetGuiPlugin.class, OseeLevel.SEVERE_POPUP, ex);
- }
- addItem.setMenu(attributesMenu);
- }
-
- private void createDeleteMenuItem(Menu parentMenu) {
- deleteItem = new MenuItem(parentMenu, SWT.PUSH);
- deleteItem.setImage(null);
- deleteItem.setText("Delete");
- deleteItem.addSelectionListener(new SelectionAdapter() {
- @Override
- public void widgetSelected(SelectionEvent e) {
- Attribute<?> attribute = getSelectedAttribute();
- attribute.delete();
- editor.onDirtied();
- notifyModifyAttribuesListeners();
- tableViewer.refresh();
- }
- });
- }
-
- private Attribute<?> getSelectedAttribute() {
- TableItem[] items = tableViewer.getTable().getSelection();
- if (items.length > 0) {
- return (Attribute<?>) tableViewer.getTable().getSelection()[0].getData();
- } else {
- return null;
- }
- }
-
- public class AttributeMenuListener implements MenuListener {
- @Override
- public void menuHidden(MenuEvent e) {
- // do nothing
- }
-
- @Override
- public void menuShown(MenuEvent e) {
- Attribute<?> attribute = getSelectedAttribute();
-
- if (attribute == null) {
- deleteItem.setText("Delete - No Attribute Selected");
- deleteItem.setEnabled(false);
- } else if (!attribute.canDelete()) {
- deleteItem.setText("Delete - Lower Limit Met");
- deleteItem.setEnabled(false);
- } else {
- deleteItem.setText("Delete");
- deleteItem.setEnabled(!artifact.isReadOnly());
- }
- }
- }
-
- public Artifact getArtifact() {
- return artifact;
- }
-
- public void refreshArtifact(Artifact artifact) {
- this.artifact = artifact;
-
- if (tableViewer.getContentProvider() != null) {
- tableViewer.setInput(artifact);
- tableViewer.refresh();
- }
- }
-
- public void addModifyAttributesListener(ModifyAttributesListener listener) {
- if (!modifyAttrListeners.contains(listener)) {
- modifyAttrListeners.add(listener);
- }
- }
-
- public void removeModifyAttributesListener(ModifyAttributesListener listener) {
- modifyAttrListeners.remove(listener);
- }
-
- public void notifyModifyAttribuesListeners() {
- for (ModifyAttributesListener listener : modifyAttrListeners) {
- listener.handleEvent();
- }
- }
-
- private void setHelpContexts() {
- SkynetGuiPlugin.getInstance().setHelp(tableViewer.getControl(), "artifact_editor",
- "org.eclipse.osee.framework.help.ui");
- }
-
- /**
- * @return the toolBar
- */
- public ToolBar getToolBar() {
- return toolBar;
- }
-}
+/*******************************************************************************
+ * 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.skynet;
+
+import java.util.ArrayList;
+import java.util.logging.Level;
+import org.eclipse.jface.viewers.CellEditor;
+import org.eclipse.jface.viewers.ColumnViewerEditor;
+import org.eclipse.jface.viewers.ColumnViewerEditorActivationStrategy;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.jface.viewers.TableViewer;
+import org.eclipse.jface.viewers.TableViewerEditor;
+import org.eclipse.osee.framework.core.exception.OseeCoreException;
+import org.eclipse.osee.framework.core.model.type.AttributeType;
+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.skynet.core.artifact.Attribute;
+import org.eclipse.osee.framework.ui.skynet.widgets.cellEditor.UniversalCellEditor;
+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.custom.SashForm;
+import org.eclipse.swt.events.ArmEvent;
+import org.eclipse.swt.events.ArmListener;
+import org.eclipse.swt.events.MenuEvent;
+import org.eclipse.swt.events.MenuListener;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Group;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Menu;
+import org.eclipse.swt.widgets.MenuItem;
+import org.eclipse.swt.widgets.Table;
+import org.eclipse.swt.widgets.TableColumn;
+import org.eclipse.swt.widgets.TableItem;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.swt.widgets.ToolBar;
+
+public class AttributesComposite extends Composite {
+ private TableViewer tableViewer;
+ private Table table;
+ private Text helpText;
+ private static final String[] columnNames = new String[] {"name", "value"};
+ private static final Integer[] columnWidths = new Integer[] {200, 600};
+ private Artifact artifact;
+ private final IDirtiableEditor editor;
+ private Label warningLabel;
+ private final ArrayList<ModifyAttributesListener> modifyAttrListeners = new ArrayList<ModifyAttributesListener>();
+ private MenuItem deleteItem;
+ private final ToolBar toolBar;
+
+ public static final int NAME_COLUMN_INDEX = 0;
+ public static final int VALUE_COLUMN_INDEX = 1;
+
+ public AttributesComposite(IDirtiableEditor editor, Composite parent, int style, Artifact artifact) {
+ this(editor, parent, style, artifact, null);
+ }
+
+ public AttributesComposite(IDirtiableEditor editor, Composite parent, int style, Artifact artifact, ToolBar toolBar) {
+ super(parent, style);
+ this.artifact = artifact;
+ this.editor = editor;
+
+ create(this);
+ Menu popupMenu = new Menu(parent);
+ createAddMenuItem(popupMenu);
+ createDeleteMenuItem(popupMenu);
+ popupMenu.addMenuListener(new AttributeMenuListener());
+ tableViewer.getTable().setMenu(popupMenu);
+
+ this.toolBar = toolBar;
+ }
+
+ public void updateLabel(String msg) {
+ warningLabel.setText(msg);
+ layout();
+ }
+
+ private void create(Composite parent) {
+ this.setLayout(new GridLayout());
+ this.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
+
+ SashForm mainSash = new SashForm(this, SWT.NONE);
+ mainSash.setLayout(new GridLayout());
+ mainSash.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
+ mainSash.setOrientation(SWT.VERTICAL);
+
+ createTableArea(mainSash);
+
+ SashForm sashForm = new SashForm(mainSash, SWT.NONE);
+ sashForm.setLayout(new GridLayout());
+ sashForm.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
+ sashForm.setOrientation(SWT.HORIZONTAL);
+
+ createWarningArea(sashForm);
+ createHelpArea(sashForm);
+
+ mainSash.setWeights(new int[] {8, 2});
+ sashForm.setWeights(new int[] {5, 5});
+
+ setHelpContexts();
+ }
+
+ private void createTableArea(Composite parent) {
+ Group composite = new Group(parent, SWT.NONE);
+ composite.setLayout(new GridLayout());
+ composite.setLayoutData(new GridData(SWT.CENTER, SWT.CENTER, true, true));
+ composite.setText("Attributes");
+
+ createTable(composite);
+ createColumns();
+ createTableViewer(composite);
+
+ tableViewer.refresh();
+ attachTableListeners();
+ }
+
+ private void createTable(Composite parent) {
+ table =
+ new Table(parent,
+ SWT.SINGLE | SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL | SWT.FULL_SELECTION | SWT.HIDE_SELECTION);
+ table.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
+ table.setLinesVisible(true);
+ table.setHeaderVisible(true);
+ }
+
+ private void attachTableListeners() {
+ tableViewer.addPostSelectionChangedListener(new ISelectionChangedListener() {
+
+ @Override
+ public void selectionChanged(SelectionChangedEvent event) {
+ IStructuredSelection selection = (IStructuredSelection) event.getSelection();
+ Object selected = selection.getFirstElement();
+
+ if (selected instanceof Attribute<?>) {
+ Attribute<?> attribute = (Attribute<?>) selected;
+ String tipText = attribute.getAttributeType().getDescription();
+ if (tipText != null && !tipText.equals("null")) {
+ helpText.setText(tipText);
+ } else {
+ helpText.setText("");
+ }
+ }
+ }
+ });
+ }
+
+ private void createTableViewer(Composite parent) {
+ tableViewer = new TableViewer(table);
+
+ TableViewerEditor.create(
+ tableViewer,
+ new ColumnViewerEditorActivationStrategy(tableViewer),
+ ColumnViewerEditor.TABBING_HORIZONTAL | ColumnViewerEditor.TABBING_MOVE_TO_ROW_NEIGHBOR | ColumnViewerEditor.TABBING_VERTICAL | ColumnViewerEditor.KEYBOARD_ACTIVATION);
+ tableViewer.setUseHashlookup(true);
+ tableViewer.setColumnProperties(columnNames);
+
+ if (!artifact.isReadOnly()) {
+ CellEditor[] editors = new CellEditor[columnNames.length];
+ editors[VALUE_COLUMN_INDEX] = new UniversalCellEditor(table, SWT.NONE);
+
+ tableViewer.setCellEditors(editors);
+ tableViewer.setCellModifier(new AttributeCellModifier(editor, tableViewer, this));
+ }
+ tableViewer.setContentProvider(new AttributeContentProvider());
+ tableViewer.setLabelProvider(new AttributeLabelProvider());
+ tableViewer.setInput(artifact);
+ }
+
+ private void createColumns() {
+ for (int index = 0; index < columnNames.length; index++) {
+ TableColumn column = new TableColumn(table, SWT.LEFT, index);
+ column.setText(columnNames[index]);
+ column.setWidth(columnWidths[index]);
+ }
+ }
+
+ private void createHelpArea(Composite parent) {
+ Group composite = new Group(parent, SWT.NONE);
+ composite.setLayout(new GridLayout());
+ composite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
+ composite.setText("Tips");
+
+ helpText = new Text(composite, SWT.WRAP | SWT.READ_ONLY);
+ helpText.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
+ }
+
+ private void createWarningArea(Composite parent) {
+ Group composite = new Group(parent, SWT.NONE);
+ composite.setLayout(new GridLayout());
+ composite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
+ composite.setText("Warnings");
+
+ warningLabel = new Label(composite, SWT.NONE);
+ warningLabel.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
+ warningLabel.setForeground(Displays.getSystemColor(SWT.COLOR_RED));
+ updateLabel("");
+ }
+
+ private void createAddMenuItem(Menu parentMenu) {
+ MenuItem addItem = new MenuItem(parentMenu, SWT.CASCADE);
+ addItem.setText("Add");
+ addItem.setEnabled(true && !artifact.isReadOnly());
+
+ // Update the enabled values for the popup menu each time it comes up
+ addItem.addArmListener(new ArmListener() {
+
+ @Override
+ public void widgetArmed(ArmEvent e) {
+ MenuItem addItem = (MenuItem) e.getSource();
+ for (MenuItem attrItem : addItem.getMenu().getItems()) {
+ try {
+ attrItem.setEnabled(artifact.getRemainingAttributeCount((AttributeType) attrItem.getData()) > 0);
+ } catch (OseeCoreException ex) {
+ OseeLog.log(SkynetGuiPlugin.class, Level.SEVERE, ex);
+ }
+ }
+ }
+ });
+
+ Menu attributesMenu = new Menu(parentMenu);
+
+ try {
+ SelectionAdapter listener = new AttributeMenuSelectionListener(this, tableViewer, editor);
+ for (AttributeType attributeType : artifact.getAttributeTypes()) {
+ MenuItem item = new MenuItem(attributesMenu, SWT.CASCADE);
+ item.setText(attributeType.getName() + " Attribute");
+ item.setData(attributeType);
+ item.addSelectionListener(listener);
+ }
+ } catch (OseeCoreException ex) {
+ OseeLog.log(SkynetGuiPlugin.class, OseeLevel.SEVERE_POPUP, ex);
+ }
+ addItem.setMenu(attributesMenu);
+ }
+
+ private void createDeleteMenuItem(Menu parentMenu) {
+ deleteItem = new MenuItem(parentMenu, SWT.PUSH);
+ deleteItem.setImage(null);
+ deleteItem.setText("Delete");
+ deleteItem.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ Attribute<?> attribute = getSelectedAttribute();
+ attribute.delete();
+ editor.onDirtied();
+ notifyModifyAttribuesListeners();
+ tableViewer.refresh();
+ }
+ });
+ }
+
+ private Attribute<?> getSelectedAttribute() {
+ TableItem[] items = tableViewer.getTable().getSelection();
+ if (items.length > 0) {
+ return (Attribute<?>) tableViewer.getTable().getSelection()[0].getData();
+ } else {
+ return null;
+ }
+ }
+
+ public class AttributeMenuListener implements MenuListener {
+ @Override
+ public void menuHidden(MenuEvent e) {
+ // do nothing
+ }
+
+ @Override
+ public void menuShown(MenuEvent e) {
+ Attribute<?> attribute = getSelectedAttribute();
+
+ if (attribute == null) {
+ deleteItem.setText("Delete - No Attribute Selected");
+ deleteItem.setEnabled(false);
+ } else if (!attribute.canDelete()) {
+ deleteItem.setText("Delete - Lower Limit Met");
+ deleteItem.setEnabled(false);
+ } else {
+ deleteItem.setText("Delete");
+ deleteItem.setEnabled(!artifact.isReadOnly());
+ }
+ }
+ }
+
+ public Artifact getArtifact() {
+ return artifact;
+ }
+
+ public void refreshArtifact(Artifact artifact) {
+ this.artifact = artifact;
+
+ if (tableViewer.getContentProvider() != null) {
+ tableViewer.setInput(artifact);
+ tableViewer.refresh();
+ }
+ }
+
+ public void addModifyAttributesListener(ModifyAttributesListener listener) {
+ if (!modifyAttrListeners.contains(listener)) {
+ modifyAttrListeners.add(listener);
+ }
+ }
+
+ public void removeModifyAttributesListener(ModifyAttributesListener listener) {
+ modifyAttrListeners.remove(listener);
+ }
+
+ public void notifyModifyAttribuesListeners() {
+ for (ModifyAttributesListener listener : modifyAttrListeners) {
+ listener.handleEvent();
+ }
+ }
+
+ private void setHelpContexts() {
+ SkynetGuiPlugin.getInstance().setHelp(tableViewer.getControl(), "artifact_editor",
+ "org.eclipse.osee.framework.help.ui");
+ }
+
+ /**
+ * @return the toolBar
+ */
+ public ToolBar getToolBar() {
+ return toolBar;
+ }
+}
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/RelationCellModifier.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/RelationCellModifier.java
index 0f144183168..c846e4e1fb3 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/RelationCellModifier.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/RelationCellModifier.java
@@ -25,9 +25,6 @@ import org.eclipse.swt.widgets.Item;
public class RelationCellModifier implements ICellModifier {
private final TreeViewer treeViewer;
- /**
- *
- */
public RelationCellModifier(TreeViewer treeViewer) {
super();
this.treeViewer = treeViewer;
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 a154910683b..c75cbbdbac3 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
@@ -563,7 +563,6 @@ public class RelationsComposite extends Composite implements IFrameworkTransacti
/**
* Performs the deletion functionality
*
- * @param selection
*/
private void performDeleteArtifact(IStructuredSelection selection) {
try {
@@ -591,7 +590,6 @@ public class RelationsComposite extends Composite implements IFrameworkTransacti
/**
* Performs the deletion functionality
*
- * @param selection
* @throws ArtifactDoesNotExist
*/
private void performDeleteRelation(IStructuredSelection selection) {
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/XFormToolkit.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/XFormToolkit.java
index 06dfe041196..d2efca996b6 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/XFormToolkit.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/XFormToolkit.java
@@ -30,16 +30,10 @@ import org.eclipse.ui.forms.widgets.Section;
*/
public class XFormToolkit extends FormToolkit {
- /**
- * @param display
- */
public XFormToolkit(Display display) {
super(display);
}
- /**
- * @param colors
- */
public XFormToolkit(FormColors colors) {
super(colors);
}
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/access/PolicyDialog.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/access/PolicyDialog.java
index cf10b1b043b..5282d881ae3 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/access/PolicyDialog.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/access/PolicyDialog.java
@@ -1,213 +1,213 @@
-/*******************************************************************************
- * 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.skynet.access;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.logging.Level;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.osee.framework.access.AccessControlData;
-import org.eclipse.osee.framework.access.AccessControlManager;
-import org.eclipse.osee.framework.core.enums.CoreArtifactTypes;
-import org.eclipse.osee.framework.core.enums.PermissionEnum;
-import org.eclipse.osee.framework.core.exception.OseeCoreException;
-import org.eclipse.osee.framework.core.model.Branch;
-import org.eclipse.osee.framework.logging.OseeLog;
-import org.eclipse.osee.framework.skynet.core.UserManager;
-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.ui.skynet.SkynetGuiPlugin;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-
-/**
- * GUI that is used to maintain an <Code>Artifact</Code> access control list.
- *
- * @author Jeff C. Phillips
- */
-public class PolicyDialog extends Dialog {
- private PolicyTableViewer policyTableViewer;
- private Button btnAdd;
- private Button chkChildrenPermission;
- private Combo cmbUsers;
- private Combo cmbPermissionLevel;
- private final Object accessControlledObject;
- private Label accessLabel;
-
- public PolicyDialog(Shell parentShell, Object accessControlledObject) {
- super(parentShell);
-
- this.accessControlledObject = accessControlledObject;
- setShellStyle(SWT.DIALOG_TRIM | SWT.APPLICATION_MODAL | getDefaultOrientation() | SWT.RESIZE);
- }
-
- @Override
- protected Control createDialogArea(Composite parent) {
- getShell().setText("Access Control List: " + getHeaderName(accessControlledObject));
- Composite mainComposite = new Composite(parent, SWT.NONE);
- mainComposite.setFont(parent.getFont());
- mainComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
- mainComposite.setLayout(new GridLayout(1, false));
-
- addDialogContols(mainComposite);
- try {
- setInputs();
- } catch (Exception ex) {
- OseeLog.log(SkynetGuiPlugin.class, Level.SEVERE, ex);
- }
- addListeners();
- checkEnabled();
-
- return mainComposite;
- }
-
- private void setInputs() throws OseeCoreException {
- cmbUsers.setText("-Select Person-");
- cmbPermissionLevel.setText("-Select Permission-");
-
- ArrayList<Artifact> subjectList = new ArrayList<Artifact>();
- subjectList.addAll(UserManager.getUsersSortedByName());
- subjectList.addAll(ArtifactQuery.getArtifactListFromType(CoreArtifactTypes.UserGroup,
- BranchManager.getCommonBranch()));
- Collections.sort(subjectList, new UserComparator<Artifact>());
- for (Artifact subject : subjectList) {
- String name = subject.getName();
- cmbUsers.add(name);
- cmbUsers.setData(name, subject);
- }
-
- PermissionEnum[] permissions = PermissionEnum.values();
- Arrays.sort(permissions, new Comparator<PermissionEnum>() {
-
- @Override
- public int compare(PermissionEnum o1, PermissionEnum o2) {
- return o1.getName().compareToIgnoreCase(o2.getName());
- }
- });
-
- for (PermissionEnum permission : permissions) {
- if (!permission.equals(PermissionEnum.LOCK)) {
- cmbPermissionLevel.add(permission.getName() + " - Rank = " + permission.getRank() + "");
- cmbPermissionLevel.setData(permission.getName(), permission);
- }
- }
- }
-
- private void addListeners() {
- btnAdd.addSelectionListener(new SelectionAdapter() {
- @Override
- public void widgetSelected(SelectionEvent e) {
- Artifact subject = (Artifact) cmbUsers.getData(cmbUsers.getText().replaceAll(" - Rank.*", ""));
- PermissionEnum permission =
- (PermissionEnum) cmbPermissionLevel.getData(cmbPermissionLevel.getText().replaceAll(" - Rank.*", ""));
-
- if (subject != null && permission != null) {
- policyTableViewer.addItem(subject, accessControlledObject, permission);
- }
- }
- });
- }
-
- private void addDialogContols(Composite mainComposite) {
-
- accessLabel = new Label(mainComposite, SWT.NONE);
-
- Group group = new Group(mainComposite, SWT.NULL);
- group.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
- group.setLayout(new GridLayout(1, false));
-
- policyTableViewer = new PolicyTableViewer(group, accessControlledObject);
-
- Composite composite = new Composite(group, SWT.NONE);
- composite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false));
- composite.setLayout(new GridLayout(4, false));
-
- cmbUsers = new Combo(composite, SWT.NONE);
- cmbPermissionLevel = new Combo(composite, SWT.NONE);
- btnAdd = new Button(composite, SWT.PUSH);
- btnAdd.setText("Add");
- new Label(composite, SWT.NONE).setText(" NOTE: Higher permission rank overrides lower rank.");
-
- chkChildrenPermission = new Button(mainComposite, SWT.CHECK);
- chkChildrenPermission.setText("Set permission for artifact's default hierarchy descendents.");
- }
-
- private void checkEnabled() {
- boolean accessEnabled = getAccessEnabled();
-
- accessLabel.setText(accessEnabled ? "" : "You do not have permissions to modify access.");
-
- boolean isArtifact = accessControlledObject instanceof Artifact;
-
- cmbUsers.setEnabled(accessEnabled);
- cmbPermissionLevel.setEnabled(accessEnabled);
- btnAdd.setEnabled(accessEnabled);
- policyTableViewer.allowTableModification(accessEnabled);
- chkChildrenPermission.setEnabled(isArtifact);
- }
-
- private boolean getAccessEnabled() {
- boolean returnValue;
-
- try {
- returnValue = AccessControlManager.hasPermission(accessControlledObject, PermissionEnum.WRITE);
- } catch (OseeCoreException ex) {
- OseeLog.log(SkynetGuiPlugin.class, Level.SEVERE, ex);
- returnValue = false;
- }
-
- return returnValue;
- }
-
- @Override
- protected void okPressed() {
- for (AccessControlData data : policyTableViewer.getAccessControlList().values()) {
- if (data.isDirty()) {
- boolean isRecursionAllowed = chkChildrenPermission.getSelection();
- AccessControlManager.persistPermission(data, isRecursionAllowed);
- }
- }
- super.okPressed();
- }
-
- private String getHeaderName(Object object) {
- String name = "";
- if (object instanceof Artifact) {
- name = ((Artifact) object).getName();
- } else if (object instanceof Branch) {
- name = ((Branch) object).getName();
- }
- return name;
- }
-
- private static final class UserComparator<T> implements Comparator<T> {
- @Override
- public int compare(T o1, T o2) {
- if (o1 instanceof Artifact && o2 instanceof Artifact) {
- return ((Artifact) o1).getName().compareToIgnoreCase(((Artifact) o2).getName());
- }
- return 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.skynet.access;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.logging.Level;
+import org.eclipse.jface.dialogs.Dialog;
+import org.eclipse.osee.framework.access.AccessControlData;
+import org.eclipse.osee.framework.access.AccessControlManager;
+import org.eclipse.osee.framework.core.enums.CoreArtifactTypes;
+import org.eclipse.osee.framework.core.enums.PermissionEnum;
+import org.eclipse.osee.framework.core.exception.OseeCoreException;
+import org.eclipse.osee.framework.core.model.Branch;
+import org.eclipse.osee.framework.logging.OseeLog;
+import org.eclipse.osee.framework.skynet.core.UserManager;
+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.ui.skynet.SkynetGuiPlugin;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Combo;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Group;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Shell;
+
+/**
+ * GUI that is used to maintain an <Code>Artifact</Code> access control list.
+ *
+ * @author Jeff C. Phillips
+ */
+public class PolicyDialog extends Dialog {
+ private PolicyTableViewer policyTableViewer;
+ private Button btnAdd;
+ private Button chkChildrenPermission;
+ private Combo cmbUsers;
+ private Combo cmbPermissionLevel;
+ private final Object accessControlledObject;
+ private Label accessLabel;
+
+ public PolicyDialog(Shell parentShell, Object accessControlledObject) {
+ super(parentShell);
+
+ this.accessControlledObject = accessControlledObject;
+ setShellStyle(SWT.DIALOG_TRIM | SWT.APPLICATION_MODAL | getDefaultOrientation() | SWT.RESIZE);
+ }
+
+ @Override
+ protected Control createDialogArea(Composite parent) {
+ getShell().setText("Access Control List: " + getHeaderName(accessControlledObject));
+ Composite mainComposite = new Composite(parent, SWT.NONE);
+ mainComposite.setFont(parent.getFont());
+ mainComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
+ mainComposite.setLayout(new GridLayout(1, false));
+
+ addDialogContols(mainComposite);
+ try {
+ setInputs();
+ } catch (Exception ex) {
+ OseeLog.log(SkynetGuiPlugin.class, Level.SEVERE, ex);
+ }
+ addListeners();
+ checkEnabled();
+
+ return mainComposite;
+ }
+
+ private void setInputs() throws OseeCoreException {
+ cmbUsers.setText("-Select Person-");
+ cmbPermissionLevel.setText("-Select Permission-");
+
+ ArrayList<Artifact> subjectList = new ArrayList<Artifact>();
+ subjectList.addAll(UserManager.getUsersSortedByName());
+ subjectList.addAll(ArtifactQuery.getArtifactListFromType(CoreArtifactTypes.UserGroup,
+ BranchManager.getCommonBranch()));
+ Collections.sort(subjectList, new UserComparator<Artifact>());
+ for (Artifact subject : subjectList) {
+ String name = subject.getName();
+ cmbUsers.add(name);
+ cmbUsers.setData(name, subject);
+ }
+
+ PermissionEnum[] permissions = PermissionEnum.values();
+ Arrays.sort(permissions, new Comparator<PermissionEnum>() {
+
+ @Override
+ public int compare(PermissionEnum o1, PermissionEnum o2) {
+ return o1.getName().compareToIgnoreCase(o2.getName());
+ }
+ });
+
+ for (PermissionEnum permission : permissions) {
+ if (!permission.equals(PermissionEnum.LOCK)) {
+ cmbPermissionLevel.add(permission.getName() + " - Rank = " + permission.getRank() + "");
+ cmbPermissionLevel.setData(permission.getName(), permission);
+ }
+ }
+ }
+
+ private void addListeners() {
+ btnAdd.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ Artifact subject = (Artifact) cmbUsers.getData(cmbUsers.getText().replaceAll(" - Rank.*", ""));
+ PermissionEnum permission =
+ (PermissionEnum) cmbPermissionLevel.getData(cmbPermissionLevel.getText().replaceAll(" - Rank.*", ""));
+
+ if (subject != null && permission != null) {
+ policyTableViewer.addItem(subject, accessControlledObject, permission);
+ }
+ }
+ });
+ }
+
+ private void addDialogContols(Composite mainComposite) {
+
+ accessLabel = new Label(mainComposite, SWT.NONE);
+
+ Group group = new Group(mainComposite, SWT.NULL);
+ group.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
+ group.setLayout(new GridLayout(1, false));
+
+ policyTableViewer = new PolicyTableViewer(group, accessControlledObject);
+
+ Composite composite = new Composite(group, SWT.NONE);
+ composite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false));
+ composite.setLayout(new GridLayout(4, false));
+
+ cmbUsers = new Combo(composite, SWT.NONE);
+ cmbPermissionLevel = new Combo(composite, SWT.NONE);
+ btnAdd = new Button(composite, SWT.PUSH);
+ btnAdd.setText("Add");
+ new Label(composite, SWT.NONE).setText(" NOTE: Higher permission rank overrides lower rank.");
+
+ chkChildrenPermission = new Button(mainComposite, SWT.CHECK);
+ chkChildrenPermission.setText("Set permission for artifact's default hierarchy descendents.");
+ }
+
+ private void checkEnabled() {
+ boolean accessEnabled = getAccessEnabled();
+
+ accessLabel.setText(accessEnabled ? "" : "You do not have permissions to modify access.");
+
+ boolean isArtifact = accessControlledObject instanceof Artifact;
+
+ cmbUsers.setEnabled(accessEnabled);
+ cmbPermissionLevel.setEnabled(accessEnabled);
+ btnAdd.setEnabled(accessEnabled);
+ policyTableViewer.allowTableModification(accessEnabled);
+ chkChildrenPermission.setEnabled(isArtifact);
+ }
+
+ private boolean getAccessEnabled() {
+ boolean returnValue;
+
+ try {
+ returnValue = AccessControlManager.hasPermission(accessControlledObject, PermissionEnum.WRITE);
+ } catch (OseeCoreException ex) {
+ OseeLog.log(SkynetGuiPlugin.class, Level.SEVERE, ex);
+ returnValue = false;
+ }
+
+ return returnValue;
+ }
+
+ @Override
+ protected void okPressed() {
+ for (AccessControlData data : policyTableViewer.getAccessControlList().values()) {
+ if (data.isDirty()) {
+ boolean isRecursionAllowed = chkChildrenPermission.getSelection();
+ AccessControlManager.persistPermission(data, isRecursionAllowed);
+ }
+ }
+ super.okPressed();
+ }
+
+ private String getHeaderName(Object object) {
+ String name = "";
+ if (object instanceof Artifact) {
+ name = ((Artifact) object).getName();
+ } else if (object instanceof Branch) {
+ name = ((Branch) object).getName();
+ }
+ return name;
+ }
+
+ private static final class UserComparator<T> implements Comparator<T> {
+ @Override
+ public int compare(T o1, T o2) {
+ if (o1 instanceof Artifact && o2 instanceof Artifact) {
+ return ((Artifact) o1).getName().compareToIgnoreCase(((Artifact) o2).getName());
+ }
+ return 0;
+ }
+ }
+}
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/access/PolicyLabelProvider.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/access/PolicyLabelProvider.java
index 09fca9e5139..0bb3ec7c30d 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/access/PolicyLabelProvider.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/access/PolicyLabelProvider.java
@@ -1,95 +1,95 @@
-/*******************************************************************************
- * 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.skynet.access;
-
-import org.eclipse.jface.viewers.ILabelProviderListener;
-import org.eclipse.nebula.widgets.xviewer.XViewer;
-import org.eclipse.nebula.widgets.xviewer.XViewerColumn;
-import org.eclipse.nebula.widgets.xviewer.XViewerLabelProvider;
-import org.eclipse.osee.framework.access.AccessControlData;
-import org.eclipse.osee.framework.core.enums.PermissionEnum;
-import org.eclipse.osee.framework.ui.skynet.FrameworkImage;
-import org.eclipse.osee.framework.ui.swt.ImageManager;
-import org.eclipse.swt.graphics.Image;
-
-public class PolicyLabelProvider extends XViewerLabelProvider {
-
- public PolicyLabelProvider(XViewer viewer) {
- super(viewer);
- }
-
- @Override
- public String getColumnText(Object element, XViewerColumn col, int columnIndex) throws Exception {
- String ret;
- try {
- ret = getColumnText(col, (AccessControlData) element);
- } catch (Exception ex) {
- ret = "Error: " + ex.getLocalizedMessage();
- }
-
- return ret;
- }
-
- private String getColumnText(XViewerColumn col, AccessControlData data) {
- String colId = col.getId();
- if (colId.equals(PolicyTableColumns.userName.toString())) {
- return data.getSubject().getName();
- } else {
- PermissionEnum permissionEnum = null;
- if (colId.equals(PolicyTableColumns.totalAccess.toString())) {
- permissionEnum = data.getPermission();
- } else if (colId.equals(PolicyTableColumns.branchAccess.toString())) {
- permissionEnum = data.getBranchPermission();
- } else if (colId.equals(PolicyTableColumns.artifactType.toString())) {
- permissionEnum = data.getArtifactTypePermission();
- } else if (colId.equals(PolicyTableColumns.artifact.toString())) {
- permissionEnum = data.getArtifactPermission();
- }
-
- if (permissionEnum != null) {
- return permissionEnum.getName();
- }
- }
-
- return "";
- }
-
- @Override
- public Image getColumnImage(Object element, XViewerColumn col, int columnIndex) throws Exception {
- String colId = col.getId();
- if (colId.equals(PolicyTableColumns.delete.toString())) {
- return ImageManager.getImage(FrameworkImage.REMOVE);
- } else {
- return null;
- }
- }
-
- @Override
- public void dispose() {
- // do nothing
- }
-
- @Override
- public void removeListener(ILabelProviderListener listener) {
- // do nothing
- }
-
- @Override
- public void addListener(ILabelProviderListener listener) {
- // do nothing
- }
-
- @Override
- public boolean isLabelProperty(Object element, String property) {
- return true;
- }
-
+/*******************************************************************************
+ * 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.skynet.access;
+
+import org.eclipse.jface.viewers.ILabelProviderListener;
+import org.eclipse.nebula.widgets.xviewer.XViewer;
+import org.eclipse.nebula.widgets.xviewer.XViewerColumn;
+import org.eclipse.nebula.widgets.xviewer.XViewerLabelProvider;
+import org.eclipse.osee.framework.access.AccessControlData;
+import org.eclipse.osee.framework.core.enums.PermissionEnum;
+import org.eclipse.osee.framework.ui.skynet.FrameworkImage;
+import org.eclipse.osee.framework.ui.swt.ImageManager;
+import org.eclipse.swt.graphics.Image;
+
+public class PolicyLabelProvider extends XViewerLabelProvider {
+
+ public PolicyLabelProvider(XViewer viewer) {
+ super(viewer);
+ }
+
+ @Override
+ public String getColumnText(Object element, XViewerColumn col, int columnIndex) throws Exception {
+ String ret;
+ try {
+ ret = getColumnText(col, (AccessControlData) element);
+ } catch (Exception ex) {
+ ret = "Error: " + ex.getLocalizedMessage();
+ }
+
+ return ret;
+ }
+
+ private String getColumnText(XViewerColumn col, AccessControlData data) {
+ String colId = col.getId();
+ if (colId.equals(PolicyTableColumns.userName.toString())) {
+ return data.getSubject().getName();
+ } else {
+ PermissionEnum permissionEnum = null;
+ if (colId.equals(PolicyTableColumns.totalAccess.toString())) {
+ permissionEnum = data.getPermission();
+ } else if (colId.equals(PolicyTableColumns.branchAccess.toString())) {
+ permissionEnum = data.getBranchPermission();
+ } else if (colId.equals(PolicyTableColumns.artifactType.toString())) {
+ permissionEnum = data.getArtifactTypePermission();
+ } else if (colId.equals(PolicyTableColumns.artifact.toString())) {
+ permissionEnum = data.getArtifactPermission();
+ }
+
+ if (permissionEnum != null) {
+ return permissionEnum.getName();
+ }
+ }
+
+ return "";
+ }
+
+ @Override
+ public Image getColumnImage(Object element, XViewerColumn col, int columnIndex) throws Exception {
+ String colId = col.getId();
+ if (colId.equals(PolicyTableColumns.delete.toString())) {
+ return ImageManager.getImage(FrameworkImage.REMOVE);
+ } else {
+ return null;
+ }
+ }
+
+ @Override
+ public void dispose() {
+ // do nothing
+ }
+
+ @Override
+ public void removeListener(ILabelProviderListener listener) {
+ // do nothing
+ }
+
+ @Override
+ public void addListener(ILabelProviderListener listener) {
+ // do nothing
+ }
+
+ @Override
+ public boolean isLabelProperty(Object element, String property) {
+ return true;
+ }
+
} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/access/PolicyTableCellModifier.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/access/PolicyTableCellModifier.java
index 13fc638ff4b..502d508921d 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/access/PolicyTableCellModifier.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/access/PolicyTableCellModifier.java
@@ -1,72 +1,72 @@
-/*******************************************************************************
- * 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.skynet.access;
-
-import org.eclipse.jface.viewers.ICellModifier;
-import org.eclipse.osee.framework.access.AccessControlData;
-import org.eclipse.swt.widgets.TreeItem;
-
-/**
- * @author Jeff C. Phillips
- */
-public class PolicyTableCellModifier implements ICellModifier {
-
- private final PolicyTableViewer policyTableViewer;
- private boolean enabled = true;
-
- public PolicyTableCellModifier(PolicyTableViewer policyTableViewer) {
- super();
- this.policyTableViewer = policyTableViewer;
- }
-
- @Override
- public boolean canModify(Object element, String property) {
- if (property.equals(PolicyTableColumns.delete.toString())) {
- return true;
- }
- return false;
- }
-
- @Override
- public Object getValue(Object element, String property) {
- if (property.equals(PolicyTableColumns.delete.toString())) {
- return new Boolean(false);
- } else if (property.equals(PolicyTableColumns.artifact.toString())) {
- return ((AccessControlData) element).getPermission().ordinal();
- }
- return "";
- }
-
- @Override
- public void modify(Object element, String property, Object value) {
- TreeItem item = (TreeItem) element;
- AccessControlData data = (AccessControlData) item.getData();
-
- if (property.equals(PolicyTableColumns.delete.toString())) {
- policyTableViewer.removeData(data);
- }
-
- policyTableViewer.refresh();
- }
-
- public boolean isEnabled() {
- return enabled;
- }
-
- /**
- * Don't disable entire viewer, just delete button
- *
- * @param enabled the enabled to set
- */
- public void setEnabled(boolean enabled) {
- this.enabled = enabled;
- }
-}
+/*******************************************************************************
+ * 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.skynet.access;
+
+import org.eclipse.jface.viewers.ICellModifier;
+import org.eclipse.osee.framework.access.AccessControlData;
+import org.eclipse.swt.widgets.TreeItem;
+
+/**
+ * @author Jeff C. Phillips
+ */
+public class PolicyTableCellModifier implements ICellModifier {
+
+ private final PolicyTableViewer policyTableViewer;
+ private boolean enabled = true;
+
+ public PolicyTableCellModifier(PolicyTableViewer policyTableViewer) {
+ super();
+ this.policyTableViewer = policyTableViewer;
+ }
+
+ @Override
+ public boolean canModify(Object element, String property) {
+ if (property.equals(PolicyTableColumns.delete.toString())) {
+ return true;
+ }
+ return false;
+ }
+
+ @Override
+ public Object getValue(Object element, String property) {
+ if (property.equals(PolicyTableColumns.delete.toString())) {
+ return new Boolean(false);
+ } else if (property.equals(PolicyTableColumns.artifact.toString())) {
+ return ((AccessControlData) element).getPermission().ordinal();
+ }
+ return "";
+ }
+
+ @Override
+ public void modify(Object element, String property, Object value) {
+ TreeItem item = (TreeItem) element;
+ AccessControlData data = (AccessControlData) item.getData();
+
+ if (property.equals(PolicyTableColumns.delete.toString())) {
+ policyTableViewer.removeData(data);
+ }
+
+ policyTableViewer.refresh();
+ }
+
+ public boolean isEnabled() {
+ return enabled;
+ }
+
+ /**
+ * Don't disable entire viewer, just delete button
+ *
+ * @param enabled the enabled to set
+ */
+ public void setEnabled(boolean enabled) {
+ this.enabled = enabled;
+ }
+}
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/access/PolicyTableColumns.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/access/PolicyTableColumns.java
index ea3027db085..6ce53cfabd5 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/access/PolicyTableColumns.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/access/PolicyTableColumns.java
@@ -1,56 +1,56 @@
-/*******************************************************************************
- * 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.skynet.access;
-
-import org.eclipse.nebula.widgets.xviewer.XViewerColumn;
-import org.eclipse.nebula.widgets.xviewer.XViewerColumn.SortDataType;
-
-public enum PolicyTableColumns {
- dummyColumn("---", 0, 1 << 14, true, SortDataType.String, false, ""),
- delete("", 25, 1 << 24, true, SortDataType.String, false, ""),
- userName("User Name", 160, 1 << 14, true, SortDataType.String, false, ""),
- totalAccess("Total", 75, 1 << 14, true, SortDataType.String, false, ""),
- branchAccess("Branch", 75, 1 << 14, true, SortDataType.String, false, ""),
- artifactType("Artifact Type", 75, 1 << 14, true, SortDataType.String, false, ""),
- artifact("Artifact", 75, 1 << 14, true, SortDataType.String, false, "");
-
- private final String label;
- private final int width;
- private final int SWT;
- private final boolean show;
- private final SortDataType sortType;
- private final boolean multiColumnEditable;
- private final String description;
-
- private PolicyTableColumns(String label, int width, int SWT, boolean show, SortDataType sortType, boolean multiColumnEditable, String description) {
- this.label = label;
- this.width = width;
- this.SWT = SWT;
- this.show = show;
- this.sortType = sortType;
- this.multiColumnEditable = multiColumnEditable;
- this.description = description;
- }
-
- public final XViewerColumn getXViewerColumn() {
- return new XViewerColumn(this.toString(), label, width, SWT, show, sortType, multiColumnEditable, description);
- }
-
- public static String[] getNames() {
- String[] ret = new String[PolicyTableColumns.values().length];
- PolicyTableColumns[] columns = PolicyTableColumns.values();
- for (int i = 0; i < PolicyTableColumns.values().length; i++) {
- ret[i] = columns[i].toString();
- }
-
- return ret;
- }
-}
+/*******************************************************************************
+ * 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.skynet.access;
+
+import org.eclipse.nebula.widgets.xviewer.XViewerColumn;
+import org.eclipse.nebula.widgets.xviewer.XViewerColumn.SortDataType;
+
+public enum PolicyTableColumns {
+ dummyColumn("---", 0, 1 << 14, true, SortDataType.String, false, ""),
+ delete("", 25, 1 << 24, true, SortDataType.String, false, ""),
+ userName("User Name", 160, 1 << 14, true, SortDataType.String, false, ""),
+ totalAccess("Total", 75, 1 << 14, true, SortDataType.String, false, ""),
+ branchAccess("Branch", 75, 1 << 14, true, SortDataType.String, false, ""),
+ artifactType("Artifact Type", 75, 1 << 14, true, SortDataType.String, false, ""),
+ artifact("Artifact", 75, 1 << 14, true, SortDataType.String, false, "");
+
+ private final String label;
+ private final int width;
+ private final int SWT;
+ private final boolean show;
+ private final SortDataType sortType;
+ private final boolean multiColumnEditable;
+ private final String description;
+
+ private PolicyTableColumns(String label, int width, int SWT, boolean show, SortDataType sortType, boolean multiColumnEditable, String description) {
+ this.label = label;
+ this.width = width;
+ this.SWT = SWT;
+ this.show = show;
+ this.sortType = sortType;
+ this.multiColumnEditable = multiColumnEditable;
+ this.description = description;
+ }
+
+ public final XViewerColumn getXViewerColumn() {
+ return new XViewerColumn(this.toString(), label, width, SWT, show, sortType, multiColumnEditable, description);
+ }
+
+ public static String[] getNames() {
+ String[] ret = new String[PolicyTableColumns.values().length];
+ PolicyTableColumns[] columns = PolicyTableColumns.values();
+ for (int i = 0; i < PolicyTableColumns.values().length; i++) {
+ ret[i] = columns[i].toString();
+ }
+
+ return ret;
+ }
+}
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/access/PolicyTableViewer.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/access/PolicyTableViewer.java
index e5d1f6528ac..b80252c1bb9 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/access/PolicyTableViewer.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/access/PolicyTableViewer.java
@@ -1,108 +1,108 @@
-/*******************************************************************************
- * 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.skynet.access;
-
-import java.util.HashMap;
-import java.util.Map;
-import java.util.logging.Level;
-import org.eclipse.jface.viewers.CellEditor;
-import org.eclipse.jface.viewers.CheckboxCellEditor;
-import org.eclipse.nebula.widgets.xviewer.XViewer;
-import org.eclipse.osee.framework.access.AccessControlData;
-import org.eclipse.osee.framework.access.AccessControlManager;
-import org.eclipse.osee.framework.access.AccessObject;
-import org.eclipse.osee.framework.core.enums.PermissionEnum;
-import org.eclipse.osee.framework.core.exception.OseeDataStoreException;
-import org.eclipse.osee.framework.logging.OseeLog;
-import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
-import org.eclipse.osee.framework.ui.skynet.SkynetGuiPlugin;
-import org.eclipse.osee.framework.ui.skynet.widgets.xBranch.PolicyTableXViewerFactory;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Displays an <Code>Artifact</Code> access control list, used by the <Code>PolicyDialog</Code>.
- *
- * @author Jeff C. Phillips
- */
-public class PolicyTableViewer {
-
- private final Map<String, AccessControlData> accessControlList = new HashMap<String, AccessControlData>();
- private final Object object;
- private final Composite parent;
-
- private XViewer tableXViewer;
-
- public PolicyTableViewer(Composite parent, Object object) {
- this.parent = parent;
- this.object = object;
-
- createControl();
- }
-
- public void allowTableModification(boolean allow) {
- ((PolicyTableCellModifier) tableXViewer.getCellModifier()).setEnabled(allow);
- }
-
- public void addItem(Artifact subject, Object object, PermissionEnum permission) {
- AccessObject accessObject = AccessControlManager.getAccessObject(object);
- AccessControlData data = new AccessControlData(subject, accessObject, permission, true);
- accessControlList.put(data.getSubject().getGuid(), data);
- tableXViewer.refresh();
- }
-
- private void createControl() {
- GridData gd = new GridData(SWT.FILL, SWT.FILL, true, true);
- gd.heightHint = 150;
- gd.widthHint = 500;
-
- tableXViewer = new XViewer(parent, SWT.BORDER | SWT.FULL_SELECTION, new PolicyTableXViewerFactory(), true, true);
- tableXViewer.setUseHashlookup(true);
- tableXViewer.setColumnProperties(PolicyTableColumns.getNames());
- tableXViewer.getTree().setLayoutData(gd);
-
- CellEditor[] validEditors = new CellEditor[PolicyTableColumns.values().length];
- validEditors[1] = new CheckboxCellEditor(parent, SWT.NONE);
- // validEditors[Columns.Artifact.ordinal()] =
- // new ComboBoxCellEditor(table, PermissionEnum.getPermissionNames(), SWT.READ_ONLY);
- tableXViewer.setCellEditors(validEditors);
- tableXViewer.setCellModifier(new PolicyTableCellModifier(this));
- tableXViewer.setContentProvider(new PolicyContentProvider(accessControlList, object));
- tableXViewer.setLabelProvider(new PolicyLabelProvider(tableXViewer));
- tableXViewer.setInput(accessControlList.values());
- }
-
- public Map<String, AccessControlData> getAccessControlList() {
- return accessControlList;
- }
-
- public void refresh() {
- tableXViewer.refresh();
- }
-
- public void removeData(AccessControlData data) {
- try {
- AccessControlManager.removeAccessControlDataIf(true, data);
- } catch (OseeDataStoreException ex) {
- OseeLog.log(SkynetGuiPlugin.class, Level.SEVERE, ex);
- }
- accessControlList.remove(data.getSubject().getGuid());
- }
-
- public void modifyPermissionLevel(AccessControlData data, PermissionEnum permission) {
- data.setPermission(permission);
- }
-
- public int getCount() {
- return accessControlList.size();
- }
-}
+/*******************************************************************************
+ * 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.skynet.access;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.logging.Level;
+import org.eclipse.jface.viewers.CellEditor;
+import org.eclipse.jface.viewers.CheckboxCellEditor;
+import org.eclipse.nebula.widgets.xviewer.XViewer;
+import org.eclipse.osee.framework.access.AccessControlData;
+import org.eclipse.osee.framework.access.AccessControlManager;
+import org.eclipse.osee.framework.access.AccessObject;
+import org.eclipse.osee.framework.core.enums.PermissionEnum;
+import org.eclipse.osee.framework.core.exception.OseeDataStoreException;
+import org.eclipse.osee.framework.logging.OseeLog;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.ui.skynet.SkynetGuiPlugin;
+import org.eclipse.osee.framework.ui.skynet.widgets.xBranch.PolicyTableXViewerFactory;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.widgets.Composite;
+
+/**
+ * Displays an <Code>Artifact</Code> access control list, used by the <Code>PolicyDialog</Code>.
+ *
+ * @author Jeff C. Phillips
+ */
+public class PolicyTableViewer {
+
+ private final Map<String, AccessControlData> accessControlList = new HashMap<String, AccessControlData>();
+ private final Object object;
+ private final Composite parent;
+
+ private XViewer tableXViewer;
+
+ public PolicyTableViewer(Composite parent, Object object) {
+ this.parent = parent;
+ this.object = object;
+
+ createControl();
+ }
+
+ public void allowTableModification(boolean allow) {
+ ((PolicyTableCellModifier) tableXViewer.getCellModifier()).setEnabled(allow);
+ }
+
+ public void addItem(Artifact subject, Object object, PermissionEnum permission) {
+ AccessObject accessObject = AccessControlManager.getAccessObject(object);
+ AccessControlData data = new AccessControlData(subject, accessObject, permission, true);
+ accessControlList.put(data.getSubject().getGuid(), data);
+ tableXViewer.refresh();
+ }
+
+ private void createControl() {
+ GridData gd = new GridData(SWT.FILL, SWT.FILL, true, true);
+ gd.heightHint = 150;
+ gd.widthHint = 500;
+
+ tableXViewer = new XViewer(parent, SWT.BORDER | SWT.FULL_SELECTION, new PolicyTableXViewerFactory(), true, true);
+ tableXViewer.setUseHashlookup(true);
+ tableXViewer.setColumnProperties(PolicyTableColumns.getNames());
+ tableXViewer.getTree().setLayoutData(gd);
+
+ CellEditor[] validEditors = new CellEditor[PolicyTableColumns.values().length];
+ validEditors[1] = new CheckboxCellEditor(parent, SWT.NONE);
+ // validEditors[Columns.Artifact.ordinal()] =
+ // new ComboBoxCellEditor(table, PermissionEnum.getPermissionNames(), SWT.READ_ONLY);
+ tableXViewer.setCellEditors(validEditors);
+ tableXViewer.setCellModifier(new PolicyTableCellModifier(this));
+ tableXViewer.setContentProvider(new PolicyContentProvider(accessControlList, object));
+ tableXViewer.setLabelProvider(new PolicyLabelProvider(tableXViewer));
+ tableXViewer.setInput(accessControlList.values());
+ }
+
+ public Map<String, AccessControlData> getAccessControlList() {
+ return accessControlList;
+ }
+
+ public void refresh() {
+ tableXViewer.refresh();
+ }
+
+ public void removeData(AccessControlData data) {
+ try {
+ AccessControlManager.removeAccessControlDataIf(true, data);
+ } catch (OseeDataStoreException ex) {
+ OseeLog.log(SkynetGuiPlugin.class, Level.SEVERE, ex);
+ }
+ accessControlList.remove(data.getSubject().getGuid());
+ }
+
+ public void modifyPermissionLevel(AccessControlData data, PermissionEnum permission) {
+ data.setPermission(permission);
+ }
+
+ public int getCount() {
+ return accessControlList.size();
+ }
+}
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/action/CollapseAllAction.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/action/CollapseAllAction.java
index fcf8ea5f256..ef0db852b02 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/action/CollapseAllAction.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/action/CollapseAllAction.java
@@ -1,56 +1,56 @@
-/*******************************************************************************
- * 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.skynet.action;
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.osee.framework.logging.OseeLevel;
-import org.eclipse.osee.framework.logging.OseeLog;
-import org.eclipse.osee.framework.ui.skynet.FrameworkImage;
-import org.eclipse.osee.framework.ui.skynet.SkynetGuiPlugin;
-import org.eclipse.osee.framework.ui.swt.ImageManager;
-
-/**
- * @author Donald G. Dunne
- */
-public class CollapseAllAction extends Action {
-
- private final ICollapseAllHandler iCollapseAllHandler;
- private TreeViewer treeViewer;
-
- public static interface ICollapseAllHandler {
- public void expandAllActionHandler();
- }
-
- public CollapseAllAction(TreeViewer treeViewer) {
- this((ICollapseAllHandler) null);
- this.treeViewer = treeViewer;
- }
-
- public CollapseAllAction(ICollapseAllHandler iCollapseActionHandler) {
- this.iCollapseAllHandler = iCollapseActionHandler;
- setImageDescriptor(ImageManager.getImageDescriptor(FrameworkImage.COLLAPSE_ALL));
- setToolTipText("Collapse All");
- }
-
- @Override
- public void run() {
- try {
- if (treeViewer != null) {
- treeViewer.collapseAll();
- } else {
- iCollapseAllHandler.expandAllActionHandler();
- }
- } catch (Exception ex) {
- OseeLog.log(SkynetGuiPlugin.class, OseeLevel.SEVERE_POPUP, ex);
- }
- }
-}
+/*******************************************************************************
+ * 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.skynet.action;
+
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.osee.framework.logging.OseeLevel;
+import org.eclipse.osee.framework.logging.OseeLog;
+import org.eclipse.osee.framework.ui.skynet.FrameworkImage;
+import org.eclipse.osee.framework.ui.skynet.SkynetGuiPlugin;
+import org.eclipse.osee.framework.ui.swt.ImageManager;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class CollapseAllAction extends Action {
+
+ private final ICollapseAllHandler iCollapseAllHandler;
+ private TreeViewer treeViewer;
+
+ public static interface ICollapseAllHandler {
+ public void expandAllActionHandler();
+ }
+
+ public CollapseAllAction(TreeViewer treeViewer) {
+ this((ICollapseAllHandler) null);
+ this.treeViewer = treeViewer;
+ }
+
+ public CollapseAllAction(ICollapseAllHandler iCollapseActionHandler) {
+ this.iCollapseAllHandler = iCollapseActionHandler;
+ setImageDescriptor(ImageManager.getImageDescriptor(FrameworkImage.COLLAPSE_ALL));
+ setToolTipText("Collapse All");
+ }
+
+ @Override
+ public void run() {
+ try {
+ if (treeViewer != null) {
+ treeViewer.collapseAll();
+ } else {
+ iCollapseAllHandler.expandAllActionHandler();
+ }
+ } catch (Exception ex) {
+ OseeLog.log(SkynetGuiPlugin.class, OseeLevel.SEVERE_POPUP, ex);
+ }
+ }
+}
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/action/EditTransactionComment.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/action/EditTransactionComment.java
index 14f00847b78..2e2e286ea80 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/action/EditTransactionComment.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/action/EditTransactionComment.java
@@ -1,66 +1,66 @@
-/*******************************************************************************
- * 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.skynet.action;
-
-import java.util.ArrayList;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.osee.framework.core.exception.OseeDataStoreException;
-import org.eclipse.osee.framework.core.model.TransactionRecord;
-import org.eclipse.osee.framework.logging.OseeLevel;
-import org.eclipse.osee.framework.logging.OseeLog;
-import org.eclipse.osee.framework.skynet.core.transaction.TransactionManager;
-import org.eclipse.osee.framework.ui.plugin.util.AWorkbench;
-import org.eclipse.osee.framework.ui.skynet.FrameworkImage;
-import org.eclipse.osee.framework.ui.skynet.SkynetGuiPlugin;
-import org.eclipse.osee.framework.ui.skynet.widgets.dialog.EntryDialog;
-import org.eclipse.osee.framework.ui.swt.ImageManager;
-
-/**
- * @author Donald G. Dunne
- */
-public class EditTransactionComment extends Action {
-
- private final ITransactionRecordSelectionProvider provider;
-
- public EditTransactionComment(ITransactionRecordSelectionProvider provider) {
- super("Edit Transaction Comment");
- this.provider = provider;
- }
-
- @Override
- public ImageDescriptor getImageDescriptor() {
- return ImageManager.getImageDescriptor(FrameworkImage.EDIT);
- }
-
- @Override
- public void run() {
- if (provider.getSelectedTransactionRecords().isEmpty()) {
- AWorkbench.popup("Transaction Record must be selected.");
- return;
- }
- ArrayList<TransactionRecord> records = provider.getSelectedTransactionRecords();
- EntryDialog ed = new EntryDialog("Edit Transaction Record Comment", "Enter Transaction Record comment");
- if (ed.open() == 0) {
- for (TransactionRecord record : records) {
- try {
- TransactionManager.setTransactionComment(record, ed.getEntry());
- record.setComment(ed.getEntry());
- } catch (OseeDataStoreException ex) {
- OseeLog.log(SkynetGuiPlugin.class, OseeLevel.SEVERE_POPUP, ex);
- }
- }
- provider.refreshUI(records);
- AWorkbench.popup("Transaction Record comment(s) updated.");
- }
-
- }
-}
+/*******************************************************************************
+ * 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.skynet.action;
+
+import java.util.ArrayList;
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.osee.framework.core.exception.OseeDataStoreException;
+import org.eclipse.osee.framework.core.model.TransactionRecord;
+import org.eclipse.osee.framework.logging.OseeLevel;
+import org.eclipse.osee.framework.logging.OseeLog;
+import org.eclipse.osee.framework.skynet.core.transaction.TransactionManager;
+import org.eclipse.osee.framework.ui.plugin.util.AWorkbench;
+import org.eclipse.osee.framework.ui.skynet.FrameworkImage;
+import org.eclipse.osee.framework.ui.skynet.SkynetGuiPlugin;
+import org.eclipse.osee.framework.ui.skynet.widgets.dialog.EntryDialog;
+import org.eclipse.osee.framework.ui.swt.ImageManager;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class EditTransactionComment extends Action {
+
+ private final ITransactionRecordSelectionProvider provider;
+
+ public EditTransactionComment(ITransactionRecordSelectionProvider provider) {
+ super("Edit Transaction Comment");
+ this.provider = provider;
+ }
+
+ @Override
+ public ImageDescriptor getImageDescriptor() {
+ return ImageManager.getImageDescriptor(FrameworkImage.EDIT);
+ }
+
+ @Override
+ public void run() {
+ if (provider.getSelectedTransactionRecords().isEmpty()) {
+ AWorkbench.popup("Transaction Record must be selected.");
+ return;
+ }
+ ArrayList<TransactionRecord> records = provider.getSelectedTransactionRecords();
+ EntryDialog ed = new EntryDialog("Edit Transaction Record Comment", "Enter Transaction Record comment");
+ if (ed.open() == 0) {
+ for (TransactionRecord record : records) {
+ try {
+ TransactionManager.setTransactionComment(record, ed.getEntry());
+ record.setComment(ed.getEntry());
+ } catch (OseeDataStoreException ex) {
+ OseeLog.log(SkynetGuiPlugin.class, OseeLevel.SEVERE_POPUP, ex);
+ }
+ }
+ provider.refreshUI(records);
+ AWorkbench.popup("Transaction Record comment(s) updated.");
+ }
+
+ }
+}
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/action/ExpandAllAction.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/action/ExpandAllAction.java
index 50eaae0e0ff..912d558c8a7 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/action/ExpandAllAction.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/action/ExpandAllAction.java
@@ -1,80 +1,80 @@
-/*******************************************************************************
- * 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.skynet.action;
-
-import java.util.Iterator;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.viewers.AbstractTreeViewer;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.osee.framework.logging.OseeLevel;
-import org.eclipse.osee.framework.logging.OseeLog;
-import org.eclipse.osee.framework.ui.skynet.FrameworkImage;
-import org.eclipse.osee.framework.ui.skynet.SkynetGuiPlugin;
-import org.eclipse.osee.framework.ui.swt.ImageManager;
-
-/**
- * @author Donald G. Dunne
- */
-public class ExpandAllAction extends Action {
-
- private final IExpandAllHandler iExpandAllHandler;
- private TreeViewer treeViewer = null;
- private boolean selectedOnly;
-
- public static interface IExpandAllHandler {
- public void expandAllActionHandler();
- }
-
- public ExpandAllAction(TreeViewer treeViewer) {
- this(treeViewer, false);
- setText("Expand All");
- }
-
- public ExpandAllAction(TreeViewer treeViewer, boolean selectedOnly) {
- this((IExpandAllHandler) null);
- this.treeViewer = treeViewer;
- this.selectedOnly = selectedOnly;
- setText("Expand All");
- }
-
- public ExpandAllAction(IExpandAllHandler iRefreshActionHandler) {
- this.iExpandAllHandler = iRefreshActionHandler;
- setImageDescriptor(ImageManager.getImageDescriptor(FrameworkImage.EXPAND_ALL));
- setToolTipText("Expand All");
- this.selectedOnly = false;
- setText("Expand All");
- }
-
- private void expandAll(IStructuredSelection selection) {
- Iterator<?> iter = selection.iterator();
- while (iter.hasNext()) {
- treeViewer.expandToLevel(iter.next(), AbstractTreeViewer.ALL_LEVELS);
- }
- }
-
- @Override
- public void run() {
- try {
- if (treeViewer != null) {
- if (selectedOnly) {
- expandAll((IStructuredSelection) treeViewer.getSelection());
- } else {
- treeViewer.expandAll();
- }
- } else {
- iExpandAllHandler.expandAllActionHandler();
- }
- } catch (Exception ex) {
- OseeLog.log(SkynetGuiPlugin.class, OseeLevel.SEVERE_POPUP, ex);
- }
- }
-}
+/*******************************************************************************
+ * 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.skynet.action;
+
+import java.util.Iterator;
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.viewers.AbstractTreeViewer;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.osee.framework.logging.OseeLevel;
+import org.eclipse.osee.framework.logging.OseeLog;
+import org.eclipse.osee.framework.ui.skynet.FrameworkImage;
+import org.eclipse.osee.framework.ui.skynet.SkynetGuiPlugin;
+import org.eclipse.osee.framework.ui.swt.ImageManager;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class ExpandAllAction extends Action {
+
+ private final IExpandAllHandler iExpandAllHandler;
+ private TreeViewer treeViewer = null;
+ private boolean selectedOnly;
+
+ public static interface IExpandAllHandler {
+ public void expandAllActionHandler();
+ }
+
+ public ExpandAllAction(TreeViewer treeViewer) {
+ this(treeViewer, false);
+ setText("Expand All");
+ }
+
+ public ExpandAllAction(TreeViewer treeViewer, boolean selectedOnly) {
+ this((IExpandAllHandler) null);
+ this.treeViewer = treeViewer;
+ this.selectedOnly = selectedOnly;
+ setText("Expand All");
+ }
+
+ public ExpandAllAction(IExpandAllHandler iRefreshActionHandler) {
+ this.iExpandAllHandler = iRefreshActionHandler;
+ setImageDescriptor(ImageManager.getImageDescriptor(FrameworkImage.EXPAND_ALL));
+ setToolTipText("Expand All");
+ this.selectedOnly = false;
+ setText("Expand All");
+ }
+
+ private void expandAll(IStructuredSelection selection) {
+ Iterator<?> iter = selection.iterator();
+ while (iter.hasNext()) {
+ treeViewer.expandToLevel(iter.next(), AbstractTreeViewer.ALL_LEVELS);
+ }
+ }
+
+ @Override
+ public void run() {
+ try {
+ if (treeViewer != null) {
+ if (selectedOnly) {
+ expandAll((IStructuredSelection) treeViewer.getSelection());
+ } else {
+ treeViewer.expandAll();
+ }
+ } else {
+ iExpandAllHandler.expandAllActionHandler();
+ }
+ } catch (Exception ex) {
+ OseeLog.log(SkynetGuiPlugin.class, OseeLevel.SEVERE_POPUP, ex);
+ }
+ }
+}
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/action/RefreshAction.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/action/RefreshAction.java
index a2d8d079d5f..bfc9ce84b84 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/action/RefreshAction.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/action/RefreshAction.java
@@ -1,45 +1,45 @@
-/*******************************************************************************
- * 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.skynet.action;
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.osee.framework.logging.OseeLevel;
-import org.eclipse.osee.framework.logging.OseeLog;
-import org.eclipse.osee.framework.ui.plugin.PluginUiImage;
-import org.eclipse.osee.framework.ui.skynet.SkynetGuiPlugin;
-import org.eclipse.osee.framework.ui.swt.ImageManager;
-
-/**
- * @author Donald G. Dunne
- */
-public class RefreshAction extends Action {
-
- private final IRefreshActionHandler iRefreshActionHandler;
-
- public static interface IRefreshActionHandler {
- public void refreshActionHandler();
- }
-
- public RefreshAction(IRefreshActionHandler iRefreshActionHandler) {
- this.iRefreshActionHandler = iRefreshActionHandler;
- setImageDescriptor(ImageManager.getImageDescriptor(PluginUiImage.REFRESH));
- setToolTipText("Refresh");
- }
-
- @Override
- public void run() {
- try {
- iRefreshActionHandler.refreshActionHandler();
- } catch (Exception ex) {
- OseeLog.log(SkynetGuiPlugin.class, OseeLevel.SEVERE_POPUP, ex);
- }
- }
-}
+/*******************************************************************************
+ * 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.skynet.action;
+
+import org.eclipse.jface.action.Action;
+import org.eclipse.osee.framework.logging.OseeLevel;
+import org.eclipse.osee.framework.logging.OseeLog;
+import org.eclipse.osee.framework.ui.plugin.PluginUiImage;
+import org.eclipse.osee.framework.ui.skynet.SkynetGuiPlugin;
+import org.eclipse.osee.framework.ui.swt.ImageManager;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class RefreshAction extends Action {
+
+ private final IRefreshActionHandler iRefreshActionHandler;
+
+ public static interface IRefreshActionHandler {
+ public void refreshActionHandler();
+ }
+
+ public RefreshAction(IRefreshActionHandler iRefreshActionHandler) {
+ this.iRefreshActionHandler = iRefreshActionHandler;
+ setImageDescriptor(ImageManager.getImageDescriptor(PluginUiImage.REFRESH));
+ setToolTipText("Refresh");
+ }
+
+ @Override
+ public void run() {
+ try {
+ iRefreshActionHandler.refreshActionHandler();
+ } catch (Exception ex) {
+ OseeLog.log(SkynetGuiPlugin.class, OseeLevel.SEVERE_POPUP, ex);
+ }
+ }
+}
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/action/browser/BrowserPrintAction.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/action/browser/BrowserPrintAction.java
index 05f2396c47d..ccf92b751eb 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/action/browser/BrowserPrintAction.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/action/browser/BrowserPrintAction.java
@@ -1,41 +1,41 @@
-/*******************************************************************************
- * 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.skynet.action.browser;
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.osee.framework.logging.OseeLevel;
-import org.eclipse.osee.framework.logging.OseeLog;
-import org.eclipse.osee.framework.ui.skynet.FrameworkImage;
-import org.eclipse.osee.framework.ui.skynet.SkynetGuiPlugin;
-import org.eclipse.osee.framework.ui.swt.ImageManager;
-
-/**
- * @author Donald G. Dunne
- */
-public class BrowserPrintAction extends Action {
-
- private final IBrowserActionHandler iBrowserActionHandler;
-
- public BrowserPrintAction(IBrowserActionHandler iBrowserActionHandler) {
- this.iBrowserActionHandler = iBrowserActionHandler;
- setImageDescriptor(ImageManager.getImageDescriptor(FrameworkImage.PRINT));
- setToolTipText("Print");
- }
-
- @Override
- public void run() {
- try {
- iBrowserActionHandler.getBrowser().setUrl("javascript:print()");
- } catch (Exception ex) {
- OseeLog.log(SkynetGuiPlugin.class, OseeLevel.SEVERE_POPUP, ex);
- }
- }
-}
+/*******************************************************************************
+ * 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.skynet.action.browser;
+
+import org.eclipse.jface.action.Action;
+import org.eclipse.osee.framework.logging.OseeLevel;
+import org.eclipse.osee.framework.logging.OseeLog;
+import org.eclipse.osee.framework.ui.skynet.FrameworkImage;
+import org.eclipse.osee.framework.ui.skynet.SkynetGuiPlugin;
+import org.eclipse.osee.framework.ui.swt.ImageManager;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class BrowserPrintAction extends Action {
+
+ private final IBrowserActionHandler iBrowserActionHandler;
+
+ public BrowserPrintAction(IBrowserActionHandler iBrowserActionHandler) {
+ this.iBrowserActionHandler = iBrowserActionHandler;
+ setImageDescriptor(ImageManager.getImageDescriptor(FrameworkImage.PRINT));
+ setToolTipText("Print");
+ }
+
+ @Override
+ public void run() {
+ try {
+ iBrowserActionHandler.getBrowser().setUrl("javascript:print()");
+ } catch (Exception ex) {
+ OseeLog.log(SkynetGuiPlugin.class, OseeLevel.SEVERE_POPUP, ex);
+ }
+ }
+}
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 95d18a14766..53323d47a43 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
@@ -1,46 +1,46 @@
-/*******************************************************************************
- * 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.skynet.artifact;
-
-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;
-
-/**
- * @author Roberto E. Escobar
- */
-public class ArtifactNameConflictHandler {
-
- public String resolve(IArtifact source) {
- final Pair<String, String> beforeAfterNames = new Pair<String, String>("", "");
-
- 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(Displays.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();
- }
-}
+/*******************************************************************************
+ * 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.skynet.artifact;
+
+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;
+
+/**
+ * @author Roberto E. Escobar
+ */
+public class ArtifactNameConflictHandler {
+
+ public String resolve(IArtifact source) {
+ final Pair<String, String> beforeAfterNames = new Pair<String, String>("", "");
+
+ 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(Displays.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/ArtifactPasteOperation.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/ArtifactPasteOperation.java
index 596272dc9a1..2607630d23d 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/ArtifactPasteOperation.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/ArtifactPasteOperation.java
@@ -1,131 +1,131 @@
-/*******************************************************************************
- * 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.skynet.artifact;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.OperationCanceledException;
-import org.eclipse.osee.framework.core.enums.CoreRelationTypes;
-import org.eclipse.osee.framework.core.enums.IRelationEnumeration;
-import org.eclipse.osee.framework.core.enums.RelationOrderBaseTypes;
-import org.eclipse.osee.framework.core.exception.OseeArgumentException;
-import org.eclipse.osee.framework.core.exception.OseeCoreException;
-import org.eclipse.osee.framework.core.operation.AbstractOperation;
-import org.eclipse.osee.framework.jdk.core.util.Strings;
-import org.eclipse.osee.framework.skynet.core.User;
-import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
-import org.eclipse.osee.framework.skynet.core.relation.RelationManager;
-import org.eclipse.osee.framework.skynet.core.relation.RelationTypeManager;
-import org.eclipse.osee.framework.skynet.core.relation.order.IRelationSorter;
-import org.eclipse.osee.framework.skynet.core.relation.order.RelationOrderData;
-import org.eclipse.osee.framework.ui.skynet.SkynetGuiPlugin;
-import org.eclipse.osee.framework.ui.skynet.util.ArtifactPasteConfiguration;
-
-/**
- * @author Roberto E. Escobar
- */
-public class ArtifactPasteOperation extends AbstractOperation {
-
- private final List<Artifact> itemsToCopy;
- private final Artifact destination;
- private final ArtifactPasteConfiguration config;
- private final ArtifactNameConflictHandler nameConflictHandler;
-
- public ArtifactPasteOperation(ArtifactPasteConfiguration config, Artifact destination, List<Artifact> itemsToCopy, ArtifactNameConflictHandler nameConflictHandler) {
- super("Paste Artifact(s)", SkynetGuiPlugin.PLUGIN_ID);
- this.itemsToCopy = itemsToCopy;
- this.destination = destination;
- this.config = config;
- this.nameConflictHandler = nameConflictHandler;
- }
-
- @Override
- protected void doWork(final IProgressMonitor monitor) throws Exception {
- if (destination == null) {
- throw new OseeArgumentException("Destination Artifact cannot be null.");
- }
- if (!itemsToCopy.isEmpty()) {
- double workAmount = 0.80;
- final Artifact itemToCopy = itemsToCopy.get(0);
- if (itemToCopy.hasParent() && destination.equals(itemToCopy.getParent())) {
-
- // Prevent Pasting multiples if pasting onto same parent
- if (itemToCopy instanceof User) {
- return;
- }
-
- Object object = nameConflictHandler.resolve(itemToCopy);
- String changedName = object != null ? object.toString() : null;
- if (!Strings.isValid(changedName) || itemToCopy.getName().equals(changedName)) {
- throw new OperationCanceledException();
- } else {
- Artifact newArtifact = pasteArtifact(monitor, workAmount, config, destination, itemToCopy);
- newArtifact.setName(changedName);
- }
- } else {
- workAmount = workAmount / itemsToCopy.size();
- for (Artifact item : itemsToCopy) {
- pasteArtifact(monitor, workAmount, config, destination, item);
- }
- }
- destination.persist();
- monitor.worked(calculateWork(0.20));
- } else {
- monitor.worked(calculateWork(1.0));
- }
- }
-
- private void pasteRelationOrder(ArtifactPasteConfiguration config, Artifact source, Artifact newArtifact, List<Artifact> copiedChildren) throws OseeCoreException {
- if (config.isKeepRelationOrderSettings()) {
- IRelationEnumeration relationTypeSide = CoreRelationTypes.Default_Hierarchical__Child;
- RelationOrderData data = RelationManager.createRelationOrderData(source);
- String order =
- data.getCurrentSorterGuid(RelationTypeManager.getType(relationTypeSide), relationTypeSide.getSide());
- IRelationSorter sorter = RelationManager.getSorterProvider().getRelationOrder(order);
- if (RelationOrderBaseTypes.USER_DEFINED == sorter.getSorterId()) {
- newArtifact.setRelationOrder(relationTypeSide, copiedChildren);
- } else {
- newArtifact.setRelationOrder(relationTypeSide, sorter.getSorterId());
- }
- }
- }
-
- private Artifact pasteArtifact(IProgressMonitor monitor, double workAmount, ArtifactPasteConfiguration config, Artifact destination, Artifact source) throws OseeCoreException {
- boolean workComplete = true;
- Artifact newArtifact = null;
- // We do not support duplicating user artifacts.
- if (!(source instanceof User)) {
- newArtifact = source.duplicate(destination.getBranch());
- destination.addChild(newArtifact);
- List<Artifact> copiedChildren = new ArrayList<Artifact>();
- if (config.isIncludeChildrenOfCopiedElements()) {
- Collection<Artifact> children = source.getChildren();
- if (!children.isEmpty()) {
- workComplete = false;
- double stepAmount = workAmount / children.size();
- for (Artifact sourceChild : children) {
- copiedChildren.add(pasteArtifact(monitor, stepAmount, config, newArtifact, sourceChild));
- }
- }
- }
-
- if (config.isKeepRelationOrderSettings()) {
- pasteRelationOrder(config, source, newArtifact, copiedChildren);
- }
- }
- if (workComplete) {
- monitor.worked(calculateWork(workAmount));
- }
- return newArtifact;
- }
-}
+/*******************************************************************************
+ * 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.skynet.artifact;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.OperationCanceledException;
+import org.eclipse.osee.framework.core.enums.CoreRelationTypes;
+import org.eclipse.osee.framework.core.enums.IRelationEnumeration;
+import org.eclipse.osee.framework.core.enums.RelationOrderBaseTypes;
+import org.eclipse.osee.framework.core.exception.OseeArgumentException;
+import org.eclipse.osee.framework.core.exception.OseeCoreException;
+import org.eclipse.osee.framework.core.operation.AbstractOperation;
+import org.eclipse.osee.framework.jdk.core.util.Strings;
+import org.eclipse.osee.framework.skynet.core.User;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.skynet.core.relation.RelationManager;
+import org.eclipse.osee.framework.skynet.core.relation.RelationTypeManager;
+import org.eclipse.osee.framework.skynet.core.relation.order.IRelationSorter;
+import org.eclipse.osee.framework.skynet.core.relation.order.RelationOrderData;
+import org.eclipse.osee.framework.ui.skynet.SkynetGuiPlugin;
+import org.eclipse.osee.framework.ui.skynet.util.ArtifactPasteConfiguration;
+
+/**
+ * @author Roberto E. Escobar
+ */
+public class ArtifactPasteOperation extends AbstractOperation {
+
+ private final List<Artifact> itemsToCopy;
+ private final Artifact destination;
+ private final ArtifactPasteConfiguration config;
+ private final ArtifactNameConflictHandler nameConflictHandler;
+
+ public ArtifactPasteOperation(ArtifactPasteConfiguration config, Artifact destination, List<Artifact> itemsToCopy, ArtifactNameConflictHandler nameConflictHandler) {
+ super("Paste Artifact(s)", SkynetGuiPlugin.PLUGIN_ID);
+ this.itemsToCopy = itemsToCopy;
+ this.destination = destination;
+ this.config = config;
+ this.nameConflictHandler = nameConflictHandler;
+ }
+
+ @Override
+ protected void doWork(final IProgressMonitor monitor) throws Exception {
+ if (destination == null) {
+ throw new OseeArgumentException("Destination Artifact cannot be null.");
+ }
+ if (!itemsToCopy.isEmpty()) {
+ double workAmount = 0.80;
+ final Artifact itemToCopy = itemsToCopy.get(0);
+ if (itemToCopy.hasParent() && destination.equals(itemToCopy.getParent())) {
+
+ // Prevent Pasting multiples if pasting onto same parent
+ if (itemToCopy instanceof User) {
+ return;
+ }
+
+ Object object = nameConflictHandler.resolve(itemToCopy);
+ String changedName = object != null ? object.toString() : null;
+ if (!Strings.isValid(changedName) || itemToCopy.getName().equals(changedName)) {
+ throw new OperationCanceledException();
+ } else {
+ Artifact newArtifact = pasteArtifact(monitor, workAmount, config, destination, itemToCopy);
+ newArtifact.setName(changedName);
+ }
+ } else {
+ workAmount = workAmount / itemsToCopy.size();
+ for (Artifact item : itemsToCopy) {
+ pasteArtifact(monitor, workAmount, config, destination, item);
+ }
+ }
+ destination.persist();
+ monitor.worked(calculateWork(0.20));
+ } else {
+ monitor.worked(calculateWork(1.0));
+ }
+ }
+
+ private void pasteRelationOrder(ArtifactPasteConfiguration config, Artifact source, Artifact newArtifact, List<Artifact> copiedChildren) throws OseeCoreException {
+ if (config.isKeepRelationOrderSettings()) {
+ IRelationEnumeration relationTypeSide = CoreRelationTypes.Default_Hierarchical__Child;
+ RelationOrderData data = RelationManager.createRelationOrderData(source);
+ String order =
+ data.getCurrentSorterGuid(RelationTypeManager.getType(relationTypeSide), relationTypeSide.getSide());
+ IRelationSorter sorter = RelationManager.getSorterProvider().getRelationOrder(order);
+ if (RelationOrderBaseTypes.USER_DEFINED == sorter.getSorterId()) {
+ newArtifact.setRelationOrder(relationTypeSide, copiedChildren);
+ } else {
+ newArtifact.setRelationOrder(relationTypeSide, sorter.getSorterId());
+ }
+ }
+ }
+
+ private Artifact pasteArtifact(IProgressMonitor monitor, double workAmount, ArtifactPasteConfiguration config, Artifact destination, Artifact source) throws OseeCoreException {
+ boolean workComplete = true;
+ Artifact newArtifact = null;
+ // We do not support duplicating user artifacts.
+ if (!(source instanceof User)) {
+ newArtifact = source.duplicate(destination.getBranch());
+ destination.addChild(newArtifact);
+ List<Artifact> copiedChildren = new ArrayList<Artifact>();
+ if (config.isIncludeChildrenOfCopiedElements()) {
+ Collection<Artifact> children = source.getChildren();
+ if (!children.isEmpty()) {
+ workComplete = false;
+ double stepAmount = workAmount / children.size();
+ for (Artifact sourceChild : children) {
+ copiedChildren.add(pasteArtifact(monitor, stepAmount, config, newArtifact, sourceChild));
+ }
+ }
+ }
+
+ if (config.isKeepRelationOrderSettings()) {
+ pasteRelationOrder(config, source, newArtifact, copiedChildren);
+ }
+ }
+ if (workComplete) {
+ monitor.worked(calculateWork(workAmount));
+ }
+ return newArtifact;
+ }
+}
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/ArtifactSaveNotificationHandler.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/ArtifactSaveNotificationHandler.java
index 94dee1dd9a2..1647114854b 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/ArtifactSaveNotificationHandler.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/ArtifactSaveNotificationHandler.java
@@ -1,97 +1,97 @@
-/*******************************************************************************
- * 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.skynet.artifact;
-
-import java.util.Collection;
-import java.util.logging.Level;
-import org.eclipse.osee.framework.core.exception.OseeCoreException;
-import org.eclipse.osee.framework.core.model.Branch;
-import org.eclipse.osee.framework.jdk.core.type.HashCollection;
-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.skynet.core.artifact.ArtifactCache;
-import org.eclipse.osee.framework.skynet.core.utility.Artifacts;
-import org.eclipse.osee.framework.ui.plugin.util.ArrayTreeContentProvider;
-import org.eclipse.osee.framework.ui.skynet.ArtifactDecoratorPreferences;
-import org.eclipse.osee.framework.ui.skynet.ArtifactLabelProvider;
-import org.eclipse.osee.framework.ui.skynet.ArtifactViewerSorter;
-import org.eclipse.osee.framework.ui.skynet.SkynetGuiPlugin;
-import org.eclipse.osee.framework.ui.skynet.artifact.massEditor.MassArtifactEditor;
-import org.eclipse.osee.framework.ui.skynet.util.filteredTree.SimpleCheckFilteredTreeDialog;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchListener;
-
-/**
- * This handler will find any artifacts in the artifact cache that were dirty and allow user to persist before shutdown.
- *
- * @author Donald G. Dunne
- */
-public class ArtifactSaveNotificationHandler implements IWorkbenchListener {
-
- public static boolean noPopUp = false;
-
- @Override
- public void postShutdown(IWorkbench arg0) {
- // do nothing
- }
-
- @Override
- public boolean preShutdown(IWorkbench arg0, boolean arg1) {
- if (noPopUp) {
- return true;
- }
- OseeLog.log(SkynetGuiPlugin.class, Level.INFO, "Verifying Artifact Persistence");
- try {
- Collection<Artifact> dirtyArts = ArtifactCache.getDirtyArtifacts();
- if (dirtyArts.isEmpty()) {
- return true;
- }
- ArtifactDecoratorPreferences preferences = new ArtifactDecoratorPreferences();
- preferences.setShowArtBranch(true);
- preferences.setShowArtType(true);
- SimpleCheckFilteredTreeDialog dialog =
- new SimpleCheckFilteredTreeDialog(
- "Unsaved Artifacts Detected",
- "Some artifacts have not been saved.\n\nSelect any artifact to save (if any) and select Ok or Cancel to stop shutdown.",
- new ArrayTreeContentProvider(), new ArtifactLabelProvider(preferences), new ArtifactViewerSorter(), 0,
- Integer.MAX_VALUE);
- dialog.setInput(dirtyArts);
- if (dialog.open() == 0) {
- if (dialog.getResult().length == 0) {
- return true;
- }
- HashCollection<Branch, Artifact> branchMap = Artifacts.getBranchArtifactMap(dirtyArts);
- for (Branch branch : branchMap.keySet()) {
- OseeLog.log(SkynetGuiPlugin.class, Level.INFO, String.format(
- "Persisting [%d] unsaved artifacts for branch [%s]", branchMap.getValues().size(), branch));
- Artifacts.persistInTransaction(branchMap.getValues(branch));
- }
- return true;
- } else {
- HashCollection<Branch, Artifact> branchMap = Artifacts.getBranchArtifactMap(dirtyArts);
- for (Branch branch : branchMap.keySet()) {
- MassArtifactEditor.editArtifacts(String.format("Unsaved Artifacts for Branch [%s]", branch),
- branchMap.getValues(branch));
- }
- }
- } catch (OseeCoreException ex) {
- OseeLog.log(SkynetGuiPlugin.class, OseeLevel.SEVERE_POPUP, ex);
- }
-
- return false;
- }
-
- public static void setNoPopUp(boolean noPopUp) {
- // mainly for testing purposes
- ArtifactSaveNotificationHandler.noPopUp = noPopUp;
- }
-}
+/*******************************************************************************
+ * 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.skynet.artifact;
+
+import java.util.Collection;
+import java.util.logging.Level;
+import org.eclipse.osee.framework.core.exception.OseeCoreException;
+import org.eclipse.osee.framework.core.model.Branch;
+import org.eclipse.osee.framework.jdk.core.type.HashCollection;
+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.skynet.core.artifact.ArtifactCache;
+import org.eclipse.osee.framework.skynet.core.utility.Artifacts;
+import org.eclipse.osee.framework.ui.plugin.util.ArrayTreeContentProvider;
+import org.eclipse.osee.framework.ui.skynet.ArtifactDecoratorPreferences;
+import org.eclipse.osee.framework.ui.skynet.ArtifactLabelProvider;
+import org.eclipse.osee.framework.ui.skynet.ArtifactViewerSorter;
+import org.eclipse.osee.framework.ui.skynet.SkynetGuiPlugin;
+import org.eclipse.osee.framework.ui.skynet.artifact.massEditor.MassArtifactEditor;
+import org.eclipse.osee.framework.ui.skynet.util.filteredTree.SimpleCheckFilteredTreeDialog;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchListener;
+
+/**
+ * This handler will find any artifacts in the artifact cache that were dirty and allow user to persist before shutdown.
+ *
+ * @author Donald G. Dunne
+ */
+public class ArtifactSaveNotificationHandler implements IWorkbenchListener {
+
+ public static boolean noPopUp = false;
+
+ @Override
+ public void postShutdown(IWorkbench arg0) {
+ // do nothing
+ }
+
+ @Override
+ public boolean preShutdown(IWorkbench arg0, boolean arg1) {
+ if (noPopUp) {
+ return true;
+ }
+ OseeLog.log(SkynetGuiPlugin.class, Level.INFO, "Verifying Artifact Persistence");
+ try {
+ Collection<Artifact> dirtyArts = ArtifactCache.getDirtyArtifacts();
+ if (dirtyArts.isEmpty()) {
+ return true;
+ }
+ ArtifactDecoratorPreferences preferences = new ArtifactDecoratorPreferences();
+ preferences.setShowArtBranch(true);
+ preferences.setShowArtType(true);
+ SimpleCheckFilteredTreeDialog dialog =
+ new SimpleCheckFilteredTreeDialog(
+ "Unsaved Artifacts Detected",
+ "Some artifacts have not been saved.\n\nSelect any artifact to save (if any) and select Ok or Cancel to stop shutdown.",
+ new ArrayTreeContentProvider(), new ArtifactLabelProvider(preferences), new ArtifactViewerSorter(), 0,
+ Integer.MAX_VALUE);
+ dialog.setInput(dirtyArts);
+ if (dialog.open() == 0) {
+ if (dialog.getResult().length == 0) {
+ return true;
+ }
+ HashCollection<Branch, Artifact> branchMap = Artifacts.getBranchArtifactMap(dirtyArts);
+ for (Branch branch : branchMap.keySet()) {
+ OseeLog.log(SkynetGuiPlugin.class, Level.INFO, String.format(
+ "Persisting [%d] unsaved artifacts for branch [%s]", branchMap.getValues().size(), branch));
+ Artifacts.persistInTransaction(branchMap.getValues(branch));
+ }
+ return true;
+ } else {
+ HashCollection<Branch, Artifact> branchMap = Artifacts.getBranchArtifactMap(dirtyArts);
+ for (Branch branch : branchMap.keySet()) {
+ MassArtifactEditor.editArtifacts(String.format("Unsaved Artifacts for Branch [%s]", branch),
+ branchMap.getValues(branch));
+ }
+ }
+ } catch (OseeCoreException ex) {
+ OseeLog.log(SkynetGuiPlugin.class, OseeLevel.SEVERE_POPUP, ex);
+ }
+
+ return false;
+ }
+
+ public static void setNoPopUp(boolean noPopUp) {
+ // mainly for testing purposes
+ ArtifactSaveNotificationHandler.noPopUp = noPopUp;
+ }
+}
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/EnumSelectionDialog.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/EnumSelectionDialog.java
index 65e73951f6e..849ebedc8d0 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/EnumSelectionDialog.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/EnumSelectionDialog.java
@@ -47,10 +47,6 @@ public class EnumSelectionDialog extends CheckedTreeSelectionDialog {
};
private Selection selected = Selection.AddSelection;
- /**
- * @param parent
- * @param artifacts
- */
public EnumSelectionDialog(IAttributeType attributeType, Collection<? extends Artifact> artifacts) {
super(Displays.getActiveShell(), new StringLabelProvider(), new ArrayTreeContentProvider());
setTitle("Select Options");
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 be18f2424c1..b9b07766eed 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
@@ -1,36 +1,36 @@
-/*******************************************************************************
- * 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.skynet.artifact;
-
-import org.eclipse.jface.dialogs.IInputValidator;
-import org.eclipse.osee.framework.jdk.core.util.Strings;
-
-/**
- * @author Roberto E. Escobar
- */
-public final class NonBlankAndNotSameAsStartingValidator implements IInputValidator {
- private final String startingName;
-
- public NonBlankAndNotSameAsStartingValidator(String startingName) {
- this.startingName = startingName;
- }
-
- @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;
- }
+/*******************************************************************************
+ * 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.skynet.artifact;
+
+import org.eclipse.jface.dialogs.IInputValidator;
+import org.eclipse.osee.framework.jdk.core.util.Strings;
+
+/**
+ * @author Roberto E. Escobar
+ */
+public final class NonBlankAndNotSameAsStartingValidator implements IInputValidator {
+ private final String startingName;
+
+ public NonBlankAndNotSameAsStartingValidator(String startingName) {
+ this.startingName = startingName;
+ }
+
+ @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 4802f00a84d..c7319dff9c4 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
@@ -1,102 +1,102 @@
-/*******************************************************************************
- * 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.skynet.artifact;
-
-import java.net.HttpURLConnection;
-import java.util.Map;
-import java.util.logging.Level;
-import org.eclipse.osee.framework.access.AccessControlManager;
-import org.eclipse.osee.framework.core.client.server.HttpResponse;
-import org.eclipse.osee.framework.core.enums.PermissionEnum;
-import org.eclipse.osee.framework.jdk.core.type.MutableBoolean;
-import org.eclipse.osee.framework.jdk.core.util.AHTML;
-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.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.osee.framework.ui.swt.Displays;
-import org.eclipse.ui.IEditorPart;
-
-/**
- * @author Roberto E. Escobar
- */
-public class OpenArtifactEditorLoopbackCmd extends BaseArtifactLoopbackCmd {
-
- @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);
- }
-
- 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 {
- 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) {
- OseeLog.log(SkynetGuiPlugin.class, Level.SEVERE, 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");
- }
- }
-}
+/*******************************************************************************
+ * 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.skynet.artifact;
+
+import java.net.HttpURLConnection;
+import java.util.Map;
+import java.util.logging.Level;
+import org.eclipse.osee.framework.access.AccessControlManager;
+import org.eclipse.osee.framework.core.client.server.HttpResponse;
+import org.eclipse.osee.framework.core.enums.PermissionEnum;
+import org.eclipse.osee.framework.jdk.core.type.MutableBoolean;
+import org.eclipse.osee.framework.jdk.core.util.AHTML;
+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.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.osee.framework.ui.swt.Displays;
+import org.eclipse.ui.IEditorPart;
+
+/**
+ * @author Roberto E. Escobar
+ */
+public class OpenArtifactEditorLoopbackCmd extends BaseArtifactLoopbackCmd {
+
+ @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);
+ }
+
+ 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 {
+ 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) {
+ OseeLog.log(SkynetGuiPlugin.class, Level.SEVERE, 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/AnnotationComposite.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/annotation/AnnotationComposite.java
index 9b609367acf..19a215d7bb8 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/annotation/AnnotationComposite.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/annotation/AnnotationComposite.java
@@ -29,18 +29,10 @@ import org.eclipse.ui.forms.widgets.FormToolkit;
*/
public class AnnotationComposite extends Composite {
- /**
- * @param parent
- * @param style
- */
public AnnotationComposite(Composite parent, int style, Artifact artifact) {
this(null, parent, style, artifact);
}
- /**
- * @param parent
- * @param style
- */
public AnnotationComposite(FormToolkit toolkit, Composite parent, int style, Artifact artifact) {
super(parent, style);
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 664d03a1967..a732e4e1a71 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
@@ -1,210 +1,210 @@
-/*******************************************************************************
- * 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.skynet.artifact.editor;
-
-import java.util.List;
-import java.util.logging.Level;
-import org.eclipse.osee.framework.core.exception.OseeCoreException;
-import org.eclipse.osee.framework.logging.OseeLog;
-import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
-import org.eclipse.osee.framework.skynet.core.event.AccessControlEventType;
-import org.eclipse.osee.framework.skynet.core.event.BranchEventType;
-import org.eclipse.osee.framework.skynet.core.event.FrameworkTransactionData;
-import org.eclipse.osee.framework.skynet.core.event.IAccessControlEventListener;
-import org.eclipse.osee.framework.skynet.core.event.IArtifactsChangeTypeEventListener;
-import org.eclipse.osee.framework.skynet.core.event.IArtifactsPurgedEventListener;
-import org.eclipse.osee.framework.skynet.core.event.IBranchEventListener;
-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.skynet.core.event2.AccessControlEvent;
-import org.eclipse.osee.framework.skynet.core.event2.BranchEvent;
-import org.eclipse.osee.framework.skynet.core.event2.filter.IEventFilter;
-import org.eclipse.osee.framework.skynet.core.utility.LoadedArtifacts;
-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;
-
-/**
- * @author Jeff C. Phillips
- */
-public abstract class AbstractEventArtifactEditor extends AbstractArtifactEditor implements IArtifactEditorEventHandler {
-
- private final InternalEventHandler internalEventHandler;
-
- public AbstractEventArtifactEditor() {
- super();
- if (OseeEventManager.getPreferences().isOldEvents()) {
- internalEventHandler = new InternalEventHandler();
- OseeEventManager.addListener(internalEventHandler);
- } else {
- internalEventHandler = null;
- ArtifactEditorEventManager.add(this);
- }
- }
-
- @Override
- protected void addPages() {
- // do nothing
- }
-
- @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.getPreferences().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 List<? extends IEventFilter> getEventFilters() {
- Artifact artifact = getArtifactFromEditorInput();
- if (artifact != null) {
- return OseeEventManager.getEventFiltersForBranch(artifact.getBranch());
- }
- return null;
- }
- }
-}
+/*******************************************************************************
+ * 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.skynet.artifact.editor;
+
+import java.util.List;
+import java.util.logging.Level;
+import org.eclipse.osee.framework.core.exception.OseeCoreException;
+import org.eclipse.osee.framework.logging.OseeLog;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.skynet.core.event.AccessControlEventType;
+import org.eclipse.osee.framework.skynet.core.event.BranchEventType;
+import org.eclipse.osee.framework.skynet.core.event.FrameworkTransactionData;
+import org.eclipse.osee.framework.skynet.core.event.IAccessControlEventListener;
+import org.eclipse.osee.framework.skynet.core.event.IArtifactsChangeTypeEventListener;
+import org.eclipse.osee.framework.skynet.core.event.IArtifactsPurgedEventListener;
+import org.eclipse.osee.framework.skynet.core.event.IBranchEventListener;
+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.skynet.core.event2.AccessControlEvent;
+import org.eclipse.osee.framework.skynet.core.event2.BranchEvent;
+import org.eclipse.osee.framework.skynet.core.event2.filter.IEventFilter;
+import org.eclipse.osee.framework.skynet.core.utility.LoadedArtifacts;
+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;
+
+/**
+ * @author Jeff C. Phillips
+ */
+public abstract class AbstractEventArtifactEditor extends AbstractArtifactEditor implements IArtifactEditorEventHandler {
+
+ private final InternalEventHandler internalEventHandler;
+
+ public AbstractEventArtifactEditor() {
+ super();
+ if (OseeEventManager.getPreferences().isOldEvents()) {
+ internalEventHandler = new InternalEventHandler();
+ OseeEventManager.addListener(internalEventHandler);
+ } else {
+ internalEventHandler = null;
+ ArtifactEditorEventManager.add(this);
+ }
+ }
+
+ @Override
+ protected void addPages() {
+ // do nothing
+ }
+
+ @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.getPreferences().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 List<? extends IEventFilter> getEventFilters() {
+ Artifact artifact = getArtifactFromEditorInput();
+ if (artifact != null) {
+ return OseeEventManager.getEventFiltersForBranch(artifact.getBranch());
+ }
+ return null;
+ }
+ }
+}
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 18ae10a4448..cc6fb073ce9 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
@@ -1,253 +1,253 @@
-/*******************************************************************************
- * 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.skynet.artifact.editor;
-
-import java.util.logging.Level;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-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.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.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.ui.PartInitException;
-import org.eclipse.ui.progress.UIJob;
-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() {
- 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();
- }
+/*******************************************************************************
+ * 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.skynet.artifact.editor;
+
+import java.util.logging.Level;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+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.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.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.ui.PartInitException;
+import org.eclipse.ui.progress.UIJob;
+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() {
+ 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 d80498d57d2..4b1f100d684 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
@@ -1,277 +1,277 @@
-/*******************************************************************************
- * 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.skynet.artifact.editor;
-
-import java.net.URL;
-import java.util.logging.Level;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.action.IToolBarManager;
-import org.eclipse.jface.action.Separator;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionProvider;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.window.Window;
-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.skynet.core.artifact.Artifact;
-import org.eclipse.osee.framework.skynet.core.artifact.ArtifactURL;
-import org.eclipse.osee.framework.skynet.core.artifact.Attribute;
-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.skynet.ArtifactExplorer;
-import org.eclipse.osee.framework.ui.skynet.FrameworkImage;
-import org.eclipse.osee.framework.ui.skynet.OpenWithContributionItem;
-import org.eclipse.osee.framework.ui.skynet.SkynetGuiPlugin;
-import org.eclipse.osee.framework.ui.skynet.access.PolicyDialog;
-import org.eclipse.osee.framework.ui.skynet.widgets.xBranch.BranchView;
-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.swt.dnd.Clipboard;
-import org.eclipse.swt.dnd.TextTransfer;
-import org.eclipse.swt.dnd.Transfer;
-import org.eclipse.ui.IEditorSite;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.PlatformUI;
-
-/**
- * @author Roberto E. Escobar
- */
-public class ArtifactEditorActionBarContributor implements IActionContributor {
-
- private final AbstractArtifactEditor editor;
-
- public ArtifactEditorActionBarContributor(AbstractArtifactEditor editor) {
- this.editor = editor;
- }
-
- @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;
-
- 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 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");
- }
-
- @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 {
-
- public DeleteArtifactAction() {
- super("&Delete Artifact\tDelete", IAction.AS_PUSH_BUTTON);
- setImageDescriptor(ImageManager.getImageDescriptor(FrameworkImage.DELETE));
- }
-
- @Override
- public void run() {
- try {
- MessageDialog dialog =
- new MessageDialog(Displays.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 {
-
- 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);
- }
- }
- }
-
- 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);
- }
- }
- }
-
- 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(Displays.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 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;
- }
- }
-
- if (rString == null) {
- rString = RelationManager.reportHasDirtyLinks(artifact);
- }
- AWorkbench.popup("Dirty Report", !Strings.isValid(rString) ? "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.");
- }
-
- @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");
- }
-
- @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);
- }
- }
- }
-
-}
+/*******************************************************************************
+ * 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.skynet.artifact.editor;
+
+import java.net.URL;
+import java.util.logging.Level;
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.action.IToolBarManager;
+import org.eclipse.jface.action.Separator;
+import org.eclipse.jface.dialogs.IDialogConstants;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.ISelectionProvider;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.window.Window;
+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.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.skynet.core.artifact.ArtifactURL;
+import org.eclipse.osee.framework.skynet.core.artifact.Attribute;
+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.skynet.ArtifactExplorer;
+import org.eclipse.osee.framework.ui.skynet.FrameworkImage;
+import org.eclipse.osee.framework.ui.skynet.OpenWithContributionItem;
+import org.eclipse.osee.framework.ui.skynet.SkynetGuiPlugin;
+import org.eclipse.osee.framework.ui.skynet.access.PolicyDialog;
+import org.eclipse.osee.framework.ui.skynet.widgets.xBranch.BranchView;
+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.swt.dnd.Clipboard;
+import org.eclipse.swt.dnd.TextTransfer;
+import org.eclipse.swt.dnd.Transfer;
+import org.eclipse.ui.IEditorSite;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.PlatformUI;
+
+/**
+ * @author Roberto E. Escobar
+ */
+public class ArtifactEditorActionBarContributor implements IActionContributor {
+
+ private final AbstractArtifactEditor editor;
+
+ public ArtifactEditorActionBarContributor(AbstractArtifactEditor editor) {
+ this.editor = editor;
+ }
+
+ @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;
+
+ 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 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");
+ }
+
+ @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 {
+
+ public DeleteArtifactAction() {
+ super("&Delete Artifact\tDelete", IAction.AS_PUSH_BUTTON);
+ setImageDescriptor(ImageManager.getImageDescriptor(FrameworkImage.DELETE));
+ }
+
+ @Override
+ public void run() {
+ try {
+ MessageDialog dialog =
+ new MessageDialog(Displays.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 {
+
+ 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);
+ }
+ }
+ }
+
+ 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);
+ }
+ }
+ }
+
+ 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(Displays.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 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;
+ }
+ }
+
+ if (rString == null) {
+ rString = RelationManager.reportHasDirtyLinks(artifact);
+ }
+ AWorkbench.popup("Dirty Report", !Strings.isValid(rString) ? "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.");
+ }
+
+ @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");
+ }
+
+ @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/BaseArtifactEditorInput.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/editor/BaseArtifactEditorInput.java
index 8aad6090e5b..5b187a71426 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
@@ -1,94 +1,94 @@
-/*******************************************************************************
- * 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.skynet.artifact.editor;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
-import org.eclipse.osee.framework.ui.skynet.ArtifactImageManager;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IPersistableElement;
-
-/**
- * @author Roberto E. Escobar
- */
-public abstract class BaseArtifactEditorInput implements IEditorInput {
- private final 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 exists() {
- return true;
- }
-
- @Override
- public ImageDescriptor getImageDescriptor() {
- return ArtifactImageManager.getImageDescriptor(artifact);
- }
-
- public Image getImage() {
- return ArtifactImageManager.getImage(artifact);
- }
-
- @Override
- public String getName() {
- if (artifact == null) {
- return "No Artifact Input Provided";
- }
- return String.format("%s%s", artifact.getVersionedName(), artifact.isReadOnly() ? " (Read-Only)" : "");
- }
-
- @Override
- public IPersistableElement getPersistable() {
- return null;
- }
-
- @Override
- public String getToolTipText() {
- return getName();
- }
-
- @SuppressWarnings("rawtypes")
- @Override
- public Object getAdapter(Class adapter) {
- if (Artifact.class.equals(adapter)) {
- return getArtifact();
- }
- return null;
- }
-
- public Artifact getArtifact() {
- return artifact;
- }
-
- public boolean isReadOnly() {
- return artifact == null || artifact.isReadOnly();
- }
-
- @Override
- public int hashCode() {
- return this.artifact.hashCode();
- }
-}
+/*******************************************************************************
+ * 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.skynet.artifact.editor;
+
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.ui.skynet.ArtifactImageManager;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IPersistableElement;
+
+/**
+ * @author Roberto E. Escobar
+ */
+public abstract class BaseArtifactEditorInput implements IEditorInput {
+ private final 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 exists() {
+ return true;
+ }
+
+ @Override
+ public ImageDescriptor getImageDescriptor() {
+ return ArtifactImageManager.getImageDescriptor(artifact);
+ }
+
+ public Image getImage() {
+ return ArtifactImageManager.getImage(artifact);
+ }
+
+ @Override
+ public String getName() {
+ if (artifact == null) {
+ return "No Artifact Input Provided";
+ }
+ return String.format("%s%s", artifact.getVersionedName(), artifact.isReadOnly() ? " (Read-Only)" : "");
+ }
+
+ @Override
+ public IPersistableElement getPersistable() {
+ return null;
+ }
+
+ @Override
+ public String getToolTipText() {
+ return getName();
+ }
+
+ @SuppressWarnings("rawtypes")
+ @Override
+ public Object getAdapter(Class adapter) {
+ if (Artifact.class.equals(adapter)) {
+ return getArtifact();
+ }
+ return null;
+ }
+
+ public Artifact getArtifact() {
+ return artifact;
+ }
+
+ public boolean isReadOnly() {
+ return artifact == null || artifact.isReadOnly();
+ }
+
+ @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/IActionContributor.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/editor/IActionContributor.java
index 22ba53958c1..78840d94755 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/editor/IActionContributor.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/editor/IActionContributor.java
@@ -1,21 +1,21 @@
-/*******************************************************************************
- * 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.skynet.artifact.editor;
-
-import org.eclipse.jface.action.IToolBarManager;
-
-/**
- * @author Roberto E. Escobar
- */
-public interface IActionContributor {
-
- public void contributeToToolBar(IToolBarManager manager);
-}
+/*******************************************************************************
+ * 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.skynet.artifact.editor;
+
+import org.eclipse.jface.action.IToolBarManager;
+
+/**
+ * @author Roberto E. Escobar
+ */
+public interface IActionContributor {
+
+ public void contributeToToolBar(IToolBarManager manager);
+}
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/editor/IArtifactEditorEventHandler.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/editor/IArtifactEditorEventHandler.java
index 60b14651377..799d5678e08 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/editor/IArtifactEditorEventHandler.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/editor/IArtifactEditorEventHandler.java
@@ -8,28 +8,28 @@
* Contributors:
* Boeing - initial API and implementation
*******************************************************************************/
-package org.eclipse.osee.framework.ui.skynet.artifact.editor;
-
+package org.eclipse.osee.framework.ui.skynet.artifact.editor;
+
import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
import org.eclipse.swt.graphics.Image;
-
-/**
- * @author Donald G. Dunne
- */
-public interface IArtifactEditorEventHandler {
-
- public AbstractEventArtifactEditor getEditor();
-
- public boolean isDisposed();
-
- public void refreshDirtyArtifact();
-
- public void closeEditor();
-
- public void refreshRelations();
-
- public Artifact getArtifactFromEditorInput();
-
- public void setMainImage(Image titleImage);
-
-}
+
+/**
+ * @author Donald G. Dunne
+ */
+public interface IArtifactEditorEventHandler {
+
+ public AbstractEventArtifactEditor getEditor();
+
+ public boolean isDisposed();
+
+ public void refreshDirtyArtifact();
+
+ public void closeEditor();
+
+ public void refreshRelations();
+
+ public Artifact getArtifactFromEditorInput();
+
+ public void setMainImage(Image titleImage);
+
+}
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 22ac10717ac..b423444a118 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
@@ -1,253 +1,253 @@
-/*******************************************************************************
- * 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.skynet.artifact.editor.pages;
-
-import java.util.LinkedHashMap;
-import java.util.Map;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.IToolBarManager;
-import org.eclipse.jface.action.Separator;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.osee.framework.jdk.core.util.Lib;
-import org.eclipse.osee.framework.jdk.core.util.ReservedCharacters;
-import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
-import org.eclipse.osee.framework.ui.plugin.PluginUiImage;
-import org.eclipse.osee.framework.ui.skynet.FrameworkImage;
-import org.eclipse.osee.framework.ui.skynet.RelationsComposite;
-import org.eclipse.osee.framework.ui.skynet.artifact.editor.ArtifactEditor;
-import org.eclipse.osee.framework.ui.skynet.artifact.editor.parts.MessageSummaryNote;
-import org.eclipse.osee.framework.ui.skynet.artifact.editor.sections.AttributesFormSection;
-import org.eclipse.osee.framework.ui.skynet.artifact.editor.sections.DetailsFormSection;
-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;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.graphics.Point;
-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.Label;
-import org.eclipse.ui.forms.IManagedForm;
-import org.eclipse.ui.forms.IMessage;
-import org.eclipse.ui.forms.SectionPart;
-import org.eclipse.ui.forms.editor.FormEditor;
-import org.eclipse.ui.forms.editor.FormPage;
-import org.eclipse.ui.forms.events.HyperlinkAdapter;
-import org.eclipse.ui.forms.events.HyperlinkEvent;
-import org.eclipse.ui.forms.widgets.ExpandableComposite;
-import org.eclipse.ui.forms.widgets.FormText;
-import org.eclipse.ui.forms.widgets.FormToolkit;
-import org.eclipse.ui.forms.widgets.ScrolledForm;
-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 = ExpandableComposite.TITLE_BAR | ExpandableComposite.TWISTIE;
-
- sectionParts.put(SectionEnum.Attributes, new AttributesFormSection(getEditor(), form.getBody(), toolkit,
- sectionStyle | ExpandableComposite.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> ",
- ReservedCharacters.encodeXmlEntities(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 = Dialog.getImage(Dialog.DLG_IMG_MESSAGE_INFO);
- }
- } catch (Exception ex) {
- image = Dialog.getImage(Dialog.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();
- }
- }
-}
+/*******************************************************************************
+ * 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.skynet.artifact.editor.pages;
+
+import java.util.LinkedHashMap;
+import java.util.Map;
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.IToolBarManager;
+import org.eclipse.jface.action.Separator;
+import org.eclipse.jface.dialogs.Dialog;
+import org.eclipse.osee.framework.jdk.core.util.Lib;
+import org.eclipse.osee.framework.jdk.core.util.ReservedCharacters;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.ui.plugin.PluginUiImage;
+import org.eclipse.osee.framework.ui.skynet.FrameworkImage;
+import org.eclipse.osee.framework.ui.skynet.RelationsComposite;
+import org.eclipse.osee.framework.ui.skynet.artifact.editor.ArtifactEditor;
+import org.eclipse.osee.framework.ui.skynet.artifact.editor.parts.MessageSummaryNote;
+import org.eclipse.osee.framework.ui.skynet.artifact.editor.sections.AttributesFormSection;
+import org.eclipse.osee.framework.ui.skynet.artifact.editor.sections.DetailsFormSection;
+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;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.Point;
+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.Label;
+import org.eclipse.ui.forms.IManagedForm;
+import org.eclipse.ui.forms.IMessage;
+import org.eclipse.ui.forms.SectionPart;
+import org.eclipse.ui.forms.editor.FormEditor;
+import org.eclipse.ui.forms.editor.FormPage;
+import org.eclipse.ui.forms.events.HyperlinkAdapter;
+import org.eclipse.ui.forms.events.HyperlinkEvent;
+import org.eclipse.ui.forms.widgets.ExpandableComposite;
+import org.eclipse.ui.forms.widgets.FormText;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+import org.eclipse.ui.forms.widgets.ScrolledForm;
+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 = ExpandableComposite.TITLE_BAR | ExpandableComposite.TWISTIE;
+
+ sectionParts.put(SectionEnum.Attributes, new AttributesFormSection(getEditor(), form.getBody(), toolkit,
+ sectionStyle | ExpandableComposite.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> ",
+ ReservedCharacters.encodeXmlEntities(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 = Dialog.getImage(Dialog.DLG_IMG_MESSAGE_INFO);
+ }
+ } catch (Exception ex) {
+ image = Dialog.getImage(Dialog.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 c1fc400af4b..32eab860979 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
@@ -1,282 +1,282 @@
-/*******************************************************************************
- * 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.skynet.artifact.editor.parts;
-
-import java.util.Arrays;
-import java.util.List;
-import java.util.logging.Level;
-import org.eclipse.jface.dialogs.IMessageProvider;
-import org.eclipse.osee.framework.core.enums.CoreAttributeTypes;
-import org.eclipse.osee.framework.core.exception.OseeCoreException;
-import org.eclipse.osee.framework.core.model.type.AttributeType;
-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.skynet.core.attribute.AttributeTypeManager;
-import org.eclipse.osee.framework.skynet.core.attribute.WordAttribute;
-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.editor.ArtifactEditor;
-import org.eclipse.osee.framework.ui.skynet.artifact.editor.sections.AttributeTypeUtil;
-import org.eclipse.osee.framework.ui.skynet.widgets.IArtifactStoredWidget;
-import org.eclipse.osee.framework.ui.skynet.widgets.XModifiedListener;
-import org.eclipse.osee.framework.ui.skynet.widgets.XOption;
-import org.eclipse.osee.framework.ui.skynet.widgets.XWidget;
-import org.eclipse.osee.framework.ui.skynet.widgets.XWidgetAccessDecorationProvider;
-import org.eclipse.osee.framework.ui.skynet.widgets.XWidgetDecorator;
-import org.eclipse.osee.framework.ui.skynet.widgets.XWidgetUtility;
-import org.eclipse.osee.framework.ui.skynet.widgets.workflow.AttributeXWidgetManager;
-import org.eclipse.osee.framework.ui.skynet.widgets.workflow.DefaultXWidgetOptionResolver;
-import org.eclipse.osee.framework.ui.skynet.widgets.workflow.DynamicXWidgetLayoutData;
-import org.eclipse.osee.framework.ui.skynet.widgets.workflow.IAttributeXWidgetProvider;
-import org.eclipse.osee.framework.ui.skynet.widgets.workflow.WorkPage;
-import org.eclipse.osee.framework.ui.swt.ALayout;
-import org.eclipse.osee.framework.ui.swt.FontManager;
-import org.eclipse.osee.framework.ui.swt.Widgets;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Font;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.ui.forms.AbstractFormPart;
-import org.eclipse.ui.forms.events.ExpansionEvent;
-import org.eclipse.ui.forms.events.IExpansionListener;
-import org.eclipse.ui.forms.widgets.ExpandableComposite;
-import org.eclipse.ui.forms.widgets.FormToolkit;
-
-/**
- * @author Roberto E. Escobar
- */
-public class AttributeFormPart extends AbstractFormPart {
-
- private final ArtifactEditor editor;
- private Composite composite;
- private final XWidgetDecorator decorator;
-
- public AttributeFormPart(ArtifactEditor editor) {
- this.editor = editor;
- this.decorator = new XWidgetDecorator();
+/*******************************************************************************
+ * 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.skynet.artifact.editor.parts;
+
+import java.util.Arrays;
+import java.util.List;
+import java.util.logging.Level;
+import org.eclipse.jface.dialogs.IMessageProvider;
+import org.eclipse.osee.framework.core.enums.CoreAttributeTypes;
+import org.eclipse.osee.framework.core.exception.OseeCoreException;
+import org.eclipse.osee.framework.core.model.type.AttributeType;
+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.skynet.core.attribute.AttributeTypeManager;
+import org.eclipse.osee.framework.skynet.core.attribute.WordAttribute;
+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.editor.ArtifactEditor;
+import org.eclipse.osee.framework.ui.skynet.artifact.editor.sections.AttributeTypeUtil;
+import org.eclipse.osee.framework.ui.skynet.widgets.IArtifactStoredWidget;
+import org.eclipse.osee.framework.ui.skynet.widgets.XModifiedListener;
+import org.eclipse.osee.framework.ui.skynet.widgets.XOption;
+import org.eclipse.osee.framework.ui.skynet.widgets.XWidget;
+import org.eclipse.osee.framework.ui.skynet.widgets.XWidgetAccessDecorationProvider;
+import org.eclipse.osee.framework.ui.skynet.widgets.XWidgetDecorator;
+import org.eclipse.osee.framework.ui.skynet.widgets.XWidgetUtility;
+import org.eclipse.osee.framework.ui.skynet.widgets.workflow.AttributeXWidgetManager;
+import org.eclipse.osee.framework.ui.skynet.widgets.workflow.DefaultXWidgetOptionResolver;
+import org.eclipse.osee.framework.ui.skynet.widgets.workflow.DynamicXWidgetLayoutData;
+import org.eclipse.osee.framework.ui.skynet.widgets.workflow.IAttributeXWidgetProvider;
+import org.eclipse.osee.framework.ui.skynet.widgets.workflow.WorkPage;
+import org.eclipse.osee.framework.ui.swt.ALayout;
+import org.eclipse.osee.framework.ui.swt.FontManager;
+import org.eclipse.osee.framework.ui.swt.Widgets;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Font;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.ui.forms.AbstractFormPart;
+import org.eclipse.ui.forms.events.ExpansionEvent;
+import org.eclipse.ui.forms.events.IExpansionListener;
+import org.eclipse.ui.forms.widgets.ExpandableComposite;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+
+/**
+ * @author Roberto E. Escobar
+ */
+public class AttributeFormPart extends AbstractFormPart {
+
+ private final ArtifactEditor editor;
+ private Composite composite;
+ private final XWidgetDecorator decorator;
+
+ public AttributeFormPart(ArtifactEditor editor) {
+ this.editor = editor;
+ this.decorator = new XWidgetDecorator();
try {
decorator.addProvider(new XWidgetAccessDecorationProvider(
SkynetGuiPlugin.getInstance().getPolicyHandlerService()));
} catch (OseeCoreException ex) {
OseeLog.log(SkynetGuiPlugin.class, Level.SEVERE, ex.toString(), ex);
}
- }
-
- public void createContents(Composite parent) {
- decorator.dispose();
-
- 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) {
+ }
+
+ public void createContents(Composite parent) {
+ decorator.dispose();
+
+ 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.RelationOrder)) {
- 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());
- decorator.addWidget(xWidget);
- }
- decorator.refresh();
- 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, widgetModifiedListener, isEditable);
-
- } catch (OseeCoreException ex) {
- toolkit.createLabel(parent, String.format("Error creating controls for: [%s]", attributeType.getName()));
- }
- return internalComposite;
- }
-
- 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);
- }
-
- private final XModifiedListener widgetModifiedListener = new XModifiedListener() {
-
- @Override
- public void widgetModified(XWidget widget) {
- editor.onDirtied();
- }
- };
-
- @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 IArtifactStoredWidget) {
- IArtifactStoredWidget aWidget = (IArtifactStoredWidget) 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 IArtifactStoredWidget) {
- IArtifactStoredWidget aWidget = (IArtifactStoredWidget) xWidget;
- try {
- Result result = aWidget.isDirty();
- if (result.isTrue()) {
- xWidget.setControlCausedMessage("attribute.dirty", "Dirty", IMessageProvider.INFORMATION);
- if (!isDirty()) {
- markDirty();
- }
- } else {
- xWidget.removeControlCausedMessage("attribute.dirty");
- }
- } catch (Exception ex) {
- xWidget.setControlCausedMessage("attribute.dirty", "Unable to compute isDirty", IMessageProvider.ERROR);
- }
- }
- }
- }
-
-}
+ 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());
+ decorator.addWidget(xWidget);
+ }
+ decorator.refresh();
+ 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, widgetModifiedListener, isEditable);
+
+ } catch (OseeCoreException ex) {
+ toolkit.createLabel(parent, String.format("Error creating controls for: [%s]", attributeType.getName()));
+ }
+ return internalComposite;
+ }
+
+ 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);
+ }
+
+ private final XModifiedListener widgetModifiedListener = new XModifiedListener() {
+
+ @Override
+ public void widgetModified(XWidget widget) {
+ editor.onDirtied();
+ }
+ };
+
+ @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 IArtifactStoredWidget) {
+ IArtifactStoredWidget aWidget = (IArtifactStoredWidget) 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 IArtifactStoredWidget) {
+ IArtifactStoredWidget aWidget = (IArtifactStoredWidget) xWidget;
+ try {
+ Result result = aWidget.isDirty();
+ if (result.isTrue()) {
+ xWidget.setControlCausedMessage("attribute.dirty", "Dirty", IMessageProvider.INFORMATION);
+ 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 5154c53dc72..899aede049e 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
@@ -1,153 +1,153 @@
-/*******************************************************************************
- * 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.skynet.artifact.editor.parts;
-
-import java.io.PrintWriter;
-import java.io.StringWriter;
-import org.eclipse.jface.dialogs.IMessageProvider;
-import org.eclipse.osee.framework.logging.OseeLevel;
-import org.eclipse.osee.framework.logging.OseeLog;
-import org.eclipse.osee.framework.ui.skynet.SkynetGuiPlugin;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.FocusAdapter;
-import org.eclipse.swt.events.FocusEvent;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.layout.FillLayout;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.ISharedImages;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.forms.IManagedForm;
-import org.eclipse.ui.forms.IMessage;
-import org.eclipse.ui.forms.events.HyperlinkAdapter;
-import org.eclipse.ui.forms.events.HyperlinkEvent;
-import org.eclipse.ui.forms.widgets.Form;
-import org.eclipse.ui.forms.widgets.FormText;
-import org.eclipse.ui.forms.widgets.FormToolkit;
-import org.eclipse.ui.forms.widgets.ScrolledForm;
-
-/**
- * @author Roberto E. Escobar
- */
-public class MessageSummaryNote {
- private final Shell shell;
-
- 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());
-
- 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);
- text.addFocusListener(new FocusAdapter() {
-
- @Override
- public void focusLost(FocusEvent e) {
- shell.close();
- }
- });
- shell.setLocation(0, 0);
- }
-
- public void setLocation(Point point) {
- shell.setLocation(point);
- }
-
- 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) {
- OseeLog.log(SkynetGuiPlugin.class, OseeLevel.SEVERE, 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 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();
- }
-}
+/*******************************************************************************
+ * 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.skynet.artifact.editor.parts;
+
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import org.eclipse.jface.dialogs.IMessageProvider;
+import org.eclipse.osee.framework.logging.OseeLevel;
+import org.eclipse.osee.framework.logging.OseeLog;
+import org.eclipse.osee.framework.ui.skynet.SkynetGuiPlugin;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.FocusAdapter;
+import org.eclipse.swt.events.FocusEvent;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.layout.FillLayout;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.ISharedImages;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.forms.IManagedForm;
+import org.eclipse.ui.forms.IMessage;
+import org.eclipse.ui.forms.events.HyperlinkAdapter;
+import org.eclipse.ui.forms.events.HyperlinkEvent;
+import org.eclipse.ui.forms.widgets.Form;
+import org.eclipse.ui.forms.widgets.FormText;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+import org.eclipse.ui.forms.widgets.ScrolledForm;
+
+/**
+ * @author Roberto E. Escobar
+ */
+public class MessageSummaryNote {
+ private final Shell shell;
+
+ 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());
+
+ 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);
+ text.addFocusListener(new FocusAdapter() {
+
+ @Override
+ public void focusLost(FocusEvent e) {
+ shell.close();
+ }
+ });
+ shell.setLocation(0, 0);
+ }
+
+ public void setLocation(Point point) {
+ shell.setLocation(point);
+ }
+
+ 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) {
+ OseeLog.log(SkynetGuiPlugin.class, OseeLevel.SEVERE, 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 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/ArtifactEditorFormSection.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/editor/sections/ArtifactEditorFormSection.java
index 823a9c21dd4..72701016f4a 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/editor/sections/ArtifactEditorFormSection.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/editor/sections/ArtifactEditorFormSection.java
@@ -1,38 +1,38 @@
-/*******************************************************************************
- * 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.skynet.artifact.editor.sections;
-
-import org.eclipse.osee.framework.ui.skynet.artifact.editor.AbstractArtifactEditor;
-import org.eclipse.osee.framework.ui.skynet.artifact.editor.BaseArtifactEditorInput;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.forms.SectionPart;
-import org.eclipse.ui.forms.widgets.FormToolkit;
-
-/**
- * @author Roberto E. Escobar
- */
-public abstract class ArtifactEditorFormSection extends SectionPart {
-
- private final AbstractArtifactEditor editor;
-
- public ArtifactEditorFormSection(AbstractArtifactEditor editor, Composite parent, FormToolkit toolkit, int style) {
- super(parent, toolkit, style);
- this.editor = editor;
- }
-
- public AbstractArtifactEditor getEditor() {
- return editor;
- }
-
- public BaseArtifactEditorInput getEditorInput() {
- return (BaseArtifactEditorInput) editor.getEditorInput();
- }
+/*******************************************************************************
+ * 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.skynet.artifact.editor.sections;
+
+import org.eclipse.osee.framework.ui.skynet.artifact.editor.AbstractArtifactEditor;
+import org.eclipse.osee.framework.ui.skynet.artifact.editor.BaseArtifactEditorInput;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.forms.SectionPart;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+
+/**
+ * @author Roberto E. Escobar
+ */
+public abstract class ArtifactEditorFormSection extends SectionPart {
+
+ private final AbstractArtifactEditor editor;
+
+ public ArtifactEditorFormSection(AbstractArtifactEditor editor, Composite parent, FormToolkit toolkit, int style) {
+ super(parent, toolkit, style);
+ this.editor = editor;
+ }
+
+ public AbstractArtifactEditor getEditor() {
+ return editor;
+ }
+
+ public BaseArtifactEditorInput getEditorInput() {
+ return (BaseArtifactEditorInput) editor.getEditorInput();
+ }
} \ 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/AttributeTypeUtil.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/editor/sections/AttributeTypeUtil.java
index 3b7840d311d..7999f3b6a79 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/editor/sections/AttributeTypeUtil.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/editor/sections/AttributeTypeUtil.java
@@ -1,76 +1,76 @@
-/*******************************************************************************
- * 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.skynet.artifact.editor.sections;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-import org.eclipse.osee.framework.core.enums.CoreAttributeTypes;
-import org.eclipse.osee.framework.core.exception.OseeCoreException;
-import org.eclipse.osee.framework.core.model.type.AttributeType;
-import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
-import org.eclipse.osee.framework.skynet.core.artifact.Attribute;
-
-/**
- * @author Roberto E. Escobar
- */
-public class AttributeTypeUtil {
-
- public static AttributeType[] getEmptyTypes(Artifact artifact) throws OseeCoreException {
- List<AttributeType> items = new ArrayList<AttributeType>();
- for (AttributeType type : artifact.getAttributeTypes()) {
+/*******************************************************************************
+ * 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.skynet.artifact.editor.sections;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+import org.eclipse.osee.framework.core.enums.CoreAttributeTypes;
+import org.eclipse.osee.framework.core.exception.OseeCoreException;
+import org.eclipse.osee.framework.core.model.type.AttributeType;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.skynet.core.artifact.Attribute;
+
+/**
+ * @author Roberto E. Escobar
+ */
+public class AttributeTypeUtil {
+
+ public static AttributeType[] getEmptyTypes(Artifact artifact) throws OseeCoreException {
+ List<AttributeType> items = new ArrayList<AttributeType>();
+ for (AttributeType type : artifact.getAttributeTypes()) {
if (!CoreAttributeTypes.Name.equals(type) && artifact.getAttributes(type).isEmpty()) {
- items.add(type);
- }
- }
- Collections.sort(items);
- return items.toArray(new AttributeType[items.size()]);
- }
-
- public static Set<AttributeType> toTypes(List<Attribute<?>> attributes) {
- Set<AttributeType> types = new HashSet<AttributeType>();
- for (Attribute<?> attribute : attributes) {
- types.add(attribute.getAttributeType());
- }
- return types;
- }
-
- public static AttributeType[] getTypesWithData(Artifact artifact) throws OseeCoreException {
- List<AttributeType> items = new ArrayList<AttributeType>();
-
- List<Attribute<?>> attributeInstances = artifact.getAttributes(artifact.isDeleted());
- Set<AttributeType> typesInExistence = toTypes(attributeInstances);
-
- AttributeType nameType = null;
- AttributeType annotations = null;
-
- for (AttributeType type : typesInExistence) {
+ items.add(type);
+ }
+ }
+ Collections.sort(items);
+ return items.toArray(new AttributeType[items.size()]);
+ }
+
+ public static Set<AttributeType> toTypes(List<Attribute<?>> attributes) {
+ Set<AttributeType> types = new HashSet<AttributeType>();
+ for (Attribute<?> attribute : attributes) {
+ types.add(attribute.getAttributeType());
+ }
+ return types;
+ }
+
+ public static AttributeType[] getTypesWithData(Artifact artifact) throws OseeCoreException {
+ List<AttributeType> items = new ArrayList<AttributeType>();
+
+ List<Attribute<?>> attributeInstances = artifact.getAttributes(artifact.isDeleted());
+ Set<AttributeType> typesInExistence = toTypes(attributeInstances);
+
+ AttributeType nameType = null;
+ AttributeType annotations = null;
+
+ for (AttributeType type : typesInExistence) {
if (CoreAttributeTypes.Name.equals(type)) {
- nameType = type;
- } else if (CoreAttributeTypes.Annotation.equals(type)) {
- annotations = type;
- } else {
- items.add(type);
- }
- }
- Collections.sort(items);
- if (nameType != null) {
- items.add(0, nameType);
- }
- if (annotations != null) {
- items.add(annotations);
- }
- return items.toArray(new AttributeType[items.size()]);
- }
-
-}
+ nameType = type;
+ } else if (CoreAttributeTypes.Annotation.equals(type)) {
+ annotations = type;
+ } else {
+ items.add(type);
+ }
+ }
+ Collections.sort(items);
+ if (nameType != null) {
+ items.add(0, nameType);
+ }
+ if (annotations != null) {
+ items.add(annotations);
+ }
+ return items.toArray(new AttributeType[items.size()]);
+ }
+
+}
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/editor/sections/AttributesFormSection.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/editor/sections/AttributesFormSection.java
index be0cc99b0d0..77748b43b86 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/editor/sections/AttributesFormSection.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/editor/sections/AttributesFormSection.java
@@ -1,132 +1,132 @@
-/*******************************************************************************
- * 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.skynet.artifact.editor.sections;
-
-import org.eclipse.jface.action.IContributionItem;
-import org.eclipse.jface.action.IToolBarManager;
-import org.eclipse.jface.action.ToolBarManager;
-import org.eclipse.osee.framework.ui.skynet.artifact.editor.ArtifactEditor;
-import org.eclipse.osee.framework.ui.skynet.artifact.editor.IActionContributor;
-import org.eclipse.osee.framework.ui.skynet.artifact.editor.parts.AttributeFormPart;
-import org.eclipse.osee.framework.ui.swt.ALayout;
-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.Control;
-import org.eclipse.ui.forms.IManagedForm;
-import org.eclipse.ui.forms.widgets.FormToolkit;
-import org.eclipse.ui.forms.widgets.Section;
-
-/**
- * @author Roberto E. Escobar
- */
-public class AttributesFormSection extends ArtifactEditorFormSection {
-
- private IActionContributor actionContributor;
- private AttributeFormPart formPart;
- private IToolBarManager toolBarManager;
-
- public AttributesFormSection(ArtifactEditor editor, Composite parent, FormToolkit toolkit, int style) {
- super(editor, parent, toolkit, style);
- }
-
- @Override
- public void initialize(IManagedForm form) {
- super.initialize(form);
- Section section = getSection();
- section.setText("Attributes");
- section.setLayout(new GridLayout(1, false));
- section.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false));
-
- addToolBar(form);
- updateDataPart();
- updateToolBarVisibility();
- }
-
- private IToolBarManager getToolBarManager() {
- if (toolBarManager == null) {
- toolBarManager = new ToolBarManager(SWT.FLAT);
- }
- return toolBarManager;
- }
-
- private void addToolBar(IManagedForm form) {
- final FormToolkit toolkit = form.getToolkit();
- Composite composite = toolkit.createComposite(getSection());
- composite.setLayout(ALayout.getZeroMarginLayout());
- composite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
- composite.setBackground(getSection().getBackground());
-
- IToolBarManager manager = getToolBarManager();
- ((ToolBarManager) manager).createControl(composite);
- getActionContributor().contributeToToolBar(manager);
- manager.update(true);
-
- getSection().setTextClient(composite);
- }
-
- private IActionContributor getActionContributor() {
- if (actionContributor == null) {
- actionContributor = new AttributeActionContribution((ArtifactEditor) getEditor());
- }
- return actionContributor;
- }
-
- private void updateDataPart() {
- final IManagedForm form = getManagedForm();
- final FormToolkit toolkit = form.getToolkit();
- final Section section = getSection();
-
- if (formPart != null) {
- form.removePart(formPart);
- formPart.dispose();
- Control control = section.getClient();
- if (control != null && !control.isDisposed()) {
- control.dispose();
- }
- }
- Composite sectionBody = toolkit.createComposite(section, toolkit.getBorderStyle());
- sectionBody.setLayout(ALayout.getZeroMarginLayout());
- sectionBody.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
-
- formPart = new AttributeFormPart((ArtifactEditor) getEditor());
- form.addPart(formPart);
- formPart.createContents(sectionBody);
- section.setClient(sectionBody);
- toolkit.paintBordersFor(section);
-
- section.layout(true);
- form.getForm().getBody().layout(true);
- }
-
- @Override
- public void refresh() {
- super.refresh();
- updateDataPart();
- updateToolBarVisibility();
- }
-
- private void updateToolBarVisibility() {
- boolean isReadOnly = !getEditorInput().isReadOnly();
- getSection().getTextClient().setVisible(isReadOnly);
- for (IContributionItem item : getToolBarManager().getItems()) {
- item.setVisible(isReadOnly);
- }
- getToolBarManager().update(true);
- }
-
- @Override
- public void dispose() {
- formPart.dispose();
- super.dispose();
- }
-}
+/*******************************************************************************
+ * 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.skynet.artifact.editor.sections;
+
+import org.eclipse.jface.action.IContributionItem;
+import org.eclipse.jface.action.IToolBarManager;
+import org.eclipse.jface.action.ToolBarManager;
+import org.eclipse.osee.framework.ui.skynet.artifact.editor.ArtifactEditor;
+import org.eclipse.osee.framework.ui.skynet.artifact.editor.IActionContributor;
+import org.eclipse.osee.framework.ui.skynet.artifact.editor.parts.AttributeFormPart;
+import org.eclipse.osee.framework.ui.swt.ALayout;
+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.Control;
+import org.eclipse.ui.forms.IManagedForm;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+import org.eclipse.ui.forms.widgets.Section;
+
+/**
+ * @author Roberto E. Escobar
+ */
+public class AttributesFormSection extends ArtifactEditorFormSection {
+
+ private IActionContributor actionContributor;
+ private AttributeFormPart formPart;
+ private IToolBarManager toolBarManager;
+
+ public AttributesFormSection(ArtifactEditor editor, Composite parent, FormToolkit toolkit, int style) {
+ super(editor, parent, toolkit, style);
+ }
+
+ @Override
+ public void initialize(IManagedForm form) {
+ super.initialize(form);
+ Section section = getSection();
+ section.setText("Attributes");
+ section.setLayout(new GridLayout(1, false));
+ section.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false));
+
+ addToolBar(form);
+ updateDataPart();
+ updateToolBarVisibility();
+ }
+
+ private IToolBarManager getToolBarManager() {
+ if (toolBarManager == null) {
+ toolBarManager = new ToolBarManager(SWT.FLAT);
+ }
+ return toolBarManager;
+ }
+
+ private void addToolBar(IManagedForm form) {
+ final FormToolkit toolkit = form.getToolkit();
+ Composite composite = toolkit.createComposite(getSection());
+ composite.setLayout(ALayout.getZeroMarginLayout());
+ composite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
+ composite.setBackground(getSection().getBackground());
+
+ IToolBarManager manager = getToolBarManager();
+ ((ToolBarManager) manager).createControl(composite);
+ getActionContributor().contributeToToolBar(manager);
+ manager.update(true);
+
+ getSection().setTextClient(composite);
+ }
+
+ private IActionContributor getActionContributor() {
+ if (actionContributor == null) {
+ actionContributor = new AttributeActionContribution((ArtifactEditor) getEditor());
+ }
+ return actionContributor;
+ }
+
+ private void updateDataPart() {
+ final IManagedForm form = getManagedForm();
+ final FormToolkit toolkit = form.getToolkit();
+ final Section section = getSection();
+
+ if (formPart != null) {
+ form.removePart(formPart);
+ formPart.dispose();
+ Control control = section.getClient();
+ if (control != null && !control.isDisposed()) {
+ control.dispose();
+ }
+ }
+ Composite sectionBody = toolkit.createComposite(section, toolkit.getBorderStyle());
+ sectionBody.setLayout(ALayout.getZeroMarginLayout());
+ sectionBody.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
+
+ formPart = new AttributeFormPart((ArtifactEditor) getEditor());
+ form.addPart(formPart);
+ formPart.createContents(sectionBody);
+ section.setClient(sectionBody);
+ toolkit.paintBordersFor(section);
+
+ section.layout(true);
+ form.getForm().getBody().layout(true);
+ }
+
+ @Override
+ public void refresh() {
+ super.refresh();
+ updateDataPart();
+ updateToolBarVisibility();
+ }
+
+ private void updateToolBarVisibility() {
+ boolean isReadOnly = !getEditorInput().isReadOnly();
+ getSection().getTextClient().setVisible(isReadOnly);
+ for (IContributionItem item : getToolBarManager().getItems()) {
+ item.setVisible(isReadOnly);
+ }
+ getToolBarManager().update(true);
+ }
+
+ @Override
+ public void dispose() {
+ formPart.dispose();
+ super.dispose();
+ }
+}
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 4e11e9df40f..880b2be5511 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
@@ -1,101 +1,101 @@
-/*******************************************************************************
- * 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.skynet.artifact.editor.sections;
-
-import org.eclipse.osee.framework.jdk.core.util.Lib;
-import org.eclipse.osee.framework.skynet.core.utility.Artifacts;
-import org.eclipse.osee.framework.ui.skynet.artifact.editor.ArtifactEditor;
-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.Composite;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Listener;
-import org.eclipse.ui.forms.IManagedForm;
-import org.eclipse.ui.forms.widgets.FormText;
-import org.eclipse.ui.forms.widgets.FormToolkit;
-import org.eclipse.ui.forms.widgets.Section;
-
-/**
- * @author Roberto E. Escobar
- */
-public class DetailsFormSection extends ArtifactEditorFormSection {
-
- 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);
- }
-
- @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 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));
-
- 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;
- }
-
- 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 refresh() {
- super.refresh();
- createSection();
- }
-
-}
+/*******************************************************************************
+ * 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.skynet.artifact.editor.sections;
+
+import org.eclipse.osee.framework.jdk.core.util.Lib;
+import org.eclipse.osee.framework.skynet.core.utility.Artifacts;
+import org.eclipse.osee.framework.ui.skynet.artifact.editor.ArtifactEditor;
+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.Composite;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Listener;
+import org.eclipse.ui.forms.IManagedForm;
+import org.eclipse.ui.forms.widgets.FormText;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+import org.eclipse.ui.forms.widgets.Section;
+
+/**
+ * @author Roberto E. Escobar
+ */
+public class DetailsFormSection extends ArtifactEditorFormSection {
+
+ 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);
+ }
+
+ @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 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));
+
+ 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;
+ }
+
+ 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 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 1d8d94fa1a0..1198a85cd21 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
@@ -1,152 +1,152 @@
-/*******************************************************************************
- * 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.skynet.artifact.editor.sections;
-
-import org.eclipse.osee.framework.ui.skynet.RelationsComposite;
-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.MouseEvent;
-import org.eclipse.swt.events.MouseListener;
-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.Event;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Listener;
-import org.eclipse.ui.forms.IManagedForm;
-import org.eclipse.ui.forms.widgets.FormToolkit;
-import org.eclipse.ui.forms.widgets.Section;
-
-/**
- * @author Roberto E. Escobar
- */
-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() {
-
- @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().addMouseListener(new MouseListener() {
-
- private void redrawPage() {
- Displays.ensureInDisplayThread(new Runnable() {
- @Override
- public void run() {
- relationComposite.layout();
- relationComposite.getParent().layout();
- getManagedForm().reflow(true);
- }
- });
- }
-
- @Override
- public void mouseDoubleClick(MouseEvent e) {
- // do nothing
- }
-
- @Override
- public void mouseDown(MouseEvent e) {
- redrawPage();
- }
-
- @Override
- public void mouseUp(MouseEvent e) {
- // do nothing
- }
- });
- 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();
- }
-}
+/*******************************************************************************
+ * 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.skynet.artifact.editor.sections;
+
+import org.eclipse.osee.framework.ui.skynet.RelationsComposite;
+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.MouseEvent;
+import org.eclipse.swt.events.MouseListener;
+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.Event;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Listener;
+import org.eclipse.ui.forms.IManagedForm;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+import org.eclipse.ui.forms.widgets.Section;
+
+/**
+ * @author Roberto E. Escobar
+ */
+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() {
+
+ @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().addMouseListener(new MouseListener() {
+
+ private void redrawPage() {
+ Displays.ensureInDisplayThread(new Runnable() {
+ @Override
+ public void run() {
+ relationComposite.layout();
+ relationComposite.getParent().layout();
+ getManagedForm().reflow(true);
+ }
+ });
+ }
+
+ @Override
+ public void mouseDoubleClick(MouseEvent e) {
+ // do nothing
+ }
+
+ @Override
+ public void mouseDown(MouseEvent e) {
+ redrawPage();
+ }
+
+ @Override
+ public void mouseUp(MouseEvent e) {
+ // do nothing
+ }
+ });
+ 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/IMassViewerEventHandler.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/massEditor/IMassViewerEventHandler.java
index 37e373959f6..3fea7a86e03 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/massEditor/IMassViewerEventHandler.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/massEditor/IMassViewerEventHandler.java
@@ -8,15 +8,15 @@
* Contributors:
* Boeing - initial API and implementation
*******************************************************************************/
-package org.eclipse.osee.framework.ui.skynet.artifact.massEditor;
-
-/**
- * @author Donald G. Dunne
- */
-public interface IMassViewerEventHandler {
-
- public MassXViewer getMassXViewer();
-
- public boolean isDisposed();
-
-}
+package org.eclipse.osee.framework.ui.skynet.artifact.massEditor;
+
+/**
+ * @author Donald G. Dunne
+ */
+public interface IMassViewerEventHandler {
+
+ public MassXViewer getMassXViewer();
+
+ public boolean isDisposed();
+
+}
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 4c9bc1e9fad..bf650f32257 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
@@ -1,299 +1,299 @@
-/*******************************************************************************
- * 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.skynet.artifact.massEditor;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.Set;
-import java.util.logging.Level;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jface.action.ActionContributionItem;
-import org.eclipse.osee.framework.access.AccessControlManager;
-import org.eclipse.osee.framework.core.enums.PermissionEnum;
-import org.eclipse.osee.framework.core.model.Branch;
-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.skynet.core.UserManager;
-import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
-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.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;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.ToolBar;
-import org.eclipse.swt.widgets.ToolItem;
-import org.eclipse.swt.widgets.Tree;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IWorkbenchPage;
-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() {
- @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 "";
- }
-}
+/*******************************************************************************
+ * 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.skynet.artifact.massEditor;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.Set;
+import java.util.logging.Level;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.jface.action.ActionContributionItem;
+import org.eclipse.osee.framework.access.AccessControlManager;
+import org.eclipse.osee.framework.core.enums.PermissionEnum;
+import org.eclipse.osee.framework.core.model.Branch;
+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.skynet.core.UserManager;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+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.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;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.ToolBar;
+import org.eclipse.swt.widgets.ToolItem;
+import org.eclipse.swt.widgets.Tree;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IWorkbenchPage;
+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() {
+ @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/MassXViewer.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/massEditor/MassXViewer.java
index c668c3f650a..bc1ff3ea909 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
@@ -1,343 +1,345 @@
-/*******************************************************************************
- * 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.skynet.artifact.massEditor;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-import java.util.logging.Level;
-import org.eclipse.nebula.widgets.xviewer.XViewer;
-import org.eclipse.osee.framework.core.data.IAttributeType;
-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.skynet.core.artifact.ArtifactData;
-import org.eclipse.osee.framework.skynet.core.attribute.AttributeTypeManager;
-import org.eclipse.osee.framework.skynet.core.event.FrameworkTransactionData;
-import org.eclipse.osee.framework.skynet.core.event.IArtifactsChangeTypeEventListener;
-import org.eclipse.osee.framework.skynet.core.event.IArtifactsPurgedEventListener;
-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.skynet.core.utility.LoadedArtifacts;
-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.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;
-import org.eclipse.swt.dnd.DragSourceEvent;
-import org.eclipse.swt.dnd.DragSourceListener;
-import org.eclipse.swt.dnd.DropTarget;
-import org.eclipse.swt.dnd.DropTargetAdapter;
-import org.eclipse.swt.dnd.DropTargetEvent;
-import org.eclipse.swt.dnd.FileTransfer;
-import org.eclipse.swt.dnd.TextTransfer;
-import org.eclipse.swt.dnd.Transfer;
-import org.eclipse.swt.events.DisposeEvent;
-import org.eclipse.swt.events.DisposeListener;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.TreeColumn;
-import org.eclipse.swt.widgets.TreeItem;
-
-/**
- * <REM2> new handled in MassXViewerEventManager
- *
- * @author Donald G. Dunne
- */
-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> artifacts = new HashSet<Artifact>();
- for (TreeItem item : treeItems) {
- artifacts.add((Artifact) item.getData());
- }
- try {
- IAttributeType attributeType = AttributeTypeManager.getType(colName);
- if (ArtifactPromptChange.promptChangeAttribute(attributeType, artifacts, false)) {
- refresh();
- editor.onDirtied();
- }
- } catch (OseeCoreException ex) {
- OseeLog.log(SkynetGuiPlugin.class, OseeLevel.SEVERE_POPUP, ex);
- }
- }
-
- @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) {
- super.handleAltLeftClick(treeColumn, treeItem);
- String colName = treeColumn.getText();
- if (EXTRA_COLUMNS.contains(colName)) {
- AWorkbench.popup("ERROR", "Can't change the field " + colName);
- }
- try {
- IAttributeType attributeType = AttributeTypeManager.getType(colName);
- Artifact useArt = (Artifact) treeItem.getData();
- boolean persist = false;
- if (ArtifactPromptChange.promptChangeAttribute(attributeType, Arrays.asList(useArt), persist)) {
- refresh();
- editor.onDirtied();
- return true;
- }
- } catch (OseeCoreException ex) {
- OseeLog.log(SkynetGuiPlugin.class, OseeLevel.SEVERE_POPUP, ex);
- }
- 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) {
- // do nothing
- }
- });
- }
-
- 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.DEFAULT_OPEN);
- }
-
- 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();
- }
-
-}
+/*******************************************************************************
+ * 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.skynet.artifact.massEditor;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+import java.util.logging.Level;
+import org.eclipse.nebula.widgets.xviewer.XViewer;
+import org.eclipse.osee.framework.core.data.IAttributeType;
+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.skynet.core.artifact.ArtifactData;
+import org.eclipse.osee.framework.skynet.core.attribute.AttributeTypeManager;
+import org.eclipse.osee.framework.skynet.core.event.FrameworkTransactionData;
+import org.eclipse.osee.framework.skynet.core.event.IArtifactsChangeTypeEventListener;
+import org.eclipse.osee.framework.skynet.core.event.IArtifactsPurgedEventListener;
+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.skynet.core.utility.LoadedArtifacts;
+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.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;
+import org.eclipse.swt.dnd.DragSourceEvent;
+import org.eclipse.swt.dnd.DragSourceListener;
+import org.eclipse.swt.dnd.DropTarget;
+import org.eclipse.swt.dnd.DropTargetAdapter;
+import org.eclipse.swt.dnd.DropTargetEvent;
+import org.eclipse.swt.dnd.FileTransfer;
+import org.eclipse.swt.dnd.TextTransfer;
+import org.eclipse.swt.dnd.Transfer;
+import org.eclipse.swt.events.DisposeEvent;
+import org.eclipse.swt.events.DisposeListener;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.TreeColumn;
+import org.eclipse.swt.widgets.TreeItem;
+
+/**
+ * <REM2> new handled in MassXViewerEventManager
+ *
+ * @author Donald G. Dunne
+ */
+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> artifacts = new HashSet<Artifact>();
+ for (TreeItem item : treeItems) {
+ artifacts.add((Artifact) item.getData());
+ }
+ try {
+ IAttributeType attributeType = AttributeTypeManager.getType(colName);
+ if (ArtifactPromptChange.promptChangeAttribute(attributeType, artifacts, false)) {
+ refresh();
+ editor.onDirtied();
+ }
+ } catch (OseeCoreException ex) {
+ OseeLog.log(SkynetGuiPlugin.class, OseeLevel.SEVERE_POPUP, ex);
+ }
+ }
+
+ @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) {
+ super.handleAltLeftClick(treeColumn, treeItem);
+ String colName = treeColumn.getText();
+ if (EXTRA_COLUMNS.contains(colName)) {
+ AWorkbench.popup("ERROR", "Can't change the field " + colName);
+ }
+ try {
+ IAttributeType attributeType = AttributeTypeManager.getType(colName);
+ Artifact useArt = (Artifact) treeItem.getData();
+ boolean persist = false;
+ if (ArtifactPromptChange.promptChangeAttribute(attributeType, Arrays.asList(useArt), persist)) {
+ refresh();
+ editor.onDirtied();
+ return true;
+ }
+ } catch (OseeCoreException ex) {
+ OseeLog.log(SkynetGuiPlugin.class, OseeLevel.SEVERE_POPUP, ex);
+ }
+ 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) {
+ // do nothing
+ }
+ });
+ }
+
+ 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.DEFAULT_OPEN);
+ }
+
+ 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 84010701a67..a9afaa835d6 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
@@ -8,8 +8,8 @@
* Contributors:
* Boeing - initial API and implementation
*******************************************************************************/
-package org.eclipse.osee.framework.ui.skynet.artifact.massEditor;
-
+package org.eclipse.osee.framework.ui.skynet.artifact.massEditor;
+
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
@@ -24,84 +24,84 @@ 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.swt.Displays;
-
-/**
- * Common location for event handling for mass editor in order to keep number of registrations and processing to a
- * minimum.
- *
- * @author Donald G. Dunne
- */
-public class MassXViewerEventManager implements IArtifactEventListener {
-
- List<IMassViewerEventHandler> handlers = new ArrayList<IMassViewerEventHandler>();
- static MassXViewerEventManager instance;
-
- public static void add(IMassViewerEventHandler iWorldEventHandler) {
- if (instance == null) {
- instance = new MassXViewerEventManager();
- OseeEventManager.addListener(instance);
- }
- instance.handlers.add(iWorldEventHandler);
- }
-
- public static void remove(IMassViewerEventHandler iWorldEventHandler) {
- if (instance != null) {
- instance.handlers.remove(iWorldEventHandler);
- }
- }
-
- @Override
- public void handleArtifactEvent(final ArtifactEvent artifactEvent, Sender sender) {
- for (IMassViewerEventHandler handler : new CopyOnWriteArrayList<IMassViewerEventHandler>(handlers)) {
- if (handler.isDisposed()) {
- handlers.remove(handler);
- }
- }
-
- final Collection<Artifact> modifiedArts =
- artifactEvent.getCacheArtifacts(EventModType.Modified, EventModType.Reloaded);
- final Collection<Artifact> relModifiedArts = artifactEvent.getRelCacheArtifacts();
- final Collection<EventBasicGuidArtifact> deletedPurgedArts =
- artifactEvent.get(EventModType.Deleted, EventModType.Purged);
-
- Displays.ensureInDisplayThread(new Runnable() {
- @Override
- public void run() {
- if (!deletedPurgedArts.isEmpty()) {
- for (IMassViewerEventHandler handler : handlers) {
- if (!handler.isDisposed()) {
- IContentProvider contentProvider = handler.getMassXViewer().getContentProvider();
- // remove from UI
- if (contentProvider instanceof MassContentProvider) {
- ((MassContentProvider) contentProvider).removeAll(deletedPurgedArts);
- }
- }
- }
- }
- for (IMassViewerEventHandler handler : handlers) {
- if (!handler.isDisposed()) {
- IContentProvider contentProvider = handler.getMassXViewer().getContentProvider();
- // remove from UI
- if (contentProvider instanceof MassContentProvider) {
- ((MassContentProvider) contentProvider).updateAll(modifiedArts);
- }
- }
-
- for (Artifact art : relModifiedArts) {
- // Don't refresh deleted artifacts
- if (art.isDeleted()) {
- continue;
- }
- handler.getMassXViewer().refresh(art);
- }
- }
- }
- });
- }
-
- @Override
- public List<? extends IEventFilter> getEventFilters() {
- return null;
- }
-
-}
+
+/**
+ * Common location for event handling for mass editor in order to keep number of registrations and processing to a
+ * minimum.
+ *
+ * @author Donald G. Dunne
+ */
+public class MassXViewerEventManager implements IArtifactEventListener {
+
+ List<IMassViewerEventHandler> handlers = new ArrayList<IMassViewerEventHandler>();
+ static MassXViewerEventManager instance;
+
+ public static void add(IMassViewerEventHandler iWorldEventHandler) {
+ if (instance == null) {
+ instance = new MassXViewerEventManager();
+ OseeEventManager.addListener(instance);
+ }
+ instance.handlers.add(iWorldEventHandler);
+ }
+
+ public static void remove(IMassViewerEventHandler iWorldEventHandler) {
+ if (instance != null) {
+ instance.handlers.remove(iWorldEventHandler);
+ }
+ }
+
+ @Override
+ public void handleArtifactEvent(final ArtifactEvent artifactEvent, Sender sender) {
+ for (IMassViewerEventHandler handler : new CopyOnWriteArrayList<IMassViewerEventHandler>(handlers)) {
+ if (handler.isDisposed()) {
+ handlers.remove(handler);
+ }
+ }
+
+ final Collection<Artifact> modifiedArts =
+ artifactEvent.getCacheArtifacts(EventModType.Modified, EventModType.Reloaded);
+ final Collection<Artifact> relModifiedArts = artifactEvent.getRelCacheArtifacts();
+ final Collection<EventBasicGuidArtifact> deletedPurgedArts =
+ artifactEvent.get(EventModType.Deleted, EventModType.Purged);
+
+ Displays.ensureInDisplayThread(new Runnable() {
+ @Override
+ public void run() {
+ if (!deletedPurgedArts.isEmpty()) {
+ for (IMassViewerEventHandler handler : handlers) {
+ if (!handler.isDisposed()) {
+ IContentProvider contentProvider = handler.getMassXViewer().getContentProvider();
+ // remove from UI
+ if (contentProvider instanceof MassContentProvider) {
+ ((MassContentProvider) contentProvider).removeAll(deletedPurgedArts);
+ }
+ }
+ }
+ }
+ for (IMassViewerEventHandler handler : handlers) {
+ if (!handler.isDisposed()) {
+ IContentProvider contentProvider = handler.getMassXViewer().getContentProvider();
+ // remove from UI
+ if (contentProvider instanceof MassContentProvider) {
+ ((MassContentProvider) contentProvider).updateAll(modifiedArts);
+ }
+ }
+
+ for (Artifact art : relModifiedArts) {
+ // Don't refresh deleted artifacts
+ if (art.isDeleted()) {
+ continue;
+ }
+ handler.getMassXViewer().refresh(art);
+ }
+ }
+ }
+ });
+ }
+
+ @Override
+ public List<? extends IEventFilter> getEventFilters() {
+ return null;
+ }
+
+}
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/massEditor/MassXViewerFactory.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/massEditor/MassXViewerFactory.java
index 63945be07ad..d2ef6088970 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/massEditor/MassXViewerFactory.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/massEditor/MassXViewerFactory.java
@@ -1,53 +1,53 @@
-/*******************************************************************************
- * 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.skynet.artifact.massEditor;
-
-import java.util.Collection;
-import org.eclipse.nebula.widgets.xviewer.customize.CustomizeData;
-import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
-import org.eclipse.osee.framework.ui.skynet.widgets.xviewer.skynet.SkynetXViewerFactory;
-import org.eclipse.osee.framework.ui.skynet.widgets.xviewer.skynet.column.XViewerArtifactNameColumn;
-import org.eclipse.osee.framework.ui.skynet.widgets.xviewer.skynet.column.XViewerArtifactTypeColumn;
-import org.eclipse.osee.framework.ui.skynet.widgets.xviewer.skynet.column.XViewerGuidColumn;
-import org.eclipse.osee.framework.ui.skynet.widgets.xviewer.skynet.column.XViewerHridColumn;
-import org.eclipse.osee.framework.ui.skynet.widgets.xviewer.skynet.column.XViewerLastModifiedByColumn;
-import org.eclipse.osee.framework.ui.skynet.widgets.xviewer.skynet.column.XViewerLastModifiedDateColumn;
-
-/**
- * @author Donald G. Dunne
- */
-public class MassXViewerFactory extends SkynetXViewerFactory {
-
- private static String NAMESPACE = "org.eclipse.osee.framework.ui.skynet.massEditor.ArtifactXViewer";
- private static XViewerArtifactNameColumn nameCol = new XViewerArtifactNameColumn(true);
-
- public MassXViewerFactory(Collection<? extends Artifact> artifacts) {
- super(NAMESPACE);
- registerColumns(nameCol);
- registerAllAttributeColumnsForArtifacts(artifacts, true, true);
- registerColumns(new XViewerHridColumn(true));
- registerColumns(new XViewerGuidColumn(true));
- registerColumns(new XViewerArtifactTypeColumn(true));
- registerColumns(new XViewerLastModifiedDateColumn(true));
- registerColumns(new XViewerLastModifiedByColumn(true));
- }
-
- @Override
- public CustomizeData getDefaultTableCustomizeData() {
- CustomizeData custData = new CustomizeData();
- custData.getSortingData().setSortingNames(nameCol.getId());
- custData.getColumnData().setColumns(getColumns());
- custData.setNameSpace(getNamespace());
- custData.setName("Artifacts");
- return custData;
- }
-
-}
+/*******************************************************************************
+ * 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.skynet.artifact.massEditor;
+
+import java.util.Collection;
+import org.eclipse.nebula.widgets.xviewer.customize.CustomizeData;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.ui.skynet.widgets.xviewer.skynet.SkynetXViewerFactory;
+import org.eclipse.osee.framework.ui.skynet.widgets.xviewer.skynet.column.XViewerArtifactNameColumn;
+import org.eclipse.osee.framework.ui.skynet.widgets.xviewer.skynet.column.XViewerArtifactTypeColumn;
+import org.eclipse.osee.framework.ui.skynet.widgets.xviewer.skynet.column.XViewerGuidColumn;
+import org.eclipse.osee.framework.ui.skynet.widgets.xviewer.skynet.column.XViewerHridColumn;
+import org.eclipse.osee.framework.ui.skynet.widgets.xviewer.skynet.column.XViewerLastModifiedByColumn;
+import org.eclipse.osee.framework.ui.skynet.widgets.xviewer.skynet.column.XViewerLastModifiedDateColumn;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class MassXViewerFactory extends SkynetXViewerFactory {
+
+ private static String NAMESPACE = "org.eclipse.osee.framework.ui.skynet.massEditor.ArtifactXViewer";
+ private static XViewerArtifactNameColumn nameCol = new XViewerArtifactNameColumn(true);
+
+ public MassXViewerFactory(Collection<? extends Artifact> artifacts) {
+ super(NAMESPACE);
+ registerColumns(nameCol);
+ registerAllAttributeColumnsForArtifacts(artifacts, true, true);
+ registerColumns(new XViewerHridColumn(true));
+ registerColumns(new XViewerGuidColumn(true));
+ registerColumns(new XViewerArtifactTypeColumn(true));
+ registerColumns(new XViewerLastModifiedDateColumn(true));
+ registerColumns(new XViewerLastModifiedByColumn(true));
+ }
+
+ @Override
+ public CustomizeData getDefaultTableCustomizeData() {
+ CustomizeData custData = new CustomizeData();
+ custData.getSortingData().setSortingNames(nameCol.getId());
+ custData.getColumnData().setColumns(getColumns());
+ custData.setNameSpace(getNamespace());
+ custData.setName("Artifacts");
+ return custData;
+ }
+
+}
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/ats/IOseeAtsService.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/ats/IOseeAtsService.java
index b4c98d6b8e2..511f19588d6 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/ats/IOseeAtsService.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/ats/IOseeAtsService.java
@@ -1,25 +1,25 @@
-/*******************************************************************************
- * 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.skynet.ats;
-
-import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
-
-/**
- * @author Roberto E. Escobar
- */
-public interface IOseeAtsService {
-
- boolean isAtsAdmin();
-
- void openArtifact(Artifact artifact);
-
- void openArtifact(String guid, OseeEditor view);
-}
+/*******************************************************************************
+ * 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.skynet.ats;
+
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+
+/**
+ * @author Roberto E. Escobar
+ */
+public interface IOseeAtsService {
+
+ boolean isAtsAdmin();
+
+ void openArtifact(Artifact artifact);
+
+ void openArtifact(String guid, OseeEditor view);
+}
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/ats/OseeEditor.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/ats/OseeEditor.java
index 095dda37fde..c0ede504e81 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/ats/OseeEditor.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/ats/OseeEditor.java
@@ -1,20 +1,20 @@
-/*******************************************************************************
- * 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.skynet.ats;
-
-/**
- * @author Donald G. Dunne
- */
-public enum OseeEditor {
- ActionEditor,
- ArtifactEditor,
- ArtifactHyperViewer,
+/*******************************************************************************
+ * 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.skynet.ats;
+
+/**
+ * @author Donald G. Dunne
+ */
+public enum OseeEditor {
+ ActionEditor,
+ ArtifactEditor,
+ ArtifactHyperViewer,
}; \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/AbstractBlam.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/AbstractBlam.java
index e14d1623954..3595891b7e9 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/AbstractBlam.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/AbstractBlam.java
@@ -1,133 +1,133 @@
-/*******************************************************************************
- * 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.skynet.blam;
-
-import java.io.IOException;
-import java.util.Collection;
-import java.util.List;
-import java.util.logging.Level;
-import javax.xml.parsers.ParserConfigurationException;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.core.runtime.jobs.JobChangeAdapter;
-import org.eclipse.osee.framework.core.exception.OseeCoreException;
-import org.eclipse.osee.framework.core.operation.IOperation;
-import org.eclipse.osee.framework.core.operation.Operations;
-import org.eclipse.osee.framework.database.IOseeDatabaseService;
-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.skynet.core.artifact.Artifact;
-import org.eclipse.osee.framework.ui.skynet.SkynetGuiPlugin;
-import org.eclipse.osee.framework.ui.skynet.XWidgetParser;
-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.skynet.widgets.workflow.DynamicXWidgetLayoutData;
-import org.eclipse.osee.framework.ui.skynet.widgets.workflow.IDynamicWidgetLayoutListener;
-import org.eclipse.ui.forms.widgets.FormToolkit;
-import org.xml.sax.SAXException;
-
-/**
- * @author Ryan D. Brooks
- */
-public abstract class AbstractBlam implements IDynamicWidgetLayoutListener {
- private Appendable output;
- public static final String branchXWidgetXml =
- "<xWidgets><XWidget xwidgetType=\"XBranchSelectWidget\" displayName=\"Branch\" /></xWidgets>";
- public static final String emptyXWidgetsXml = "<xWidgets/>";
- protected IOseeDatabaseService databaseService;
-
- public abstract void runOperation(VariableMap variableMap, IProgressMonitor monitor) throws Exception;
-
- /**
- * Return collection of categories that blam belongs to eg: ATS, ATS.Admin, ATS.Report. These will be used to create
- * categories that blams are put into in UI navigators. BLAM can belong in multiple categories.
- *
- * @return categories
- */
- public abstract Collection<String> getCategories();
-
- public String getXWidgetsXml() {
- return AbstractBlam.branchXWidgetXml;
- }
-
- public String getDescriptionUsage() {
- return "Select parameters below and click the play button at the top right.";
- }
-
- public String getName() {
- return getClass().getSimpleName();
- }
-
- public void setOutput(Appendable output) {
- this.output = output;
- }
-
- public void setOseeDatabaseService(IOseeDatabaseService service) {
- databaseService = service;
- }
-
- protected Appendable getOutput() {
- return output;
- }
-
- public void print(String value) {
- if (this.output != null && value != null) {
- try {
- this.output.append(value);
- } catch (IOException ex) {
- OseeLog.log(SkynetGuiPlugin.class, Level.SEVERE, ex);
- }
- }
- }
-
- public void println(String value) {
- if (Strings.isValid(value)) {
- print(value + "\n");
- }
- }
-
- public void execute(String jobName, Appendable appendable, VariableMap variableMap, JobChangeAdapter jobChangeAdapter) {
- try {
- IOperation blamOperation = new ExecuteBlamOperation(jobName, appendable, variableMap, this);
- Operations.executeAsJob(blamOperation, true, Job.LONG, jobChangeAdapter);
- } catch (Exception ex) {
- OseeLog.log(SkynetGuiPlugin.class, OseeLevel.SEVERE_POPUP, ex);
- }
- }
-
- @SuppressWarnings("unused")
- public List<DynamicXWidgetLayoutData> getLayoutDatas() throws IllegalArgumentException, ParserConfigurationException, SAXException, IOException, CoreException {
- return XWidgetParser.extractWorkAttributes(new DynamicXWidgetLayout(), getXWidgetsXml());
- }
-
- @SuppressWarnings("unused")
- @Override
- public void createXWidgetLayoutData(DynamicXWidgetLayoutData layoutData, XWidget xWidget, FormToolkit toolkit, Artifact art, XModifiedListener modListener, boolean isEditable) throws OseeCoreException {
- // provided for subclass implementation
- }
-
- @SuppressWarnings("unused")
- @Override
- public void widgetCreated(XWidget xWidget, FormToolkit toolkit, Artifact art, DynamicXWidgetLayout dynamicXWidgetLayout, XModifiedListener modListener, boolean isEditable) throws OseeCoreException {
- // provided for subclass implementation
- }
-
- @SuppressWarnings("unused")
- @Override
- public void widgetCreating(XWidget xWidget, FormToolkit toolkit, Artifact art, DynamicXWidgetLayout dynamicXWidgetLayout, XModifiedListener modListener, boolean isEditable) throws OseeCoreException {
- // provided for subclass implementation
- }
-
+/*******************************************************************************
+ * 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.skynet.blam;
+
+import java.io.IOException;
+import java.util.Collection;
+import java.util.List;
+import java.util.logging.Level;
+import javax.xml.parsers.ParserConfigurationException;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.core.runtime.jobs.JobChangeAdapter;
+import org.eclipse.osee.framework.core.exception.OseeCoreException;
+import org.eclipse.osee.framework.core.operation.IOperation;
+import org.eclipse.osee.framework.core.operation.Operations;
+import org.eclipse.osee.framework.database.IOseeDatabaseService;
+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.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.ui.skynet.SkynetGuiPlugin;
+import org.eclipse.osee.framework.ui.skynet.XWidgetParser;
+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.skynet.widgets.workflow.DynamicXWidgetLayoutData;
+import org.eclipse.osee.framework.ui.skynet.widgets.workflow.IDynamicWidgetLayoutListener;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+import org.xml.sax.SAXException;
+
+/**
+ * @author Ryan D. Brooks
+ */
+public abstract class AbstractBlam implements IDynamicWidgetLayoutListener {
+ private Appendable output;
+ public static final String branchXWidgetXml =
+ "<xWidgets><XWidget xwidgetType=\"XBranchSelectWidget\" displayName=\"Branch\" /></xWidgets>";
+ public static final String emptyXWidgetsXml = "<xWidgets/>";
+ protected IOseeDatabaseService databaseService;
+
+ public abstract void runOperation(VariableMap variableMap, IProgressMonitor monitor) throws Exception;
+
+ /**
+ * Return collection of categories that blam belongs to eg: ATS, ATS.Admin, ATS.Report. These will be used to create
+ * categories that blams are put into in UI navigators. BLAM can belong in multiple categories.
+ *
+ * @return categories
+ */
+ public abstract Collection<String> getCategories();
+
+ public String getXWidgetsXml() {
+ return AbstractBlam.branchXWidgetXml;
+ }
+
+ public String getDescriptionUsage() {
+ return "Select parameters below and click the play button at the top right.";
+ }
+
+ public String getName() {
+ return getClass().getSimpleName();
+ }
+
+ public void setOutput(Appendable output) {
+ this.output = output;
+ }
+
+ public void setOseeDatabaseService(IOseeDatabaseService service) {
+ databaseService = service;
+ }
+
+ protected Appendable getOutput() {
+ return output;
+ }
+
+ public void print(String value) {
+ if (this.output != null && value != null) {
+ try {
+ this.output.append(value);
+ } catch (IOException ex) {
+ OseeLog.log(SkynetGuiPlugin.class, Level.SEVERE, ex);
+ }
+ }
+ }
+
+ public void println(String value) {
+ if (Strings.isValid(value)) {
+ print(value + "\n");
+ }
+ }
+
+ public void execute(String jobName, Appendable appendable, VariableMap variableMap, JobChangeAdapter jobChangeAdapter) {
+ try {
+ IOperation blamOperation = new ExecuteBlamOperation(jobName, appendable, variableMap, this);
+ Operations.executeAsJob(blamOperation, true, Job.LONG, jobChangeAdapter);
+ } catch (Exception ex) {
+ OseeLog.log(SkynetGuiPlugin.class, OseeLevel.SEVERE_POPUP, ex);
+ }
+ }
+
+ @SuppressWarnings("unused")
+ public List<DynamicXWidgetLayoutData> getLayoutDatas() throws IllegalArgumentException, ParserConfigurationException, SAXException, IOException, CoreException {
+ return XWidgetParser.extractWorkAttributes(new DynamicXWidgetLayout(), getXWidgetsXml());
+ }
+
+ @SuppressWarnings("unused")
+ @Override
+ public void createXWidgetLayoutData(DynamicXWidgetLayoutData layoutData, XWidget xWidget, FormToolkit toolkit, Artifact art, XModifiedListener modListener, boolean isEditable) throws OseeCoreException {
+ // provided for subclass implementation
+ }
+
+ @SuppressWarnings("unused")
+ @Override
+ public void widgetCreated(XWidget xWidget, FormToolkit toolkit, Artifact art, DynamicXWidgetLayout dynamicXWidgetLayout, XModifiedListener modListener, boolean isEditable) throws OseeCoreException {
+ // provided for subclass implementation
+ }
+
+ @SuppressWarnings("unused")
+ @Override
+ public void widgetCreating(XWidget xWidget, FormToolkit toolkit, Artifact art, DynamicXWidgetLayout dynamicXWidgetLayout, XModifiedListener modListener, boolean isEditable) throws OseeCoreException {
+ // provided for subclass implementation
+ }
+
} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/BlamContributionManager.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/BlamContributionManager.java
index 9d50e48ee1b..d6f48ae2fba 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/BlamContributionManager.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/BlamContributionManager.java
@@ -1,110 +1,110 @@
-/*******************************************************************************
- * 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.skynet.blam;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import org.eclipse.osee.framework.access.AccessControlManager;
-import org.eclipse.osee.framework.core.exception.OseeCoreException;
-import org.eclipse.osee.framework.plugin.core.util.ExtensionDefinedObjects;
-import org.eclipse.osee.framework.ui.plugin.PluginUiImage;
-import org.eclipse.osee.framework.ui.plugin.xnavigate.XNavigateItem;
-import org.eclipse.osee.framework.ui.skynet.FrameworkImage;
-import org.eclipse.osee.framework.ui.skynet.widgets.xnavigate.XNavigateItemBlam;
-
-/**
- * @author Donald G. Dunne
- */
-public class BlamContributionManager {
-
- public static Collection<AbstractBlam> getBlamOperationsNameSort() {
- ArrayList<AbstractBlam> blamsSortedByName = new ArrayList<AbstractBlam>();
- Map<String, AbstractBlam> blamMap = new HashMap<String, AbstractBlam>();
- for (AbstractBlam blam : getBlamOperations()) {
- blamMap.put(blam.getName(), blam);
- }
- String names[] = blamMap.keySet().toArray(new String[blamMap.keySet().size()]);
- Arrays.sort(names);
- for (String name : names) {
- blamsSortedByName.add(blamMap.get(name));
- }
- return blamsSortedByName;
- }
-
- public static Collection<AbstractBlam> getBlamOperations() {
- ExtensionDefinedObjects<AbstractBlam> definedObjects =
- new ExtensionDefinedObjects<AbstractBlam>("org.eclipse.osee.framework.ui.skynet.BlamOperation", "Operation",
- "className");
- return definedObjects.getObjects();
- }
-
- public static void addBlamOperationsToNavigator(List<XNavigateItem> items) throws OseeCoreException {
- Map<String, XNavigateItem> nameToParent = new HashMap<String, XNavigateItem>();
- XNavigateItem blamOperationItems = new XNavigateItem(null, "Blam Operations", FrameworkImage.BLAM);
- for (AbstractBlam blamOperation : BlamContributionManager.getBlamOperationsNameSort()) {
-
- // Create categories first (so can have them up top)
- for (String category : blamOperation.getCategories()) {
- if (AccessControlManager.isOseeAdmin() || !category.contains("Admin") || category.contains("Admin") && AccessControlManager.isOseeAdmin()) {
- createCategories(category.split("\\."), 0, blamOperationItems, nameToParent);
- }
- }
- }
- // Add blams to categories
- for (AbstractBlam blamOperation : BlamContributionManager.getBlamOperationsNameSort()) {
- // If categories not specified, add to top level
- if (blamOperation.getCategories().isEmpty()) {
- new XNavigateItemBlam(blamOperationItems, blamOperation);
- }
- for (String category : blamOperation.getCategories()) {
- // Category will be null if admin category and not admin
- if (nameToParent.get(category) != null) {
- new XNavigateItemBlam(nameToParent.get(category), blamOperation);
- }
- }
- }
- items.add(blamOperationItems);
- }
-
- private static void createCategories(String[] categoryElements, int index, XNavigateItem parentItem, Map<String, XNavigateItem> nameToParent) throws OseeCoreException {
- String firstElement = categoryElements[index];
- XNavigateItem thisCategoryItem = null;
- for (XNavigateItem childItem : parentItem.getChildren()) {
- if (childItem.getName().equals(firstElement)) {
- thisCategoryItem = childItem;
- break;
- }
- }
- // Create new folder category
- if (thisCategoryItem == null) {
- // Add to parentItem
- thisCategoryItem = new XNavigateItem(parentItem, firstElement, PluginUiImage.FOLDER);
- String catName = "";
- for (int x = 0; x <= index; x++) {
- if (!catName.equals("")) {
- catName += ".";
- }
- catName += categoryElements[x];
- }
- // Add to lookup map
- nameToParent.put(catName, thisCategoryItem);
- }
- // Process children categories
- if (categoryElements.length > index + 1) {
- createCategories(categoryElements, index + 1, thisCategoryItem, nameToParent);
- }
- }
-}
+/*******************************************************************************
+ * 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.skynet.blam;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import org.eclipse.osee.framework.access.AccessControlManager;
+import org.eclipse.osee.framework.core.exception.OseeCoreException;
+import org.eclipse.osee.framework.plugin.core.util.ExtensionDefinedObjects;
+import org.eclipse.osee.framework.ui.plugin.PluginUiImage;
+import org.eclipse.osee.framework.ui.plugin.xnavigate.XNavigateItem;
+import org.eclipse.osee.framework.ui.skynet.FrameworkImage;
+import org.eclipse.osee.framework.ui.skynet.widgets.xnavigate.XNavigateItemBlam;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class BlamContributionManager {
+
+ public static Collection<AbstractBlam> getBlamOperationsNameSort() {
+ ArrayList<AbstractBlam> blamsSortedByName = new ArrayList<AbstractBlam>();
+ Map<String, AbstractBlam> blamMap = new HashMap<String, AbstractBlam>();
+ for (AbstractBlam blam : getBlamOperations()) {
+ blamMap.put(blam.getName(), blam);
+ }
+ String names[] = blamMap.keySet().toArray(new String[blamMap.keySet().size()]);
+ Arrays.sort(names);
+ for (String name : names) {
+ blamsSortedByName.add(blamMap.get(name));
+ }
+ return blamsSortedByName;
+ }
+
+ public static Collection<AbstractBlam> getBlamOperations() {
+ ExtensionDefinedObjects<AbstractBlam> definedObjects =
+ new ExtensionDefinedObjects<AbstractBlam>("org.eclipse.osee.framework.ui.skynet.BlamOperation", "Operation",
+ "className");
+ return definedObjects.getObjects();
+ }
+
+ public static void addBlamOperationsToNavigator(List<XNavigateItem> items) throws OseeCoreException {
+ Map<String, XNavigateItem> nameToParent = new HashMap<String, XNavigateItem>();
+ XNavigateItem blamOperationItems = new XNavigateItem(null, "Blam Operations", FrameworkImage.BLAM);
+ for (AbstractBlam blamOperation : BlamContributionManager.getBlamOperationsNameSort()) {
+
+ // Create categories first (so can have them up top)
+ for (String category : blamOperation.getCategories()) {
+ if (AccessControlManager.isOseeAdmin() || !category.contains("Admin") || category.contains("Admin") && AccessControlManager.isOseeAdmin()) {
+ createCategories(category.split("\\."), 0, blamOperationItems, nameToParent);
+ }
+ }
+ }
+ // Add blams to categories
+ for (AbstractBlam blamOperation : BlamContributionManager.getBlamOperationsNameSort()) {
+ // If categories not specified, add to top level
+ if (blamOperation.getCategories().isEmpty()) {
+ new XNavigateItemBlam(blamOperationItems, blamOperation);
+ }
+ for (String category : blamOperation.getCategories()) {
+ // Category will be null if admin category and not admin
+ if (nameToParent.get(category) != null) {
+ new XNavigateItemBlam(nameToParent.get(category), blamOperation);
+ }
+ }
+ }
+ items.add(blamOperationItems);
+ }
+
+ private static void createCategories(String[] categoryElements, int index, XNavigateItem parentItem, Map<String, XNavigateItem> nameToParent) throws OseeCoreException {
+ String firstElement = categoryElements[index];
+ XNavigateItem thisCategoryItem = null;
+ for (XNavigateItem childItem : parentItem.getChildren()) {
+ if (childItem.getName().equals(firstElement)) {
+ thisCategoryItem = childItem;
+ break;
+ }
+ }
+ // Create new folder category
+ if (thisCategoryItem == null) {
+ // Add to parentItem
+ thisCategoryItem = new XNavigateItem(parentItem, firstElement, PluginUiImage.FOLDER);
+ String catName = "";
+ for (int x = 0; x <= index; x++) {
+ if (!catName.equals("")) {
+ catName += ".";
+ }
+ catName += categoryElements[x];
+ }
+ // Add to lookup map
+ nameToParent.put(catName, thisCategoryItem);
+ }
+ // Process children categories
+ if (categoryElements.length > index + 1) {
+ createCategories(categoryElements, index + 1, thisCategoryItem, nameToParent);
+ }
+ }
+}
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/BlamEditorActionBarContributor.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/BlamEditorActionBarContributor.java
index 64679802bb7..a7f059c96cf 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/BlamEditorActionBarContributor.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/BlamEditorActionBarContributor.java
@@ -1,79 +1,79 @@
-/*******************************************************************************
- * 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.skynet.blam;
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.action.IToolBarManager;
-import org.eclipse.osee.framework.logging.OseeLevel;
-import org.eclipse.osee.framework.logging.OseeLog;
-import org.eclipse.osee.framework.ui.plugin.OseeUiActions;
-import org.eclipse.osee.framework.ui.skynet.FrameworkImage;
-import org.eclipse.osee.framework.ui.skynet.SkynetGuiPlugin;
-import org.eclipse.osee.framework.ui.skynet.artifact.editor.IActionContributor;
-import org.eclipse.osee.framework.ui.swt.ImageManager;
-import org.eclipse.ui.IEditorSite;
-
-/**
- * @author Roberto E. Escobar
- */
-public class BlamEditorActionBarContributor implements IActionContributor {
-
- private final BlamEditor editor;
- private Action executeBlamAction;
- private Action bugAction;
-
- public BlamEditorActionBarContributor(BlamEditor editor) {
- this.editor = editor;
- }
-
- @Override
- public void contributeToToolBar(IToolBarManager manager) {
- manager.add(getExecuteBlamAction());
- manager.add(getAtsBugAction());
- }
-
- // OseeAts.addButtonToEditorToolBar(editor, this, SkynetGuiPlugin.getInstance(), form.getToolBarManager(),
- // BlamEditor.EDITOR_ID, "BLAM Editor");
- public final Action getAtsBugAction() {
- if (bugAction == null) {
- IEditorSite site = editor.getEditorSite();
- bugAction =
- OseeUiActions.createBugAction(SkynetGuiPlugin.getInstance(), editor, site.getId(), site.getRegisteredName());
- }
- return bugAction;
- }
-
- public final Action getExecuteBlamAction() {
- if (executeBlamAction == null) {
- executeBlamAction = new ExecuteBlamAction();
- }
- return executeBlamAction;
- }
-
- private final class ExecuteBlamAction extends Action {
- public ExecuteBlamAction() {
- super("Run BLAM in Job", IAction.AS_PUSH_BUTTON);
- setImageDescriptor(ImageManager.getImageDescriptor(FrameworkImage.RUN_EXC));
- setToolTipText("Executes the BLAM Operation");
- }
-
- @Override
- public void run() {
- try {
- editor.executeBlam();
- } catch (Exception ex) {
- OseeLog.log(getClass(), OseeLevel.SEVERE_POPUP, ex);
- }
- }
- }
-}
+/*******************************************************************************
+ * 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.skynet.blam;
+
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.action.IToolBarManager;
+import org.eclipse.osee.framework.logging.OseeLevel;
+import org.eclipse.osee.framework.logging.OseeLog;
+import org.eclipse.osee.framework.ui.plugin.OseeUiActions;
+import org.eclipse.osee.framework.ui.skynet.FrameworkImage;
+import org.eclipse.osee.framework.ui.skynet.SkynetGuiPlugin;
+import org.eclipse.osee.framework.ui.skynet.artifact.editor.IActionContributor;
+import org.eclipse.osee.framework.ui.swt.ImageManager;
+import org.eclipse.ui.IEditorSite;
+
+/**
+ * @author Roberto E. Escobar
+ */
+public class BlamEditorActionBarContributor implements IActionContributor {
+
+ private final BlamEditor editor;
+ private Action executeBlamAction;
+ private Action bugAction;
+
+ public BlamEditorActionBarContributor(BlamEditor editor) {
+ this.editor = editor;
+ }
+
+ @Override
+ public void contributeToToolBar(IToolBarManager manager) {
+ manager.add(getExecuteBlamAction());
+ manager.add(getAtsBugAction());
+ }
+
+ // OseeAts.addButtonToEditorToolBar(editor, this, SkynetGuiPlugin.getInstance(), form.getToolBarManager(),
+ // BlamEditor.EDITOR_ID, "BLAM Editor");
+ public final Action getAtsBugAction() {
+ if (bugAction == null) {
+ IEditorSite site = editor.getEditorSite();
+ bugAction =
+ OseeUiActions.createBugAction(SkynetGuiPlugin.getInstance(), editor, site.getId(), site.getRegisteredName());
+ }
+ return bugAction;
+ }
+
+ public final Action getExecuteBlamAction() {
+ if (executeBlamAction == null) {
+ executeBlamAction = new ExecuteBlamAction();
+ }
+ return executeBlamAction;
+ }
+
+ private final class ExecuteBlamAction extends Action {
+ public ExecuteBlamAction() {
+ super("Run BLAM in Job", IAction.AS_PUSH_BUTTON);
+ setImageDescriptor(ImageManager.getImageDescriptor(FrameworkImage.RUN_EXC));
+ setToolTipText("Executes the BLAM Operation");
+ }
+
+ @Override
+ public void run() {
+ try {
+ editor.executeBlam();
+ } catch (Exception ex) {
+ OseeLog.log(getClass(), OseeLevel.SEVERE_POPUP, ex);
+ }
+ }
+ }
+}
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/BlamParameter.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/BlamParameter.java
index d0564356bef..d3084679287 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/BlamParameter.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/BlamParameter.java
@@ -21,11 +21,6 @@ public class BlamParameter {
@SuppressWarnings("unused")
private final String binding;
- /**
- * @param name
- * @param clazz
- * @param binding
- */
public BlamParameter(String name, Class<?> clazz, String binding) {
super();
this.name = name;
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/operation/ChangeArtifactTypeBlam.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/operation/ChangeArtifactTypeBlam.java
index 8d0ca5aa884..89dab01a6c4 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/operation/ChangeArtifactTypeBlam.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/operation/ChangeArtifactTypeBlam.java
@@ -1,52 +1,52 @@
-/*******************************************************************************
- * 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.skynet.blam.operation;
-
-import java.util.Arrays;
-import java.util.Collection;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.osee.framework.skynet.core.artifact.ChangeArtifactType;
-import org.eclipse.osee.framework.ui.skynet.blam.AbstractBlam;
-import org.eclipse.osee.framework.ui.skynet.blam.VariableMap;
-
-/**
- * Changes the descriptor type of an artifact to the provided descriptor.
- *
- * @author Jeff C. Phillips
- */
-public class ChangeArtifactTypeBlam extends AbstractBlam {
-
- @Override
- public String getName() {
- return "Change Artifact Type";
- }
-
- @Override
- public void runOperation(VariableMap variableMap, IProgressMonitor monitor) throws Exception {
- ChangeArtifactType.changeArtifactType(variableMap.getArtifacts("artifacts"),
- variableMap.getArtifactType("New Artifact Type"));
- }
-
- @Override
- public String getXWidgetsXml() {
- return "<xWidgets><XWidget xwidgetType=\"XListDropViewer\" displayName=\"artifacts\" />" +
- //
- "<XWidget xwidgetType=\"XArtifactTypeListViewer\" displayName=\"New Artifact Type\" /></xWidgets>";
- }
-
- @Override
- public Collection<String> getCategories() {
+/*******************************************************************************
+ * 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.skynet.blam.operation;
+
+import java.util.Arrays;
+import java.util.Collection;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.osee.framework.skynet.core.artifact.ChangeArtifactType;
+import org.eclipse.osee.framework.ui.skynet.blam.AbstractBlam;
+import org.eclipse.osee.framework.ui.skynet.blam.VariableMap;
+
+/**
+ * Changes the descriptor type of an artifact to the provided descriptor.
+ *
+ * @author Jeff C. Phillips
+ */
+public class ChangeArtifactTypeBlam extends AbstractBlam {
+
+ @Override
+ public String getName() {
+ return "Change Artifact Type";
+ }
+
+ @Override
+ public void runOperation(VariableMap variableMap, IProgressMonitor monitor) throws Exception {
+ ChangeArtifactType.changeArtifactType(variableMap.getArtifacts("artifacts"),
+ variableMap.getArtifactType("New Artifact Type"));
+ }
+
+ @Override
+ public String getXWidgetsXml() {
+ return "<xWidgets><XWidget xwidgetType=\"XListDropViewer\" displayName=\"artifacts\" />" +
+ //
+ "<XWidget xwidgetType=\"XArtifactTypeListViewer\" displayName=\"New Artifact Type\" /></xWidgets>";
+ }
+
+ @Override
+ public Collection<String> getCategories() {
return Arrays.asList("Admin");
- }
-
+ }
+
@Override
public String getDescriptionUsage() {
return "Log what the previous type of each artifact was because that information is loss after running this blam";
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/operation/CheckDefaulHierarchy.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/operation/CheckDefaulHierarchy.java
index 40b905289ed..9fc2f8dd419 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/operation/CheckDefaulHierarchy.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/operation/CheckDefaulHierarchy.java
@@ -1,63 +1,63 @@
-/*******************************************************************************
- * 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.skynet.blam.operation;
-
-import static org.eclipse.osee.framework.skynet.core.artifact.DeletionFlag.EXCLUDE_DELETED;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.List;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.osee.framework.core.exception.MultipleArtifactsExist;
-import org.eclipse.osee.framework.core.model.Branch;
-import org.eclipse.osee.framework.core.model.type.ArtifactType;
-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.skynet.blam.AbstractBlam;
-import org.eclipse.osee.framework.ui.skynet.blam.VariableMap;
-
-/**
- * @author Ryan D. Brooks
- */
-public class CheckDefaulHierarchy extends AbstractBlam {
- @Override
- public String getName() {
- return "Check Default Hierarchy";
- }
-
- @Override
- public void runOperation(VariableMap variableMap, IProgressMonitor monitor) throws Exception {
- Branch branch = variableMap.getBranch("Branch");
- ArtifactType artifactType = variableMap.getArtifactType("Artifact Type");
- List<Artifact> artifacts = ArtifactQuery.getArtifactListFromType(artifactType, branch, EXCLUDE_DELETED);
- for (Artifact artifact : artifacts) {
- try {
- if (!artifact.hasParent()) {
- print("\n" + artifact.getGuid() + " has no parent\n");
- }
- } catch (MultipleArtifactsExist ex) {
- print("\n" + ex.getLocalizedMessage() + "\n");
- }
- }
- }
-
- @Override
- public String getXWidgetsXml() {
- return "<xWidgets><XWidget xwidgetType=\"XBranchSelectWidget\" displayName=\"Branch\" />" +
- //
- "<XWidget xwidgetType=\"XArtifactTypeListViewer\" displayName=\"Artifact Type\" /></xWidgets>";
- }
-
- @Override
- public Collection<String> getCategories() {
- return Arrays.asList("Admin.Health");
- }
-}
+/*******************************************************************************
+ * 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.skynet.blam.operation;
+
+import static org.eclipse.osee.framework.skynet.core.artifact.DeletionFlag.EXCLUDE_DELETED;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.List;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.osee.framework.core.exception.MultipleArtifactsExist;
+import org.eclipse.osee.framework.core.model.Branch;
+import org.eclipse.osee.framework.core.model.type.ArtifactType;
+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.skynet.blam.AbstractBlam;
+import org.eclipse.osee.framework.ui.skynet.blam.VariableMap;
+
+/**
+ * @author Ryan D. Brooks
+ */
+public class CheckDefaulHierarchy extends AbstractBlam {
+ @Override
+ public String getName() {
+ return "Check Default Hierarchy";
+ }
+
+ @Override
+ public void runOperation(VariableMap variableMap, IProgressMonitor monitor) throws Exception {
+ Branch branch = variableMap.getBranch("Branch");
+ ArtifactType artifactType = variableMap.getArtifactType("Artifact Type");
+ List<Artifact> artifacts = ArtifactQuery.getArtifactListFromType(artifactType, branch, EXCLUDE_DELETED);
+ for (Artifact artifact : artifacts) {
+ try {
+ if (!artifact.hasParent()) {
+ print("\n" + artifact.getGuid() + " has no parent\n");
+ }
+ } catch (MultipleArtifactsExist ex) {
+ print("\n" + ex.getLocalizedMessage() + "\n");
+ }
+ }
+ }
+
+ @Override
+ public String getXWidgetsXml() {
+ return "<xWidgets><XWidget xwidgetType=\"XBranchSelectWidget\" displayName=\"Branch\" />" +
+ //
+ "<XWidget xwidgetType=\"XArtifactTypeListViewer\" displayName=\"Artifact Type\" /></xWidgets>";
+ }
+
+ @Override
+ public Collection<String> getCategories() {
+ return Arrays.asList("Admin.Health");
+ }
+}
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/operation/ConsolidateRelations.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/operation/ConsolidateRelations.java
index 567c7647cf7..b83c1abc92e 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/operation/ConsolidateRelations.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/operation/ConsolidateRelations.java
@@ -1,52 +1,52 @@
-/*******************************************************************************
- * Copyright (c) 2009 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.skynet.blam.operation;
-
-import java.util.Arrays;
-import java.util.Collection;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.osee.framework.core.operation.IOperation;
-import org.eclipse.osee.framework.core.operation.Operations;
-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;
-
-/**
- * @author Ryan D. Brooks
- */
-public class ConsolidateRelations extends AbstractBlam {
-
- @Override
- public String getName() {
- return "Consolidate Relations";
- }
-
- @Override
- public void runOperation(VariableMap variableMap, IProgressMonitor monitor) throws Exception {
- IOperation operation = new ConsolidateRelationsTxOperation(SkynetGuiPlugin.getInstance());
+/*******************************************************************************
+ * Copyright (c) 2009 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.skynet.blam.operation;
+
+import java.util.Arrays;
+import java.util.Collection;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.osee.framework.core.operation.IOperation;
+import org.eclipse.osee.framework.core.operation.Operations;
+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;
+
+/**
+ * @author Ryan D. Brooks
+ */
+public class ConsolidateRelations extends AbstractBlam {
+
+ @Override
+ public String getName() {
+ return "Consolidate Relations";
+ }
+
+ @Override
+ public void runOperation(VariableMap variableMap, IProgressMonitor monitor) throws Exception {
+ IOperation operation = new ConsolidateRelationsTxOperation(SkynetGuiPlugin.getInstance());
Operations.executeWorkAndCheckStatus(operation, monitor);
- }
-
- @Override
- public String getDescriptionUsage() {
- return "Consolidate Relations to use a single relation version where possible.";
- }
-
- @Override
- public Collection<String> getCategories() {
- return Arrays.asList("Admin");
- }
-
- @Override
- public String getXWidgetsXml() {
- return AbstractBlam.emptyXWidgetsXml;
- }
+ }
+
+ @Override
+ public String getDescriptionUsage() {
+ return "Consolidate Relations to use a single relation version where possible.";
+ }
+
+ @Override
+ public Collection<String> getCategories() {
+ return Arrays.asList("Admin");
+ }
+
+ @Override
+ public String getXWidgetsXml() {
+ return AbstractBlam.emptyXWidgetsXml;
+ }
} \ 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/ConsolidateRelationsTxOperation.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/operation/ConsolidateRelationsTxOperation.java
index 86f647d8bfe..f3dee653574 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/operation/ConsolidateRelationsTxOperation.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/operation/ConsolidateRelationsTxOperation.java
@@ -175,8 +175,12 @@ public class ConsolidateRelationsTxOperation extends AbstractDbTxOperation {
if (isNextAddressing(netGammaId, transactionId)) {
if (updateAddressing) {
- updateAddressingData.add(new Object[] {previousNetGammaId, netModType.getValue(),
- netTxCurrent.getValue(), previousTransactionId, previousObsoleteGammaId});
+ updateAddressingData.add(new Object[] {
+ previousNetGammaId,
+ netModType.getValue(),
+ netTxCurrent.getValue(),
+ previousTransactionId,
+ previousObsoleteGammaId});
}
updateAddressing = obsoleteGammaId != netGammaId;
previousNetGammaId = netGammaId;
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/operation/DatabaseHealth.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/operation/DatabaseHealth.java
index 63d9128d5de..8c718b739e1 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/operation/DatabaseHealth.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/operation/DatabaseHealth.java
@@ -1,161 +1,161 @@
-/*******************************************************************************
- * 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.skynet.blam.operation;
-
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.Set;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.osee.framework.access.AccessControlManager;
-import org.eclipse.osee.framework.core.exception.OseeAccessDeniedException;
-import org.eclipse.osee.framework.core.operation.AbstractOperation;
-import org.eclipse.osee.framework.core.operation.Operations;
-import org.eclipse.osee.framework.jdk.core.util.AXml;
-import org.eclipse.osee.framework.jdk.core.util.Strings;
-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.dbHealth.DatabaseHealthOperation;
-import org.eclipse.osee.framework.ui.skynet.dbHealth.DatabaseHealthOpsExtensionManager;
-import org.eclipse.osee.framework.ui.skynet.results.ResultsEditor;
-import org.eclipse.osee.framework.ui.skynet.results.XResultData;
-import org.eclipse.osee.framework.ui.skynet.results.html.XResultPage.Manipulations;
-
-/**
- * @author Jeff C. Phillips
- */
-public class DatabaseHealth extends AbstractBlam {
- private static final String CLEAN_ALL_PROMPT = "Run all the Cleanup Operations";
- private static final String SHOW_ALL_PROMPT = "Run all the Verification Operations";;
-
- @Override
- public String getName() {
- return "Database Health";
- }
-
- @Override
- public String getDescriptionUsage() {
- return "Runs Database Health Checks/Fixes. Cursor over label to see descriptions.";
- }
-
- @Override
- public void runOperation(VariableMap variableMap, IProgressMonitor monitor) throws Exception {
- boolean fixAll = variableMap.getBoolean(CLEAN_ALL_PROMPT);
- boolean verifyAll = variableMap.getBoolean(SHOW_ALL_PROMPT);
-
- MasterDbHealthOperation dbHealthOperation = new MasterDbHealthOperation(getName());
-
- for (String taskName : DatabaseHealthOpsExtensionManager.getFixOperationNames()) {
- if (fixAll || variableMap.getBoolean(taskName)) {
- dbHealthOperation.addOperation(DatabaseHealthOpsExtensionManager.getFixOperationByName(taskName), true);
- }
- }
- for (String taskName : DatabaseHealthOpsExtensionManager.getVerifyOperationNames()) {
- if (verifyAll || variableMap.getBoolean(taskName)) {
- dbHealthOperation.addOperation(DatabaseHealthOpsExtensionManager.getVerifyOperationByName(taskName), false);
- }
- }
- Operations.executeWorkAndCheckStatus(dbHealthOperation, monitor);
- }
-
- @Override
- public String getXWidgetsXml() {
- StringBuilder builder = new StringBuilder();
- builder.append("<xWidgets>");
- builder.append("<XWidget xwidgetType=\"XCheckBox\" displayName=\"" + CLEAN_ALL_PROMPT + "\" labelAfter=\"true\" horizontalLabel=\"true\"/>");
- builder.append("<XWidget xwidgetType=\"XCheckBox\" displayName=\"" + SHOW_ALL_PROMPT + "\" labelAfter=\"true\" horizontalLabel=\"true\"/>");
-
- builder.append("<XWidget xwidgetType=\"XLabel\" displayName=\" \"/>");
- builder.append("<XWidget xwidgetType=\"XLabel\" displayName=\"Select Verification Operations to Run:\"/>");
- for (DatabaseHealthOperation healthOp : DatabaseHealthOpsExtensionManager.getVerifyOperations()) {
- builder.append(getOperationsCheckBoxes(healthOp, false));
- }
-
- builder.append("<XWidget xwidgetType=\"XLabel\" displayName=\" \"/>");
- builder.append("<XWidget xwidgetType=\"XLabel\" displayName=\"Select Clean Up Operations to Run:\"/>");
- for (DatabaseHealthOperation fixOp : DatabaseHealthOpsExtensionManager.getFixOperations()) {
- builder.append(getOperationsCheckBoxes(fixOp, true));
- }
-
- builder.append("</xWidgets>");
- return builder.toString();
- }
-
- private String getOperationsCheckBoxes(DatabaseHealthOperation fixOp, boolean fix) {
- StringBuilder builder = new StringBuilder();
- builder.append("<XWidget xwidgetType=\"XCheckBox\" displayName=\"");
- builder.append(fix ? fixOp.getFixTaskName() : fixOp.getVerifyTaskName());
- String toolTip = AXml.textToXml((fix ? fixOp.getFixDescription() : fixOp.getCheckDescription()));
- builder.append("\" labelAfter=\"true\" horizontalLabel=\"true\" toolTip=\"" + toolTip + "\"/>");
- return builder.toString();
- }
-
- @Override
- public Collection<String> getCategories() {
- return Arrays.asList("Admin.Health");
- }
-
- private final class MasterDbHealthOperation extends AbstractOperation {
-
- private final Set<DatabaseHealthOperation> fixOperations = new HashSet<DatabaseHealthOperation>();
- private final Set<DatabaseHealthOperation> verifyOperations = new HashSet<DatabaseHealthOperation>();
-
- public MasterDbHealthOperation(String operationName) {
- super(operationName, SkynetGuiPlugin.PLUGIN_ID);
- }
-
- public void addOperation(DatabaseHealthOperation operation, boolean isFixOperation) {
- if (operation != null) {
- if (isFixOperation) {
- fixOperations.add(operation);
- } else {
- verifyOperations.add(operation);
- }
- }
- }
-
- private void executeOperation(IProgressMonitor monitor, DatabaseHealthOperation operation, double workPercentage, boolean isFix) throws Exception {
- checkForCancelledStatus(monitor);
- if (operation != null) {
- operation.setFixOperationEnabled(isFix);
- println(String.format("\nProcessing: [%s]", operation.getName()));
- doSubWork(operation, monitor, workPercentage);
-
- String detailedReport = operation.getDetailedReport().toString();
- if (Strings.isValid(detailedReport)) {
- XResultData result = new XResultData();
- result.addRaw(detailedReport.toString());
- result.report(operation.getName(), Manipulations.RAW_HTML);
- } else {
- ResultsEditor.open(operation.getResultsProvider());
- }
- println(String.format("Completed: [%s]", operation.getName()));
- }
- }
-
- @Override
- protected void doWork(IProgressMonitor monitor) throws Exception {
- int totalTasks = fixOperations.size() + verifyOperations.size();
- double workPercentage = 1.0 / totalTasks;
- if (!AccessControlManager.isOseeAdmin()) {
- throw new OseeAccessDeniedException("Must be a Developer to run this BLAM");
- } else {
- for (DatabaseHealthOperation operation : fixOperations) {
- executeOperation(monitor, operation, workPercentage, true);
- }
- for (DatabaseHealthOperation operation : verifyOperations) {
- executeOperation(monitor, operation, workPercentage, false);
- }
- }
- }
- }
+/*******************************************************************************
+ * 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.skynet.blam.operation;
+
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.Set;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.osee.framework.access.AccessControlManager;
+import org.eclipse.osee.framework.core.exception.OseeAccessDeniedException;
+import org.eclipse.osee.framework.core.operation.AbstractOperation;
+import org.eclipse.osee.framework.core.operation.Operations;
+import org.eclipse.osee.framework.jdk.core.util.AXml;
+import org.eclipse.osee.framework.jdk.core.util.Strings;
+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.dbHealth.DatabaseHealthOperation;
+import org.eclipse.osee.framework.ui.skynet.dbHealth.DatabaseHealthOpsExtensionManager;
+import org.eclipse.osee.framework.ui.skynet.results.ResultsEditor;
+import org.eclipse.osee.framework.ui.skynet.results.XResultData;
+import org.eclipse.osee.framework.ui.skynet.results.html.XResultPage.Manipulations;
+
+/**
+ * @author Jeff C. Phillips
+ */
+public class DatabaseHealth extends AbstractBlam {
+ private static final String CLEAN_ALL_PROMPT = "Run all the Cleanup Operations";
+ private static final String SHOW_ALL_PROMPT = "Run all the Verification Operations";;
+
+ @Override
+ public String getName() {
+ return "Database Health";
+ }
+
+ @Override
+ public String getDescriptionUsage() {
+ return "Runs Database Health Checks/Fixes. Cursor over label to see descriptions.";
+ }
+
+ @Override
+ public void runOperation(VariableMap variableMap, IProgressMonitor monitor) throws Exception {
+ boolean fixAll = variableMap.getBoolean(CLEAN_ALL_PROMPT);
+ boolean verifyAll = variableMap.getBoolean(SHOW_ALL_PROMPT);
+
+ MasterDbHealthOperation dbHealthOperation = new MasterDbHealthOperation(getName());
+
+ for (String taskName : DatabaseHealthOpsExtensionManager.getFixOperationNames()) {
+ if (fixAll || variableMap.getBoolean(taskName)) {
+ dbHealthOperation.addOperation(DatabaseHealthOpsExtensionManager.getFixOperationByName(taskName), true);
+ }
+ }
+ for (String taskName : DatabaseHealthOpsExtensionManager.getVerifyOperationNames()) {
+ if (verifyAll || variableMap.getBoolean(taskName)) {
+ dbHealthOperation.addOperation(DatabaseHealthOpsExtensionManager.getVerifyOperationByName(taskName), false);
+ }
+ }
+ Operations.executeWorkAndCheckStatus(dbHealthOperation, monitor);
+ }
+
+ @Override
+ public String getXWidgetsXml() {
+ StringBuilder builder = new StringBuilder();
+ builder.append("<xWidgets>");
+ builder.append("<XWidget xwidgetType=\"XCheckBox\" displayName=\"" + CLEAN_ALL_PROMPT + "\" labelAfter=\"true\" horizontalLabel=\"true\"/>");
+ builder.append("<XWidget xwidgetType=\"XCheckBox\" displayName=\"" + SHOW_ALL_PROMPT + "\" labelAfter=\"true\" horizontalLabel=\"true\"/>");
+
+ builder.append("<XWidget xwidgetType=\"XLabel\" displayName=\" \"/>");
+ builder.append("<XWidget xwidgetType=\"XLabel\" displayName=\"Select Verification Operations to Run:\"/>");
+ for (DatabaseHealthOperation healthOp : DatabaseHealthOpsExtensionManager.getVerifyOperations()) {
+ builder.append(getOperationsCheckBoxes(healthOp, false));
+ }
+
+ builder.append("<XWidget xwidgetType=\"XLabel\" displayName=\" \"/>");
+ builder.append("<XWidget xwidgetType=\"XLabel\" displayName=\"Select Clean Up Operations to Run:\"/>");
+ for (DatabaseHealthOperation fixOp : DatabaseHealthOpsExtensionManager.getFixOperations()) {
+ builder.append(getOperationsCheckBoxes(fixOp, true));
+ }
+
+ builder.append("</xWidgets>");
+ return builder.toString();
+ }
+
+ private String getOperationsCheckBoxes(DatabaseHealthOperation fixOp, boolean fix) {
+ StringBuilder builder = new StringBuilder();
+ builder.append("<XWidget xwidgetType=\"XCheckBox\" displayName=\"");
+ builder.append(fix ? fixOp.getFixTaskName() : fixOp.getVerifyTaskName());
+ String toolTip = AXml.textToXml((fix ? fixOp.getFixDescription() : fixOp.getCheckDescription()));
+ builder.append("\" labelAfter=\"true\" horizontalLabel=\"true\" toolTip=\"" + toolTip + "\"/>");
+ return builder.toString();
+ }
+
+ @Override
+ public Collection<String> getCategories() {
+ return Arrays.asList("Admin.Health");
+ }
+
+ private final class MasterDbHealthOperation extends AbstractOperation {
+
+ private final Set<DatabaseHealthOperation> fixOperations = new HashSet<DatabaseHealthOperation>();
+ private final Set<DatabaseHealthOperation> verifyOperations = new HashSet<DatabaseHealthOperation>();
+
+ public MasterDbHealthOperation(String operationName) {
+ super(operationName, SkynetGuiPlugin.PLUGIN_ID);
+ }
+
+ public void addOperation(DatabaseHealthOperation operation, boolean isFixOperation) {
+ if (operation != null) {
+ if (isFixOperation) {
+ fixOperations.add(operation);
+ } else {
+ verifyOperations.add(operation);
+ }
+ }
+ }
+
+ private void executeOperation(IProgressMonitor monitor, DatabaseHealthOperation operation, double workPercentage, boolean isFix) throws Exception {
+ checkForCancelledStatus(monitor);
+ if (operation != null) {
+ operation.setFixOperationEnabled(isFix);
+ println(String.format("\nProcessing: [%s]", operation.getName()));
+ doSubWork(operation, monitor, workPercentage);
+
+ String detailedReport = operation.getDetailedReport().toString();
+ if (Strings.isValid(detailedReport)) {
+ XResultData result = new XResultData();
+ result.addRaw(detailedReport.toString());
+ result.report(operation.getName(), Manipulations.RAW_HTML);
+ } else {
+ ResultsEditor.open(operation.getResultsProvider());
+ }
+ println(String.format("Completed: [%s]", operation.getName()));
+ }
+ }
+
+ @Override
+ protected void doWork(IProgressMonitor monitor) throws Exception {
+ int totalTasks = fixOperations.size() + verifyOperations.size();
+ double workPercentage = 1.0 / totalTasks;
+ if (!AccessControlManager.isOseeAdmin()) {
+ throw new OseeAccessDeniedException("Must be a Developer to run this BLAM");
+ } else {
+ for (DatabaseHealthOperation operation : fixOperations) {
+ executeOperation(monitor, operation, workPercentage, true);
+ }
+ for (DatabaseHealthOperation operation : verifyOperations) {
+ executeOperation(monitor, operation, workPercentage, false);
+ }
+ }
+ }
+ }
} \ 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/ExperimentalBlam.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/operation/ExperimentalBlam.java
index 826be27f754..4711c3d8547 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/operation/ExperimentalBlam.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/operation/ExperimentalBlam.java
@@ -1,43 +1,43 @@
-/*******************************************************************************
- * 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.skynet.blam.operation;
-
-import java.util.Arrays;
-import java.util.Collection;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.osee.framework.ui.skynet.blam.AbstractBlam;
-import org.eclipse.osee.framework.ui.skynet.blam.VariableMap;
-
-/**
- * @author Ryan D. Brooks
- */
-public class ExperimentalBlam extends AbstractBlam {
-
- @Override
- public String getName() {
- return "Experimental Blam";
- }
-
- @Override
- public void runOperation(VariableMap variableMap, IProgressMonitor monitor) throws Exception {
- // provided for subclass implementation
- }
-
- @Override
- public Collection<String> getCategories() {
- return Arrays.asList("Admin");
- }
-
- @Override
- public String getXWidgetsXml() {
- return "<xWidgets><XWidget xwidgetType=\"XCheckBox\" horizontalLabel=\"true\" labelAfter=\"true\" displayName=\"Even Branches\" /></xWidgets>";
- }
+/*******************************************************************************
+ * 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.skynet.blam.operation;
+
+import java.util.Arrays;
+import java.util.Collection;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.osee.framework.ui.skynet.blam.AbstractBlam;
+import org.eclipse.osee.framework.ui.skynet.blam.VariableMap;
+
+/**
+ * @author Ryan D. Brooks
+ */
+public class ExperimentalBlam extends AbstractBlam {
+
+ @Override
+ public String getName() {
+ return "Experimental Blam";
+ }
+
+ @Override
+ public void runOperation(VariableMap variableMap, IProgressMonitor monitor) throws Exception {
+ // provided for subclass implementation
+ }
+
+ @Override
+ public Collection<String> getCategories() {
+ return Arrays.asList("Admin");
+ }
+
+ @Override
+ public String getXWidgetsXml() {
+ return "<xWidgets><XWidget xwidgetType=\"XCheckBox\" horizontalLabel=\"true\" labelAfter=\"true\" displayName=\"Even Branches\" /></xWidgets>";
+ }
} \ 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/ExtractReqPriority.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/operation/ExtractReqPriority.java
index 633ee622d07..e64ec4c457b 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/operation/ExtractReqPriority.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/operation/ExtractReqPriority.java
@@ -1,90 +1,90 @@
-/*******************************************************************************
- * 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.skynet.blam.operation;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.InputStreamReader;
-import java.io.UnsupportedEncodingException;
-import java.util.HashMap;
-import org.eclipse.osee.framework.jdk.core.util.io.xml.ExcelSaxHandler;
-import org.eclipse.osee.framework.jdk.core.util.io.xml.RowProcessor;
-import org.xml.sax.InputSource;
-import org.xml.sax.SAXException;
-import org.xml.sax.XMLReader;
-import org.xml.sax.helpers.XMLReaderFactory;
-
-/**
- * @author Ryan D. Brooks
- */
-public class ExtractReqPriority implements RowProcessor {
- private final HashMap<String, String> reqPriorities;
-
- public ExtractReqPriority(String excelMlPath) throws UnsupportedEncodingException, FileNotFoundException, IOException, SAXException {
- this.reqPriorities = new HashMap<String, String>();
-
- File file = new File(excelMlPath);
-
- XMLReader xmlReader = XMLReaderFactory.createXMLReader();
- xmlReader.setContentHandler(new ExcelSaxHandler(this, true));
- xmlReader.parse(new InputSource(new InputStreamReader(new FileInputStream(file), "UTF-8")));
- }
-
- public HashMap<String, String> getReqPriorities() {
- return reqPriorities;
- }
-
- @Override
- public void detectedRowAndColumnCounts(int rowCount, int columnCount) {
- // do nothing
- }
-
- @Override
- public void foundStartOfWorksheet(String sheetName) {
- // do nothing
- }
-
- @Override
- public void processCommentRow(String[] row) {
- // do nothing
- }
-
- @Override
- public void processEmptyRow() {
- // do nothing
- }
-
- @Override
- public void processHeaderRow(String[] row) {
- // do nothing
- }
-
- @Override
- public void processRow(String[] row) {
- // pick the highest priority specified in the workbook (in case there are multiple priorities for the same item)
- if (row[1] != null) {
- String priority = reqPriorities.get(row[1]);
- if (priority != null) {
- if (priority.compareTo(row[0]) > 0) {
- return;
- }
- }
- reqPriorities.put(row[1], row[0]);
- }
- }
-
- @Override
- public void reachedEndOfWorksheet() {
- // do nothing
- }
+/*******************************************************************************
+ * 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.skynet.blam.operation;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.io.UnsupportedEncodingException;
+import java.util.HashMap;
+import org.eclipse.osee.framework.jdk.core.util.io.xml.ExcelSaxHandler;
+import org.eclipse.osee.framework.jdk.core.util.io.xml.RowProcessor;
+import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
+import org.xml.sax.XMLReader;
+import org.xml.sax.helpers.XMLReaderFactory;
+
+/**
+ * @author Ryan D. Brooks
+ */
+public class ExtractReqPriority implements RowProcessor {
+ private final HashMap<String, String> reqPriorities;
+
+ public ExtractReqPriority(String excelMlPath) throws UnsupportedEncodingException, FileNotFoundException, IOException, SAXException {
+ this.reqPriorities = new HashMap<String, String>();
+
+ File file = new File(excelMlPath);
+
+ XMLReader xmlReader = XMLReaderFactory.createXMLReader();
+ xmlReader.setContentHandler(new ExcelSaxHandler(this, true));
+ xmlReader.parse(new InputSource(new InputStreamReader(new FileInputStream(file), "UTF-8")));
+ }
+
+ public HashMap<String, String> getReqPriorities() {
+ return reqPriorities;
+ }
+
+ @Override
+ public void detectedRowAndColumnCounts(int rowCount, int columnCount) {
+ // do nothing
+ }
+
+ @Override
+ public void foundStartOfWorksheet(String sheetName) {
+ // do nothing
+ }
+
+ @Override
+ public void processCommentRow(String[] row) {
+ // do nothing
+ }
+
+ @Override
+ public void processEmptyRow() {
+ // do nothing
+ }
+
+ @Override
+ public void processHeaderRow(String[] row) {
+ // do nothing
+ }
+
+ @Override
+ public void processRow(String[] row) {
+ // pick the highest priority specified in the workbook (in case there are multiple priorities for the same item)
+ if (row[1] != null) {
+ String priority = reqPriorities.get(row[1]);
+ if (priority != null) {
+ if (priority.compareTo(row[0]) > 0) {
+ return;
+ }
+ }
+ reqPriorities.put(row[1], row[0]);
+ }
+ }
+
+ @Override
+ public void reachedEndOfWorksheet() {
+ // do nothing
+ }
} \ 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/FixTemplateContentArtifacts.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/operation/FixTemplateContentArtifacts.java
index 0e8330c4162..697adc7fbab 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/operation/FixTemplateContentArtifacts.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/operation/FixTemplateContentArtifacts.java
@@ -1,373 +1,373 @@
-/*******************************************************************************
- * 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.skynet.blam.operation;
-
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.net.HttpURLConnection;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.LinkedList;
-import java.util.Map;
-import java.util.logging.Level;
-import java.util.zip.ZipEntry;
-import java.util.zip.ZipInputStream;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.osee.framework.core.client.ClientSessionManager;
-import org.eclipse.osee.framework.core.client.server.HttpUrlBuilderClient;
-import org.eclipse.osee.framework.core.data.OseeServerContext;
-import org.eclipse.osee.framework.core.enums.CoreAttributeTypes;
-import org.eclipse.osee.framework.core.exception.OseeCoreException;
-import org.eclipse.osee.framework.core.exception.OseeExceptions;
-import org.eclipse.osee.framework.core.util.HttpProcessor;
-import org.eclipse.osee.framework.core.util.HttpProcessor.AcquireResult;
-import org.eclipse.osee.framework.database.core.ConnectionHandler;
-import org.eclipse.osee.framework.database.core.IOseeStatement;
-import org.eclipse.osee.framework.jdk.core.util.AHTML;
-import org.eclipse.osee.framework.jdk.core.util.Lib;
-import org.eclipse.osee.framework.jdk.core.util.Strings;
-import org.eclipse.osee.framework.jdk.core.util.xml.Jaxp;
-import org.eclipse.osee.framework.logging.OseeLog;
-import org.eclipse.osee.framework.plugin.core.util.OseeData;
-import org.eclipse.osee.framework.skynet.core.attribute.AttributeTypeManager;
-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.render.WordTemplateRenderer;
-import org.eclipse.osee.framework.ui.skynet.results.XResultData;
-import org.eclipse.osee.framework.ui.skynet.results.html.XResultPage.Manipulations;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.NodeList;
-
-/**
- * @author Jeff C. Phillips
- * @author Theron Virgin
- */
-public class FixTemplateContentArtifacts extends AbstractBlam {
- private static final boolean DEBUG =
- Boolean.parseBoolean(Platform.getDebugOption("org.eclipse.osee.framework.ui.skynet/debug/Blam"));
-
- private static final String GET_ATTRS =
- "SELECT DISTINCT(art.human_readable_id), attr.gamma_id, attr.uri FROM osee_attribute attr, osee_artifact art WHERE attr.attr_type_id = ? AND attr.art_id = art.art_id AND attr.uri is not null AND attr.uri != ''";
- private final Collection<String> badData = new LinkedList<String>();
- private static final String[] columnHeaders = new String[] {"Corrupted Data"};
-
- private static File createTempFolder() {
- File rootDirectory = OseeData.getFile("FixTemplate_" + Lib.getDateTimeString() + File.separator);
- rootDirectory.mkdirs();
- return rootDirectory;
- }
-
- @Override
- public String getName() {
- return "Fix Template Content Artifacts";
- }
-
- @SuppressWarnings("unused")
- @Override
- public void runOperation(VariableMap variableMap, IProgressMonitor monitor) throws Exception {
- if (true) {
- System.err.println("Only to be run by developer");
- return;
- }
- File backupFolder = createTempFolder();
- OseeLog.log(SkynetGuiPlugin.class, Level.INFO,
- String.format("Backup Folder location: [%s]", backupFolder.getAbsolutePath()));
-
- ArrayList<AttrData> attrDatas = loadAttrData();
- int totalAttrs = attrDatas.size();
-
- monitor.beginTask("Fix word template content", totalAttrs);
-
- for (int index = 0; index < attrDatas.size(); index++) {
- AttrData attrData = attrDatas.get(index);
- monitor.subTask(String.format("[%s of %s] - hrid[%s]", index, totalAttrs, attrData.getHrid()));
- Resource resource = getResource(attrData.getUri());
-
- Element rootElement = null;
- if (DEBUG) {
- OseeLog.log(SkynetGuiPlugin.class, Level.INFO, String.format("Before Fix: %s", resource.data));
- }
-
- final Collection<Element> elements = new LinkedList<Element>();
- final Collection<Element> sectPr = new LinkedList<Element>();
- boolean fixedAttribute = false;
- try {
- Document doc = Jaxp.readXmlDocument("<ForFix>" + resource.data + "</ForFix>");
- rootElement = doc.getDocumentElement();
-
- NodeList nodeList = rootElement.getElementsByTagName("*");
- for (int i = 0; i < nodeList.getLength(); i++) {
- Element element = (Element) nodeList.item(i);
- if (element.getNodeName().endsWith("w:p")) {
- elements.add(element);
- }
- if (element.getNodeName().endsWith("w:sectPr")) {
- sectPr.add(element);
- }
- }
- for (Element paragraph : elements) {
- boolean badParagraph = isBadParagraph(paragraph);
- if (badParagraph) {
- paragraph.getParentNode().removeChild(paragraph);
- }
- fixedAttribute = fixedAttribute || badParagraph;
- }
- for (Element sect : sectPr) {
- sect.getParentNode().removeChild(sect);
- fixedAttribute = true;
- }
- } catch (Exception ex) {
- badData.add(attrData.gammaId);
- OseeLog.log(SkynetGuiPlugin.class, Level.SEVERE,
- String.format("Skiping File %s because of exception %s", attrData.getHrid(), ex));
- }
-
- if (fixedAttribute) {
- try {
- // Backup File
- backupResourceLocally(backupFolder, resource);
-
- // Perform Fix
- resource.data = new String(WordTemplateRenderer.getFormattedContent(rootElement), "UTF-8");
- resource.encoding = "UTF-8";
-
- // UploadResource
- uploadResource(attrData.getGammaId(), resource);
-
- if (DEBUG) {
- OseeLog.log(SkynetGuiPlugin.class, Level.INFO, String.format(" After Fix : %s", resource.data));
- }
- } catch (Exception ex) {
- OseeLog.log(SkynetGuiPlugin.class, Level.SEVERE,
- String.format("Skiping File %s because of exception %s", attrData.getHrid(), ex));
- }
- }
- monitor.worked(1);
- }
-
- StringBuffer sbFull = new StringBuffer(AHTML.beginMultiColumnTable(100, 1));
- sbFull.append(AHTML.beginMultiColumnTable(100, 1));
- sbFull.append(AHTML.addHeaderRowMultiColumnTable(columnHeaders));
- for (String string : badData) {
- sbFull.append(AHTML.addRowMultiColumnTable(new String[] {string}));
- }
- sbFull.append(AHTML.endMultiColumnTable());
- XResultData rd = new XResultData();
- rd.addRaw(sbFull.toString());
- rd.report("Fix bad data", Manipulations.RAW_HTML);
-
- }
-
- private ArrayList<AttrData> loadAttrData() throws OseeCoreException {
- ArrayList<AttrData> attrData = new ArrayList<AttrData>();
-
- IOseeStatement chStmt = ConnectionHandler.getStatement();
- try {
+/*******************************************************************************
+ * 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.skynet.blam.operation;
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.net.HttpURLConnection;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.LinkedList;
+import java.util.Map;
+import java.util.logging.Level;
+import java.util.zip.ZipEntry;
+import java.util.zip.ZipInputStream;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.osee.framework.core.client.ClientSessionManager;
+import org.eclipse.osee.framework.core.client.server.HttpUrlBuilderClient;
+import org.eclipse.osee.framework.core.data.OseeServerContext;
+import org.eclipse.osee.framework.core.enums.CoreAttributeTypes;
+import org.eclipse.osee.framework.core.exception.OseeCoreException;
+import org.eclipse.osee.framework.core.exception.OseeExceptions;
+import org.eclipse.osee.framework.core.util.HttpProcessor;
+import org.eclipse.osee.framework.core.util.HttpProcessor.AcquireResult;
+import org.eclipse.osee.framework.database.core.ConnectionHandler;
+import org.eclipse.osee.framework.database.core.IOseeStatement;
+import org.eclipse.osee.framework.jdk.core.util.AHTML;
+import org.eclipse.osee.framework.jdk.core.util.Lib;
+import org.eclipse.osee.framework.jdk.core.util.Strings;
+import org.eclipse.osee.framework.jdk.core.util.xml.Jaxp;
+import org.eclipse.osee.framework.logging.OseeLog;
+import org.eclipse.osee.framework.plugin.core.util.OseeData;
+import org.eclipse.osee.framework.skynet.core.attribute.AttributeTypeManager;
+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.render.WordTemplateRenderer;
+import org.eclipse.osee.framework.ui.skynet.results.XResultData;
+import org.eclipse.osee.framework.ui.skynet.results.html.XResultPage.Manipulations;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.NodeList;
+
+/**
+ * @author Jeff C. Phillips
+ * @author Theron Virgin
+ */
+public class FixTemplateContentArtifacts extends AbstractBlam {
+ private static final boolean DEBUG =
+ Boolean.parseBoolean(Platform.getDebugOption("org.eclipse.osee.framework.ui.skynet/debug/Blam"));
+
+ private static final String GET_ATTRS =
+ "SELECT DISTINCT(art.human_readable_id), attr.gamma_id, attr.uri FROM osee_attribute attr, osee_artifact art WHERE attr.attr_type_id = ? AND attr.art_id = art.art_id AND attr.uri is not null AND attr.uri != ''";
+ private final Collection<String> badData = new LinkedList<String>();
+ private static final String[] columnHeaders = new String[] {"Corrupted Data"};
+
+ private static File createTempFolder() {
+ File rootDirectory = OseeData.getFile("FixTemplate_" + Lib.getDateTimeString() + File.separator);
+ rootDirectory.mkdirs();
+ return rootDirectory;
+ }
+
+ @Override
+ public String getName() {
+ return "Fix Template Content Artifacts";
+ }
+
+ @SuppressWarnings("unused")
+ @Override
+ public void runOperation(VariableMap variableMap, IProgressMonitor monitor) throws Exception {
+ if (true) {
+ System.err.println("Only to be run by developer");
+ return;
+ }
+ File backupFolder = createTempFolder();
+ OseeLog.log(SkynetGuiPlugin.class, Level.INFO,
+ String.format("Backup Folder location: [%s]", backupFolder.getAbsolutePath()));
+
+ ArrayList<AttrData> attrDatas = loadAttrData();
+ int totalAttrs = attrDatas.size();
+
+ monitor.beginTask("Fix word template content", totalAttrs);
+
+ for (int index = 0; index < attrDatas.size(); index++) {
+ AttrData attrData = attrDatas.get(index);
+ monitor.subTask(String.format("[%s of %s] - hrid[%s]", index, totalAttrs, attrData.getHrid()));
+ Resource resource = getResource(attrData.getUri());
+
+ Element rootElement = null;
+ if (DEBUG) {
+ OseeLog.log(SkynetGuiPlugin.class, Level.INFO, String.format("Before Fix: %s", resource.data));
+ }
+
+ final Collection<Element> elements = new LinkedList<Element>();
+ final Collection<Element> sectPr = new LinkedList<Element>();
+ boolean fixedAttribute = false;
+ try {
+ Document doc = Jaxp.readXmlDocument("<ForFix>" + resource.data + "</ForFix>");
+ rootElement = doc.getDocumentElement();
+
+ NodeList nodeList = rootElement.getElementsByTagName("*");
+ for (int i = 0; i < nodeList.getLength(); i++) {
+ Element element = (Element) nodeList.item(i);
+ if (element.getNodeName().endsWith("w:p")) {
+ elements.add(element);
+ }
+ if (element.getNodeName().endsWith("w:sectPr")) {
+ sectPr.add(element);
+ }
+ }
+ for (Element paragraph : elements) {
+ boolean badParagraph = isBadParagraph(paragraph);
+ if (badParagraph) {
+ paragraph.getParentNode().removeChild(paragraph);
+ }
+ fixedAttribute = fixedAttribute || badParagraph;
+ }
+ for (Element sect : sectPr) {
+ sect.getParentNode().removeChild(sect);
+ fixedAttribute = true;
+ }
+ } catch (Exception ex) {
+ badData.add(attrData.gammaId);
+ OseeLog.log(SkynetGuiPlugin.class, Level.SEVERE,
+ String.format("Skiping File %s because of exception %s", attrData.getHrid(), ex));
+ }
+
+ if (fixedAttribute) {
+ try {
+ // Backup File
+ backupResourceLocally(backupFolder, resource);
+
+ // Perform Fix
+ resource.data = new String(WordTemplateRenderer.getFormattedContent(rootElement), "UTF-8");
+ resource.encoding = "UTF-8";
+
+ // UploadResource
+ uploadResource(attrData.getGammaId(), resource);
+
+ if (DEBUG) {
+ OseeLog.log(SkynetGuiPlugin.class, Level.INFO, String.format(" After Fix : %s", resource.data));
+ }
+ } catch (Exception ex) {
+ OseeLog.log(SkynetGuiPlugin.class, Level.SEVERE,
+ String.format("Skiping File %s because of exception %s", attrData.getHrid(), ex));
+ }
+ }
+ monitor.worked(1);
+ }
+
+ StringBuffer sbFull = new StringBuffer(AHTML.beginMultiColumnTable(100, 1));
+ sbFull.append(AHTML.beginMultiColumnTable(100, 1));
+ sbFull.append(AHTML.addHeaderRowMultiColumnTable(columnHeaders));
+ for (String string : badData) {
+ sbFull.append(AHTML.addRowMultiColumnTable(new String[] {string}));
+ }
+ sbFull.append(AHTML.endMultiColumnTable());
+ XResultData rd = new XResultData();
+ rd.addRaw(sbFull.toString());
+ rd.report("Fix bad data", Manipulations.RAW_HTML);
+
+ }
+
+ private ArrayList<AttrData> loadAttrData() throws OseeCoreException {
+ ArrayList<AttrData> attrData = new ArrayList<AttrData>();
+
+ IOseeStatement chStmt = ConnectionHandler.getStatement();
+ try {
chStmt.runPreparedQuery(GET_ATTRS, AttributeTypeManager.getTypeId(CoreAttributeTypes.WordTemplateContent));
- while (chStmt.next()) {
- attrData.add(new AttrData(chStmt.getString("gamma_Id"), chStmt.getString("human_readable_id"),
- chStmt.getString("uri")));
- }
- } finally {
- chStmt.close();
- }
- return attrData;
- }
-
- private static void uploadResource(String gammaId, Resource resource) throws Exception {
- String fileName = resource.resourceName;
- Map<String, String> parameterMap = new HashMap<String, String>();
- parameterMap.put("sessionId", ClientSessionManager.getSessionId());
- parameterMap.put("is.overwrite.allowed", String.valueOf(true));
- parameterMap.put("protocol", "attr");
- parameterMap.put("seed", gammaId);
-
- String extension = Lib.getExtension(fileName);
- if (Strings.isValid(extension)) {
- parameterMap.put("extension", extension);
- int charToRemove = extension.length() + 1;
- fileName = fileName.substring(0, fileName.length() - charToRemove);
- }
- parameterMap.put("name", fileName);
-
- byte[] toUpload = resource.data.getBytes(resource.encoding);
- if (resource.wasZipped) {
- toUpload = Lib.compressStream(new ByteArrayInputStream(toUpload), resource.entryName);
- }
-
- String urlString =
- HttpUrlBuilderClient.getInstance().getOsgiServletServiceUrl(OseeServerContext.RESOURCE_CONTEXT, parameterMap);
- HttpProcessor.put(new URL(urlString), new ByteArrayInputStream(toUpload), resource.result.getContentType(),
- resource.result.getEncoding());
- }
-
- private Resource getResource(String resourcePath) throws OseeCoreException {
- Resource toReturn = null;
- ByteArrayOutputStream sourceOutputStream = new ByteArrayOutputStream();
- try {
- Map<String, String> parameterMap = new HashMap<String, String>();
- parameterMap.put("sessionId", ClientSessionManager.getSessionId());
- parameterMap.put("uri", resourcePath);
- String urlString =
- HttpUrlBuilderClient.getInstance().getOsgiServletServiceUrl(OseeServerContext.RESOURCE_CONTEXT,
- parameterMap);
-
- AcquireResult result = HttpProcessor.acquire(new URL(urlString), sourceOutputStream);
- if (result.getCode() == HttpURLConnection.HTTP_OK) {
- toReturn = new Resource(resourcePath, result, sourceOutputStream.toByteArray());
- }
- } catch (Exception ex) {
- OseeExceptions.wrapAndThrow(ex);
- } finally {
- try {
- sourceOutputStream.close();
- } catch (IOException ex) {
- OseeExceptions.wrapAndThrow(ex);
- }
- }
- return toReturn;
- }
-
- private final class Resource {
- private final String entryName;
- private final String resourceName;
- private final AcquireResult result;
- private final byte[] rawBytes;
- private final boolean wasZipped;
- private final String sourcePath;
-
- private String data;
- private String encoding;
-
- private Resource(String sourcePath, AcquireResult result, byte[] rawBytes) throws IOException {
- this.rawBytes = rawBytes;
- this.result = result;
- int index = sourcePath.lastIndexOf('/');
- this.sourcePath = sourcePath;
- this.resourceName = sourcePath.substring(index + 1, sourcePath.length());
- this.wasZipped = result.getContentType().contains("zip");
- if (wasZipped) {
- ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
- this.entryName = decompressStream(new ByteArrayInputStream(rawBytes), outputStream);
- this.encoding = "UTF-8";
- this.data = new String(outputStream.toByteArray(), encoding);
- } else {
- this.data = new String(rawBytes, result.getEncoding());
- this.entryName = null;
- this.encoding = result.getEncoding();
- }
- }
- }
-
- private static void backupResourceLocally(File backupFolder, Resource resource) throws IOException {
- InputStream inputStream = null;
- OutputStream outputStream = null;
- try {
- String path = resource.sourcePath;
- path = path.replaceAll("attr://", "");
- path = path.replaceAll("/", Lib.isWindows() ? "\\\\" : "/");
- File file = new File(backupFolder, path);
- File parent = file.getParentFile();
- if (parent != null) {
- parent.mkdirs();
- }
- outputStream = new FileOutputStream(file);
-
- inputStream = new ByteArrayInputStream(resource.rawBytes);
- Lib.inputStreamToOutputStream(inputStream, outputStream);
- } finally {
- if (inputStream != null) {
- inputStream.close();
- }
- if (outputStream != null) {
- outputStream.close();
- }
- }
- }
-
- private static String decompressStream(InputStream inputStream, OutputStream outputStream) throws IOException {
- String zipEntryName = null;
- ZipInputStream zipInputStream = null;
- try {
- zipInputStream = new ZipInputStream(inputStream);
- ZipEntry entry = zipInputStream.getNextEntry();
- zipEntryName = entry.getName();
- // Transfer bytes from the ZIP file to the output file
- byte[] buf = new byte[1024];
- int len;
- while ((len = zipInputStream.read(buf)) > 0) {
- outputStream.write(buf, 0, len);
- }
- } finally {
- if (zipInputStream != null) {
- zipInputStream.close();
- }
- }
- return zipEntryName;
- }
-
- //To handle the case of sub-sections
- private boolean isBadParagraph(Element paragraph) {
- boolean badParagraph = false;
- String content = paragraph.getTextContent();
- if (content != null && content.contains("LISTNUM \"listreset\"")) {
- badParagraph = true;
- }
-
- return badParagraph;
- }
-
- @Override
- public String getXWidgetsXml() {
- return AbstractBlam.emptyXWidgetsXml;
- }
-
- class AttrData {
- private final String gammaId;
- private final String hrid;
- private final String uri;
-
- public AttrData(String gammaId, String hrid, String uri) {
- super();
- this.gammaId = gammaId;
- this.hrid = hrid;
- this.uri = uri;
- }
-
- public String getGammaId() {
- return gammaId;
- }
-
- public String getHrid() {
- return hrid;
- }
-
- public String getUri() {
- return uri;
- }
- }
-
- @Override
- public Collection<String> getCategories() {
- return Arrays.asList("Admin.Health");
- }
-}
+ while (chStmt.next()) {
+ attrData.add(new AttrData(chStmt.getString("gamma_Id"), chStmt.getString("human_readable_id"),
+ chStmt.getString("uri")));
+ }
+ } finally {
+ chStmt.close();
+ }
+ return attrData;
+ }
+
+ private static void uploadResource(String gammaId, Resource resource) throws Exception {
+ String fileName = resource.resourceName;
+ Map<String, String> parameterMap = new HashMap<String, String>();
+ parameterMap.put("sessionId", ClientSessionManager.getSessionId());
+ parameterMap.put("is.overwrite.allowed", String.valueOf(true));
+ parameterMap.put("protocol", "attr");
+ parameterMap.put("seed", gammaId);
+
+ String extension = Lib.getExtension(fileName);
+ if (Strings.isValid(extension)) {
+ parameterMap.put("extension", extension);
+ int charToRemove = extension.length() + 1;
+ fileName = fileName.substring(0, fileName.length() - charToRemove);
+ }
+ parameterMap.put("name", fileName);
+
+ byte[] toUpload = resource.data.getBytes(resource.encoding);
+ if (resource.wasZipped) {
+ toUpload = Lib.compressStream(new ByteArrayInputStream(toUpload), resource.entryName);
+ }
+
+ String urlString =
+ HttpUrlBuilderClient.getInstance().getOsgiServletServiceUrl(OseeServerContext.RESOURCE_CONTEXT, parameterMap);
+ HttpProcessor.put(new URL(urlString), new ByteArrayInputStream(toUpload), resource.result.getContentType(),
+ resource.result.getEncoding());
+ }
+
+ private Resource getResource(String resourcePath) throws OseeCoreException {
+ Resource toReturn = null;
+ ByteArrayOutputStream sourceOutputStream = new ByteArrayOutputStream();
+ try {
+ Map<String, String> parameterMap = new HashMap<String, String>();
+ parameterMap.put("sessionId", ClientSessionManager.getSessionId());
+ parameterMap.put("uri", resourcePath);
+ String urlString =
+ HttpUrlBuilderClient.getInstance().getOsgiServletServiceUrl(OseeServerContext.RESOURCE_CONTEXT,
+ parameterMap);
+
+ AcquireResult result = HttpProcessor.acquire(new URL(urlString), sourceOutputStream);
+ if (result.getCode() == HttpURLConnection.HTTP_OK) {
+ toReturn = new Resource(resourcePath, result, sourceOutputStream.toByteArray());
+ }
+ } catch (Exception ex) {
+ OseeExceptions.wrapAndThrow(ex);
+ } finally {
+ try {
+ sourceOutputStream.close();
+ } catch (IOException ex) {
+ OseeExceptions.wrapAndThrow(ex);
+ }
+ }
+ return toReturn;
+ }
+
+ private final class Resource {
+ private final String entryName;
+ private final String resourceName;
+ private final AcquireResult result;
+ private final byte[] rawBytes;
+ private final boolean wasZipped;
+ private final String sourcePath;
+
+ private String data;
+ private String encoding;
+
+ private Resource(String sourcePath, AcquireResult result, byte[] rawBytes) throws IOException {
+ this.rawBytes = rawBytes;
+ this.result = result;
+ int index = sourcePath.lastIndexOf('/');
+ this.sourcePath = sourcePath;
+ this.resourceName = sourcePath.substring(index + 1, sourcePath.length());
+ this.wasZipped = result.getContentType().contains("zip");
+ if (wasZipped) {
+ ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
+ this.entryName = decompressStream(new ByteArrayInputStream(rawBytes), outputStream);
+ this.encoding = "UTF-8";
+ this.data = new String(outputStream.toByteArray(), encoding);
+ } else {
+ this.data = new String(rawBytes, result.getEncoding());
+ this.entryName = null;
+ this.encoding = result.getEncoding();
+ }
+ }
+ }
+
+ private static void backupResourceLocally(File backupFolder, Resource resource) throws IOException {
+ InputStream inputStream = null;
+ OutputStream outputStream = null;
+ try {
+ String path = resource.sourcePath;
+ path = path.replaceAll("attr://", "");
+ path = path.replaceAll("/", Lib.isWindows() ? "\\\\" : "/");
+ File file = new File(backupFolder, path);
+ File parent = file.getParentFile();
+ if (parent != null) {
+ parent.mkdirs();
+ }
+ outputStream = new FileOutputStream(file);
+
+ inputStream = new ByteArrayInputStream(resource.rawBytes);
+ Lib.inputStreamToOutputStream(inputStream, outputStream);
+ } finally {
+ if (inputStream != null) {
+ inputStream.close();
+ }
+ if (outputStream != null) {
+ outputStream.close();
+ }
+ }
+ }
+
+ private static String decompressStream(InputStream inputStream, OutputStream outputStream) throws IOException {
+ String zipEntryName = null;
+ ZipInputStream zipInputStream = null;
+ try {
+ zipInputStream = new ZipInputStream(inputStream);
+ ZipEntry entry = zipInputStream.getNextEntry();
+ zipEntryName = entry.getName();
+ // Transfer bytes from the ZIP file to the output file
+ byte[] buf = new byte[1024];
+ int len;
+ while ((len = zipInputStream.read(buf)) > 0) {
+ outputStream.write(buf, 0, len);
+ }
+ } finally {
+ if (zipInputStream != null) {
+ zipInputStream.close();
+ }
+ }
+ return zipEntryName;
+ }
+
+ //To handle the case of sub-sections
+ private boolean isBadParagraph(Element paragraph) {
+ boolean badParagraph = false;
+ String content = paragraph.getTextContent();
+ if (content != null && content.contains("LISTNUM \"listreset\"")) {
+ badParagraph = true;
+ }
+
+ return badParagraph;
+ }
+
+ @Override
+ public String getXWidgetsXml() {
+ return AbstractBlam.emptyXWidgetsXml;
+ }
+
+ class AttrData {
+ private final String gammaId;
+ private final String hrid;
+ private final String uri;
+
+ public AttrData(String gammaId, String hrid, String uri) {
+ super();
+ this.gammaId = gammaId;
+ this.hrid = hrid;
+ this.uri = uri;
+ }
+
+ public String getGammaId() {
+ return gammaId;
+ }
+
+ public String getHrid() {
+ return hrid;
+ }
+
+ public String getUri() {
+ return uri;
+ }
+ }
+
+ @Override
+ public Collection<String> getCategories() {
+ return Arrays.asList("Admin.Health");
+ }
+}
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 673ebf0d225..b559aecce59 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
@@ -1,93 +1,93 @@
-/*******************************************************************************
- * 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.skynet.blam.operation;
-
-import java.util.Arrays;
-import java.util.Collection;
-import org.eclipse.core.runtime.IProgressMonitor;
-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;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Listener;
-
-/**
- * Capture an image within the bounds of OSEE workbench.
- *
- * @author Donald G. Dunne
- */
-public class ImageCaptureBlam extends AbstractBlam {
-
- public Point topLeftPoint;
- public Point botRightPoint;
- public boolean listenerAdded = false;
-
- @Override
- public String getName() {
- return "Image Capture";
- }
-
- @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() {
- @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, Displays.getActiveShell());
- diag.open();
- }
- }
- }
- };
-
- @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 Collection<String> getCategories() {
- return Arrays.asList("Util");
- }
+/*******************************************************************************
+ * 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.skynet.blam.operation;
+
+import java.util.Arrays;
+import java.util.Collection;
+import org.eclipse.core.runtime.IProgressMonitor;
+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;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Listener;
+
+/**
+ * Capture an image within the bounds of OSEE workbench.
+ *
+ * @author Donald G. Dunne
+ */
+public class ImageCaptureBlam extends AbstractBlam {
+
+ public Point topLeftPoint;
+ public Point botRightPoint;
+ public boolean listenerAdded = false;
+
+ @Override
+ public String getName() {
+ return "Image Capture";
+ }
+
+ @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() {
+ @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, Displays.getActiveShell());
+ diag.open();
+ }
+ }
+ }
+ };
+
+ @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 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/LoadAllArtifactsOnBranch.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/operation/LoadAllArtifactsOnBranch.java
index 0839659ebde..ef6c99e47a3 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/operation/LoadAllArtifactsOnBranch.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/operation/LoadAllArtifactsOnBranch.java
@@ -1,47 +1,47 @@
-/*******************************************************************************
- * 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.skynet.blam.operation;
-
-import static org.eclipse.osee.framework.skynet.core.artifact.DeletionFlag.EXCLUDE_DELETED;
-import java.util.Arrays;
-import java.util.Collection;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.osee.framework.core.model.Branch;
-import org.eclipse.osee.framework.skynet.core.artifact.search.ArtifactQuery;
-import org.eclipse.osee.framework.ui.skynet.blam.AbstractBlam;
-import org.eclipse.osee.framework.ui.skynet.blam.VariableMap;
-
-/**
- * @author Andrew M. Finkbeiner
- */
-public class LoadAllArtifactsOnBranch extends AbstractBlam {
-
- @Override
- public String getName() {
- return "Load All Artifacts On Branch";
- }
-
- @Override
- public void runOperation(VariableMap variableMap, IProgressMonitor monitor) throws Exception {
- Branch branch = variableMap.getBranch("Parent Branch");
- ArtifactQuery.getArtifactListFromBranch(branch, EXCLUDE_DELETED);
- }
-
- @Override
- public String getXWidgetsXml() {
- return "<xWidgets><XWidget xwidgetType=\"XText\" displayName=\"Branch List\" /><XWidget xwidgetType=\"XBranchSelectWidget\" displayName=\"Parent Branch\" /></xWidgets>";
- }
-
- @Override
- public Collection<String> getCategories() {
- return Arrays.asList("Admin.Health");
- }
+/*******************************************************************************
+ * 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.skynet.blam.operation;
+
+import static org.eclipse.osee.framework.skynet.core.artifact.DeletionFlag.EXCLUDE_DELETED;
+import java.util.Arrays;
+import java.util.Collection;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.osee.framework.core.model.Branch;
+import org.eclipse.osee.framework.skynet.core.artifact.search.ArtifactQuery;
+import org.eclipse.osee.framework.ui.skynet.blam.AbstractBlam;
+import org.eclipse.osee.framework.ui.skynet.blam.VariableMap;
+
+/**
+ * @author Andrew M. Finkbeiner
+ */
+public class LoadAllArtifactsOnBranch extends AbstractBlam {
+
+ @Override
+ public String getName() {
+ return "Load All Artifacts On Branch";
+ }
+
+ @Override
+ public void runOperation(VariableMap variableMap, IProgressMonitor monitor) throws Exception {
+ Branch branch = variableMap.getBranch("Parent Branch");
+ ArtifactQuery.getArtifactListFromBranch(branch, EXCLUDE_DELETED);
+ }
+
+ @Override
+ public String getXWidgetsXml() {
+ return "<xWidgets><XWidget xwidgetType=\"XText\" displayName=\"Branch List\" /><XWidget xwidgetType=\"XBranchSelectWidget\" displayName=\"Parent Branch\" /></xWidgets>";
+ }
+
+ @Override
+ public Collection<String> getCategories() {
+ return Arrays.asList("Admin.Health");
+ }
} \ 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/ParseWindowsDirectoryListing.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/operation/ParseWindowsDirectoryListing.java
index db901614214..7fce426c1cb 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/operation/ParseWindowsDirectoryListing.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/operation/ParseWindowsDirectoryListing.java
@@ -1,68 +1,68 @@
-/*******************************************************************************
- * 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.skynet.blam.operation;
-
-import java.io.BufferedWriter;
-import java.io.FileWriter;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.osee.framework.jdk.core.util.Lib;
-import org.eclipse.osee.framework.ui.skynet.blam.AbstractBlam;
-import org.eclipse.osee.framework.ui.skynet.blam.VariableMap;
-
-/**
- * @author Ryan D. Brooks
- */
-public class ParseWindowsDirectoryListing extends AbstractBlam {
- private static final String DIRECTORY_PREFIX = " Directory of Y:\\";
-
- @Override
- public String getName() {
- return "Parse Windows Directory Listing";
- }
-
- @Override
- public void runOperation(VariableMap variableMap, IProgressMonitor monitor) throws Exception {
- String listingFile = variableMap.getString("Directory Listing File");
- Matcher matcher = Pattern.compile("(\\d+/\\d+/\\d+).*<DIR>.*?SW\\\\(\\S+)\\s+(.*)").matcher("");
- BufferedWriter writer = new BufferedWriter(new FileWriter(Lib.removeExtension(listingFile) + ".csv"));
-
- String path = null;
- for (String line : Lib.readListFromFile(listingFile)) {
- if (line.startsWith(DIRECTORY_PREFIX)) {
- path = line.substring(DIRECTORY_PREFIX.length());
- } else {
- matcher.reset(line);
- if (matcher.find()) {
- String summary = matcher.group(1) + "|" + matcher.group(2) + "|" + path + "\\" + matcher.group(3);
- if (!summary.endsWith(".")) {
- writer.write(summary);
- writer.write(Lib.lineSeparator);
- }
- }
- }
- }
- writer.close();
- }
-
- @Override
- public String getXWidgetsXml() {
- return "<xWidgets><XWidget xwidgetType=\"XText\" displayName=\"Directory Listing File\" defaultValue=\"c:\\UserData\\cte.txt\" /></xWidgets>";
- }
-
- @Override
- public Collection<String> getCategories() {
- return Arrays.asList("Util");
- }
-}
+/*******************************************************************************
+ * 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.skynet.blam.operation;
+
+import java.io.BufferedWriter;
+import java.io.FileWriter;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.osee.framework.jdk.core.util.Lib;
+import org.eclipse.osee.framework.ui.skynet.blam.AbstractBlam;
+import org.eclipse.osee.framework.ui.skynet.blam.VariableMap;
+
+/**
+ * @author Ryan D. Brooks
+ */
+public class ParseWindowsDirectoryListing extends AbstractBlam {
+ private static final String DIRECTORY_PREFIX = " Directory of Y:\\";
+
+ @Override
+ public String getName() {
+ return "Parse Windows Directory Listing";
+ }
+
+ @Override
+ public void runOperation(VariableMap variableMap, IProgressMonitor monitor) throws Exception {
+ String listingFile = variableMap.getString("Directory Listing File");
+ Matcher matcher = Pattern.compile("(\\d+/\\d+/\\d+).*<DIR>.*?SW\\\\(\\S+)\\s+(.*)").matcher("");
+ BufferedWriter writer = new BufferedWriter(new FileWriter(Lib.removeExtension(listingFile) + ".csv"));
+
+ String path = null;
+ for (String line : Lib.readListFromFile(listingFile)) {
+ if (line.startsWith(DIRECTORY_PREFIX)) {
+ path = line.substring(DIRECTORY_PREFIX.length());
+ } else {
+ matcher.reset(line);
+ if (matcher.find()) {
+ String summary = matcher.group(1) + "|" + matcher.group(2) + "|" + path + "\\" + matcher.group(3);
+ if (!summary.endsWith(".")) {
+ writer.write(summary);
+ writer.write(Lib.lineSeparator);
+ }
+ }
+ }
+ }
+ writer.close();
+ }
+
+ @Override
+ public String getXWidgetsXml() {
+ return "<xWidgets><XWidget xwidgetType=\"XText\" displayName=\"Directory Listing File\" defaultValue=\"c:\\UserData\\cte.txt\" /></xWidgets>";
+ }
+
+ @Override
+ public Collection<String> getCategories() {
+ return Arrays.asList("Util");
+ }
+}
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/operation/PopulateTxsBranchIdColumn.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/operation/PopulateTxsBranchIdColumn.java
index 27627d81d19..d88087e59bb 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/operation/PopulateTxsBranchIdColumn.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/operation/PopulateTxsBranchIdColumn.java
@@ -1,102 +1,102 @@
-/*******************************************************************************
- * 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.skynet.blam.operation;
-
-import java.sql.ResultSet;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.HashMap;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.osee.framework.core.exception.OseeCoreException;
-import org.eclipse.osee.framework.database.core.ConnectionHandler;
-import org.eclipse.osee.framework.database.core.IOseeStatement;
-import org.eclipse.osee.framework.ui.skynet.blam.AbstractBlam;
-import org.eclipse.osee.framework.ui.skynet.blam.VariableMap;
-
-/**
- * @author Ryan D. Brooks
- */
-public class PopulateTxsBranchIdColumn extends AbstractBlam {
-
- @Override
- public String getName() {
- return "Populate Txs Branch Id Column";
- }
-
- @Override
- public void runOperation(VariableMap variableMap, IProgressMonitor monitor) throws Exception {
- String tableName = variableMap.getBoolean("Archived Table") ? "osee_txs_archived" : "osee_txs";
- if (variableMap.getBoolean("Incremental Update")) {
- incrementallySetBranchId(tableName);
- } else {
- fullySetBranchId(tableName);
- }
- }
-
- @Override
- public Collection<String> getCategories() {
- return Arrays.asList("Admin");
- }
-
- @Override
- public String getXWidgetsXml() {
- return "<xWidgets><XWidget xwidgetType=\"XCheckBox\" horizontalLabel=\"true\" labelAfter=\"true\" displayName=\"Incremental Update\" /><XWidget xwidgetType=\"XCheckBox\" horizontalLabel=\"true\" labelAfter=\"true\" displayName=\"Archived Table\" /></xWidgets>";
- }
-
- private void fullySetBranchId(String tableName) throws OseeCoreException {
- int blockSize = 200000;
- String sql =
- String.format(
- "update %s txs set branch_id = (select branch_id from osee_tx_details txd where txs.transaction_id = txd.transaction_id) where transaction_id > ? and transaction_id < ?",
- tableName);
-
- for (int i = 0; i < 1000000; i += blockSize) {
- println("> " + i + " and < " + (i + blockSize + 1));
- ConnectionHandler.runPreparedUpdate(sql, i, i + blockSize + 1);
- }
- }
-
- private void incrementallySetBranchId(String tableName) throws OseeCoreException {
- String sql = "select branch_id, transaction_id from osee_tx_details";
- HashMap<Integer, Integer> branchMap = new HashMap<Integer, Integer>(600000);
-
- IOseeStatement chStmt = databaseService.getStatement(ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_UPDATABLE);
- try {
- chStmt.runPreparedQuery(10000, sql);
- while (chStmt.next()) {
- branchMap.put(chStmt.getInt("transaction_id"), chStmt.getInt("branch_id"));
- }
- } finally {
- chStmt.close();
- }
- println("# of transactions: " + branchMap.size());
-
- sql = String.format("select transaction_id, branch_id from %s where branch_id is null", tableName);
- int counter = 0;
- try {
- chStmt.runPreparedQuery(10000, sql);
- while (chStmt.next()) {
- Integer branchId = branchMap.get(chStmt.getInt("transaction_id"));
- if (branchId == null) {
- println("map not not have branch id for transaction id: " + chStmt.getInt("transaction_id"));
- } else {
- chStmt.updateObject("branch_id", branchId);
- chStmt.updateRow();
- counter++;
- }
- }
- } finally {
- chStmt.close();
- }
-
- println("Updated " + counter + " rows");
- }
+/*******************************************************************************
+ * 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.skynet.blam.operation;
+
+import java.sql.ResultSet;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.HashMap;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.osee.framework.core.exception.OseeCoreException;
+import org.eclipse.osee.framework.database.core.ConnectionHandler;
+import org.eclipse.osee.framework.database.core.IOseeStatement;
+import org.eclipse.osee.framework.ui.skynet.blam.AbstractBlam;
+import org.eclipse.osee.framework.ui.skynet.blam.VariableMap;
+
+/**
+ * @author Ryan D. Brooks
+ */
+public class PopulateTxsBranchIdColumn extends AbstractBlam {
+
+ @Override
+ public String getName() {
+ return "Populate Txs Branch Id Column";
+ }
+
+ @Override
+ public void runOperation(VariableMap variableMap, IProgressMonitor monitor) throws Exception {
+ String tableName = variableMap.getBoolean("Archived Table") ? "osee_txs_archived" : "osee_txs";
+ if (variableMap.getBoolean("Incremental Update")) {
+ incrementallySetBranchId(tableName);
+ } else {
+ fullySetBranchId(tableName);
+ }
+ }
+
+ @Override
+ public Collection<String> getCategories() {
+ return Arrays.asList("Admin");
+ }
+
+ @Override
+ public String getXWidgetsXml() {
+ return "<xWidgets><XWidget xwidgetType=\"XCheckBox\" horizontalLabel=\"true\" labelAfter=\"true\" displayName=\"Incremental Update\" /><XWidget xwidgetType=\"XCheckBox\" horizontalLabel=\"true\" labelAfter=\"true\" displayName=\"Archived Table\" /></xWidgets>";
+ }
+
+ private void fullySetBranchId(String tableName) throws OseeCoreException {
+ int blockSize = 200000;
+ String sql =
+ String.format(
+ "update %s txs set branch_id = (select branch_id from osee_tx_details txd where txs.transaction_id = txd.transaction_id) where transaction_id > ? and transaction_id < ?",
+ tableName);
+
+ for (int i = 0; i < 1000000; i += blockSize) {
+ println("> " + i + " and < " + (i + blockSize + 1));
+ ConnectionHandler.runPreparedUpdate(sql, i, i + blockSize + 1);
+ }
+ }
+
+ private void incrementallySetBranchId(String tableName) throws OseeCoreException {
+ String sql = "select branch_id, transaction_id from osee_tx_details";
+ HashMap<Integer, Integer> branchMap = new HashMap<Integer, Integer>(600000);
+
+ IOseeStatement chStmt = databaseService.getStatement(ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_UPDATABLE);
+ try {
+ chStmt.runPreparedQuery(10000, sql);
+ while (chStmt.next()) {
+ branchMap.put(chStmt.getInt("transaction_id"), chStmt.getInt("branch_id"));
+ }
+ } finally {
+ chStmt.close();
+ }
+ println("# of transactions: " + branchMap.size());
+
+ sql = String.format("select transaction_id, branch_id from %s where branch_id is null", tableName);
+ int counter = 0;
+ try {
+ chStmt.runPreparedQuery(10000, sql);
+ while (chStmt.next()) {
+ Integer branchId = branchMap.get(chStmt.getInt("transaction_id"));
+ if (branchId == null) {
+ println("map not not have branch id for transaction id: " + chStmt.getInt("transaction_id"));
+ } else {
+ chStmt.updateObject("branch_id", branchId);
+ chStmt.updateRow();
+ counter++;
+ }
+ }
+ } finally {
+ chStmt.close();
+ }
+
+ println("Updated " + counter + " rows");
+ }
} \ 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 2f47302b4e6..0f8e66b58c5 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
@@ -1,197 +1,200 @@
-/*******************************************************************************
- * 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.skynet.blam.operation;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.List;
-import java.util.logging.Level;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.osee.framework.core.data.SystemUser;
-import org.eclipse.osee.framework.core.enums.BranchArchivedState;
-import org.eclipse.osee.framework.core.enums.BranchState;
-import org.eclipse.osee.framework.core.exception.OseeArgumentException;
-import org.eclipse.osee.framework.core.exception.OseeCoreException;
-import org.eclipse.osee.framework.database.core.ConnectionHandler;
-import org.eclipse.osee.framework.database.core.IOseeStatement;
-import org.eclipse.osee.framework.jdk.core.util.AHTML;
-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.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;
-
-/**
- * @author Megumi Telles
- */
-public class PurgeArchivedBranch extends AbstractBlam {
- private static final String SELECT_ARCHIVED_BRANCHES =
- "select * from osee_branch where associated_art_id = ? and archived = ? and branch_state IN (?, ?)";
-
- private static final String SELECT_UNUSUAL_ARCHIVED_BRANCHES =
- "select * from osee_branch where associated_art_id = ? and archived = ? and branch_state NOT IN (?,?,?)";
-
- private static int systemUserArtId;
- private static boolean purgeBranches = false;
-
- @Override
- public String getName() {
- return "Purge Archived Branches";
- }
-
- @Override
- public void runOperation(VariableMap variableMap, IProgressMonitor monitor) throws Exception {
- purgeBranches = variableMap.getBoolean("Purge Branches");
- Displays.ensureInDisplayThread(new Runnable() {
- @Override
- public void run() {
- try {
- List<BranchInfo> branches = new ArrayList<BranchInfo>();
- List<BranchInfo> unusualBranches = new ArrayList<BranchInfo>();
- systemUserArtId = UserManager.getUser(SystemUser.OseeSystem).getArtId();
- branches = purgeSelectedBranches();
- if (purgeBranches) {
- confirmPurgeArchivedBranch(branches);
- }
- unusualBranches = checkUnusualArchivedBranches();
- displayReport(unusualBranches, "Unusual Archived Branches",
- "List of archived branches with unusual branch states: ");
- displayReport(branches, "Archived Branches", "List of archived branches to be purged: ");
- } catch (Exception ex) {
- OseeLog.log(SkynetGuiPlugin.class, Level.SEVERE, ex);
- }
- }
- });
- }
-
- private List<BranchInfo> purgeSelectedBranches() throws Exception {
- final List<BranchInfo> branches = new ArrayList<BranchInfo>();
- IOseeStatement chStmt = ConnectionHandler.getStatement();
- try {
- chStmt.runPreparedQuery(SELECT_ARCHIVED_BRANCHES, systemUserArtId, BranchArchivedState.ARCHIVED.getValue(),
- BranchState.REBASELINED.getValue(), BranchState.DELETED.getValue());
- while (chStmt.next()) {
- BranchInfo purgedBranch =
- new BranchInfo(chStmt.getString("branch_name"), chStmt.getInt("branch_id"), chStmt.getInt("archived"),
- BranchState.getBranchState(chStmt.getInt("branch_state")).name());
- branches.add(purgedBranch);
- }
- } finally {
- chStmt.close();
- }
- return branches;
- }
-
- private void confirmPurgeArchivedBranch(List<BranchInfo> branches) throws OseeCoreException {
- if (MessageDialog.openConfirm(Displays.getActiveShell(), "Purge Confirmation",
- "Do you wish to purge the archived branches: " + "?")) {
- //only delete archived branches that are not changed managed, rebaselined and deleted
- for (BranchInfo purgeBranch : branches) {
- try {
- BranchManager.purgeBranch(BranchManager.getBranch(Integer.valueOf(purgeBranch.getId())));
- } catch (OseeArgumentException ex) {
- OseeLog.log(SkynetGuiPlugin.class, Level.SEVERE, ex);
- }
- }
- }
- }
-
- private List<BranchInfo> checkUnusualArchivedBranches() throws Exception {
- // check to make sure archived branches are not in states other than Committed, Deleted, Rebaselined
- List<BranchInfo> branches = new ArrayList<BranchInfo>();
- IOseeStatement chStmt = ConnectionHandler.getStatement();
- try {
- chStmt.runPreparedQuery(SELECT_UNUSUAL_ARCHIVED_BRANCHES, systemUserArtId,
- BranchArchivedState.ARCHIVED.getValue(), BranchState.COMMITTED.getValue(),
- BranchState.REBASELINED.getValue(), BranchState.DELETED.getValue());
- while (chStmt.next()) {
- BranchInfo unusualBranch =
- new BranchInfo(chStmt.getString("branch_name"), chStmt.getInt("branch_id"), chStmt.getInt("archived"),
- BranchState.getBranchState(chStmt.getInt("branch_state")).name());
- branches.add(unusualBranch);
- }
- } finally {
- chStmt.close();
- }
- return branches;
- }
-
- private void displayReport(List<BranchInfo> branches, String name, String heading) throws OseeCoreException {
- XResultData rd = new XResultData();
- if (branches.size() > 0) {
- try {
- String[] columnHeaders = new String[] {"Branch Name", "Branch Id", "Archive State", "Branch State"};
- rd.addRaw(AHTML.heading(3, heading));
- rd.addRaw(AHTML.beginMultiColumnTable(100, 1));
- rd.addRaw(AHTML.addHeaderRowMultiColumnTable(columnHeaders));
- for (BranchInfo purgedBranch : branches) {
- rd.addRaw(AHTML.addRowMultiColumnTable(new String[] {purgedBranch.getName(), purgedBranch.getId(),
- purgedBranch.getArchived(), purgedBranch.getState()}));
- }
- rd.addRaw(AHTML.endMultiColumnTable());
-
- } finally {
- rd.report(name);
- }
- }
- }
-
- @Override
- public Collection<String> getCategories() {
- return Arrays.asList("Admin");
- }
-
- @Override
- public String getXWidgetsXml() {
- return "<xWidgets><XWidget xwidgetType=\"XCheckBox\" displayName=\"Purge Branches\" defaultValue=\"false\" labelAfter=\"true\" horizontalLabel=\"true\" /></xWidgets>";
- }
-
- @Override
- public String getDescriptionUsage() {
- return "Purge archived branches that are deleted, rebaselined and not changed managed";
- }
-
- private class BranchInfo {
- private final String name;
- private final int id;
- private final int archived;
- private final String state;
-
- public BranchInfo(String name, int id, int archived, String state) {
- this.name = name;
- this.id = id;
- this.archived = archived;
- this.state = state;
- }
-
- public String getName() {
- return name;
- }
-
- public String getId() {
- return Integer.toString(id);
- }
-
- public String getArchived() {
- return Integer.toString(archived);
- }
-
- public String getState() {
- return state;
- }
-
- }
+/*******************************************************************************
+ * 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.skynet.blam.operation;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.List;
+import java.util.logging.Level;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.osee.framework.core.data.SystemUser;
+import org.eclipse.osee.framework.core.enums.BranchArchivedState;
+import org.eclipse.osee.framework.core.enums.BranchState;
+import org.eclipse.osee.framework.core.exception.OseeArgumentException;
+import org.eclipse.osee.framework.core.exception.OseeCoreException;
+import org.eclipse.osee.framework.database.core.ConnectionHandler;
+import org.eclipse.osee.framework.database.core.IOseeStatement;
+import org.eclipse.osee.framework.jdk.core.util.AHTML;
+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.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;
+
+/**
+ * @author Megumi Telles
+ */
+public class PurgeArchivedBranch extends AbstractBlam {
+ private static final String SELECT_ARCHIVED_BRANCHES =
+ "select * from osee_branch where associated_art_id = ? and archived = ? and branch_state IN (?, ?)";
+
+ private static final String SELECT_UNUSUAL_ARCHIVED_BRANCHES =
+ "select * from osee_branch where associated_art_id = ? and archived = ? and branch_state NOT IN (?,?,?)";
+
+ private static int systemUserArtId;
+ private static boolean purgeBranches = false;
+
+ @Override
+ public String getName() {
+ return "Purge Archived Branches";
+ }
+
+ @Override
+ public void runOperation(VariableMap variableMap, IProgressMonitor monitor) throws Exception {
+ purgeBranches = variableMap.getBoolean("Purge Branches");
+ Displays.ensureInDisplayThread(new Runnable() {
+ @Override
+ public void run() {
+ try {
+ List<BranchInfo> branches = new ArrayList<BranchInfo>();
+ List<BranchInfo> unusualBranches = new ArrayList<BranchInfo>();
+ systemUserArtId = UserManager.getUser(SystemUser.OseeSystem).getArtId();
+ branches = purgeSelectedBranches();
+ if (purgeBranches) {
+ confirmPurgeArchivedBranch(branches);
+ }
+ unusualBranches = checkUnusualArchivedBranches();
+ displayReport(unusualBranches, "Unusual Archived Branches",
+ "List of archived branches with unusual branch states: ");
+ displayReport(branches, "Archived Branches", "List of archived branches to be purged: ");
+ } catch (Exception ex) {
+ OseeLog.log(SkynetGuiPlugin.class, Level.SEVERE, ex);
+ }
+ }
+ });
+ }
+
+ private List<BranchInfo> purgeSelectedBranches() throws Exception {
+ final List<BranchInfo> branches = new ArrayList<BranchInfo>();
+ IOseeStatement chStmt = ConnectionHandler.getStatement();
+ try {
+ chStmt.runPreparedQuery(SELECT_ARCHIVED_BRANCHES, systemUserArtId, BranchArchivedState.ARCHIVED.getValue(),
+ BranchState.REBASELINED.getValue(), BranchState.DELETED.getValue());
+ while (chStmt.next()) {
+ BranchInfo purgedBranch =
+ new BranchInfo(chStmt.getString("branch_name"), chStmt.getInt("branch_id"), chStmt.getInt("archived"),
+ BranchState.getBranchState(chStmt.getInt("branch_state")).name());
+ branches.add(purgedBranch);
+ }
+ } finally {
+ chStmt.close();
+ }
+ return branches;
+ }
+
+ private void confirmPurgeArchivedBranch(List<BranchInfo> branches) throws OseeCoreException {
+ if (MessageDialog.openConfirm(Displays.getActiveShell(), "Purge Confirmation",
+ "Do you wish to purge the archived branches: " + "?")) {
+ //only delete archived branches that are not changed managed, rebaselined and deleted
+ for (BranchInfo purgeBranch : branches) {
+ try {
+ BranchManager.purgeBranch(BranchManager.getBranch(Integer.valueOf(purgeBranch.getId())));
+ } catch (OseeArgumentException ex) {
+ OseeLog.log(SkynetGuiPlugin.class, Level.SEVERE, ex);
+ }
+ }
+ }
+ }
+
+ private List<BranchInfo> checkUnusualArchivedBranches() throws Exception {
+ // check to make sure archived branches are not in states other than Committed, Deleted, Rebaselined
+ List<BranchInfo> branches = new ArrayList<BranchInfo>();
+ IOseeStatement chStmt = ConnectionHandler.getStatement();
+ try {
+ chStmt.runPreparedQuery(SELECT_UNUSUAL_ARCHIVED_BRANCHES, systemUserArtId,
+ BranchArchivedState.ARCHIVED.getValue(), BranchState.COMMITTED.getValue(),
+ BranchState.REBASELINED.getValue(), BranchState.DELETED.getValue());
+ while (chStmt.next()) {
+ BranchInfo unusualBranch =
+ new BranchInfo(chStmt.getString("branch_name"), chStmt.getInt("branch_id"), chStmt.getInt("archived"),
+ BranchState.getBranchState(chStmt.getInt("branch_state")).name());
+ branches.add(unusualBranch);
+ }
+ } finally {
+ chStmt.close();
+ }
+ return branches;
+ }
+
+ private void displayReport(List<BranchInfo> branches, String name, String heading) throws OseeCoreException {
+ XResultData rd = new XResultData();
+ if (branches.size() > 0) {
+ try {
+ String[] columnHeaders = new String[] {"Branch Name", "Branch Id", "Archive State", "Branch State"};
+ rd.addRaw(AHTML.heading(3, heading));
+ rd.addRaw(AHTML.beginMultiColumnTable(100, 1));
+ rd.addRaw(AHTML.addHeaderRowMultiColumnTable(columnHeaders));
+ for (BranchInfo purgedBranch : branches) {
+ rd.addRaw(AHTML.addRowMultiColumnTable(new String[] {
+ purgedBranch.getName(),
+ purgedBranch.getId(),
+ purgedBranch.getArchived(),
+ purgedBranch.getState()}));
+ }
+ rd.addRaw(AHTML.endMultiColumnTable());
+
+ } finally {
+ rd.report(name);
+ }
+ }
+ }
+
+ @Override
+ public Collection<String> getCategories() {
+ return Arrays.asList("Admin");
+ }
+
+ @Override
+ public String getXWidgetsXml() {
+ return "<xWidgets><XWidget xwidgetType=\"XCheckBox\" displayName=\"Purge Branches\" defaultValue=\"false\" labelAfter=\"true\" horizontalLabel=\"true\" /></xWidgets>";
+ }
+
+ @Override
+ public String getDescriptionUsage() {
+ return "Purge archived branches that are deleted, rebaselined and not changed managed";
+ }
+
+ private class BranchInfo {
+ private final String name;
+ private final int id;
+ private final int archived;
+ private final String state;
+
+ public BranchInfo(String name, int id, int archived, String state) {
+ this.name = name;
+ this.id = id;
+ this.archived = archived;
+ this.state = state;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public String getId() {
+ return Integer.toString(id);
+ }
+
+ public String getArchived() {
+ return Integer.toString(archived);
+ }
+
+ public String getState() {
+ return state;
+ }
+
+ }
} \ 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/PurgeTransactionBlam.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/operation/PurgeTransactionBlam.java
index 0ccdbe81c0d..3163a6016f3 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/operation/PurgeTransactionBlam.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/operation/PurgeTransactionBlam.java
@@ -1,59 +1,59 @@
-/*******************************************************************************
- * 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.skynet.blam.operation;
-
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.List;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.osee.framework.jdk.core.util.Lib;
-import org.eclipse.osee.framework.skynet.core.artifact.BranchManager;
-import org.eclipse.osee.framework.ui.skynet.blam.AbstractBlam;
-import org.eclipse.osee.framework.ui.skynet.blam.VariableMap;
-
-/**
- * @author Ryan D. Brooks
- */
-public class PurgeTransactionBlam extends AbstractBlam {
-
- @Override
- public String getName() {
- return "Purge Transaction";
- }
-
- @Override
- public void runOperation(VariableMap variableMap, IProgressMonitor monitor) throws Exception {
- List<Integer> txs = Lib.stringToIntegerList(variableMap.getString("Transaction List"));
- boolean force = variableMap.getBoolean("Force Delete");
- int[] txIds = new int[txs.size()];
- for (int index = 0; index < txs.size(); index++) {
- txIds[index] = txs.get(index);
- }
- Job job = BranchManager.purgeTransactions(null, force, txIds);
- job.join();
- }
-
- @Override
- public String getXWidgetsXml() {
- StringBuilder builder = new StringBuilder();
- builder.append("<xWidgets>");
- builder.append("<XWidget xwidgetType=\"XText\" displayName=\"Transaction List\" />");
- builder.append("<XWidget xwidgetType=\"XCheckBox\" displayName=\"Force Delete\" />");
- builder.append("</xWidgets>");
- return builder.toString();
- }
-
- @Override
- public Collection<String> getCategories() {
- return Arrays.asList("Admin");
- }
+/*******************************************************************************
+ * 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.skynet.blam.operation;
+
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.List;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.osee.framework.jdk.core.util.Lib;
+import org.eclipse.osee.framework.skynet.core.artifact.BranchManager;
+import org.eclipse.osee.framework.ui.skynet.blam.AbstractBlam;
+import org.eclipse.osee.framework.ui.skynet.blam.VariableMap;
+
+/**
+ * @author Ryan D. Brooks
+ */
+public class PurgeTransactionBlam extends AbstractBlam {
+
+ @Override
+ public String getName() {
+ return "Purge Transaction";
+ }
+
+ @Override
+ public void runOperation(VariableMap variableMap, IProgressMonitor monitor) throws Exception {
+ List<Integer> txs = Lib.stringToIntegerList(variableMap.getString("Transaction List"));
+ boolean force = variableMap.getBoolean("Force Delete");
+ int[] txIds = new int[txs.size()];
+ for (int index = 0; index < txs.size(); index++) {
+ txIds[index] = txs.get(index);
+ }
+ Job job = BranchManager.purgeTransactions(null, force, txIds);
+ job.join();
+ }
+
+ @Override
+ public String getXWidgetsXml() {
+ StringBuilder builder = new StringBuilder();
+ builder.append("<xWidgets>");
+ builder.append("<XWidget xwidgetType=\"XText\" displayName=\"Transaction List\" />");
+ builder.append("<XWidget xwidgetType=\"XCheckBox\" displayName=\"Force Delete\" />");
+ builder.append("</xWidgets>");
+ return builder.toString();
+ }
+
+ @Override
+ public Collection<String> getCategories() {
+ return Arrays.asList("Admin");
+ }
} \ 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/ReportAttributeTypesUsageBlam.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/operation/ReportAttributeTypesUsageBlam.java
index 77033bab97c..9227a3e27f7 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/operation/ReportAttributeTypesUsageBlam.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/operation/ReportAttributeTypesUsageBlam.java
@@ -1,67 +1,67 @@
-/*******************************************************************************
- * 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.skynet.blam.operation;
-
-import java.util.Arrays;
-import java.util.Collection;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.osee.framework.core.model.Branch;
-import org.eclipse.osee.framework.core.model.type.AttributeType;
-import org.eclipse.osee.framework.jdk.core.util.AHTML;
-import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
-import org.eclipse.osee.framework.skynet.core.artifact.search.ArtifactQuery;
-import org.eclipse.osee.framework.skynet.core.attribute.AttributeTypeManager;
-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;
-
-/**
- * @author Donald G. Dunne
- */
-public class ReportAttributeTypesUsageBlam extends AbstractBlam {
-
- @Override
- public String getName() {
- return "Report Attribute Types Usage";
- }
-
- @Override
- public void runOperation(VariableMap variableMap, IProgressMonitor monitor) throws Exception {
- monitor.beginTask("Report Usage of AttributeTypes on Branch", IProgressMonitor.UNKNOWN);
-
- XResultData xResultData = new XResultData();
- Branch branch = variableMap.getBranch("Branch");
- xResultData.log(getName() + " " + branch.getName());
- xResultData.addRaw(AHTML.beginMultiColumnTable(100, 1));
- xResultData.addRaw(AHTML.addHeaderRowMultiColumnTable(new String[] {"AttributeType", "Occurances"}));
- for (AttributeType attributeType : AttributeTypeManager.getAllTypes()) {
- Collection<Artifact> arts = ArtifactQuery.getArtifactListFromAttributeType(attributeType, branch);
- xResultData.addRaw(AHTML.addRowMultiColumnTable(attributeType.getName(), String.valueOf(arts.size())));
- }
- xResultData.addRaw(AHTML.endMultiColumnTable());
- xResultData.report(getName() + " " + branch.getName());
- }
-
- @Override
- public String getXWidgetsXml() {
- return "<xWidgets><XWidget xwidgetType=\"XBranchSelectWidget\" displayName=\"Branch\" /></xWidgets>";
- }
-
- @Override
- public String getDescriptionUsage() {
- return "Performs ArtifactQuery search on all attribyte types for a selected branch and reports usage by \"current\" artifacts.";
- }
-
- @Override
- public Collection<String> getCategories() {
- return Arrays.asList("Admin");
- }
+/*******************************************************************************
+ * 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.skynet.blam.operation;
+
+import java.util.Arrays;
+import java.util.Collection;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.osee.framework.core.model.Branch;
+import org.eclipse.osee.framework.core.model.type.AttributeType;
+import org.eclipse.osee.framework.jdk.core.util.AHTML;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.skynet.core.artifact.search.ArtifactQuery;
+import org.eclipse.osee.framework.skynet.core.attribute.AttributeTypeManager;
+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;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class ReportAttributeTypesUsageBlam extends AbstractBlam {
+
+ @Override
+ public String getName() {
+ return "Report Attribute Types Usage";
+ }
+
+ @Override
+ public void runOperation(VariableMap variableMap, IProgressMonitor monitor) throws Exception {
+ monitor.beginTask("Report Usage of AttributeTypes on Branch", IProgressMonitor.UNKNOWN);
+
+ XResultData xResultData = new XResultData();
+ Branch branch = variableMap.getBranch("Branch");
+ xResultData.log(getName() + " " + branch.getName());
+ xResultData.addRaw(AHTML.beginMultiColumnTable(100, 1));
+ xResultData.addRaw(AHTML.addHeaderRowMultiColumnTable(new String[] {"AttributeType", "Occurances"}));
+ for (AttributeType attributeType : AttributeTypeManager.getAllTypes()) {
+ Collection<Artifact> arts = ArtifactQuery.getArtifactListFromAttributeType(attributeType, branch);
+ xResultData.addRaw(AHTML.addRowMultiColumnTable(attributeType.getName(), String.valueOf(arts.size())));
+ }
+ xResultData.addRaw(AHTML.endMultiColumnTable());
+ xResultData.report(getName() + " " + branch.getName());
+ }
+
+ @Override
+ public String getXWidgetsXml() {
+ return "<xWidgets><XWidget xwidgetType=\"XBranchSelectWidget\" displayName=\"Branch\" /></xWidgets>";
+ }
+
+ @Override
+ public String getDescriptionUsage() {
+ return "Performs ArtifactQuery search on all attribyte types for a selected branch and reports usage by \"current\" artifacts.";
+ }
+
+ @Override
+ public Collection<String> getCategories() {
+ return Arrays.asList("Admin");
+ }
} \ 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/ResourceManipulation.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/operation/ResourceManipulation.java
index 24f6328bfcd..a087ef25eff 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/operation/ResourceManipulation.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/operation/ResourceManipulation.java
@@ -1,460 +1,475 @@
-/*******************************************************************************
- * 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.skynet.blam.operation;
-
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.net.HttpURLConnection;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-import java.util.logging.Level;
-import java.util.zip.ZipEntry;
-import java.util.zip.ZipInputStream;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.osee.framework.core.client.ClientSessionManager;
-import org.eclipse.osee.framework.core.client.server.HttpUrlBuilderClient;
-import org.eclipse.osee.framework.core.data.OseeServerContext;
-import org.eclipse.osee.framework.core.enums.CoreAttributeTypes;
-import org.eclipse.osee.framework.core.exception.OseeCoreException;
-import org.eclipse.osee.framework.core.exception.OseeExceptions;
-import org.eclipse.osee.framework.core.util.HttpProcessor;
-import org.eclipse.osee.framework.core.util.HttpProcessor.AcquireResult;
-import org.eclipse.osee.framework.database.core.ConnectionHandler;
-import org.eclipse.osee.framework.database.core.IOseeStatement;
-import org.eclipse.osee.framework.jdk.core.util.AHTML;
-import org.eclipse.osee.framework.jdk.core.util.Lib;
-import org.eclipse.osee.framework.jdk.core.util.Strings;
-import org.eclipse.osee.framework.logging.OseeLog;
-import org.eclipse.osee.framework.plugin.core.util.OseeData;
-import org.eclipse.osee.framework.skynet.core.attribute.AttributeTypeManager;
-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.skynet.results.html.XResultPage.Manipulations;
-
-/**
- * @author Jeff C. Phillips
- * @author Theron Virgin
- */
-public class ResourceManipulation extends AbstractBlam {
- private static final boolean DEBUG =
- Boolean.parseBoolean(Platform.getDebugOption("org.eclipse.osee.framework.ui.skynet/debug/Blam"));
-
- private static final String GET_ATTRS =
- "SELECT DISTINCT(art.human_readable_id), attr.gamma_id, attr.uri FROM osee_attribute attr, osee_artifact art WHERE attr.attr_type_id = ? AND attr.art_id = art.art_id AND attr.uri is not null AND attr.uri != ''";
- private static final String GET_ATTRS_TEST = GET_ATTRS + " AND t1.gamma_id = 4259157";
-
- private final Collection<String> badData = new LinkedList<String>();
- private static final String[] columnHeaders = new String[] {"Corrupted Data"};
-
- private static File createTempFolder() {
- File rootDirectory = OseeData.getFile("FixTemplate_" + Lib.getDateTimeString() + File.separator);
- rootDirectory.mkdirs();
- return rootDirectory;
- }
-
- @Override
- public String getName() {
- return "Resource Manipulation";
- }
-
- @SuppressWarnings("unused")
- @Override
- public void runOperation(VariableMap variableMap, IProgressMonitor monitor) throws Exception {
- File backupFolder = createTempFolder();
- OseeLog.log(SkynetGuiPlugin.class, Level.INFO,
- String.format("Backup Folder location: [%s]", backupFolder.getAbsolutePath()));
-
- if (true) {
- System.out.println("An admin must enable this operation");
- return;
- }
- ArrayList<AttrData> attrDatas = loadAttrData();
- monitor.beginTask("Fix word template content", attrDatas.size());
- for (AttrData attrData : attrDatas) {
- monitor.subTask(attrData.getHrid());
- Resource resource = getResource(attrData.getUri());
- byte[] originalData = resource.data;
- byte[] finalVersion = new byte[0];
- int count = 0;
- int countlast = 0;
- System.out.println(" " + attrData.getUri() + " " + attrData.getGammaId());
- List<Byte> badByteBuffer = new LinkedList<Byte>();
- int byteCount = 0;
- int initialByte = 0;
- int startByte = 0;
- for (byte byt : originalData) {
- if (byt < 0) {
- if (count == 0) {
- initialByte = byteCount;
- badByteBuffer.clear();
- }
- badByteBuffer.add(new Byte(byt).byteValue());
- String value = UnicodeConverter.getValue(badByteBuffer);
- if (value != null) {
- if (value.contains("GOOD")) {
- System.out.println(String.format(" Found the Clean Value %s", value));
- System.out.print(" ");
- for (byte byter : badByteBuffer) {
- System.out.print(byter + ", ");
- }
- System.out.println();
- } else {
- byte[] goodBytes = UnicodeConverter.getGoodBytes(value);
- System.out.println(String.format(" Found the Value %s", value));
- System.out.print(" ");
- finalVersion = fixBytes(startByte, initialByte, goodBytes, finalVersion, originalData);
- startByte = finalVersion.length + 1;
- for (byte byter : badByteBuffer) {
- System.out.print(byter + ", ");
- }
- System.out.println();
- System.out.print(" ");
- for (byte byter : goodBytes) {
- System.out.print(byter + ", ");
- }
- System.out.println();
- startByte = byteCount + 1;
- }
- count = 0;
- } else {
- count++;
- }
- } else {
- if (count > 0) {
- System.out.println("Couldn't Find the Value for");
- for (byte byter : badByteBuffer) {
- System.out.print(byter + ", ");
- }
- System.out.println("");
- }
- count = 0;
- badByteBuffer.clear();
- }
- byteCount++;
-
- //Need to add on the tail if needs be
- }
-
- finalVersion = addTail(startByte, finalVersion, originalData);
- count = 0;
- countlast = 0;
- System.out.println("ORIGINAL");
- for (byte byt : originalData) {
- count++;
- if (byt < 0) {
- if (countlast + 1 != count) {
- System.out.println("");
- }
- System.out.println(count + " " + byt + " " + new String(new byte[] {originalData[count - 8],
- originalData[count - 7], originalData[count - 6], originalData[count - 5], originalData[count - 4],
- originalData[count - 3], originalData[count - 2], originalData[count - 1], originalData[count],
- originalData[count + 1], originalData[count + 2], originalData[count + 3], originalData[count + 4],
- originalData[count + 5], originalData[count + 6]}, "UTF-8"));
- countlast = count;
- }
- }
-
- System.out.println("FIXED");
- count = 0;
- countlast = 0;
- for (byte byt : finalVersion) {
- count++;
- if (byt < 0) {
- if (countlast + 1 != count) {
- System.out.println("");
- }
- System.out.println(count + " " + byt + " " + new String(new byte[] {finalVersion[count - 9],
- finalVersion[count - 8], finalVersion[count - 7], finalVersion[count - 6], finalVersion[count - 5],
- finalVersion[count - 4], finalVersion[count - 3], finalVersion[count - 2], finalVersion[count - 1],
- finalVersion[count], finalVersion[count + 1], finalVersion[count + 2], finalVersion[count + 3],
- finalVersion[count + 4], finalVersion[count + 5], finalVersion[count + 6]}, "UTF-8"));
- countlast = count;
- }
- }
-
- try {
- // Backup File
- backupResourceLocally(backupFolder, resource);
-
- // Perform Fix
-
- resource.data = finalVersion;
- // = new String(WordTemplateRenderer.getFormattedContent(rootElement), "UTF-8");
- // resource.encoding = "UTF-8";
- //
-
- // UploadResource
- uploadResource(attrData.getGammaId(), resource);
-
- if (DEBUG) {
- OseeLog.log(SkynetGuiPlugin.class, Level.INFO, String.format(" After Fix : %s", resource.data));
- }
- } catch (Exception ex) {
- OseeLog.log(SkynetGuiPlugin.class, Level.SEVERE,
- String.format("Skiping File %s because of exception %s", attrData.getHrid(), ex));
- }
- monitor.worked(1);
- }
-
- StringBuffer sbFull = new StringBuffer(AHTML.beginMultiColumnTable(100, 1));
- sbFull.append(AHTML.beginMultiColumnTable(100, 1));
- sbFull.append(AHTML.addHeaderRowMultiColumnTable(columnHeaders));
- for (String string : badData) {
- sbFull.append(AHTML.addRowMultiColumnTable(new String[] {string}));
- }
- sbFull.append(AHTML.endMultiColumnTable());
- XResultData rd = new XResultData();
- rd.addRaw(sbFull.toString());
- rd.report("Fix bad data", Manipulations.RAW_HTML);
- }
-
- /**
- * @param startByte
- * @param initialByte
- * @param goodBytes
- * @param finalVersion
- * @return
- */
- private byte[] fixBytes(int startByte, int initialByte, byte[] goodBytes, byte[] finalVersion, byte[] originalData) {
- byte[] fixed = new byte[initialByte - startByte + goodBytes.length + finalVersion.length];
- int count = 0;
- for (byte byt : finalVersion) {
- fixed[count] = byt;
- count++;
- }
- for (int x = startByte; x < initialByte; x++) {
- fixed[count] = originalData[x];
- count++;
- }
- for (byte byt : goodBytes) {
- fixed[count] = byt;
- count++;
- }
- return fixed;
- }
-
- /**
- * @param startByte
- * @param initialByte
- * @param goodBytes
- * @param finalVersion
- * @return
- */
- private byte[] addTail(int startByte, byte[] finalVersion, byte[] originalData) {
- byte[] fixed = new byte[originalData.length - startByte + finalVersion.length];
- int count = 0;
- for (byte byt : finalVersion) {
- fixed[count] = byt;
- count++;
- }
- for (int x = startByte; x < originalData.length; x++) {
- fixed[count] = originalData[x];
- count++;
- }
- return fixed;
- }
-
- private ArrayList<AttrData> loadAttrData() throws OseeCoreException {
- ArrayList<AttrData> attrData = new ArrayList<AttrData>();
-
- IOseeStatement chStmt = ConnectionHandler.getStatement();
- try {
+/*******************************************************************************
+ * 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.skynet.blam.operation;
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.net.HttpURLConnection;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+import java.util.logging.Level;
+import java.util.zip.ZipEntry;
+import java.util.zip.ZipInputStream;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.osee.framework.core.client.ClientSessionManager;
+import org.eclipse.osee.framework.core.client.server.HttpUrlBuilderClient;
+import org.eclipse.osee.framework.core.data.OseeServerContext;
+import org.eclipse.osee.framework.core.enums.CoreAttributeTypes;
+import org.eclipse.osee.framework.core.exception.OseeCoreException;
+import org.eclipse.osee.framework.core.exception.OseeExceptions;
+import org.eclipse.osee.framework.core.util.HttpProcessor;
+import org.eclipse.osee.framework.core.util.HttpProcessor.AcquireResult;
+import org.eclipse.osee.framework.database.core.ConnectionHandler;
+import org.eclipse.osee.framework.database.core.IOseeStatement;
+import org.eclipse.osee.framework.jdk.core.util.AHTML;
+import org.eclipse.osee.framework.jdk.core.util.Lib;
+import org.eclipse.osee.framework.jdk.core.util.Strings;
+import org.eclipse.osee.framework.logging.OseeLog;
+import org.eclipse.osee.framework.plugin.core.util.OseeData;
+import org.eclipse.osee.framework.skynet.core.attribute.AttributeTypeManager;
+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.skynet.results.html.XResultPage.Manipulations;
+
+/**
+ * @author Jeff C. Phillips
+ * @author Theron Virgin
+ */
+public class ResourceManipulation extends AbstractBlam {
+ private static final boolean DEBUG =
+ Boolean.parseBoolean(Platform.getDebugOption("org.eclipse.osee.framework.ui.skynet/debug/Blam"));
+
+ private static final String GET_ATTRS =
+ "SELECT DISTINCT(art.human_readable_id), attr.gamma_id, attr.uri FROM osee_attribute attr, osee_artifact art WHERE attr.attr_type_id = ? AND attr.art_id = art.art_id AND attr.uri is not null AND attr.uri != ''";
+ private static final String GET_ATTRS_TEST = GET_ATTRS + " AND t1.gamma_id = 4259157";
+
+ private final Collection<String> badData = new LinkedList<String>();
+ private static final String[] columnHeaders = new String[] {"Corrupted Data"};
+
+ private static File createTempFolder() {
+ File rootDirectory = OseeData.getFile("FixTemplate_" + Lib.getDateTimeString() + File.separator);
+ rootDirectory.mkdirs();
+ return rootDirectory;
+ }
+
+ @Override
+ public String getName() {
+ return "Resource Manipulation";
+ }
+
+ @SuppressWarnings("unused")
+ @Override
+ public void runOperation(VariableMap variableMap, IProgressMonitor monitor) throws Exception {
+ File backupFolder = createTempFolder();
+ OseeLog.log(SkynetGuiPlugin.class, Level.INFO,
+ String.format("Backup Folder location: [%s]", backupFolder.getAbsolutePath()));
+
+ if (true) {
+ System.out.println("An admin must enable this operation");
+ return;
+ }
+ ArrayList<AttrData> attrDatas = loadAttrData();
+ monitor.beginTask("Fix word template content", attrDatas.size());
+ for (AttrData attrData : attrDatas) {
+ monitor.subTask(attrData.getHrid());
+ Resource resource = getResource(attrData.getUri());
+ byte[] originalData = resource.data;
+ byte[] finalVersion = new byte[0];
+ int count = 0;
+ int countlast = 0;
+ System.out.println(" " + attrData.getUri() + " " + attrData.getGammaId());
+ List<Byte> badByteBuffer = new LinkedList<Byte>();
+ int byteCount = 0;
+ int initialByte = 0;
+ int startByte = 0;
+ for (byte byt : originalData) {
+ if (byt < 0) {
+ if (count == 0) {
+ initialByte = byteCount;
+ badByteBuffer.clear();
+ }
+ badByteBuffer.add(new Byte(byt).byteValue());
+ String value = UnicodeConverter.getValue(badByteBuffer);
+ if (value != null) {
+ if (value.contains("GOOD")) {
+ System.out.println(String.format(" Found the Clean Value %s", value));
+ System.out.print(" ");
+ for (byte byter : badByteBuffer) {
+ System.out.print(byter + ", ");
+ }
+ System.out.println();
+ } else {
+ byte[] goodBytes = UnicodeConverter.getGoodBytes(value);
+ System.out.println(String.format(" Found the Value %s", value));
+ System.out.print(" ");
+ finalVersion = fixBytes(startByte, initialByte, goodBytes, finalVersion, originalData);
+ startByte = finalVersion.length + 1;
+ for (byte byter : badByteBuffer) {
+ System.out.print(byter + ", ");
+ }
+ System.out.println();
+ System.out.print(" ");
+ for (byte byter : goodBytes) {
+ System.out.print(byter + ", ");
+ }
+ System.out.println();
+ startByte = byteCount + 1;
+ }
+ count = 0;
+ } else {
+ count++;
+ }
+ } else {
+ if (count > 0) {
+ System.out.println("Couldn't Find the Value for");
+ for (byte byter : badByteBuffer) {
+ System.out.print(byter + ", ");
+ }
+ System.out.println("");
+ }
+ count = 0;
+ badByteBuffer.clear();
+ }
+ byteCount++;
+
+ //Need to add on the tail if needs be
+ }
+
+ finalVersion = addTail(startByte, finalVersion, originalData);
+ count = 0;
+ countlast = 0;
+ System.out.println("ORIGINAL");
+ for (byte byt : originalData) {
+ count++;
+ if (byt < 0) {
+ if (countlast + 1 != count) {
+ System.out.println("");
+ }
+ System.out.println(count + " " + byt + " " + new String(new byte[] {
+ originalData[count - 8],
+ originalData[count - 7],
+ originalData[count - 6],
+ originalData[count - 5],
+ originalData[count - 4],
+ originalData[count - 3],
+ originalData[count - 2],
+ originalData[count - 1],
+ originalData[count],
+ originalData[count + 1],
+ originalData[count + 2],
+ originalData[count + 3],
+ originalData[count + 4],
+ originalData[count + 5],
+ originalData[count + 6]}, "UTF-8"));
+ countlast = count;
+ }
+ }
+
+ System.out.println("FIXED");
+ count = 0;
+ countlast = 0;
+ for (byte byt : finalVersion) {
+ count++;
+ if (byt < 0) {
+ if (countlast + 1 != count) {
+ System.out.println("");
+ }
+ System.out.println(count + " " + byt + " " + new String(new byte[] {
+ finalVersion[count - 9],
+ finalVersion[count - 8],
+ finalVersion[count - 7],
+ finalVersion[count - 6],
+ finalVersion[count - 5],
+ finalVersion[count - 4],
+ finalVersion[count - 3],
+ finalVersion[count - 2],
+ finalVersion[count - 1],
+ finalVersion[count],
+ finalVersion[count + 1],
+ finalVersion[count + 2],
+ finalVersion[count + 3],
+ finalVersion[count + 4],
+ finalVersion[count + 5],
+ finalVersion[count + 6]}, "UTF-8"));
+ countlast = count;
+ }
+ }
+
+ try {
+ // Backup File
+ backupResourceLocally(backupFolder, resource);
+
+ // Perform Fix
+
+ resource.data = finalVersion;
+ // = new String(WordTemplateRenderer.getFormattedContent(rootElement), "UTF-8");
+ // resource.encoding = "UTF-8";
+ //
+
+ // UploadResource
+ uploadResource(attrData.getGammaId(), resource);
+
+ if (DEBUG) {
+ OseeLog.log(SkynetGuiPlugin.class, Level.INFO, String.format(" After Fix : %s", resource.data));
+ }
+ } catch (Exception ex) {
+ OseeLog.log(SkynetGuiPlugin.class, Level.SEVERE,
+ String.format("Skiping File %s because of exception %s", attrData.getHrid(), ex));
+ }
+ monitor.worked(1);
+ }
+
+ StringBuffer sbFull = new StringBuffer(AHTML.beginMultiColumnTable(100, 1));
+ sbFull.append(AHTML.beginMultiColumnTable(100, 1));
+ sbFull.append(AHTML.addHeaderRowMultiColumnTable(columnHeaders));
+ for (String string : badData) {
+ sbFull.append(AHTML.addRowMultiColumnTable(new String[] {string}));
+ }
+ sbFull.append(AHTML.endMultiColumnTable());
+ XResultData rd = new XResultData();
+ rd.addRaw(sbFull.toString());
+ rd.report("Fix bad data", Manipulations.RAW_HTML);
+ }
+
+ /**
+ * @return
+ */
+ private byte[] fixBytes(int startByte, int initialByte, byte[] goodBytes, byte[] finalVersion, byte[] originalData) {
+ byte[] fixed = new byte[initialByte - startByte + goodBytes.length + finalVersion.length];
+ int count = 0;
+ for (byte byt : finalVersion) {
+ fixed[count] = byt;
+ count++;
+ }
+ for (int x = startByte; x < initialByte; x++) {
+ fixed[count] = originalData[x];
+ count++;
+ }
+ for (byte byt : goodBytes) {
+ fixed[count] = byt;
+ count++;
+ }
+ return fixed;
+ }
+
+ /**
+ * @return
+ */
+ private byte[] addTail(int startByte, byte[] finalVersion, byte[] originalData) {
+ byte[] fixed = new byte[originalData.length - startByte + finalVersion.length];
+ int count = 0;
+ for (byte byt : finalVersion) {
+ fixed[count] = byt;
+ count++;
+ }
+ for (int x = startByte; x < originalData.length; x++) {
+ fixed[count] = originalData[x];
+ count++;
+ }
+ return fixed;
+ }
+
+ private ArrayList<AttrData> loadAttrData() throws OseeCoreException {
+ ArrayList<AttrData> attrData = new ArrayList<AttrData>();
+
+ IOseeStatement chStmt = ConnectionHandler.getStatement();
+ try {
chStmt.runPreparedQuery(GET_ATTRS_TEST, AttributeTypeManager.getTypeId(CoreAttributeTypes.WordTemplateContent));
- while (chStmt.next()) {
- attrData.add(new AttrData(chStmt.getString("gamma_Id"), chStmt.getString("human_readable_id"),
- chStmt.getString("uri")));
- }
- } finally {
- chStmt.close();
- }
- return attrData;
- }
-
- private static void uploadResource(String gammaId, Resource resource) throws Exception {
- String fileName = resource.resourceName;
- Map<String, String> parameterMap = new HashMap<String, String>();
- parameterMap.put("sessionId", ClientSessionManager.getSessionId());
- parameterMap.put("is.overwrite.allowed", String.valueOf(true));
- parameterMap.put("protocol", "attr");
- parameterMap.put("seed", gammaId);
-
- String extension = Lib.getExtension(fileName);
- if (Strings.isValid(extension)) {
- parameterMap.put("extension", extension);
- int charToRemove = extension.length() + 1;
- fileName = fileName.substring(0, fileName.length() - charToRemove);
- }
- parameterMap.put("name", fileName);
-
- byte[] toUpload = resource.data;
- if (resource.wasZipped) {
- toUpload = Lib.compressStream(new ByteArrayInputStream(toUpload), resource.entryName);
- }
-
- String urlString =
- HttpUrlBuilderClient.getInstance().getOsgiServletServiceUrl(OseeServerContext.RESOURCE_CONTEXT, parameterMap);
- HttpProcessor.put(new URL(urlString), new ByteArrayInputStream(toUpload), resource.result.getContentType(),
- resource.result.getEncoding());
- }
-
- private Resource getResource(String resourcePath) throws OseeCoreException {
- Resource toReturn = null;
- ByteArrayOutputStream sourceOutputStream = new ByteArrayOutputStream();
- try {
- Map<String, String> parameterMap = new HashMap<String, String>();
- parameterMap.put("sessionId", ClientSessionManager.getSessionId());
- parameterMap.put("uri", resourcePath);
- String urlString =
- HttpUrlBuilderClient.getInstance().getOsgiServletServiceUrl(OseeServerContext.RESOURCE_CONTEXT,
- parameterMap);
-
- AcquireResult result = HttpProcessor.acquire(new URL(urlString), sourceOutputStream);
- if (result.getCode() == HttpURLConnection.HTTP_OK) {
- toReturn = new Resource(resourcePath, result, sourceOutputStream.toByteArray());
- }
- } catch (Exception ex) {
- OseeExceptions.wrapAndThrow(ex);
- } finally {
- try {
- sourceOutputStream.close();
- } catch (IOException ex) {
- OseeExceptions.wrapAndThrow(ex);
- }
- }
- return toReturn;
- }
-
- private final class Resource {
- private final String entryName;
- private final String resourceName;
- private final AcquireResult result;
- private final byte[] rawBytes;
- private final boolean wasZipped;
- private final String sourcePath;
-
- private byte[] data;
-
- // private String encoding;
-
- private Resource(String sourcePath, AcquireResult result, byte[] rawBytes) throws IOException {
- this.rawBytes = rawBytes;
- this.result = result;
- int index = sourcePath.lastIndexOf('/');
- this.sourcePath = sourcePath;
- this.resourceName = sourcePath.substring(index + 1, sourcePath.length());
- this.wasZipped = result.getContentType().contains("zip");
- if (wasZipped) {
- ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
- this.entryName = decompressStream(new ByteArrayInputStream(rawBytes), outputStream);
- // this.encoding = "UTF-8";
- this.data = outputStream.toByteArray();
- } else {
- this.data = rawBytes;
- this.entryName = null;
- // this.encoding = result.getEncoding();
- }
- }
- }
-
- private static void backupResourceLocally(File backupFolder, Resource resource) throws IOException {
- InputStream inputStream = null;
- OutputStream outputStream = null;
- try {
- String path = resource.sourcePath.replace("attr://", "");
- //path = path.replaceAll("/", File.separator);
-
- File file = new File(backupFolder, path);
- file.getParentFile().mkdirs();
-
- outputStream = new FileOutputStream(file);
-
- inputStream = new ByteArrayInputStream(resource.rawBytes);
- Lib.inputStreamToOutputStream(inputStream, outputStream);
- } finally {
- if (inputStream != null) {
- inputStream.close();
- }
- if (outputStream != null) {
- outputStream.close();
- }
- }
- }
-
- private static String decompressStream(InputStream inputStream, OutputStream outputStream) throws IOException {
- String zipEntryName = null;
- ZipInputStream zipInputStream = null;
- try {
- zipInputStream = new ZipInputStream(inputStream);
- ZipEntry entry = zipInputStream.getNextEntry();
- zipEntryName = entry.getName();
- // Transfer bytes from the ZIP file to the output file
- byte[] buf = new byte[1024];
- int len;
- while ((len = zipInputStream.read(buf)) > 0) {
- outputStream.write(buf, 0, len);
- }
- } finally {
- if (zipInputStream != null) {
- zipInputStream.close();
- }
- }
- return zipEntryName;
- }
-
- @Override
- public String getXWidgetsXml() {
- return AbstractBlam.emptyXWidgetsXml;
- }
-
- class AttrData {
- private final String gammaId;
- private final String hrid;
- private final String uri;
-
- public AttrData(String gammaId, String hrid, String uri) {
- super();
- this.gammaId = gammaId;
- this.hrid = hrid;
- this.uri = uri;
- }
-
- public String getGammaId() {
- return gammaId;
- }
-
- public String getHrid() {
- return hrid;
- }
-
- public String getUri() {
- return uri;
- }
- }
-
- @Override
- public Collection<String> getCategories() {
- return Arrays.asList("Admin");
- }
-}
+ while (chStmt.next()) {
+ attrData.add(new AttrData(chStmt.getString("gamma_Id"), chStmt.getString("human_readable_id"),
+ chStmt.getString("uri")));
+ }
+ } finally {
+ chStmt.close();
+ }
+ return attrData;
+ }
+
+ private static void uploadResource(String gammaId, Resource resource) throws Exception {
+ String fileName = resource.resourceName;
+ Map<String, String> parameterMap = new HashMap<String, String>();
+ parameterMap.put("sessionId", ClientSessionManager.getSessionId());
+ parameterMap.put("is.overwrite.allowed", String.valueOf(true));
+ parameterMap.put("protocol", "attr");
+ parameterMap.put("seed", gammaId);
+
+ String extension = Lib.getExtension(fileName);
+ if (Strings.isValid(extension)) {
+ parameterMap.put("extension", extension);
+ int charToRemove = extension.length() + 1;
+ fileName = fileName.substring(0, fileName.length() - charToRemove);
+ }
+ parameterMap.put("name", fileName);
+
+ byte[] toUpload = resource.data;
+ if (resource.wasZipped) {
+ toUpload = Lib.compressStream(new ByteArrayInputStream(toUpload), resource.entryName);
+ }
+
+ String urlString =
+ HttpUrlBuilderClient.getInstance().getOsgiServletServiceUrl(OseeServerContext.RESOURCE_CONTEXT, parameterMap);
+ HttpProcessor.put(new URL(urlString), new ByteArrayInputStream(toUpload), resource.result.getContentType(),
+ resource.result.getEncoding());
+ }
+
+ private Resource getResource(String resourcePath) throws OseeCoreException {
+ Resource toReturn = null;
+ ByteArrayOutputStream sourceOutputStream = new ByteArrayOutputStream();
+ try {
+ Map<String, String> parameterMap = new HashMap<String, String>();
+ parameterMap.put("sessionId", ClientSessionManager.getSessionId());
+ parameterMap.put("uri", resourcePath);
+ String urlString =
+ HttpUrlBuilderClient.getInstance().getOsgiServletServiceUrl(OseeServerContext.RESOURCE_CONTEXT,
+ parameterMap);
+
+ AcquireResult result = HttpProcessor.acquire(new URL(urlString), sourceOutputStream);
+ if (result.getCode() == HttpURLConnection.HTTP_OK) {
+ toReturn = new Resource(resourcePath, result, sourceOutputStream.toByteArray());
+ }
+ } catch (Exception ex) {
+ OseeExceptions.wrapAndThrow(ex);
+ } finally {
+ try {
+ sourceOutputStream.close();
+ } catch (IOException ex) {
+ OseeExceptions.wrapAndThrow(ex);
+ }
+ }
+ return toReturn;
+ }
+
+ private final class Resource {
+ private final String entryName;
+ private final String resourceName;
+ private final AcquireResult result;
+ private final byte[] rawBytes;
+ private final boolean wasZipped;
+ private final String sourcePath;
+
+ private byte[] data;
+
+ // private String encoding;
+
+ private Resource(String sourcePath, AcquireResult result, byte[] rawBytes) throws IOException {
+ this.rawBytes = rawBytes;
+ this.result = result;
+ int index = sourcePath.lastIndexOf('/');
+ this.sourcePath = sourcePath;
+ this.resourceName = sourcePath.substring(index + 1, sourcePath.length());
+ this.wasZipped = result.getContentType().contains("zip");
+ if (wasZipped) {
+ ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
+ this.entryName = decompressStream(new ByteArrayInputStream(rawBytes), outputStream);
+ // this.encoding = "UTF-8";
+ this.data = outputStream.toByteArray();
+ } else {
+ this.data = rawBytes;
+ this.entryName = null;
+ // this.encoding = result.getEncoding();
+ }
+ }
+ }
+
+ private static void backupResourceLocally(File backupFolder, Resource resource) throws IOException {
+ InputStream inputStream = null;
+ OutputStream outputStream = null;
+ try {
+ String path = resource.sourcePath.replace("attr://", "");
+ //path = path.replaceAll("/", File.separator);
+
+ File file = new File(backupFolder, path);
+ file.getParentFile().mkdirs();
+
+ outputStream = new FileOutputStream(file);
+
+ inputStream = new ByteArrayInputStream(resource.rawBytes);
+ Lib.inputStreamToOutputStream(inputStream, outputStream);
+ } finally {
+ if (inputStream != null) {
+ inputStream.close();
+ }
+ if (outputStream != null) {
+ outputStream.close();
+ }
+ }
+ }
+
+ private static String decompressStream(InputStream inputStream, OutputStream outputStream) throws IOException {
+ String zipEntryName = null;
+ ZipInputStream zipInputStream = null;
+ try {
+ zipInputStream = new ZipInputStream(inputStream);
+ ZipEntry entry = zipInputStream.getNextEntry();
+ zipEntryName = entry.getName();
+ // Transfer bytes from the ZIP file to the output file
+ byte[] buf = new byte[1024];
+ int len;
+ while ((len = zipInputStream.read(buf)) > 0) {
+ outputStream.write(buf, 0, len);
+ }
+ } finally {
+ if (zipInputStream != null) {
+ zipInputStream.close();
+ }
+ }
+ return zipEntryName;
+ }
+
+ @Override
+ public String getXWidgetsXml() {
+ return AbstractBlam.emptyXWidgetsXml;
+ }
+
+ class AttrData {
+ private final String gammaId;
+ private final String hrid;
+ private final String uri;
+
+ public AttrData(String gammaId, String hrid, String uri) {
+ super();
+ this.gammaId = gammaId;
+ this.hrid = hrid;
+ this.uri = uri;
+ }
+
+ public String getGammaId() {
+ return gammaId;
+ }
+
+ public String getHrid() {
+ return hrid;
+ }
+
+ public String getUri() {
+ return uri;
+ }
+ }
+
+ @Override
+ public Collection<String> getCategories() {
+ return Arrays.asList("Admin");
+ }
+}
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/operation/SetRequirementCategory.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/operation/SetRequirementCategory.java
index 9c85087361a..98dccdc0724 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/operation/SetRequirementCategory.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/operation/SetRequirementCategory.java
@@ -1,139 +1,139 @@
-/*******************************************************************************
- * 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.skynet.blam.operation;
-
-import static org.eclipse.osee.framework.skynet.core.artifact.DeletionFlag.EXCLUDE_DELETED;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.List;
-import java.util.logging.Level;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.osee.framework.core.enums.CoreArtifactTypes;
-import org.eclipse.osee.framework.core.enums.CoreAttributeTypes;
-import org.eclipse.osee.framework.core.exception.ArtifactDoesNotExist;
-import org.eclipse.osee.framework.core.exception.MultipleArtifactsExist;
-import org.eclipse.osee.framework.core.exception.OseeCoreException;
-import org.eclipse.osee.framework.core.model.Branch;
-import org.eclipse.osee.framework.logging.OseeLog;
-import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
-import org.eclipse.osee.framework.skynet.core.artifact.search.ArtifactQuery;
-import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
-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;
-
-/**
- * @author Ryan D. Brooks
- */
-public class SetRequirementCategory extends AbstractBlam {
- private final HashMap<String, Artifact> reqs = new HashMap<String, Artifact>();
- private HashMap<String, String> reqPriorities;
- private boolean bulkLoad;
- private Branch branch;
-
- @Override
- public String getName() {
- return "Set Requirement Category";
- }
-
- @Override
- public void runOperation(VariableMap variableMap, IProgressMonitor monitor) throws Exception {
- monitor.beginTask("Set Categories", 100);
-
- branch = variableMap.getBranch("Branch");
- String excelMlPath = variableMap.getString("ExcelML Priority File");
- bulkLoad = variableMap.getBoolean("Bulk Load");
-
- ExtractReqPriority extractor = new ExtractReqPriority(excelMlPath);
- reqPriorities = extractor.getReqPriorities();
-
- if (bulkLoad) {
- for (Artifact req : ArtifactQuery.getArtifactListFromTypeWithInheritence(
- CoreArtifactTypes.AbstractSoftwareRequirement, branch, EXCLUDE_DELETED)) {
- reqs.put(req.getName().trim(), req);
- }
- }
-
- SkynetTransaction transaction = new SkynetTransaction(branch, "set requirement categories");
- for (String requirementName : reqPriorities.keySet()) {
- updateCategory(transaction, requirementName);
- }
- transaction.execute();
-
- reqs.clear();
- }
-
- private void updateCategory(SkynetTransaction transaction, String requirementName) {
- try {
- String canonicalRequirementName = requirementName.trim();
- Artifact requirement = getRequirement(requirementName, canonicalRequirementName);
+/*******************************************************************************
+ * 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.skynet.blam.operation;
+
+import static org.eclipse.osee.framework.skynet.core.artifact.DeletionFlag.EXCLUDE_DELETED;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.List;
+import java.util.logging.Level;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.osee.framework.core.enums.CoreArtifactTypes;
+import org.eclipse.osee.framework.core.enums.CoreAttributeTypes;
+import org.eclipse.osee.framework.core.exception.ArtifactDoesNotExist;
+import org.eclipse.osee.framework.core.exception.MultipleArtifactsExist;
+import org.eclipse.osee.framework.core.exception.OseeCoreException;
+import org.eclipse.osee.framework.core.model.Branch;
+import org.eclipse.osee.framework.logging.OseeLog;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.skynet.core.artifact.search.ArtifactQuery;
+import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
+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;
+
+/**
+ * @author Ryan D. Brooks
+ */
+public class SetRequirementCategory extends AbstractBlam {
+ private final HashMap<String, Artifact> reqs = new HashMap<String, Artifact>();
+ private HashMap<String, String> reqPriorities;
+ private boolean bulkLoad;
+ private Branch branch;
+
+ @Override
+ public String getName() {
+ return "Set Requirement Category";
+ }
+
+ @Override
+ public void runOperation(VariableMap variableMap, IProgressMonitor monitor) throws Exception {
+ monitor.beginTask("Set Categories", 100);
+
+ branch = variableMap.getBranch("Branch");
+ String excelMlPath = variableMap.getString("ExcelML Priority File");
+ bulkLoad = variableMap.getBoolean("Bulk Load");
+
+ ExtractReqPriority extractor = new ExtractReqPriority(excelMlPath);
+ reqPriorities = extractor.getReqPriorities();
+
+ if (bulkLoad) {
+ for (Artifact req : ArtifactQuery.getArtifactListFromTypeWithInheritence(
+ CoreArtifactTypes.AbstractSoftwareRequirement, branch, EXCLUDE_DELETED)) {
+ reqs.put(req.getName().trim(), req);
+ }
+ }
+
+ SkynetTransaction transaction = new SkynetTransaction(branch, "set requirement categories");
+ for (String requirementName : reqPriorities.keySet()) {
+ updateCategory(transaction, requirementName);
+ }
+ transaction.execute();
+
+ reqs.clear();
+ }
+
+ private void updateCategory(SkynetTransaction transaction, String requirementName) {
+ try {
+ String canonicalRequirementName = requirementName.trim();
+ Artifact requirement = getRequirement(requirementName, canonicalRequirementName);
requirement.setSoleAttributeValue(CoreAttributeTypes.Category, reqPriorities.get(canonicalRequirementName));
- requirement.persist(transaction);
- } catch (OseeCoreException ex) {
- OseeLog.log(SkynetGuiPlugin.class, Level.SEVERE, ex);
- }
- }
-
- private Artifact getSoleRequirement(String requirementName, String canonicalRequirementName) throws OseeCoreException {
- Artifact requirement;
- if (bulkLoad) {
- requirement = reqs.get(canonicalRequirementName);
- if (requirement == null) {
- throw new ArtifactDoesNotExist("cant' find " + canonicalRequirementName);
- }
- } else {
- try {
+ requirement.persist(transaction);
+ } catch (OseeCoreException ex) {
+ OseeLog.log(SkynetGuiPlugin.class, Level.SEVERE, ex);
+ }
+ }
+
+ private Artifact getSoleRequirement(String requirementName, String canonicalRequirementName) throws OseeCoreException {
+ Artifact requirement;
+ if (bulkLoad) {
+ requirement = reqs.get(canonicalRequirementName);
+ if (requirement == null) {
+ throw new ArtifactDoesNotExist("cant' find " + canonicalRequirementName);
+ }
+ } else {
+ try {
requirement = ArtifactQuery.getArtifactFromAttribute(CoreAttributeTypes.Name, requirementName, branch);
- } catch (ArtifactDoesNotExist ex) {
- requirement =
+ } catch (ArtifactDoesNotExist ex) {
+ requirement =
ArtifactQuery.getArtifactFromAttribute(CoreAttributeTypes.Name, canonicalRequirementName, branch);
- }
- }
- return requirement;
- }
-
- private Artifact getRequirement(String requirementName, String canonicalRequirementName) throws OseeCoreException {
- try {
- Artifact requirement = getSoleRequirement(requirementName, canonicalRequirementName);
-
- if (requirement.isOrphan()) {
- throw new MultipleArtifactsExist(requirement.getName());
- }
- return requirement;
- } catch (MultipleArtifactsExist ex) {
- List<Artifact> artiafcts =
- ArtifactQuery.getArtifactListFromTypeAndName(CoreArtifactTypes.SoftwareRequirement,
- canonicalRequirementName, branch);
- for (Artifact requirement : artiafcts) {
- if (requirement.isOrphan()) {
- OseeLog.log(SkynetGuiPlugin.class, Level.INFO, requirement + " is an orphan");
- }
- }
- throw ex;
- }
- }
-
- @Override
- public String getXWidgetsXml() {
- return "<xWidgets><XWidget xwidgetType=\"XCheckBox\" horizontalLabel=\"true\" labelAfter=\"true\" displayName=\"Bulk Load\" /><XWidget xwidgetType=\"XText\" displayName=\"ExcelML Priority File\" defaultValue=\"C:/UserData/RequirementCategories.xml\" /><XWidget xwidgetType=\"XBranchSelectWidget\" displayName=\"Branch\" /></xWidgets>";
- }
-
- @Override
- public String getDescriptionUsage() {
- return "Sets the Category attribute on software requirements.";
- }
-
- @Override
- public Collection<String> getCategories() {
- return Arrays.asList("Define");
- }
+ }
+ }
+ return requirement;
+ }
+
+ private Artifact getRequirement(String requirementName, String canonicalRequirementName) throws OseeCoreException {
+ try {
+ Artifact requirement = getSoleRequirement(requirementName, canonicalRequirementName);
+
+ if (requirement.isOrphan()) {
+ throw new MultipleArtifactsExist(requirement.getName());
+ }
+ return requirement;
+ } catch (MultipleArtifactsExist ex) {
+ List<Artifact> artiafcts =
+ ArtifactQuery.getArtifactListFromTypeAndName(CoreArtifactTypes.SoftwareRequirement,
+ canonicalRequirementName, branch);
+ for (Artifact requirement : artiafcts) {
+ if (requirement.isOrphan()) {
+ OseeLog.log(SkynetGuiPlugin.class, Level.INFO, requirement + " is an orphan");
+ }
+ }
+ throw ex;
+ }
+ }
+
+ @Override
+ public String getXWidgetsXml() {
+ return "<xWidgets><XWidget xwidgetType=\"XCheckBox\" horizontalLabel=\"true\" labelAfter=\"true\" displayName=\"Bulk Load\" /><XWidget xwidgetType=\"XText\" displayName=\"ExcelML Priority File\" defaultValue=\"C:/UserData/RequirementCategories.xml\" /><XWidget xwidgetType=\"XBranchSelectWidget\" displayName=\"Branch\" /></xWidgets>";
+ }
+
+ @Override
+ public String getDescriptionUsage() {
+ return "Sets the Category attribute on software requirements.";
+ }
+
+ @Override
+ public Collection<String> getCategories() {
+ return Arrays.asList("Define");
+ }
} \ 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/ShowRevertTransactions.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/operation/ShowRevertTransactions.java
index 44e055860b2..1688655743d 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/operation/ShowRevertTransactions.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/operation/ShowRevertTransactions.java
@@ -1,68 +1,70 @@
-/*******************************************************************************
- * 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.skynet.blam.operation;
-
-import java.util.Arrays;
-import java.util.Collection;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.osee.framework.database.core.ConnectionHandler;
-import org.eclipse.osee.framework.database.core.IOseeStatement;
-import org.eclipse.osee.framework.jdk.core.util.AHTML;
-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.skynet.results.html.XResultPage.Manipulations;
-
-/**
- * @author Theron Virgin
- */
-public class ShowRevertTransactions extends AbstractBlam {
- private static final String GET_REVERT_TRANSACTIONS =
- "Select DISTINCT det.branch_id, Value, txs.transaction_id, Time FROM osee_removed_txs txs, osee_tx_details det, osee_attribute attr, osee_txs txs1 WHERE txs.transaction_id = det.transaction_id AND det.author = attr.art_id AND attr.attr_type_id = 30 AND attr.gamma_id = txs1.gamma_id AND txs1.tx_current = 1 ORDER BY time";
-
- @Override
- public String getName() {
- return "Show Revert Transactions";
- }
-
- @Override
- public void runOperation(VariableMap variableMap, IProgressMonitor monitor) throws Exception {
- StringBuffer sbFull = new StringBuffer(AHTML.beginMultiColumnTable(100, 1));
-
- sbFull.append(AHTML.addHeaderRowMultiColumnTable(new String[] {"Branch ID", "User", "Transaction_ID", "Date"}));
-
- IOseeStatement chStmt = ConnectionHandler.getStatement();
- try {
- chStmt.runPreparedQuery(GET_REVERT_TRANSACTIONS);
- while (chStmt.next()) {
- sbFull.append(AHTML.addRowMultiColumnTable(new String[] {String.valueOf(chStmt.getInt("branch_id")),
- chStmt.getString("value"), String.valueOf(chStmt.getInt("transaction_id")),
- chStmt.getDate("time").toString()}));
- }
- sbFull.append(AHTML.endMultiColumnTable());
- XResultData rd = new XResultData();
- rd.addRaw(sbFull.toString());
- rd.report("Revert Transactions", Manipulations.RAW_HTML);
- } finally {
- chStmt.close();
- }
- }
-
- @Override
- public String getXWidgetsXml() {
- return "<xWidgets></xWidgets>";
- }
-
- @Override
- public Collection<String> getCategories() {
- return Arrays.asList("Admin");
- }
-}
+/*******************************************************************************
+ * 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.skynet.blam.operation;
+
+import java.util.Arrays;
+import java.util.Collection;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.osee.framework.database.core.ConnectionHandler;
+import org.eclipse.osee.framework.database.core.IOseeStatement;
+import org.eclipse.osee.framework.jdk.core.util.AHTML;
+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.skynet.results.html.XResultPage.Manipulations;
+
+/**
+ * @author Theron Virgin
+ */
+public class ShowRevertTransactions extends AbstractBlam {
+ private static final String GET_REVERT_TRANSACTIONS =
+ "Select DISTINCT det.branch_id, Value, txs.transaction_id, Time FROM osee_removed_txs txs, osee_tx_details det, osee_attribute attr, osee_txs txs1 WHERE txs.transaction_id = det.transaction_id AND det.author = attr.art_id AND attr.attr_type_id = 30 AND attr.gamma_id = txs1.gamma_id AND txs1.tx_current = 1 ORDER BY time";
+
+ @Override
+ public String getName() {
+ return "Show Revert Transactions";
+ }
+
+ @Override
+ public void runOperation(VariableMap variableMap, IProgressMonitor monitor) throws Exception {
+ StringBuffer sbFull = new StringBuffer(AHTML.beginMultiColumnTable(100, 1));
+
+ sbFull.append(AHTML.addHeaderRowMultiColumnTable(new String[] {"Branch ID", "User", "Transaction_ID", "Date"}));
+
+ IOseeStatement chStmt = ConnectionHandler.getStatement();
+ try {
+ chStmt.runPreparedQuery(GET_REVERT_TRANSACTIONS);
+ while (chStmt.next()) {
+ sbFull.append(AHTML.addRowMultiColumnTable(new String[] {
+ String.valueOf(chStmt.getInt("branch_id")),
+ chStmt.getString("value"),
+ String.valueOf(chStmt.getInt("transaction_id")),
+ chStmt.getDate("time").toString()}));
+ }
+ sbFull.append(AHTML.endMultiColumnTable());
+ XResultData rd = new XResultData();
+ rd.addRaw(sbFull.toString());
+ rd.report("Revert Transactions", Manipulations.RAW_HTML);
+ } finally {
+ chStmt.close();
+ }
+ }
+
+ @Override
+ public String getXWidgetsXml() {
+ return "<xWidgets></xWidgets>";
+ }
+
+ @Override
+ public Collection<String> getCategories() {
+ return Arrays.asList("Admin");
+ }
+}
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/operation/UnicodeConverter.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/operation/UnicodeConverter.java
index e4f483a811b..96014d5b032 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/operation/UnicodeConverter.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/operation/UnicodeConverter.java
@@ -20,8 +20,14 @@ import java.util.Map;
*/
public class UnicodeConverter {
- private static final byte[] tickyQuoteBack = new byte[] {(byte) -61, (byte) -94, (byte) -30, (byte) -126,
- (byte) -84, (byte) -59, (byte) -109};
+ private static final byte[] tickyQuoteBack = new byte[] {
+ (byte) -61,
+ (byte) -94,
+ (byte) -30,
+ (byte) -126,
+ (byte) -84,
+ (byte) -59,
+ (byte) -109};
private static final String tickyQuoteBackString = "�";
private static final byte[] tickyQuoteBackGood = new byte[] {(byte) -30, (byte) -128, (byte) -100};
@@ -30,29 +36,60 @@ public class UnicodeConverter {
private static final String degreeString = "�";
private static final byte[] degreeGood = new byte[] {(byte) -62, (byte) -80};
- private static final byte[] tickyQuoteForward = new byte[] {(byte) -61, (byte) -94, (byte) -30, (byte) -126,
- (byte) -84, (byte) -17, (byte) -65, (byte) -67};
+ private static final byte[] tickyQuoteForward = new byte[] {
+ (byte) -61,
+ (byte) -94,
+ (byte) -30,
+ (byte) -126,
+ (byte) -84,
+ (byte) -17,
+ (byte) -65,
+ (byte) -67};
private static final String tickyQuoteForwardString = "�";
private static final byte[] tickyQuoteForwardGood = new byte[] {(byte) -30, (byte) -128, (byte) -99};
- private static final byte[] notEquals = new byte[] {(byte) -61, (byte) -81, (byte) -30, (byte) -128, (byte) -102,
- (byte) -62, (byte) -71};
+ private static final byte[] notEquals = new byte[] {
+ (byte) -61,
+ (byte) -81,
+ (byte) -30,
+ (byte) -128,
+ (byte) -102,
+ (byte) -62,
+ (byte) -71};
private static final byte[] notEqualsGood = new byte[] {(byte) -17, (byte) -126, (byte) -71};
private static final String notEqualsString = " ";
//Renders as a ? in Java however appears as equal slash in Word
- private static final byte[] notEqualsForward = new byte[] {(byte) -61, (byte) -94, (byte) -30, (byte) -128,
- (byte) -80, (byte) -62, (byte) -96};
+ private static final byte[] notEqualsForward = new byte[] {
+ (byte) -61,
+ (byte) -94,
+ (byte) -30,
+ (byte) -128,
+ (byte) -80,
+ (byte) -62,
+ (byte) -96};
private static final String notEqualsForwardString = "Not Equals Forward";
private static final byte[] notEqualsForwardGood = new byte[] {(byte) -30, (byte) -119, (byte) -96};
- private static final byte[] greaterThanEquals = new byte[] {(byte) -61, (byte) -81, (byte) -30, (byte) -128,
- (byte) -102, (byte) -62, (byte) -77};
+ private static final byte[] greaterThanEquals = new byte[] {
+ (byte) -61,
+ (byte) -81,
+ (byte) -30,
+ (byte) -128,
+ (byte) -102,
+ (byte) -62,
+ (byte) -77};
private static final String greaterThanEqualsString = " ";
private static final byte[] greaterThanEqualsGood = new byte[] {(byte) -17, (byte) -126, (byte) -77};
- private static final byte[] lessThanEquals = new byte[] {(byte) -61, (byte) -81, (byte) -30, (byte) -128,
- (byte) -102, (byte) -62, (byte) -93};
+ private static final byte[] lessThanEquals = new byte[] {
+ (byte) -61,
+ (byte) -81,
+ (byte) -30,
+ (byte) -128,
+ (byte) -102,
+ (byte) -62,
+ (byte) -93};
private static final String lessThanEqualsString = " Less Than Equals";
private static final byte[] lessThanEqualsGood = new byte[] {(byte) -17, (byte) -126, (byte) -93};
@@ -67,21 +104,41 @@ public class UnicodeConverter {
// new byte[] {(byte) -61, (byte) -81, (byte) -30, (byte) -128, (byte) -102, (byte) -62, (byte) -93};
private static final byte[] microCharacterGood = new byte[] {(byte) -62, (byte) -75};
- private static final byte[] forwardTick = new byte[] {(byte) -61, (byte) -94, (byte) -30, (byte) -126, (byte) -84,
- (byte) -30, (byte) -124, (byte) -94};
+ private static final byte[] forwardTick = new byte[] {
+ (byte) -61,
+ (byte) -94,
+ (byte) -30,
+ (byte) -126,
+ (byte) -84,
+ (byte) -30,
+ (byte) -124,
+ (byte) -94};
private static final String forwardTickString = "�";
private static final byte[] forwardTickGood = new byte[] {(byte) -30, (byte) -128, (byte) -103};
- private static final byte[] dash = new byte[] {(byte) -61, (byte) -94, (byte) -30, (byte) -126, (byte) -84,
- (byte) -30, (byte) -128, (byte) -100};
+ private static final byte[] dash = new byte[] {
+ (byte) -61,
+ (byte) -94,
+ (byte) -30,
+ (byte) -126,
+ (byte) -84,
+ (byte) -30,
+ (byte) -128,
+ (byte) -100};
private static final byte[] dashGood = new byte[] {(byte) -30, (byte) -128, (byte) -109};
private static final byte[] dotGood = new byte[] {(byte) -62, (byte) -73};
private static final byte[] plusMinusGood = new byte[] {(byte) -62, (byte) -79};
private static final byte[] miniOneGood = new byte[] {(byte) -62, (byte) -71};
- private static final byte[] whatisit = new byte[] {(byte) -61, (byte) -81, (byte) -30, (byte) -126, (byte) -84,
- (byte) -62, (byte) -67};
+ private static final byte[] whatisit = new byte[] {
+ (byte) -61,
+ (byte) -81,
+ (byte) -30,
+ (byte) -126,
+ (byte) -84,
+ (byte) -62,
+ (byte) -67};
private static final byte[] whatisitGood = new byte[] {(byte) -17, (byte) -128, (byte) -67};
private static final byte[] WHATISIT2 = new byte[] {(byte) -17, (byte) -126, (byte) -80};
@@ -89,12 +146,24 @@ public class UnicodeConverter {
private static final byte[] WHATISIT4 = new byte[] {(byte) -49, (byte) -128};
private static final byte[] WHATISIT5 = new byte[] {(byte) -30, (byte) -119, (byte) -92};
- private static final byte[] upsideDownTick = new byte[] {(byte) -61, (byte) -94, (byte) -30, (byte) -126,
- (byte) -84, (byte) -53, (byte) -100};
+ private static final byte[] upsideDownTick = new byte[] {
+ (byte) -61,
+ (byte) -94,
+ (byte) -30,
+ (byte) -126,
+ (byte) -84,
+ (byte) -53,
+ (byte) -100};
private static final byte[] upsideDownTickGood = new byte[] {(byte) -30, (byte) -128, (byte) -104};
- private static final byte[] dotdotdot = new byte[] {(byte) -61, (byte) -94, (byte) -30, (byte) -126, (byte) -84,
- (byte) -62, (byte) -90};
+ private static final byte[] dotdotdot = new byte[] {
+ (byte) -61,
+ (byte) -94,
+ (byte) -30,
+ (byte) -126,
+ (byte) -84,
+ (byte) -62,
+ (byte) -90};
private static final byte[] dotdotdotGood = new byte[] {(byte) -30, (byte) -128, (byte) -90};
private static final byte[] lambdaGood = new byte[] {(byte) -62, (byte) -93};
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 e6a20bd1083..1917afd8bd8 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
@@ -1,91 +1,91 @@
-/*******************************************************************************
- * 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.skynet.blam.operation;
-
-import java.io.ByteArrayInputStream;
-import java.io.File;
-import java.io.FileInputStream;
-import java.util.Arrays;
-import java.util.Collection;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.osee.framework.core.exception.OseeArgumentException;
-import org.eclipse.osee.framework.core.model.type.ArtifactType;
-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.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;
-
-/**
- * @author Ryan D. Brooks
- */
-public final class UpdateArtifactTypeImage extends AbstractBlam {
-
- private static final String ARTIFACT_TYPE_NAME = "Select Artifact Type";
- private static final String SELECT_IMAGE = "Select Image GIF";
-
- @Override
- public String getName() {
- return "Update ArtifactType Image";
- }
-
- @Override
- public void runOperation(final VariableMap variableMap, IProgressMonitor monitor) throws Exception {
- String filename = variableMap.getString(SELECT_IMAGE);
- final ArtifactType artifactSubtypeDescriptor = variableMap.getArtifactType("Select Artifact Type");
- if (Strings.isValid(filename)) {
- File imageFile = new File(filename);
- if (!imageFile.exists()) {
- throw new OseeArgumentException("Invalid image filename.");
- }
- ArtifactImageManager.setArtifactTypeImageInDb(artifactSubtypeDescriptor,
- new ByteArrayInputStream(Lib.inputStreamToBytes(new FileInputStream(imageFile))));
- } else {
- Displays.ensureInDisplayThread(new Runnable() {
- @Override
- public void run() {
- try {
- 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);
- }
- } catch (Exception ex) {
- OseeLog.log(SkynetGuiPlugin.class, OseeLevel.SEVERE_POPUP, ex);
- }
- }
- });
- }
- }
-
- @Override
- public String getDescriptionUsage() {
- return "This BLAM will import the selected 16x16 pixel gif image as the image for the selected artifact type. Existing image will be overwritten.\nLeaving image filename blank will clear the image from the database. Programatic default will be used instead.";
- }
-
- @Override
- public String getXWidgetsXml() {
- StringBuffer buffer = new StringBuffer("<xWidgets>");
- buffer.append("<XWidget xwidgetType=\"XFileSelectionDialog\" displayName=\"" + SELECT_IMAGE + "\" />");
- buffer.append("<XWidget xwidgetType=\"XArtifactTypeListViewer\" displayName=\"" + ARTIFACT_TYPE_NAME + "\" />");
- buffer.append("</xWidgets>");
- return buffer.toString();
- }
-
- @Override
- public Collection<String> getCategories() {
- return Arrays.asList("Admin");
- }
+/*******************************************************************************
+ * 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.skynet.blam.operation;
+
+import java.io.ByteArrayInputStream;
+import java.io.File;
+import java.io.FileInputStream;
+import java.util.Arrays;
+import java.util.Collection;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.osee.framework.core.exception.OseeArgumentException;
+import org.eclipse.osee.framework.core.model.type.ArtifactType;
+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.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;
+
+/**
+ * @author Ryan D. Brooks
+ */
+public final class UpdateArtifactTypeImage extends AbstractBlam {
+
+ private static final String ARTIFACT_TYPE_NAME = "Select Artifact Type";
+ private static final String SELECT_IMAGE = "Select Image GIF";
+
+ @Override
+ public String getName() {
+ return "Update ArtifactType Image";
+ }
+
+ @Override
+ public void runOperation(final VariableMap variableMap, IProgressMonitor monitor) throws Exception {
+ String filename = variableMap.getString(SELECT_IMAGE);
+ final ArtifactType artifactSubtypeDescriptor = variableMap.getArtifactType("Select Artifact Type");
+ if (Strings.isValid(filename)) {
+ File imageFile = new File(filename);
+ if (!imageFile.exists()) {
+ throw new OseeArgumentException("Invalid image filename.");
+ }
+ ArtifactImageManager.setArtifactTypeImageInDb(artifactSubtypeDescriptor,
+ new ByteArrayInputStream(Lib.inputStreamToBytes(new FileInputStream(imageFile))));
+ } else {
+ Displays.ensureInDisplayThread(new Runnable() {
+ @Override
+ public void run() {
+ try {
+ 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);
+ }
+ } catch (Exception ex) {
+ OseeLog.log(SkynetGuiPlugin.class, OseeLevel.SEVERE_POPUP, ex);
+ }
+ }
+ });
+ }
+ }
+
+ @Override
+ public String getDescriptionUsage() {
+ return "This BLAM will import the selected 16x16 pixel gif image as the image for the selected artifact type. Existing image will be overwritten.\nLeaving image filename blank will clear the image from the database. Programatic default will be used instead.";
+ }
+
+ @Override
+ public String getXWidgetsXml() {
+ StringBuffer buffer = new StringBuffer("<xWidgets>");
+ buffer.append("<XWidget xwidgetType=\"XFileSelectionDialog\" displayName=\"" + SELECT_IMAGE + "\" />");
+ buffer.append("<XWidget xwidgetType=\"XArtifactTypeListViewer\" displayName=\"" + ARTIFACT_TYPE_NAME + "\" />");
+ buffer.append("</xWidgets>");
+ return buffer.toString();
+ }
+
+ @Override
+ public Collection<String> getCategories() {
+ return Arrays.asList("Admin");
+ }
} \ 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/ValidateArtifactsToDelete.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/operation/ValidateArtifactsToDelete.java
index 3b5c9f8b4b5..e4a11152467 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/operation/ValidateArtifactsToDelete.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/operation/ValidateArtifactsToDelete.java
@@ -46,8 +46,6 @@ public class ValidateArtifactsToDelete extends AbstractBlam {
/**
* Changes the descriptor of the artifacts to the provided artifact descriptor
*
- * @param artifacts
- * @param descriptor
*/
private void processChange(List<Artifact> artifacts) {
if (artifacts.isEmpty()) {
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/sections/BaseBlamSection.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/sections/BaseBlamSection.java
index fdc368e3c19..8a46fe3e6a6 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/sections/BaseBlamSection.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/sections/BaseBlamSection.java
@@ -1,46 +1,41 @@
-/*******************************************************************************
- * 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.skynet.blam.sections;
-
-import org.eclipse.osee.framework.ui.skynet.blam.AbstractBlam;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.forms.SectionPart;
-import org.eclipse.ui.forms.editor.FormEditor;
-import org.eclipse.ui.forms.widgets.FormToolkit;
-
-/**
- * @author Roberto E. Escobar
- */
-public class BaseBlamSection extends SectionPart {
-
- private final FormEditor editor;
- private final AbstractBlam abstractBlam;
-
- /**
- * @param parent
- * @param toolkit
- * @param style
- */
- public BaseBlamSection(FormEditor editor, AbstractBlam abstractBlam, Composite parent, FormToolkit toolkit, int style) {
- super(parent, toolkit, style);
- this.editor = editor;
- this.abstractBlam = abstractBlam;
- }
-
- public FormEditor getEditor() {
- return editor;
- }
-
- public AbstractBlam getAbstractBlam() {
- return abstractBlam;
- }
-
-}
+/*******************************************************************************
+ * 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.skynet.blam.sections;
+
+import org.eclipse.osee.framework.ui.skynet.blam.AbstractBlam;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.forms.SectionPart;
+import org.eclipse.ui.forms.editor.FormEditor;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+
+/**
+ * @author Roberto E. Escobar
+ */
+public class BaseBlamSection extends SectionPart {
+
+ private final FormEditor editor;
+ private final AbstractBlam abstractBlam;
+
+ public BaseBlamSection(FormEditor editor, AbstractBlam abstractBlam, Composite parent, FormToolkit toolkit, int style) {
+ super(parent, toolkit, style);
+ this.editor = editor;
+ this.abstractBlam = abstractBlam;
+ }
+
+ public FormEditor getEditor() {
+ return editor;
+ }
+
+ public AbstractBlam getAbstractBlam() {
+ return abstractBlam;
+ }
+
+}
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/sections/BlamInputSection.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/sections/BlamInputSection.java
index fbf6e0b801b..5009b7a79e2 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/sections/BlamInputSection.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/sections/BlamInputSection.java
@@ -1,138 +1,138 @@
-/*******************************************************************************
- * 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.skynet.blam.sections;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-import org.eclipse.osee.framework.core.exception.OseeArgumentException;
-import org.eclipse.osee.framework.logging.OseeLevel;
-import org.eclipse.osee.framework.logging.OseeLog;
-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.widgets.XModifiedListener;
-import org.eclipse.osee.framework.ui.skynet.widgets.XWidget;
-import org.eclipse.osee.framework.ui.skynet.widgets.XWidgetUtility;
-import org.eclipse.osee.framework.ui.skynet.widgets.workflow.DefaultXWidgetOptionResolver;
-import org.eclipse.osee.framework.ui.skynet.widgets.workflow.DynamicXWidgetLayout;
-import org.eclipse.osee.framework.ui.skynet.widgets.workflow.DynamicXWidgetLayoutData;
-import org.eclipse.osee.framework.ui.skynet.widgets.workflow.WorkPage;
-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.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.ui.forms.IManagedForm;
-import org.eclipse.ui.forms.editor.FormEditor;
-import org.eclipse.ui.forms.widgets.FormToolkit;
-import org.eclipse.ui.forms.widgets.Section;
-
-/**
- * @author Roberto E. Escobar
- */
-public class BlamInputSection extends BaseBlamSection {
-
- private final Collection<DynamicXWidgetLayoutData> dynamicInputLayouts;
-
- public BlamInputSection(FormEditor editor, AbstractBlam abstractBlam, Composite parent, FormToolkit toolkit, int style) {
- super(editor, abstractBlam, parent, toolkit, style);
- this.dynamicInputLayouts = new ArrayList<DynamicXWidgetLayoutData>();
- }
-
- @Override
- public void initialize(IManagedForm form) {
- super.initialize(form);
- Section section = getSection();
- section.setText("Parameters");
- section.setLayout(new GridLayout());
- section.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
- updateDataPart();
- }
-
- public VariableMap getData() throws OseeArgumentException {
- VariableMap blamVariableMap = new VariableMap();
- List<XWidget> xWidgets = XWidgetUtility.findXWidgetsInControl(getSection());
- for (XWidget xWidget : xWidgets) {
- blamVariableMap.setValue(xWidget.getLabel(), xWidget.getData());
- }
- return blamVariableMap;
- }
-
- private void updateDataPart() {
- final IManagedForm form = getManagedForm();
- final FormToolkit toolkit = form.getToolkit();
- final Section section = getSection();
-
- Control control = section.getClient();
- if (Widgets.isAccessible(control)) {
- control.dispose();
- }
- Composite sectionBody = toolkit.createComposite(section, toolkit.getBorderStyle());
- sectionBody.setLayout(new GridLayout());
- sectionBody.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
-
- createWidgets(sectionBody);
-
- section.setClient(sectionBody);
- toolkit.paintBordersFor(section);
-
- section.layout(true);
- form.getForm().getBody().layout(true);
-
- }
-
- private void createWidgets(Composite parent) {
- try {
- List<DynamicXWidgetLayoutData> layoutDatas = getDynamicXWidgetLayouts();
- WorkPage workPage = new WorkPage(layoutDatas, new DefaultXWidgetOptionResolver(), getAbstractBlam());
- workPage.createBody(getManagedForm(), parent, null, new XModifiedListener() {
-
- @Override
- public void widgetModified(XWidget widget) {
- getManagedForm().reflow(true);
- }
-
- }, true);
- } catch (Exception ex) {
- OseeLog.log(SkynetGuiPlugin.class, OseeLevel.SEVERE_POPUP, ex);
- }
- }
-
- private List<DynamicXWidgetLayoutData> getDynamicXWidgetLayouts() throws Exception {
- List<DynamicXWidgetLayoutData> itemsToReturn = new ArrayList<DynamicXWidgetLayoutData>();
- itemsToReturn.addAll(getAbstractBlam().getLayoutDatas());
- itemsToReturn.addAll(dynamicInputLayouts);
- return itemsToReturn;
- }
-
- @Override
- public void dispose() {
- super.dispose();
- }
-
- @Override
- public void refresh() {
- super.refresh();
- updateDataPart();
- }
-
- public void setDynamicXWidgetLayouts(Collection<DynamicXWidgetLayout> layouts) {
- if (layouts != null) {
- this.dynamicInputLayouts.clear();
- for (DynamicXWidgetLayout layout : layouts) {
- this.dynamicInputLayouts.addAll(layout.getLayoutDatas());
- }
- refresh();
- }
- }
-}
+/*******************************************************************************
+ * 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.skynet.blam.sections;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+import org.eclipse.osee.framework.core.exception.OseeArgumentException;
+import org.eclipse.osee.framework.logging.OseeLevel;
+import org.eclipse.osee.framework.logging.OseeLog;
+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.widgets.XModifiedListener;
+import org.eclipse.osee.framework.ui.skynet.widgets.XWidget;
+import org.eclipse.osee.framework.ui.skynet.widgets.XWidgetUtility;
+import org.eclipse.osee.framework.ui.skynet.widgets.workflow.DefaultXWidgetOptionResolver;
+import org.eclipse.osee.framework.ui.skynet.widgets.workflow.DynamicXWidgetLayout;
+import org.eclipse.osee.framework.ui.skynet.widgets.workflow.DynamicXWidgetLayoutData;
+import org.eclipse.osee.framework.ui.skynet.widgets.workflow.WorkPage;
+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.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.ui.forms.IManagedForm;
+import org.eclipse.ui.forms.editor.FormEditor;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+import org.eclipse.ui.forms.widgets.Section;
+
+/**
+ * @author Roberto E. Escobar
+ */
+public class BlamInputSection extends BaseBlamSection {
+
+ private final Collection<DynamicXWidgetLayoutData> dynamicInputLayouts;
+
+ public BlamInputSection(FormEditor editor, AbstractBlam abstractBlam, Composite parent, FormToolkit toolkit, int style) {
+ super(editor, abstractBlam, parent, toolkit, style);
+ this.dynamicInputLayouts = new ArrayList<DynamicXWidgetLayoutData>();
+ }
+
+ @Override
+ public void initialize(IManagedForm form) {
+ super.initialize(form);
+ Section section = getSection();
+ section.setText("Parameters");
+ section.setLayout(new GridLayout());
+ section.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
+ updateDataPart();
+ }
+
+ public VariableMap getData() throws OseeArgumentException {
+ VariableMap blamVariableMap = new VariableMap();
+ List<XWidget> xWidgets = XWidgetUtility.findXWidgetsInControl(getSection());
+ for (XWidget xWidget : xWidgets) {
+ blamVariableMap.setValue(xWidget.getLabel(), xWidget.getData());
+ }
+ return blamVariableMap;
+ }
+
+ private void updateDataPart() {
+ final IManagedForm form = getManagedForm();
+ final FormToolkit toolkit = form.getToolkit();
+ final Section section = getSection();
+
+ Control control = section.getClient();
+ if (Widgets.isAccessible(control)) {
+ control.dispose();
+ }
+ Composite sectionBody = toolkit.createComposite(section, toolkit.getBorderStyle());
+ sectionBody.setLayout(new GridLayout());
+ sectionBody.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
+
+ createWidgets(sectionBody);
+
+ section.setClient(sectionBody);
+ toolkit.paintBordersFor(section);
+
+ section.layout(true);
+ form.getForm().getBody().layout(true);
+
+ }
+
+ private void createWidgets(Composite parent) {
+ try {
+ List<DynamicXWidgetLayoutData> layoutDatas = getDynamicXWidgetLayouts();
+ WorkPage workPage = new WorkPage(layoutDatas, new DefaultXWidgetOptionResolver(), getAbstractBlam());
+ workPage.createBody(getManagedForm(), parent, null, new XModifiedListener() {
+
+ @Override
+ public void widgetModified(XWidget widget) {
+ getManagedForm().reflow(true);
+ }
+
+ }, true);
+ } catch (Exception ex) {
+ OseeLog.log(SkynetGuiPlugin.class, OseeLevel.SEVERE_POPUP, ex);
+ }
+ }
+
+ private List<DynamicXWidgetLayoutData> getDynamicXWidgetLayouts() throws Exception {
+ List<DynamicXWidgetLayoutData> itemsToReturn = new ArrayList<DynamicXWidgetLayoutData>();
+ itemsToReturn.addAll(getAbstractBlam().getLayoutDatas());
+ itemsToReturn.addAll(dynamicInputLayouts);
+ return itemsToReturn;
+ }
+
+ @Override
+ public void dispose() {
+ super.dispose();
+ }
+
+ @Override
+ public void refresh() {
+ super.refresh();
+ updateDataPart();
+ }
+
+ public void setDynamicXWidgetLayouts(Collection<DynamicXWidgetLayout> layouts) {
+ if (layouts != null) {
+ this.dynamicInputLayouts.clear();
+ for (DynamicXWidgetLayout layout : layouts) {
+ this.dynamicInputLayouts.addAll(layout.getLayoutDatas());
+ }
+ refresh();
+ }
+ }
+}
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 567a8c6666c..ee799808b2d 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
@@ -1,153 +1,153 @@
-/*******************************************************************************
- * 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.skynet.blam.sections;
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.ActionContributionItem;
-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;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.forms.IManagedForm;
-import org.eclipse.ui.forms.editor.FormEditor;
-import org.eclipse.ui.forms.widgets.FormToolkit;
-import org.eclipse.ui.forms.widgets.Section;
-
-/**
- * @author Roberto E. Escobar
- */
-public class BlamOutputSection extends BaseBlamSection {
-
- private Text formText;
- private Appendable appendableOutput;
- private final Action executBlamAction;
-
- public BlamOutputSection(FormEditor editor, AbstractBlam abstractBlam, Composite parent, FormToolkit toolkit, int style, Action executBlamAction) {
- super(editor, abstractBlam, parent, toolkit, style);
- this.executBlamAction = executBlamAction;
- }
-
- public void simluateRun() {
- this.executBlamAction.run();
- }
-
- @Override
- public void initialize(IManagedForm form) {
- super.initialize(form);
- Section section = getSection();
- section.setText("Execute");
- section.setLayout(new GridLayout());
- section.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
-
- 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));
-
- if (executBlamAction != null) {
- ActionContributionItem contributionItem = new ActionContributionItem(executBlamAction);
- contributionItem.setMode(ActionContributionItem.MODE_FORCE_TEXT);
- contributionItem.fill(composite);
- }
-
- formText = toolkit.createText(composite, "BLAM has not yet run\n", SWT.WRAP);
- GridData gd = new GridData(SWT.FILL, SWT.FILL, true, true);
- gd.heightHint = 500;
- gd.widthHint = 200;
- formText.setLayoutData(gd);
-
- getSection().setClient(composite);
- toolkit.paintBordersFor(composite);
-
- section.layout(true);
- form.getForm().getBody().layout(true);
-
- }
-
- public void appendText(final String text) {
- Displays.ensureInDisplayThread(new Runnable() {
- @Override
- public void run() {
- if (Widgets.isAccessible(formText)) {
- formText.append(text);
- getManagedForm().reflow(true);
- }
- }
- });
- }
-
- public void setText(final String text) {
- Displays.ensureInDisplayThread(new Runnable() {
- @Override
- public void run() {
- if (Widgets.isAccessible(formText)) {
- formText.setText(text);
- getManagedForm().reflow(true);
- }
- }
- });
- }
-
- public Appendable getOutput() {
- if (appendableOutput == null) {
- appendableOutput = new InternalAppendable();
- }
- return appendableOutput;
- }
-
- @Override
- public void dispose() {
- if (Widgets.isAccessible(formText)) {
- formText.dispose();
- }
- super.dispose();
- }
-
- @Override
- public void refresh() {
- super.refresh();
- }
-
- private final class InternalAppendable implements Appendable {
-
- private void write(final String text) {
- appendText(text);
- }
-
- @Override
- public Appendable append(CharSequence csq) {
- if (csq == null) {
- write("null");
- } else {
- write(csq.toString());
- }
- return this;
- }
-
- @Override
- public Appendable append(char c) {
- write(new String(new char[] {c}));
- return this;
- }
-
- @Override
- public Appendable append(CharSequence csq, int start, int end) {
- CharSequence cs = csq == null ? "null" : csq;
- write(cs.subSequence(start, end).toString());
- return this;
- }
-
- }
-}
+/*******************************************************************************
+ * 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.skynet.blam.sections;
+
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.ActionContributionItem;
+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;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.forms.IManagedForm;
+import org.eclipse.ui.forms.editor.FormEditor;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+import org.eclipse.ui.forms.widgets.Section;
+
+/**
+ * @author Roberto E. Escobar
+ */
+public class BlamOutputSection extends BaseBlamSection {
+
+ private Text formText;
+ private Appendable appendableOutput;
+ private final Action executBlamAction;
+
+ public BlamOutputSection(FormEditor editor, AbstractBlam abstractBlam, Composite parent, FormToolkit toolkit, int style, Action executBlamAction) {
+ super(editor, abstractBlam, parent, toolkit, style);
+ this.executBlamAction = executBlamAction;
+ }
+
+ public void simluateRun() {
+ this.executBlamAction.run();
+ }
+
+ @Override
+ public void initialize(IManagedForm form) {
+ super.initialize(form);
+ Section section = getSection();
+ section.setText("Execute");
+ section.setLayout(new GridLayout());
+ section.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
+
+ 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));
+
+ if (executBlamAction != null) {
+ ActionContributionItem contributionItem = new ActionContributionItem(executBlamAction);
+ contributionItem.setMode(ActionContributionItem.MODE_FORCE_TEXT);
+ contributionItem.fill(composite);
+ }
+
+ formText = toolkit.createText(composite, "BLAM has not yet run\n", SWT.WRAP);
+ GridData gd = new GridData(SWT.FILL, SWT.FILL, true, true);
+ gd.heightHint = 500;
+ gd.widthHint = 200;
+ formText.setLayoutData(gd);
+
+ getSection().setClient(composite);
+ toolkit.paintBordersFor(composite);
+
+ section.layout(true);
+ form.getForm().getBody().layout(true);
+
+ }
+
+ public void appendText(final String text) {
+ Displays.ensureInDisplayThread(new Runnable() {
+ @Override
+ public void run() {
+ if (Widgets.isAccessible(formText)) {
+ formText.append(text);
+ getManagedForm().reflow(true);
+ }
+ }
+ });
+ }
+
+ public void setText(final String text) {
+ Displays.ensureInDisplayThread(new Runnable() {
+ @Override
+ public void run() {
+ if (Widgets.isAccessible(formText)) {
+ formText.setText(text);
+ getManagedForm().reflow(true);
+ }
+ }
+ });
+ }
+
+ public Appendable getOutput() {
+ if (appendableOutput == null) {
+ appendableOutput = new InternalAppendable();
+ }
+ return appendableOutput;
+ }
+
+ @Override
+ public void dispose() {
+ if (Widgets.isAccessible(formText)) {
+ formText.dispose();
+ }
+ super.dispose();
+ }
+
+ @Override
+ public void refresh() {
+ super.refresh();
+ }
+
+ private final class InternalAppendable implements Appendable {
+
+ private void write(final String text) {
+ appendText(text);
+ }
+
+ @Override
+ public Appendable append(CharSequence csq) {
+ if (csq == null) {
+ write("null");
+ } else {
+ write(csq.toString());
+ }
+ return this;
+ }
+
+ @Override
+ public Appendable append(char c) {
+ write(new String(new char[] {c}));
+ return this;
+ }
+
+ @Override
+ public Appendable append(CharSequence csq, int start, int end) {
+ CharSequence cs = csq == null ? "null" : csq;
+ write(cs.subSequence(start, end).toString());
+ return this;
+ }
+
+ }
+}
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/Handlers.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/Handlers.java
index 4f088694d1f..9f85d6680fd 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/Handlers.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/Handlers.java
@@ -32,7 +32,6 @@ public class Handlers {
* Populates a list of ArtifactChange from a IStructuredSelection. Returns an empty list if no ArtifactChange were
* found.
*
- * @param selection
*/
public static List<Change> getArtifactChangesFromStructuredSelection(IStructuredSelection structuredSelection) {
return processSelectionObjects(Change.class, structuredSelection);
@@ -42,7 +41,6 @@ public class Handlers {
* Populates a list of TransactionIds from a IStructuredSelection. Returns an empty list if no TransactionIds were
* found.
*
- * @param selection
*/
public static List<TransactionRecord> getTransactionsFromStructuredSelection(IStructuredSelection structuredSelection) {
return processSelectionObjects(TransactionRecord.class, structuredSelection);
@@ -51,7 +49,6 @@ public class Handlers {
/**
* Populates a list of branches from a IStructuredSelection. Returns an empty list if no branches were found.
*
- * @param selection
*/
public static List<Branch> getBranchesFromStructuredSelection(IStructuredSelection structuredSelection) {
return processSelectionObjects(Branch.class, structuredSelection);
@@ -60,15 +57,12 @@ public class Handlers {
/**
* Populates a list of artifacts from a IStructuredSelection. Returns an empty list if no artifacts were found.
*
- * @param selection
*/
public static List<Artifact> getArtifactsFromStructuredSelection(IStructuredSelection structuredSelection) {
return processSelectionObjects(Artifact.class, structuredSelection);
}
/**
- * @param clazz
- * @param structuredSelection
* @return Returns a list of objects from the sturctruedSelection that are an instance of the Class
*/
public static <E> List<E> processSelectionObjects(Class<E> clazz, IStructuredSelection structuredSelection) {
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 14caa68ad00..04c24bde8d0 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
@@ -172,11 +172,6 @@ public abstract class CommitHandler extends CommandHandler {
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;
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/branch/commit/CommitIntoParentCompoundContributionItem.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/branch/commit/CommitIntoParentCompoundContributionItem.java
index c3f73009820..444e782e5e1 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/branch/commit/CommitIntoParentCompoundContributionItem.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/branch/commit/CommitIntoParentCompoundContributionItem.java
@@ -40,7 +40,8 @@ import org.eclipse.ui.menus.CommandContributionItemParameter;
* @author Jeff C. Phillips
*/
public class CommitIntoParentCompoundContributionItem extends CompoundContributionItem {
- private static final IParameter[] BRANCH_COMMIT_PARAMETER_DEF = new IParameter[] {new BranchIdParameter(),
+ private static final IParameter[] BRANCH_COMMIT_PARAMETER_DEF = new IParameter[] {
+ new BranchIdParameter(),
new CommitBranchParameter()};
private ICommandService commandService;
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/dbHealth/ArtifactIdWithoutVersionsCheck.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/dbHealth/ArtifactIdWithoutVersionsCheck.java
index 6c5cd6e8965..35ce71f9ba3 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/dbHealth/ArtifactIdWithoutVersionsCheck.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/dbHealth/ArtifactIdWithoutVersionsCheck.java
@@ -38,9 +38,6 @@ public class ArtifactIdWithoutVersionsCheck extends DatabaseHealthOperation {
private static final String GET_INVALID_ACL_ART_IDS =
"select item.art_id as artId from osee_artifact_acl item where NOT EXISTS (select oav.art_id from osee_artifact oav where oav.art_id = item.art_id)";
- /**
- * @param operationName
- */
public ArtifactIdWithoutVersionsCheck() {
super("Artifact Id Without osee_artifact Table Entry");
}
@@ -88,7 +85,9 @@ public class ArtifactIdWithoutVersionsCheck extends DatabaseHealthOperation {
appendToDetails(AHTML.beginMultiColumnTable(100, 1));
appendToDetails(AHTML.addHeaderRowMultiColumnTable(new String[] {"TABLE", "REFERENCED_BY", "TOTAL INVALIDS"}));
for (ItemEntry entry : itemsToDelete) {
- appendToDetails(AHTML.addRowMultiColumnTable(new String[] {entry.table, entry.invalidField,
+ appendToDetails(AHTML.addRowMultiColumnTable(new String[] {
+ entry.table,
+ entry.invalidField,
String.valueOf(entry.invalids.size())}));
}
appendToDetails(AHTML.endMultiColumnTable());
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/dbHealth/BranchStateHealthCheck.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/dbHealth/BranchStateHealthCheck.java
index 311d2ae2cb2..80af9b4c5f4 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/dbHealth/BranchStateHealthCheck.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/dbHealth/BranchStateHealthCheck.java
@@ -56,8 +56,16 @@ public class BranchStateHealthCheck extends DatabaseHealthOperation {
checkForCancelledStatus(monitor);
appendToDetails(AHTML.beginMultiColumnTable(100, 1));
- appendToDetails(AHTML.addHeaderRowMultiColumnTable(new String[] {"Reason", "Was State", "Fixed State",
- "BranchType", "Archived", "Txs", "Commit Tx", "BranchId", "Branch Name"}));
+ appendToDetails(AHTML.addHeaderRowMultiColumnTable(new String[] {
+ "Reason",
+ "Was State",
+ "Fixed State",
+ "BranchType",
+ "Archived",
+ "Txs",
+ "Commit Tx",
+ "BranchId",
+ "Branch Name"}));
Collections.sort(itemsToFix, new Comparator<BranchData>() {
@Override
@@ -77,11 +85,16 @@ public class BranchStateHealthCheck extends DatabaseHealthOperation {
});
for (BranchData data : itemsToFix) {
- appendToDetails(AHTML.addRowMultiColumnTable(new String[] {data.getReason(),
- String.valueOf(data.getOriginalBranchState()), String.valueOf(data.getBranchState()),
- String.valueOf(data.getBranchType()), String.valueOf(data.isArchived()),
- String.valueOf(data.getNumberOfTxs()), String.valueOf(data.hasCommitTransactionId()),
- String.valueOf(data.getId()), data.getBranchName()}));
+ appendToDetails(AHTML.addRowMultiColumnTable(new String[] {
+ data.getReason(),
+ String.valueOf(data.getOriginalBranchState()),
+ String.valueOf(data.getBranchState()),
+ String.valueOf(data.getBranchType()),
+ String.valueOf(data.isArchived()),
+ String.valueOf(data.getNumberOfTxs()),
+ String.valueOf(data.hasCommitTransactionId()),
+ String.valueOf(data.getId()),
+ data.getBranchName()}));
}
appendToDetails(AHTML.endMultiColumnTable());
monitor.worked(calculateWork(0.25));
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/dbHealth/DuplicateAttributes.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/dbHealth/DuplicateAttributes.java
index 5a44b5e9fe9..bd6a4b8869f 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/dbHealth/DuplicateAttributes.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/dbHealth/DuplicateAttributes.java
@@ -104,8 +104,18 @@ public class DuplicateAttributes extends DatabaseHealthOperation {
StringBuffer sbFull = new StringBuffer(AHTML.beginMultiColumnTable(100, 1));
try {
String[] columnHeaders =
- new String[] {"Art Id", "Attr id 1", "Attr id 2", "Name", "Value 1", "Value 2", "URI 1", "URI 2",
- "Gamma ID 1", "Gamma Id 2", "ID to Delete"};
+ new String[] {
+ "Art Id",
+ "Attr id 1",
+ "Attr id 2",
+ "Name",
+ "Value 1",
+ "Value 2",
+ "URI 1",
+ "URI 2",
+ "Gamma ID 1",
+ "Gamma Id 2",
+ "ID to Delete"};
sbFull.append(AHTML.beginMultiColumnTable(100, 1));
sbFull.append(AHTML.addHeaderRowMultiColumnTable(columnHeaders));
sbFull.append(AHTML.addRowSpanMultiColumnTable("Attributes with the same values", columnHeaders.length));
@@ -158,11 +168,18 @@ public class DuplicateAttributes extends DatabaseHealthOperation {
AttributeData attributeData1 = duplicate.getAttributeData1();
AttributeData attributeData2 = duplicate.getAttributeData2();
- builder.append(AHTML.addRowMultiColumnTable(new String[] {String.valueOf(duplicate.getArtId()),
- String.valueOf(attributeData1.getAttrId()), String.valueOf(attributeData2.getAttrId()),
- duplicate.getName(), attributeData1.getValue(), attributeData2.getValue(), attributeData1.getUri(),
- attributeData2.getUri(), String.valueOf(attributeData1.getGamma()),
- String.valueOf(attributeData2.getGamma()), fixMessage}));
+ builder.append(AHTML.addRowMultiColumnTable(new String[] {
+ String.valueOf(duplicate.getArtId()),
+ String.valueOf(attributeData1.getAttrId()),
+ String.valueOf(attributeData2.getAttrId()),
+ duplicate.getName(),
+ attributeData1.getValue(),
+ attributeData2.getValue(),
+ attributeData1.getUri(),
+ attributeData2.getUri(),
+ String.valueOf(attributeData1.getGamma()),
+ String.valueOf(attributeData2.getGamma()),
+ fixMessage}));
count++;
}
return count;
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/dbHealth/DuplicateHRID.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/dbHealth/DuplicateHRID.java
index a2c0d6f1680..0a9b780317b 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/dbHealth/DuplicateHRID.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/dbHealth/DuplicateHRID.java
@@ -114,13 +114,19 @@ public class DuplicateHRID extends DatabaseHealthOperation {
if (results == null) {
results =
- new String[] {String.valueOf(getAdditionalCounts(COUNT_ATTRIBUTE_VALUES_CONTAINING, dup.hrid)),
+ new String[] {
+ String.valueOf(getAdditionalCounts(COUNT_ATTRIBUTE_VALUES_CONTAINING, dup.hrid)),
String.valueOf(getAdditionalCounts(COUNT_COMMENTS_CONTAINING, dup.hrid)),
String.valueOf(getAdditionalCounts(COUNT_BRANCH_NAMES_CONTAINING, dup.hrid))};
knownValues.put(dup.hrid, results);
}
- rd.addRaw(AHTML.addRowMultiColumnTable(new String[] {dup.guid, dup.hrid, dup.artTypeName, results[0],
- results[1], results[2]}));
+ rd.addRaw(AHTML.addRowMultiColumnTable(new String[] {
+ dup.guid,
+ dup.hrid,
+ dup.artTypeName,
+ results[0],
+ results[1],
+ results[2]}));
monitor.worked(stepAmount);
}
} else {
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/dbHealth/HealthHelper.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/dbHealth/HealthHelper.java
index 31343d14646..d5b4ea881e6 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/dbHealth/HealthHelper.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/dbHealth/HealthHelper.java
@@ -31,9 +31,12 @@ public class HealthHelper {
public static final String ALL_BACKING_GAMMAS =
"(SELECT gamma_id FROM osee_artifact UNION SELECT gamma_id FROM osee_attribute UNION SELECT gamma_id FROM osee_relation_link)";
- private static final String[] NO_TX_CURRENT_SET = {"SELECT distinct t1.", ", txs1.branch_id FROM osee_txs txs1, ",
+ private static final String[] NO_TX_CURRENT_SET = {
+ "SELECT distinct t1.",
+ ", txs1.branch_id FROM osee_txs txs1, ",
" t1 WHERE txs1.gamma_id = t1.gamma_id AND txs1.tx_current = 0 %s SELECT distinct t2.",
- ", txs2.branch_id FROM osee_txs txs2, ", " t2 WHERE txs2.gamma_id = t2.gamma_id AND txs2.tx_current != 0"};
+ ", txs2.branch_id FROM osee_txs txs2, ",
+ " t2 WHERE txs2.gamma_id = t2.gamma_id AND txs2.tx_current != 0"};
private static final String[] MULTIPLE_TX_CURRENT_SET =
{
@@ -48,7 +51,8 @@ public class HealthHelper {
"UPDATE osee_txs SET tx_current = CASE WHEN mod_type = 3 THEN 2 WHEN mod_type = 5 THEN 3 ELSE 1 END WHERE (gamma_id, transaction_id) = (SELECT txs1.gamma_id, txs1.transaction_id FROM osee_txs txs1, ",
" t1 WHERE t1.",
" = ? AND t1.gamma_id = txs1.gamma_id AND txs1.transaction_id = (SELECT max(txs.transaction_id) FROM osee_txs txs, ",
- " t2 WHERE txs.branch_id = ? AND txs.gamma_id = t2.gamma_id AND t2.", " = ?))"};
+ " t2 WHERE txs.branch_id = ? AND txs.gamma_id = t2.gamma_id AND t2.",
+ " = ?))"};
private static final String[] DUPLICATE_TX_CURRENT_CLEANUP =
{
@@ -103,8 +107,10 @@ public class HealthHelper {
while (chStmt.next()) {
noneSet.add(new Pair<Integer, Integer>(chStmt.getInt(dataColumnName), chStmt.getInt("branch_id")));
- resultsTab.addRow(new ResultsXViewerRow(new String[] {String.valueOf(counter++),
- String.valueOf(chStmt.getInt(dataColumnName)), String.valueOf(chStmt.getInt("branch_id"))}));
+ resultsTab.addRow(new ResultsXViewerRow(new String[] {
+ String.valueOf(counter++),
+ String.valueOf(chStmt.getInt(dataColumnName)),
+ String.valueOf(chStmt.getInt("branch_id"))}));
}
} finally {
chStmt.close();
@@ -174,8 +180,11 @@ public class HealthHelper {
public static void dumpDataMultiple(Appendable sbFull, HashSet<LocalTxData> multipleSet) throws IOException {
int counter = 0;
for (LocalTxData link : multipleSet) {
- sbFull.append(AHTML.addRowMultiColumnTable(new String[] {String.valueOf(counter++),
- String.valueOf(link.dataId), String.valueOf(link.branchId), String.valueOf(link.number)}));
+ sbFull.append(AHTML.addRowMultiColumnTable(new String[] {
+ String.valueOf(counter++),
+ String.valueOf(link.dataId),
+ String.valueOf(link.branchId),
+ String.valueOf(link.number)}));
}
}
}
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/dbHealth/ItemsDeletedWithNoOtherModification.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/dbHealth/ItemsDeletedWithNoOtherModification.java
index 65591a11bb1..9b0a92cbfc2 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/dbHealth/ItemsDeletedWithNoOtherModification.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/dbHealth/ItemsDeletedWithNoOtherModification.java
@@ -58,7 +58,12 @@ public class ItemsDeletedWithNoOtherModification extends DatabaseHealthOperation
private static final String REMOVE_NOT_ADDRESSED_GAMMAS =
"DELETE FROM osee_txs WHERE gamma_id = ? AND transaction_id = ?";
- private static final String[] COLUMN_HEADER = {"Gamma Id", "Transaction Id", "Branch Id", "Art id", "Attribute Id",
+ private static final String[] COLUMN_HEADER = {
+ "Gamma Id",
+ "Transaction Id",
+ "Branch Id",
+ "Art id",
+ "Attribute Id",
"Rel Link Id"};
private Set<LocalValues> addressing = null;
@@ -152,9 +157,13 @@ public class ItemsDeletedWithNoOtherModification extends DatabaseHealthOperation
if (value.relLinkId != 0) {
relLinkCount++;
}
- sbFull.append(AHTML.addRowMultiColumnTable(new String[] {String.valueOf(value.gammaId),
- String.valueOf(value.transactionId), String.valueOf(value.branchId), String.valueOf(value.artId),
- String.valueOf(value.attributeId), String.valueOf(value.relLinkId)}));
+ sbFull.append(AHTML.addRowMultiColumnTable(new String[] {
+ String.valueOf(value.gammaId),
+ String.valueOf(value.transactionId),
+ String.valueOf(value.branchId),
+ String.valueOf(value.artId),
+ String.valueOf(value.attributeId),
+ String.valueOf(value.relLinkId)}));
}
builder.append(verify ? "Found " : "Fixed ");
builder.append(String.valueOf(artifactCount));
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/dbHealth/MultipleParentRelations.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/dbHealth/MultipleParentRelations.java
index f3bc8ae23b1..8ba99259cf3 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/dbHealth/MultipleParentRelations.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/dbHealth/MultipleParentRelations.java
@@ -85,9 +85,20 @@ public class MultipleParentRelations extends DatabaseHealthOperation {
private static final String GET_BRANCH_NAME = "Select branch_name from osee_branch where branch_id = ?";
- private static final String[] columnHeaders = new String[] {"Rel Link ID 1", "Rel Link ID 2", "Parent Art ID 1",
- "P1 Art Name", "Parent Art ID 2", "P2 Art Name", "Child Art ID", "Child Art Name", "Branch Ids", "Branch Name",
- "Archived", "Author 1", "Author 2"};
+ private static final String[] columnHeaders = new String[] {
+ "Rel Link ID 1",
+ "Rel Link ID 2",
+ "Parent Art ID 1",
+ "P1 Art Name",
+ "Parent Art ID 2",
+ "P2 Art Name",
+ "Child Art ID",
+ "Child Art Name",
+ "Branch Ids",
+ "Branch Name",
+ "Archived",
+ "Author 1",
+ "Author 2"};
private static final String HEADER = "Artifacts that have multiple Parents";
@@ -183,12 +194,20 @@ public class MultipleParentRelations extends DatabaseHealthOperation {
for (LocalRelationLink relLink : relations) {
if (!relLink.author1.equals("")) {
count++;
- sbFull.append(AHTML.addRowMultiColumnTable(new String[] {Integer.toString(relLink.relLinkId1),
- Integer.toString(relLink.relLinkId2), Integer.toString(relLink.parentArtId1), relLink.parentArt1,
- Integer.toString(relLink.parentArtId2), relLink.parentArt2, Integer.toString(relLink.childArtId),
+ sbFull.append(AHTML.addRowMultiColumnTable(new String[] {
+ Integer.toString(relLink.relLinkId1),
+ Integer.toString(relLink.relLinkId2),
+ Integer.toString(relLink.parentArtId1),
+ relLink.parentArt1,
+ Integer.toString(relLink.parentArtId2),
+ relLink.parentArt2,
+ Integer.toString(relLink.childArtId),
relLink.childArt,
displayAll ? branches.get(relLink.relLinkId1).toString() : Integer.toString(relLink.branchId),
- relLink.branch, Integer.toString(relLink.archived), relLink.author1, relLink.author2}));
+ relLink.branch,
+ Integer.toString(relLink.archived),
+ relLink.author1,
+ relLink.author2}));
}
}
}
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/dbHealth/RelationIntegrityCheck.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/dbHealth/RelationIntegrityCheck.java
index b6f38765168..cba6709b49a 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/dbHealth/RelationIntegrityCheck.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/dbHealth/RelationIntegrityCheck.java
@@ -74,13 +74,21 @@ public class RelationIntegrityCheck extends DatabaseHealthOperation {
private static final String INSERT_TXS =
"INSERT INTO osee_txs (gamma_id, transaction_id, tx_current, mod_type, branch_id) VALUES (?, ?, " + TxChange.ARTIFACT_DELETED.getValue() + ", " + ModificationType.ARTIFACT_DELETED.getValue() + ", ?)";
- private static final String[] columnHeaders = new String[] {"Rel Link ID", "Gamma Id", "Transaction Id",
- "Branch_id", "A Art Id", "B Art Id", "Transaction ID of Deleted Artifact"};
-
- private static final String[] DESCRIPTION = {"Relation Links with non existent Artifacts on the Branch\n",
+ private static final String[] columnHeaders = new String[] {
+ "Rel Link ID",
+ "Gamma Id",
+ "Transaction Id",
+ "Branch_id",
+ "A Art Id",
+ "B Art Id",
+ "Transaction ID of Deleted Artifact"};
+
+ private static final String[] DESCRIPTION = {
+ "Relation Links with non existent Artifacts on the Branch\n",
"Relation Links with deleted Artifacts on the Branch\n"};
- private static final String[] HEADER = {"%S Relation Links that have artifacts that don't exist on the branch",
+ private static final String[] HEADER = {
+ "%S Relation Links that have artifacts that don't exist on the branch",
"%s Relation Links that have artifacts that are deleted on the branch"};
private DoubleKeyHashMap<Integer, Integer, LocalRelationLink> deleteMap = null;
@@ -178,7 +186,9 @@ public class RelationIntegrityCheck extends DatabaseHealthOperation {
updateCurrentAddressing.add(new Object[] {relLink.gammaId, relLink.relTransId});
} else {
updatePreviousAddressing.add(new Object[] {relLink.gammaId, relLink.relTransId});
- insertArtifactDeleted.add(new Object[] {relLink.gammaId, relLink.transIdForArtifactDeletion,
+ insertArtifactDeleted.add(new Object[] {
+ relLink.gammaId,
+ relLink.transIdForArtifactDeletion,
relLink.branchId});
}
}
@@ -212,9 +222,13 @@ public class RelationIntegrityCheck extends DatabaseHealthOperation {
sbFull.append(AHTML.addRowSpanMultiColumnTable(header, columnHeaders.length));
for (LocalRelationLink relLink : map.allValues()) {
count++;
- sbFull.append(AHTML.addRowMultiColumnTable(new String[] {Integer.toString(relLink.relLinkId),
- Integer.toString(relLink.gammaId), Integer.toString(relLink.relTransId),
- Integer.toString(relLink.branchId), Integer.toString(relLink.aArtId), Integer.toString(relLink.bArtId),
+ sbFull.append(AHTML.addRowMultiColumnTable(new String[] {
+ Integer.toString(relLink.relLinkId),
+ Integer.toString(relLink.gammaId),
+ Integer.toString(relLink.relTransId),
+ Integer.toString(relLink.branchId),
+ Integer.toString(relLink.aArtId),
+ Integer.toString(relLink.bArtId),
Integer.toString(relLink.transIdForArtifactDeletion)}));
}
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/dbHealth/RepeatEnumerationAttributeValues.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/dbHealth/RepeatEnumerationAttributeValues.java
index 39dd9c24298..aa0d2c6f312 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/dbHealth/RepeatEnumerationAttributeValues.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/dbHealth/RepeatEnumerationAttributeValues.java
@@ -70,8 +70,10 @@ public class RepeatEnumerationAttributeValues extends DatabaseHealthOperation {
for (Branch branch : attributesWithErrors.keySet()) {
appendToDetails(AHTML.addRowSpanMultiColumnTable(branch.getName(), 3));
for (AttrData attrData : attributesWithErrors.getValues(branch)) {
- appendToDetails(AHTML.addRowMultiColumnTable(new String[] {attrData.getArtifactGuid(),
- AttributeTypeManager.getType(attrData.getAttributeTypeId()).getName(), attrData.getValue()}));
+ appendToDetails(AHTML.addRowMultiColumnTable(new String[] {
+ attrData.getArtifactGuid(),
+ AttributeTypeManager.getType(attrData.getAttributeTypeId()).getName(),
+ attrData.getValue()}));
}
}
appendToDetails(AHTML.endMultiColumnTable());
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/dialogs/ListDialogSortable.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/dialogs/ListDialogSortable.java
index 75510911331..95d8ddc9401 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/dialogs/ListDialogSortable.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/dialogs/ListDialogSortable.java
@@ -24,16 +24,10 @@ public class ListDialogSortable extends ListDialog {
private ViewerSorter viewerSorter;
- /**
- * @param parent
- */
public ListDialogSortable(Shell parent) {
super(parent);
}
- /**
- * @param parent
- */
public ListDialogSortable(ViewerSorter viewerSorter, Shell parent) {
super(parent);
this.viewerSorter = viewerSorter;
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/diffWizard/DiffWizardPage.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/diffWizard/DiffWizardPage.java
index 1976f233812..b0d4c402b46 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/diffWizard/DiffWizardPage.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/diffWizard/DiffWizardPage.java
@@ -136,9 +136,6 @@ public class DiffWizardPage extends WizardPage {
}
};
- /**
- * @param pageName
- */
public DiffWizardPage(Conflict conflict) {
super(TITLE);
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/export/ArtifactExportJob.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/export/ArtifactExportJob.java
index 2935498f112..b87968101c8 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/export/ArtifactExportJob.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/export/ArtifactExportJob.java
@@ -38,9 +38,6 @@ public class ArtifactExportJob extends Job {
private final File rootExportPath;
private final Collection<Artifact> exportArtifacts;
- /**
- * @param name
- */
public ArtifactExportJob(File exportPath, Collection<Artifact> exportArtifacts) {
super("Artifact Export");
this.rootExportPath = exportPath;
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/export/ArtifactExportPage.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/export/ArtifactExportPage.java
index 6eca1bfcbf4..f16e285856c 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/export/ArtifactExportPage.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/export/ArtifactExportPage.java
@@ -37,9 +37,6 @@ public class ArtifactExportPage extends WizardDataTransferPage {
private final File exportPath;
private final Collection<Artifact> selectedArtifacts;
- /**
- * @param pageName
- */
public ArtifactExportPage(IStructuredSelection selection) {
super("Main");
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/group/GroupTreeViewer.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/group/GroupTreeViewer.java
index da27cd1857e..3398ac3fbe7 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/group/GroupTreeViewer.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/group/GroupTreeViewer.java
@@ -20,9 +20,6 @@ public class GroupTreeViewer extends TreeViewer {
private final GroupExplorer groupExplorer;
- /**
- * @param parent
- */
public GroupTreeViewer(GroupExplorer groupExplorer, Composite parent) {
super(parent);
this.groupExplorer = groupExplorer;
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/internal/AccessPolicyHandlerServiceImpl.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/internal/AccessPolicyHandlerServiceImpl.java
index 170a5262c21..35d9609337a 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/internal/AccessPolicyHandlerServiceImpl.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/internal/AccessPolicyHandlerServiceImpl.java
@@ -39,9 +39,6 @@ public class AccessPolicyHandlerServiceImpl implements IAccessPolicyHandlerServi
}
/**
- * @param artifacts
- * @param attributeType
- * @param permission
* @param level - A level of OseeLevel.SEVERE_POPUP will cause an error dialog to be displayed to the user. All
* others will write to the log.
* @return PermissionStatus
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/menu/GlobalMenuListener.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/menu/GlobalMenuListener.java
index ac6c437d838..2411a931808 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/menu/GlobalMenuListener.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/menu/GlobalMenuListener.java
@@ -23,8 +23,6 @@ public interface GlobalMenuListener {
/**
* Called prior to performing the menu event. May or may not be called in display thread.
*
- * @param item
- * @param artifacts
* @return Result.False if action should NOT be performed Result.getText will be displayed as a popup to the user
*/
public Result actioning(GlobalMenuItem item, Collection<Artifact> artifacts);
@@ -32,8 +30,6 @@ public interface GlobalMenuListener {
/**
* Called after performing the menu event.
*
- * @param item
- * @param artifacts
*/
public void actioned(GlobalMenuItem item, Collection<Artifact> artifacts);
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/menu/GlobalMenuPermissions.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/menu/GlobalMenuPermissions.java
index ffc20d480a0..539355257bc 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/menu/GlobalMenuPermissions.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/menu/GlobalMenuPermissions.java
@@ -35,7 +35,6 @@ public class GlobalMenuPermissions {
* Return permission set. This is a one-shot deal at the time of instantiation. Permissions are not kept up to date
* with changes to getSelectedArtifacts in given globalMenuHelper. Must be called again to get refreshed permissions.
*
- * @param globalMenuHelper
*/
public GlobalMenuPermissions(IGlobalMenuHelper globalMenuHelper) throws OseeCoreException {
this(globalMenuHelper.getArtifacts());
@@ -44,7 +43,6 @@ public class GlobalMenuPermissions {
/**
* Return permission set for given artifact.
*
- * @param artifact
*/
public GlobalMenuPermissions(Artifact artifact) throws OseeCoreException {
this(Arrays.asList(artifact));
@@ -53,7 +51,6 @@ public class GlobalMenuPermissions {
/**
* Return permission set for given artifacts.
*
- * @param artifacts
*/
public GlobalMenuPermissions(Collection<Artifact> artifacts) throws OseeCoreException {
hasArtifacts = artifacts.size() > 0;
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/mergeWizard/EditAttributeWizardPage.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/mergeWizard/EditAttributeWizardPage.java
index 5cdb11dc156..0d06e1f3789 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/mergeWizard/EditAttributeWizardPage.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/mergeWizard/EditAttributeWizardPage.java
@@ -80,9 +80,6 @@ public class EditAttributeWizardPage extends WizardPage {
}
};
- /**
- * @param pageName
- */
public EditAttributeWizardPage(AttributeConflict conflict) {
super(TITLE);
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/mergeWizard/EditWFCAttributeWizardPage.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/mergeWizard/EditWFCAttributeWizardPage.java
index c96ce5ead9e..916a1c2d0bc 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/mergeWizard/EditWFCAttributeWizardPage.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/mergeWizard/EditWFCAttributeWizardPage.java
@@ -137,9 +137,6 @@ public class EditWFCAttributeWizardPage extends WizardPage {
}
};
- /**
- * @param pageName
- */
public EditWFCAttributeWizardPage(AttributeConflict conflict) {
super(TITLE);
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/notify/OseeNotifyUsersJob.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/notify/OseeNotifyUsersJob.java
index 6292f00de03..930dee4660b 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/notify/OseeNotifyUsersJob.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/notify/OseeNotifyUsersJob.java
@@ -86,8 +86,11 @@ public class OseeNotifyUsersJob extends Job {
sb.append(AHTML.beginMultiColumnTable(100, 1));
sb.append(AHTML.addHeaderRowMultiColumnTable(new String[] {"Reason", "Description", "Id", "URL"}));
for (OseeNotificationEvent notificationEvent : notificationEvents) {
- sb.append(AHTML.addRowMultiColumnTable(new String[] {notificationEvent.getType(),
- notificationEvent.getDescription(), notificationEvent.getId(), getHyperlink(notificationEvent)}));
+ sb.append(AHTML.addRowMultiColumnTable(new String[] {
+ notificationEvent.getType(),
+ notificationEvent.getDescription(),
+ notificationEvent.getId(),
+ getHyperlink(notificationEvent)}));
}
sb.append(AHTML.endMultiColumnTable());
return sb.toString().replaceAll("\n", "");
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/panels/DetailsBrowserComposite.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/panels/DetailsBrowserComposite.java
index fb9ddf2f1f5..6eb36f7a0b6 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/panels/DetailsBrowserComposite.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/panels/DetailsBrowserComposite.java
@@ -23,10 +23,6 @@ import org.eclipse.swt.widgets.ToolBar;
*/
public class DetailsBrowserComposite extends BrowserComposite {
- /**
- * @param parent
- * @param style
- */
public DetailsBrowserComposite(Artifact artifact, Composite parent, int style, ToolBar toolBar) {
super(parent, style, toolBar);
StringBuilder sb = new StringBuilder();
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/relation/explorer/ArtifactModelList.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/relation/explorer/ArtifactModelList.java
index 5e63c1c2bae..609648dc553 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/relation/explorer/ArtifactModelList.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/relation/explorer/ArtifactModelList.java
@@ -82,16 +82,10 @@ public class ArtifactModelList {
}
}
- /**
- * @param viewer
- */
public void removeChangeListener(IArtifactListViewer viewer) {
changeListeners.remove(viewer);
}
- /**
- * @param viewer
- */
public void addChangeListener(IArtifactListViewer viewer) {
changeListeners.add(viewer);
}
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/ITemplateRenderer.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/ITemplateRenderer.java
index ce983b478c2..64f8015cdd6 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/ITemplateRenderer.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/ITemplateRenderer.java
@@ -20,6 +20,7 @@ public interface ITemplateRenderer extends IRenderer {
public static final String PREVIEW_WITH_RECURSE_NO_ATTRIBUTES_VALUE = "PREVIEW_WITH_RECURSE_NO_ATTRIBUTES";
public static final String DIFF_VALUE = "DIFF";
public static final String DIFF_NO_ATTRIBUTES_VALUE = "DIFF_NO_ATTRIBUTES";
- public static final Object[] PREVIEW_WITH_RECURSE_OPTION_PAIR = new String[] {TEMPLATE_OPTION,
+ public static final Object[] PREVIEW_WITH_RECURSE_OPTION_PAIR = new String[] {
+ TEMPLATE_OPTION,
PREVIEW_WITH_RECURSE_VALUE};
}
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/RendererManager.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/RendererManager.java
index b6a87e92104..a8c0f4db4b5 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/RendererManager.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/RendererManager.java
@@ -53,8 +53,6 @@ public final class RendererManager {
}
/**
- * @param artifacts
- * @param presentationType
* @return Returns the intersection of renderers applicable for all of the artifacts
* @throws OseeCoreException
*/
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/WordTemplateRenderer.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/WordTemplateRenderer.java
index 65255db6262..16cb585475a 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/WordTemplateRenderer.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/WordTemplateRenderer.java
@@ -102,7 +102,6 @@ public class WordTemplateRenderer extends WordRenderer implements ITemplateRende
* Displays a list of artifacts in the Artifact Explorer that could not be multi edited because they contained
* artifacts that had an OLEData attribute.
*
- * @param artifacts
*/
private void displayNotMultiEditArtifacts(final Collection<Artifact> artifacts, final String warningString) {
if (!artifacts.isEmpty()) {
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/artifactElement/WordArtifactElementExtractor.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/artifactElement/WordArtifactElementExtractor.java
index 83660517fc6..686f24869be 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/artifactElement/WordArtifactElementExtractor.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/artifactElement/WordArtifactElementExtractor.java
@@ -109,7 +109,6 @@ public class WordArtifactElementExtractor implements IElementExtractor {
}
/**
- * @param element
* @return
*/
private boolean elementHasGrandChildren(Node element) {
@@ -129,9 +128,7 @@ public class WordArtifactElementExtractor implements IElementExtractor {
}
/**
- * @param element
* @param keepSide TODO
- * @param childNodes
* @return
*/
private Node cloneWithoutArtifactEditTag(Element element, Side keepSide) {
@@ -161,7 +158,6 @@ public class WordArtifactElementExtractor implements IElementExtractor {
}
/**
- * @param element
* @return
*/
private boolean isEditLink(Node element) {
@@ -185,8 +181,6 @@ public class WordArtifactElementExtractor implements IElementExtractor {
}
/**
- * @param newArtifactElement
- * @param element
* @throws DOMException
* @throws OseeCoreException
*/
@@ -197,7 +191,6 @@ public class WordArtifactElementExtractor implements IElementExtractor {
}
/**
- * @param element
* @return
*/
private boolean isArtifactEditTag(Element element) {
@@ -216,7 +209,6 @@ public class WordArtifactElementExtractor implements IElementExtractor {
}
/**
- * @param element
* @return
*/
private boolean properLevelChild(Element element) {
@@ -264,7 +256,6 @@ public class WordArtifactElementExtractor implements IElementExtractor {
}
/**
- * @param element
* @return
*/
private boolean properLevelChildWord2003(Element element) {
@@ -282,7 +273,6 @@ public class WordArtifactElementExtractor implements IElementExtractor {
}
/**
- * @param element
* @return
*/
private boolean properLevelChildWord2007(Element element) {
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/word/WordMLProducer.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/word/WordMLProducer.java
index e1f68dcbf01..9a3f9fec5d4 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/word/WordMLProducer.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/word/WordMLProducer.java
@@ -265,7 +265,6 @@ public class WordMLProducer extends Producer {
/**
* This method will escape the provided text.
*
- * @param text
* @throws OseeWrappedException
*/
public void addTextInsideParagraph(CharSequence text) throws OseeCoreException {
@@ -310,9 +309,6 @@ public class WordMLProducer extends Producer {
return outlineLevel < 9;
}
- /**
- * @param nextOutlineNumber
- */
public void setNextParagraphNumberTo(String nextOutlineNumber) {
String[] nextOutlineNumbers = nextOutlineNumber.split("\\.");
Arrays.fill(outlineNumber, 0);
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/word/WordTemplateProcessor.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/word/WordTemplateProcessor.java
index b5899e84c23..7d5b4acd6c8 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/word/WordTemplateProcessor.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/word/WordTemplateProcessor.java
@@ -115,10 +115,6 @@ public class WordTemplateProcessor {
* Parse through template to find xml defining artifact sets and replace it with the result of publishing those
* artifacts Only used by Publish SRS
*
- * @param variableMap
- * @param masterTemplateArtifact
- * @param slaveTemplateArtifact
- * @param artifacts
* @throws OseeCoreException
* @throws IOException
*/
@@ -144,10 +140,8 @@ public class WordTemplateProcessor {
*
* @param variableMap = will be filled with artifacts when specified in the template
* @param artifacts = null if the template defines the artifacts to be used in the publishing
- * @param template
* @param folder = null when not using an extension template
* @param outlineNumber if null will find based on first artifact
- * @param outlineType
* @return InputStream
* @throws OseeCoreException
*/
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/word/template/AddTemplateText.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/word/template/AddTemplateText.java
index 507bd0a7758..a6510bb29b8 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/word/template/AddTemplateText.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/word/template/AddTemplateText.java
@@ -25,11 +25,6 @@ public class AddTemplateText implements ITemplateTask {
private final int begin;
private final int end;
- /**
- * @param last
- * @param start
- * @param template
- */
public AddTemplateText(int begin, int end, String template) {
this.template = template;
this.end = end;
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/word/template/TemplateAttribute.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/word/template/TemplateAttribute.java
index 409589a921e..f678e706daf 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/word/template/TemplateAttribute.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/word/template/TemplateAttribute.java
@@ -45,38 +45,23 @@ public class TemplateAttribute implements ITemplateTask {
this.paragraphWrap = copyMe.paragraphWrap;
}
- /**
- * @param group
- */
public void addName(String name) {
trimTags.reset(name);
this.name = trimTags.replaceAll("");
}
- /**
- * @param group
- */
public void addLabel(String label) {
this.label = label;
}
- /**
- * @param group
- */
public void addEditable(String editable) {
this.editable = editable;
}
- /**
- * @param group
- */
public void addFormat(String format) {
this.format = format;
}
- /**
- * @param group
- */
public void addNOutline(String outline) {
this.outline = outline;
}
@@ -120,9 +105,6 @@ public class TemplateAttribute implements ITemplateTask {
return getName().equals("*");
}
- /**
- * @param group
- */
public void addParagraphWrap(String group) {
trimTags.reset(group);
String value = trimTags.replaceAll("");
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/word/template/WordTemplateManager.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/word/template/WordTemplateManager.java
index f6fb69ab214..8fb7cce7175 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/word/template/WordTemplateManager.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/word/template/WordTemplateManager.java
@@ -167,7 +167,6 @@ public class WordTemplateManager {
}
/**
- * @param artifacts
* @throws Exception
*/
public void processArtifacts(WordMLProducer wordMl, List<Artifact> artifacts) throws OseeCoreException {
@@ -214,7 +213,6 @@ public class WordTemplateManager {
}
/**
- * @param artifacts
* @return
* @throws OseeCoreException
*/
@@ -236,8 +234,6 @@ public class WordTemplateManager {
/**
* This method expands wildcard(*) attribute names into all of the attribute types of a particular artifact.
*
- * @param tasks2
- * @param artifact
* @return
* @throws OseeCoreException
*/
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/results/XResultData.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/results/XResultData.java
index 63875daba6f..954f87241b6 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/results/XResultData.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/results/XResultData.java
@@ -46,7 +46,9 @@ public final class XResultData {
public static final Pattern WarningPattern = Pattern.compile("Warning: ");
private static enum Type {
- Severe, Warning, Info;
+ Severe,
+ Warning,
+ Info;
}
private final StringBuffer sb = new StringBuffer();
@@ -147,7 +149,7 @@ public final class XResultData {
public XResultPage getReport(final String title, Manipulations... manipulations) {
return new XResultPage(title + " - " + XDate.getDateNow(XDate.MMDDYYHHMM),
- (sb.toString().equals("") ? "Nothing Logged" : sb.toString()), manipulations);
+ (sb.toString().equals("") ? "Nothing Logged" : sb.toString()), manipulations);
}
/*
@@ -172,23 +174,24 @@ public final class XResultData {
* Creates hyperlink using name. Default editor will open hrid for branchId given
*/
public static String getHyperlink(String name, String hrid, int branchId) {
- return AHTML.getHyperlink(XResultBrowserHyperCmd.getHyperCmdStr(XResultBrowserHyperCmd.openArtifactBranch,
- hrid + "(" + branchId + ")"), name);
+ return AHTML.getHyperlink(
+ XResultBrowserHyperCmd.getHyperCmdStr(XResultBrowserHyperCmd.openArtifactBranch, hrid + "(" + branchId + ")"),
+ name);
}
public static String getHyperlinkUrlExternal(String name, String url) {
return AHTML.getHyperlink(XResultBrowserHyperCmd.getHyperCmdStr(XResultBrowserHyperCmd.browserExternal, url),
- name);
+ name);
}
public static String getHyperlinkUrlInternal(String name, String url) {
return AHTML.getHyperlink(XResultBrowserHyperCmd.getHyperCmdStr(XResultBrowserHyperCmd.browserInternal, url),
- name);
+ name);
}
public static String getHyperlinkForArtifactEditor(String name, String hrid) {
return AHTML.getHyperlink(XResultBrowserHyperCmd.getHyperCmdStr(XResultBrowserHyperCmd.openArtifactEditor, hrid),
- name);
+ name);
}
public static String getHyperlinkForAction(String name, String hrid) {
@@ -201,7 +204,7 @@ public final class XResultData {
public static String getHyperlinkForAction(String name, Artifact art) {
return AHTML.getHyperlink(
- XResultBrowserHyperCmd.getHyperCmdStr(XResultBrowserHyperCmd.openAction, art.getGuid()), name);
+ XResultBrowserHyperCmd.getHyperCmdStr(XResultBrowserHyperCmd.openAction, art.getGuid()), name);
}
private int getCount(Type type) {
@@ -254,16 +257,16 @@ public final class XResultData {
rd.log("\n\nExample of hyperlinked hrid: " + XResultData.getHyperlink(UserManager.getUser()));
rd.log("Example of hyperlinked artifact different hyperlink string: " + XResultData.getHyperlink(
- "Different string", UserManager.getUser()));
+ "Different string", UserManager.getUser()));
rd.log("Example of hyperlinked hrid on another branch: " + getHyperlink(
- UserManager.getUser().getHumanReadableId(), UserManager.getUser().getHumanReadableId(),
- BranchManager.getCommonBranch().getId()));
+ UserManager.getUser().getHumanReadableId(), UserManager.getUser().getHumanReadableId(),
+ BranchManager.getCommonBranch().getId()));
rd.addRaw(AHTML.newline());
rd.addRaw("Example of hyperlink that opens external browser " + getHyperlinkUrlExternal("Google",
- "http://www.google.com") + AHTML.newline());
+ "http://www.google.com") + AHTML.newline());
rd.addRaw("Example of hyperlink that opens internal browser " + getHyperlinkUrlInternal("Google",
- "http://www.google.com") + AHTML.newline());
+ "http://www.google.com") + AHTML.newline());
rd.log("\n\nHere is a nice table");
rd.addRaw(AHTML.beginMultiColumnTable(95, 1));
@@ -271,8 +274,10 @@ public final class XResultData {
for (int x = 0; x < 3; x++) {
rd.addRaw(AHTML.addRowMultiColumnTable(new String[] {"Type " + x, "Title " + x, x + ""}));
}
- rd.addRaw(AHTML.addRowMultiColumnTable(new String[] {"Error / Warning in table ", "Error: this is error",
- "Warning: this is warning"}));
+ rd.addRaw(AHTML.addRowMultiColumnTable(new String[] {
+ "Error / Warning in table ",
+ "Error: this is error",
+ "Warning: this is warning"}));
rd.addRaw(AHTML.endMultiColumnTable());
rd.report("This is my report title");
} catch (OseeCoreException ex) {
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/results/example/ResultsEditorExample.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/results/example/ResultsEditorExample.java
index 814e30510e4..d8f261107e4 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/results/example/ResultsEditorExample.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/results/example/ResultsEditorExample.java
@@ -75,9 +75,6 @@ public class ResultsEditorExample extends XNavigateItemAction {
private final static List<Double> chartValueStrsGoal = Arrays.asList(177.0, 174.0, 167.0, 161.0, 167.0, 167.0,
163.0, 165.0, 171.0, 179.0, 177.0, 175.0, 173.0, 171.0, 169.0, 167.0, 165.0);
- /**
- * @param parent
- */
public ResultsEditorExample(XNavigateItem parent) {
super(parent, TITLE, PluginUiImage.ADMIN);
}
@@ -87,8 +84,10 @@ public class ResultsEditorExample extends XNavigateItemAction {
StringBuilder sb = new StringBuilder();
sb.append(AHTML.heading(3, TITLE));
sb.append(AHTML.beginMultiColumnTable(100, 1));
- sb.append(AHTML.addHeaderRowMultiColumnTable(new String[] {Columns.Date.name(),
- Columns.Priority_123_Open_Bugs.name(), Columns.Goal.name()}));
+ sb.append(AHTML.addHeaderRowMultiColumnTable(new String[] {
+ Columns.Date.name(),
+ Columns.Priority_123_Open_Bugs.name(),
+ Columns.Goal.name()}));
for (int x = 0; x < chartDateStrs.size(); x++) {
sb.append(AHTML.addRowMultiColumnTable(chartDateStrs.get(x), "" + chartValueStrs.get(x),
"" + chartValueStrsGoal.get(x)));
@@ -198,8 +197,10 @@ public class ResultsEditorExample extends XNavigateItemAction {
public List<IResultsEditorTab> getResultsEditorTabs() {
List<IResultsXViewerRow> rows = new ArrayList<IResultsXViewerRow>();
for (int x = 0; x < chartDateStrs.size(); x++) {
- rows.add(new ResultsXViewerRow(new String[] {chartDateStrs.get(x),
- String.valueOf(chartValueStrs.get(x)), String.valueOf(chartValueStrsGoal.get(x))}));
+ rows.add(new ResultsXViewerRow(new String[] {
+ chartDateStrs.get(x),
+ String.valueOf(chartValueStrs.get(x)),
+ String.valueOf(chartValueStrsGoal.get(x))}));
}
List<XViewerColumn> columns =
Arrays.asList(new XViewerColumn(Columns.Date.name(), Columns.Date.name(), 80, SWT.LEFT, true,
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/results/example/XResultDataExample.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/results/example/XResultDataExample.java
index a23495e4b28..5aad8bdb0b8 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/results/example/XResultDataExample.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/results/example/XResultDataExample.java
@@ -23,9 +23,6 @@ public final class XResultDataExample extends XNavigateItemAction {
public static final String TITLE = "XResultData Example";
- /**
- * @param parent
- */
public XResultDataExample(XNavigateItem parent) {
super(parent, TITLE, PluginUiImage.ADMIN);
}
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/results/example/XViewerExample.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/results/example/XViewerExample.java
index 1cf0ac53a93..af4792f889b 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/results/example/XViewerExample.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/results/example/XViewerExample.java
@@ -39,9 +39,6 @@ public final class XViewerExample extends XNavigateItemAction {
String2;
};
- /**
- * @param parent
- */
public XViewerExample(XNavigateItem parent) {
super(parent, TITLE, PluginUiImage.ADMIN);
}
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/results/html/XResultPage.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/results/html/XResultPage.java
index ae0ff8c1ec2..dde42aadc77 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/results/html/XResultPage.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/results/html/XResultPage.java
@@ -125,7 +125,6 @@ public class XResultPage {
}
/**
- * @param type
* @param name that will show hyperlinked
* @param hrid value that will be returned upon selection of hyperlink
* @return cmd value to put in HTML for processing by result page
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/results/html/XResultsComposite.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/results/html/XResultsComposite.java
index 78eb35b7107..f508555db9a 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/results/html/XResultsComposite.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/results/html/XResultsComposite.java
@@ -43,10 +43,6 @@ public class XResultsComposite extends Composite {
private String htmlText;
private String title = "";
- /**
- * @param parent
- * @param style
- */
public XResultsComposite(Composite parent, int style) {
super(parent, style);
@@ -163,10 +159,6 @@ public class XResultsComposite extends Composite {
setHtmlText(htmlText, title);
}
- /**
- * @param title
- * @param htmlText
- */
public void setHtmlText(String htmlText, String title) {
this.htmlText = htmlText;
this.title = title;
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/results/table/xresults/ResultsXViewer.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/results/table/xresults/ResultsXViewer.java
index 5a51051ff00..5e0eb38a5fb 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/results/table/xresults/ResultsXViewer.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/results/table/xresults/ResultsXViewer.java
@@ -26,12 +26,6 @@ import org.eclipse.swt.widgets.TreeItem;
*/
public class ResultsXViewer extends XViewer {
- /**
- * @param parent
- * @param style
- * @param namespace
- * @param viewerFactory
- */
public ResultsXViewer(Composite parent, int style, List<XViewerColumn> xColumns) {
super(parent, style, new ResultsXViewerFactory(xColumns));
}
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/search/AbstractArtifactSearchResult.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/search/AbstractArtifactSearchResult.java
index 03b1808c2eb..9b7b2b3106e 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/search/AbstractArtifactSearchResult.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/search/AbstractArtifactSearchResult.java
@@ -47,8 +47,7 @@ public abstract class AbstractArtifactSearchResult extends AbstractTextSearchRes
// /**
// * Removes the children artifacts from the search
// *
- // * @param children
- // */
+ // // */
// public void removeArtifacts(Collection<Artifact> children) {
// for (Artifact artifact : children) {
// Match match = artifacts.get(artifact);
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/search/filter/FilterModelList.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/search/filter/FilterModelList.java
index 3711d62646e..ec72a2c629f 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/search/filter/FilterModelList.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/search/filter/FilterModelList.java
@@ -71,25 +71,16 @@ public class FilterModelList {
return str + "\n\n";
}
- /**
- * @param filter
- */
public void filterChanged(FilterModel filter) {
for (IFilterListViewer flv : changeListeners) {
flv.updateFilter(filter);
}
}
- /**
- * @param viewer
- */
public void removeChangeListener(IFilterListViewer viewer) {
changeListeners.remove(viewer);
}
- /**
- * @param viewer
- */
public void addChangeListener(IFilterListViewer viewer) {
changeListeners.add(viewer);
}
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/search/ui/IFilterListViewer.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/search/ui/IFilterListViewer.java
index d1c594ac872..99aea200471 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/search/ui/IFilterListViewer.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/search/ui/IFilterListViewer.java
@@ -17,21 +17,18 @@ public interface IFilterListViewer {
/**
* Update the view to reflect the fact that a FilterModel was added to the FilterModel list
*
- * @param filter
*/
public void addFilter(FilterModel filter);
/**
* Update the view to reflect the fact that a FilterModel was removed from the FilterModel list
*
- * @param filter
*/
public void removeFilter(FilterModel filter);
/**
* Update the view to reflect the fact that one of the FilterModels was modified
*
- * @param filter
*/
public void updateFilter(FilterModel filter);
}
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/skywalker/ArtifactGraphContentProvider.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/skywalker/ArtifactGraphContentProvider.java
index 053a451ce5d..0ccb98fe261 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/skywalker/ArtifactGraphContentProvider.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/skywalker/ArtifactGraphContentProvider.java
@@ -36,9 +36,6 @@ public class ArtifactGraphContentProvider implements IGraphEntityContentProvider
// private static final Collection<Artifact>EMPTY_LIST = new ArrayList<Artifact>(0);
private final SkyWalkerOptions options;
- /**
- * @param levels
- */
public ArtifactGraphContentProvider(SkyWalkerOptions options) {
super();
this.options = options;
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/skywalker/RelTypeContentProvider.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/skywalker/RelTypeContentProvider.java
index ef91aa52b19..510fd45b5e8 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/skywalker/RelTypeContentProvider.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/skywalker/RelTypeContentProvider.java
@@ -35,7 +35,8 @@ public class RelTypeContentProvider implements ITreeContentProvider {
}
if (parentElement instanceof RelationType) {
- return new Object[] {new RelationTypeSide((RelationType) parentElement, RelationSide.SIDE_A),
+ return new Object[] {
+ new RelationTypeSide((RelationType) parentElement, RelationSide.SIDE_A),
new RelationTypeSide((RelationType) parentElement, RelationSide.SIDE_B)};
}
return new Object[] {};
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/skywalker/SkyWalkerOptions.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/skywalker/SkyWalkerOptions.java
index 02cc6a7557a..01550ed45ea 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/skywalker/SkyWalkerOptions.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/skywalker/SkyWalkerOptions.java
@@ -74,10 +74,6 @@ public final class SkyWalkerOptions {
};
private LinkName linkName = LinkName.Link_Name;
- /**
- * @param parent
- * @param style
- */
public SkyWalkerOptions() {
loadLayouts();
layout = defaultLayout;
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/skywalker/SkyWalkerTabOptions.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/skywalker/SkyWalkerTabOptions.java
index 836642a1c09..89d5e86cde2 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/skywalker/SkyWalkerTabOptions.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/skywalker/SkyWalkerTabOptions.java
@@ -21,10 +21,6 @@ public class SkyWalkerTabOptions {
private final TabFolder tabFolder;
- /**
- * @param parent
- * @param style
- */
public SkyWalkerTabOptions(Composite parent, int style, SkyWalkerOptions options) {
tabFolder = new TabFolder(parent, SWT.BORDER);
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/util/ArtifactClipboard.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/util/ArtifactClipboard.java
index b50f0e12d55..de393ab1b2b 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/util/ArtifactClipboard.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/util/ArtifactClipboard.java
@@ -47,9 +47,13 @@ public class ArtifactClipboard {
Artifact[] artifacts = artifactTransferData.toArray(new Artifact[artifactTransferData.size()]);
clipboard.setContents(
- new Object[] {new ArtifactData(artifacts, STATUS, viewId), HTMLTransferFormatter.getHtml(artifacts),
- Collections.toString(textTransferData, null, ", ", null)}, new Transfer[] {ArtifactTransfer.getInstance(),
- HTMLTransfer.getInstance(), TextTransfer.getInstance()});
+ new Object[] {
+ new ArtifactData(artifacts, STATUS, viewId),
+ HTMLTransferFormatter.getHtml(artifacts),
+ Collections.toString(textTransferData, null, ", ", null)}, new Transfer[] {
+ ArtifactTransfer.getInstance(),
+ HTMLTransfer.getInstance(),
+ TextTransfer.getInstance()});
}
public void setTextToClipboard(Collection<String> textTransferData) {
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/util/DbConnectionExceptionComposite.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/util/DbConnectionExceptionComposite.java
index 034018b0479..9c6b2319d29 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/util/DbConnectionExceptionComposite.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/util/DbConnectionExceptionComposite.java
@@ -20,10 +20,6 @@ import org.eclipse.swt.widgets.Composite;
*/
public class DbConnectionExceptionComposite extends ExceptionComposite {
- /**
- * @param parent
- * @param style
- */
public DbConnectionExceptionComposite(Composite parent, Exception ex) {
super(parent, ex);
}
@@ -32,7 +28,6 @@ public class DbConnectionExceptionComposite extends ExceptionComposite {
* Tests the DB Connection and returns true if ok. If exceptions and parent != null, the
* DbConnectionExceptionComposite will be displayed in parent giving exception information.
*
- * @param parent
*/
public static boolean dbConnectionIsOk(Composite parent) {
// try {
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/util/OseeEmail.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/util/OseeEmail.java
index c245696162f..ef6d4a574cd 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/util/OseeEmail.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/util/OseeEmail.java
@@ -336,8 +336,7 @@ public class OseeEmail extends MimeMessage {
*/
private static Session getSession() throws OseeCoreException {
Properties props = System.getProperties();
- props.put(
- emailType,
+ props.put(emailType,
OseeSystemArtifacts.getGlobalPreferenceArtifact().getSoleAttributeValue(CoreAttributeTypes.DefaultMailServer));
return Session.getDefaultInstance(props, null);
@@ -346,8 +345,6 @@ public class OseeEmail extends MimeMessage {
/**
* Adds an attachment to an email
*
- * @param source
- * @param attachmentName
* @throws MessagingException
*/
public void addAttachment(DataSource source, String attachmentName) throws MessagingException {
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/util/SkynetDragAndDrop.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/util/SkynetDragAndDrop.java
index e1336b75d18..236011bb885 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/util/SkynetDragAndDrop.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/util/SkynetDragAndDrop.java
@@ -62,7 +62,9 @@ public abstract class SkynetDragAndDrop {
}
private void setupDragSupport() {
- source.setTransfer(new Transfer[] {HTMLTransfer.getInstance(), ArtifactTransfer.getInstance(),
+ source.setTransfer(new Transfer[] {
+ HTMLTransfer.getInstance(),
+ ArtifactTransfer.getInstance(),
TextTransfer.getInstance()});
source.addDragListener(new DragSourceListener() {
@@ -94,7 +96,9 @@ public abstract class SkynetDragAndDrop {
}
private void setupDropSupport() {
- target.setTransfer(new Transfer[] {FileTransfer.getInstance(), TextTransfer.getInstance(),
+ target.setTransfer(new Transfer[] {
+ FileTransfer.getInstance(),
+ TextTransfer.getInstance(),
ArtifactTransfer.getInstance()});
target.addDropListener(new DropTargetAdapter() {
@@ -192,7 +196,6 @@ public abstract class SkynetDragAndDrop {
* override this method and its cousins rather than performDrop in order to have the drop data preprocessed and
* passed in the desired form
*
- * @param text
*/
public void performTextDrop(String text) {
// provided for subclass implementation
@@ -202,7 +205,6 @@ public abstract class SkynetDragAndDrop {
* override this method and its cousins rather than performDrop in order to have the drop data preprocessed and
* passed in the desired form
*
- * @param dropArtifacts
*/
public void performArtifactDrop(Artifact[] dropArtifacts) {
// provided for subclass implementation
@@ -212,7 +214,6 @@ public abstract class SkynetDragAndDrop {
* override this method and its cousins rather than performDrop in order to have the drop data preprocessed and
* passed in the desired form
*
- * @param fileNames
*/
public void performFileDrop(String[] fileNames) {
// provided for subclass implementation
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/util/WordUiUtil.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/util/WordUiUtil.java
index 6e10caca5a5..06f6c039b7c 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/util/WordUiUtil.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/util/WordUiUtil.java
@@ -51,7 +51,8 @@ public final class WordUiUtil {
rd.addRaw(AHTML.beginMultiColumnTable(60, 1));
rd.addRaw(AHTML.addHeaderRowMultiColumnTable(new String[] {"Artifact Name", "HRID"}));
for (Artifact artifact : artifacts) {
- rd.addRaw(AHTML.addRowMultiColumnTable(new String[] {artifact.toString(),
+ rd.addRaw(AHTML.addRowMultiColumnTable(new String[] {
+ artifact.toString(),
XResultData.getHyperlink(artifact)}));
}
rd.addRaw(AHTML.endMultiColumnTable());
@@ -72,7 +73,8 @@ public final class WordUiUtil {
rd.addRaw(AHTML.beginMultiColumnTable(60, 1));
rd.addRaw(AHTML.addHeaderRowMultiColumnTable(new String[] {"Artifact Name", "HRID"}));
for (Artifact artifact : artifacts) {
- rd.addRaw(AHTML.addRowMultiColumnTable(new String[] {artifact.toString(),
+ rd.addRaw(AHTML.addRowMultiColumnTable(new String[] {
+ artifact.toString(),
XResultData.getHyperlink(artifact)}));
}
rd.addRaw(AHTML.endMultiColumnTable());
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/util/email/EmailWizard.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/util/email/EmailWizard.java
index ac4b8d7b0b2..5213b705fc8 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/util/email/EmailWizard.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/util/email/EmailWizard.java
@@ -32,9 +32,6 @@ public class EmailWizard extends Wizard {
private ArrayList<Object> initialAddress = null;
/**
- * @param htmlMessage
- * @param subject
- * @param emailableFields
* @param initialAddress - User, AtsEmailGroup or String
*/
public EmailWizard(String htmlMessage, String subject, ArrayList<EmailGroup> emailableGroups, ArrayList<Object> initialAddress) {
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/util/email/EmailWizardPage.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/util/email/EmailWizardPage.java
index 591ed08059d..e050a0a1d57 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/util/email/EmailWizardPage.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/util/email/EmailWizardPage.java
@@ -63,8 +63,6 @@ public class EmailWizardPage extends WizardPage {
private final ArrayList<EmailGroup> groups;
/**
- * @param pageName
- * @param groups
* @param initialAddress User, EmailGroup or String
*/
protected EmailWizardPage(String pageName, ArrayList<EmailGroup> groups, ArrayList<Object> initialAddress) {
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/util/filteredTree/OSEECheckedFilteredTree.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/util/filteredTree/OSEECheckedFilteredTree.java
index c5987b63359..2fa4c92e2a7 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/util/filteredTree/OSEECheckedFilteredTree.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/util/filteredTree/OSEECheckedFilteredTree.java
@@ -32,11 +32,6 @@ public class OSEECheckedFilteredTree extends OSEEFilteredTree {
private final Set<Object> checked = new HashSet<Object>();
- /**
- * @param parent
- * @param treeStyle
- * @param filter
- */
public OSEECheckedFilteredTree(Composite parent, int treeStyle, PatternFilter filter) {
super(parent, treeStyle, filter);
}
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/util/filteredTree/OSEEFilteredTreeDialog.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/util/filteredTree/OSEEFilteredTreeDialog.java
index d84e8dba3af..df2f9ec462e 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/util/filteredTree/OSEEFilteredTreeDialog.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/util/filteredTree/OSEEFilteredTreeDialog.java
@@ -45,7 +45,8 @@ public abstract class OSEEFilteredTreeDialog<T> extends MessageDialog {
private final IBaseLabelProvider labelProvider;
public OSEEFilteredTreeDialog(String dialogTitle, String dialogMessage, IBaseLabelProvider labelProvider, IContentProvider contentProvider, PatternFilter patternFilter) {
- super(Displays.getActiveShell(), dialogTitle, null, dialogMessage, MessageDialog.NONE, new String[] {"OK",
+ super(Displays.getActiveShell(), dialogTitle, null, dialogMessage, MessageDialog.NONE, new String[] {
+ "OK",
"Cancel"}, 0);
this.contentProvider = contentProvider;
this.labelProvider = labelProvider;
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/DefaultBranchContentProvider.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/DefaultBranchContentProvider.java
index 2aa75d2129c..e0df74e2784 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/DefaultBranchContentProvider.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/DefaultBranchContentProvider.java
@@ -28,9 +28,6 @@ public class DefaultBranchContentProvider implements ITreeContentProvider, IBran
private final ITreeContentProvider provider;
private final Branch branch;
- /**
- * @param provider
- */
public DefaultBranchContentProvider(final ITreeContentProvider provider, Branch branch) {
if (provider == null) {
throw new IllegalArgumentException("provider can not be null");
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XDate.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XDate.java
index 089093ccf85..838cea0d581 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XDate.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XDate.java
@@ -97,7 +97,6 @@ public class XDate extends XWidget {
/**
* Set the default format for the date ADate.MMMDDDYY or ADate MMMDDDYYYHHHMM or use java.util.date format string
*
- * @param format
*/
public void setFormat(String format) {
defaultFormat = format;
@@ -136,7 +135,6 @@ public class XDate extends XWidget {
/**
* Create Date Widgets Label/DatePickerCombo
*
- * @param parent
* @param horizontalSpan - horizontalSpan takes up 4 columns, therefore horizontalSpan must be >=4
*/
@Override
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XFileTextWithSelectionDialog.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XFileTextWithSelectionDialog.java
index 4b3370e8920..fb06bde3af3 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XFileTextWithSelectionDialog.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XFileTextWithSelectionDialog.java
@@ -48,9 +48,6 @@ public class XFileTextWithSelectionDialog extends XText {
this("", Type.File);
}
- /**
- * @param displayLabel
- */
public XFileTextWithSelectionDialog(String displayLabel) {
this(displayLabel, Type.File);
}
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XHyperlabelGroupSelection.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XHyperlabelGroupSelection.java
index bd81fdea67a..5942fabfb30 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XHyperlabelGroupSelection.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XHyperlabelGroupSelection.java
@@ -28,9 +28,6 @@ public class XHyperlabelGroupSelection extends XHyperlinkLabelCmdValueSelection
public static final String WIDGET_ID = XHyperlabelGroupSelection.class.getSimpleName();
Set<Artifact> selectedGroups = new HashSet<Artifact>();
- /**
- * @param label
- */
public XHyperlabelGroupSelection(String label) {
super(label, true, 80);
}
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XListDam.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XListDam.java
index 25de975e979..481a65200b5 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XListDam.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XListDam.java
@@ -30,9 +30,6 @@ public class XListDam extends XList implements IAttributeWidget {
return artifact;
}
- /**
- * @param displayLabel
- */
public XListDam(String displayLabel) {
super(displayLabel);
}
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XListDropViewer.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XListDropViewer.java
index c5fea9b1a6b..03f15b312eb 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XListDropViewer.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XListDropViewer.java
@@ -86,7 +86,6 @@ public class XListDropViewer extends XListViewer {
/**
* Adds artifacts to the viewer's input.
*
- * @param artifacts
*/
public void addToInput(Artifact... artifacts) {
ArrayList<Object> objects = new ArrayList<Object>();
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XListViewer.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XListViewer.java
index 423a39e7b1c..9b2372d44dc 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XListViewer.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XListViewer.java
@@ -119,9 +119,6 @@ public class XListViewer extends XWidget {
}
}
- /**
- * @param input
- */
public void setInput(Object input) {
if (listViewer != null) {
listViewer.setInput(input);
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XText.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XText.java
index bf9c4957933..48d10c7ec61 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XText.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XText.java
@@ -244,9 +244,6 @@ public class XText extends XWidget {
return text;
}
- /**
- * @param text
- */
public void setText(String text) {
this.text = text;
if (sText != null) {
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XTextResourceDropDam.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XTextResourceDropDam.java
index 7fa051244df..799581a0ad8 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XTextResourceDropDam.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XTextResourceDropDam.java
@@ -48,8 +48,11 @@ public class XTextResourceDropDam extends XTextDam {
// Do not allow drop if default branch is not same as artifacts that reside in this table
DropTarget target = new DropTarget(getStyledText(), DND.DROP_COPY);
- target.setTransfer(new Transfer[] {ResourceTransfer.getInstance(), FileTransfer.getInstance(),
- TextTransfer.getInstance(), ArtifactTransfer.getInstance()});
+ target.setTransfer(new Transfer[] {
+ ResourceTransfer.getInstance(),
+ FileTransfer.getInstance(),
+ TextTransfer.getInstance(),
+ ArtifactTransfer.getInstance()});
target.addDropListener(new DropTargetAdapter() {
@Override
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/cellEditor/DateValue.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/cellEditor/DateValue.java
index 446b46cd79f..22df73544dd 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/cellEditor/DateValue.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/cellEditor/DateValue.java
@@ -20,9 +20,6 @@ import org.eclipse.swt.widgets.Control;
public class DateValue extends UniversalCellEditorValue {
private Date date;
- /**
- *
- */
public DateValue() {
super();
}
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/cellEditor/EnumeratedValue.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/cellEditor/EnumeratedValue.java
index bcbd6adec95..32785db3878 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/cellEditor/EnumeratedValue.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/cellEditor/EnumeratedValue.java
@@ -20,9 +20,6 @@ public class EnumeratedValue extends UniversalCellEditorValue {
private String value;
private String[] choices;
- /**
- *
- */
public EnumeratedValue() {
super();
}
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/cellEditor/StringValue.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/cellEditor/StringValue.java
index d3077254371..ddfebad7e0e 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/cellEditor/StringValue.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/cellEditor/StringValue.java
@@ -19,9 +19,6 @@ import org.eclipse.swt.widgets.Text;
public class StringValue extends UniversalCellEditorValue {
private String value;
- /**
- *
- */
public StringValue() {
super();
}
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/cellEditor/UniversalCellEditor.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/cellEditor/UniversalCellEditor.java
index 477d011d7d9..de43236ecf9 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/cellEditor/UniversalCellEditor.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/cellEditor/UniversalCellEditor.java
@@ -28,17 +28,10 @@ public class UniversalCellEditor extends CellEditor {
private Control control;
private boolean personCombo = false;
- /**
- * @param parent
- */
public UniversalCellEditor(Composite parent) {
this(parent, SWT.NONE);
}
- /**
- * @param parent
- * @param style
- */
public UniversalCellEditor(Composite parent, int style) {
super(parent, style);
this.comboBox = new Combo(parent, SWT.DROP_DOWN | SWT.READ_ONLY);
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/cellEditor/UniversalCellEditorValue.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/cellEditor/UniversalCellEditorValue.java
index 1a4f703b453..af0e55133cc 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/cellEditor/UniversalCellEditorValue.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/cellEditor/UniversalCellEditorValue.java
@@ -16,9 +16,6 @@ import org.eclipse.swt.widgets.Control;
* @author Ryan D. Brooks
*/
public abstract class UniversalCellEditorValue {
- /**
- *
- */
protected UniversalCellEditorValue() {
super();
}
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/dialog/ArtifactTypeFilteredTreeEntryDialog.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/dialog/ArtifactTypeFilteredTreeEntryDialog.java
index f06471a3ead..679c1cf5ed9 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/dialog/ArtifactTypeFilteredTreeEntryDialog.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/dialog/ArtifactTypeFilteredTreeEntryDialog.java
@@ -26,11 +26,6 @@ public class ArtifactTypeFilteredTreeEntryDialog extends ArtifactTypeFilteredTre
private final String entryName;
private XText xText = null;
- /**
- * @param title
- * @param message
- * @param artifactTypes
- */
public ArtifactTypeFilteredTreeEntryDialog(String title, String message, String entryName) {
super(title, message);
this.entryName = entryName;
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/dialog/DateSelectionDialog.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/dialog/DateSelectionDialog.java
index 135b77fb3a9..58d295d2a93 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/dialog/DateSelectionDialog.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/dialog/DateSelectionDialog.java
@@ -40,7 +40,8 @@ public class DateSelectionDialog extends MessageDialog {
}
public DateSelectionDialog(String dialogTitle, String dialogMessage, Date selectedDate) {
- this(Displays.getActiveShell(), dialogTitle, null, dialogMessage, MessageDialog.NONE, new String[] {"Ok",
+ this(Displays.getActiveShell(), dialogTitle, null, dialogMessage, MessageDialog.NONE, new String[] {
+ "Ok",
"Cancel"}, 0, selectedDate);
}
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/dialog/Dialogs.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/dialog/Dialogs.java
index 4da59df3f25..b4bb1b8a227 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/dialog/Dialogs.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/dialog/Dialogs.java
@@ -35,7 +35,6 @@ public class Dialogs {
/**
* Allows user to save html from a file selection dialog
*
- * @param htmlText
* @param openInSystem true if desire to open resulting file in system browser after saving
* @return Result
*/
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/dialog/EntryDialog.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/dialog/EntryDialog.java
index 4746a5d8ef8..b7b804ca894 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/dialog/EntryDialog.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/dialog/EntryDialog.java
@@ -60,7 +60,8 @@ public class EntryDialog extends MessageDialog {
private final String dialogTitle;
public EntryDialog(String dialogTitle, String dialogMessage) {
- super(Displays.getActiveShell(), dialogTitle, null, dialogMessage, MessageDialog.QUESTION, new String[] {"OK",
+ super(Displays.getActiveShell(), dialogTitle, null, dialogMessage, MessageDialog.QUESTION, new String[] {
+ "OK",
"Cancel"}, 0);
this.dialogTitle = dialogTitle;
}
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/dialog/EntryDialogWithBranchSelect.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/dialog/EntryDialogWithBranchSelect.java
index b070ab485a7..354e9cf3e38 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/dialog/EntryDialogWithBranchSelect.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/dialog/EntryDialogWithBranchSelect.java
@@ -52,7 +52,8 @@ public class EntryDialogWithBranchSelect extends MessageDialog {
private final List<IShellCloseEvent> closeEventListeners = new ArrayList<IShellCloseEvent>();
public EntryDialogWithBranchSelect(String dialogTitle, String dialogMessage) {
- super(Displays.getActiveShell(), dialogTitle, null, dialogMessage, MessageDialog.QUESTION, new String[] {"OK",
+ super(Displays.getActiveShell(), dialogTitle, null, dialogMessage, MessageDialog.QUESTION, new String[] {
+ "OK",
"Cancel"}, 0);
}
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/dialog/HtmlDialog.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/dialog/HtmlDialog.java
index bdcc6739faf..216cbb1d387 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/dialog/HtmlDialog.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/dialog/HtmlDialog.java
@@ -44,7 +44,6 @@ public class HtmlDialog extends MessageDialog {
/**
* Add listener to browser widget.
*
- * @param listener
*/
public void addLocationListener(LocationListener listener) {
this.listener = listener;
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/workflow/DynamicXWidgetLayout.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/workflow/DynamicXWidgetLayout.java
index 8c0056edc7e..9f3d58e9899 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/workflow/DynamicXWidgetLayout.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/workflow/DynamicXWidgetLayout.java
@@ -169,8 +169,7 @@ public class DynamicXWidgetLayout {
if (artifact != null) {
if (xWidget instanceof IAttributeWidget) {
try {
- IAttributeType attributeType =
- AttributeTypeManager.getType(xWidgetLayoutData.getStoreName());
+ IAttributeType attributeType = AttributeTypeManager.getType(xWidgetLayoutData.getStoreName());
((IAttributeWidget) xWidget).setAttributeType(artifact, attributeType);
} catch (Exception ex) {
OseeLog.log(SkynetGuiPlugin.class, OseeLevel.SEVERE_POPUP, ex);
@@ -379,7 +378,6 @@ public class DynamicXWidgetLayout {
}
/**
- * @param name
* @return true if ANY item in group is entered
* @throws OseeArgumentException
*/
@@ -394,7 +392,6 @@ public class DynamicXWidgetLayout {
}
/**
- * @param attrName
* @return true if only ONE item in group is entered
* @throws OseeArgumentException
*/
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/workflow/IWorkDefinitionProvider.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/workflow/IWorkDefinitionProvider.java
index e5b3718fb99..3f0b6b33c00 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/workflow/IWorkDefinitionProvider.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/workflow/IWorkDefinitionProvider.java
@@ -31,7 +31,6 @@ public interface IWorkDefinitionProvider {
/**
* Return WorkFlowDefinition to use for the given state machine artifact.
*
- * @param artifact
* @throws Exception
*/
public WorkFlowDefinition getWorkFlowDefinition(Artifact artifact) throws OseeCoreException;
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/workflow/WorkFlowDefinition.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/workflow/WorkFlowDefinition.java
index 3ec189829c3..ccc86e88c75 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/workflow/WorkFlowDefinition.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/workflow/WorkFlowDefinition.java
@@ -122,7 +122,6 @@ public class WorkFlowDefinition extends WorkItemWithChildrenDefinition {
/**
* If deCache, clears cache and reloads workflow data
*
- * @param deCache
* @throws OseeCoreException
*/
public void loadPageData(boolean deCache) throws OseeCoreException {
@@ -170,7 +169,6 @@ public class WorkFlowDefinition extends WorkItemWithChildrenDefinition {
* Since transitions can be defined by full ids or just page name (eg "Endorse"), check if pageId has namespace
* characters and thus it's full name or add id to given pageId
*
- * @param pageId
* @return
*/
private String getFullPageId(String pageId) {
@@ -232,9 +230,6 @@ public class WorkFlowDefinition extends WorkItemWithChildrenDefinition {
* 1) fromPageId, toPageId, ToPage<br>
* 2) toPageId, fromPageId, ToPageAsReturn
*
- * @param fromPageId
- * @param toPageId
- * @param transitionType
*/
public void addPageTransitionToPageAndReturn(String fromPageId, String toPageId) {
addPageTransition(pageIdToPageIdsViaTransitionType, fromPageId, toPageId, TransitionType.ToPage);
@@ -273,7 +268,6 @@ public class WorkFlowDefinition extends WorkItemWithChildrenDefinition {
*
* @param fromPageId either page Name "Endorse" or full namespace "osee.ats.Endorse"
* @param toPageId either page Name "Endorse" or full namespace "osee.ats.Endorse"
- * @param transitionType
*/
public void addPageTransition(String fromPageId, String toPageId, TransitionType... transitionType) {
WorkFlowDefinition.addPageTransition(pageIdToPageIdsViaTransitionType, fromPageId, toPageId, transitionType);
@@ -290,7 +284,6 @@ public class WorkFlowDefinition extends WorkItemWithChildrenDefinition {
*
* @param fromPageId either page Name "Endorse" or full namespace "osee.ats.Endorse"
* @param toPageId either page Name "Endorse" or full namespace "osee.ats.Endorse"
- * @param transitionType
*/
public static void addPageTransition(Map<String, Map<TransitionType, Set<String>>> pageIdToPageIdsViaTransitionType, String fromPageId, String toPageId, TransitionType... transitionType) {
List<Object> transTypes = Collections.getAggregate((Object[]) transitionType);
@@ -332,8 +325,6 @@ public class WorkFlowDefinition extends WorkItemWithChildrenDefinition {
/**
* Return all registered page definitions including those inherited from parent(s)
*
- * @param fromPageId
- * @param transitionType
* @return definitions
* @throws Exception
*/
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/workflow/WorkItemDefinition.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/workflow/WorkItemDefinition.java
index 9bd10d926db..ced5d7ecfe6 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/workflow/WorkItemDefinition.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/workflow/WorkItemDefinition.java
@@ -95,7 +95,6 @@ public abstract class WorkItemDefinition {
* Determine if this workItemDefinition is or has a parent definition of pageId. This will walk up the tree of
* definition inheritance to answer the question
*
- * @param pageId
* @return boolean
* @throws OseeCoreException
*/
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/workflow/WorkItemDefinitionFactory.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/workflow/WorkItemDefinitionFactory.java
index 0934712aed9..6a4ad07ae8d 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/workflow/WorkItemDefinitionFactory.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/workflow/WorkItemDefinitionFactory.java
@@ -102,8 +102,6 @@ public class WorkItemDefinitionFactory {
* This should only be called on database initialization or when new work item definitions are created during
* run-time.
*
- * @param workItemDefinition
- * @param artifact
*/
public static void cacheWorkItemDefinitionArtifact(WriteType writeType, WorkItemDefinition workItemDefinition, Artifact artifact) throws OseeCoreException {
addItemDefinition(writeType, workItemDefinition, artifact);
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xBranch/XBranchTextFilter.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xBranch/XBranchTextFilter.java
index c966d9861a7..182fcff4320 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xBranch/XBranchTextFilter.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xBranch/XBranchTextFilter.java
@@ -21,9 +21,6 @@ import org.eclipse.osee.framework.core.model.TransactionRecord;
*/
public class XBranchTextFilter extends XViewerTextFilter {
- /**
- * @param viewer
- */
public XBranchTextFilter(XViewer viewer) {
super(viewer);
}
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xBranch/XBranchWidget.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xBranch/XBranchWidget.java
index e3f06d27fc1..4b90d05e207 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xBranch/XBranchWidget.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xBranch/XBranchWidget.java
@@ -71,9 +71,6 @@ public class XBranchWidget extends XWidget implements IActionable {
this.searchRealTime = searchRealTime;
}
- /**
- * @param label
- */
public XBranchWidget() {
super(VIEW_ID);
@@ -327,9 +324,6 @@ public class XBranchWidget extends XWidget implements IActionable {
return null;
}
- /**
- * @param favoritesFirst
- */
public void setFavoritesFirst(boolean favoritesFirst) {
if (branchContentProvider != null) {
sorter.setFavoritesFirst(favoritesFirst);
@@ -337,9 +331,6 @@ public class XBranchWidget extends XWidget implements IActionable {
}
}
- /**
- * @param flat
- */
public void setPresentation(boolean flat) {
if (branchContentProvider != null) {
branchContentProvider.setPresentation(flat);
@@ -347,9 +338,6 @@ public class XBranchWidget extends XWidget implements IActionable {
}
}
- /**
- * @param showMergeBranches
- */
public void setShowMergeBranches(boolean showMergeBranches) {
if (branchContentProvider != null) {
branchContentProvider.setShowMergeBranches(showMergeBranches);
@@ -357,9 +345,6 @@ public class XBranchWidget extends XWidget implements IActionable {
}
}
- /**
- * @param showArchivedBranches
- */
public void setShowArchivedBranches(boolean showArchivedBranches) {
if (branchContentProvider != null) {
branchContentProvider.setShowArchivedBranches(showArchivedBranches);
@@ -367,9 +352,6 @@ public class XBranchWidget extends XWidget implements IActionable {
}
}
- /**
- * @param showTransactions
- */
public void setShowTransactions(boolean showTransactions) {
if (branchContentProvider != null) {
branchContentProvider.setShowTransactions(showTransactions);
@@ -377,9 +359,6 @@ public class XBranchWidget extends XWidget implements IActionable {
}
}
- /**
- * @param showTransactions
- */
public void setShowWorkingBranchesOnly(boolean allowOnlyWorkingBranches) {
if (branchContentProvider != null) {
branchContentProvider.setShowOnlyWorkingBranches(allowOnlyWorkingBranches);
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xHistory/HistoryView.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xHistory/HistoryView.java
index 5cf361d5c7d..5b1332bac8d 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xHistory/HistoryView.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xHistory/HistoryView.java
@@ -194,9 +194,6 @@ public class HistoryView extends ViewPart implements IActionable, IBranchEventLi
xHistoryWidget.getXViewer().getTree().setMenu(popupMenu);
}
- /**
- * @param popupMenu
- */
private void createChangeReportMenuItem(Menu popupMenu) {
final MenuItem changeReportMenuItem = new MenuItem(popupMenu, SWT.CASCADE);
changeReportMenuItem.setText("&Change Report");
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xbargraph/XBarGraphLine.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xbargraph/XBarGraphLine.java
index f9105af8dd8..69b1e477e97 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xbargraph/XBarGraphLine.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xbargraph/XBarGraphLine.java
@@ -72,8 +72,6 @@ public class XBarGraphLine {
/**
* Shows as white until completed, then green
*
- * @param name
- * @param value
* @return XBarGraphLine
*/
public static XBarGraphLine getPercentLine(String name, int value) {
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xmerge/MergeUtility.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xmerge/MergeUtility.java
index 4c6b8a3a14c..8a354aeba3b 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xmerge/MergeUtility.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xmerge/MergeUtility.java
@@ -215,9 +215,6 @@ public class MergeUtility {
return false;
}
- /**
- * @param conflict
- */
public static boolean showAttributeDeletedConflict(Conflict conflict, Shell shell) {
if (conflict.getConflictType().equals(ConflictType.ATTRIBUTE)) {
MessageDialog dialog =
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xmerge/MergeXViewer.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xmerge/MergeXViewer.java
index 50bdcf17842..d8119d67f4a 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xmerge/MergeXViewer.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xmerge/MergeXViewer.java
@@ -60,10 +60,6 @@ public class MergeXViewer extends XViewer {
private XMergeLabelProvider labelProvider;
private Action openMergeViewAction;
- /**
- * @param parent
- * @param style
- */
public MergeXViewer(Composite parent, int style, MergeXWidget xMergeViewer) {
super(parent, style, new MergeXViewerFactory());
this.mergeXWidget = xMergeViewer;
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xmerge/MergeXViewerSorter.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xmerge/MergeXViewerSorter.java
index 6e80ec5fcbc..0265bc9ca84 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xmerge/MergeXViewerSorter.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xmerge/MergeXViewerSorter.java
@@ -25,9 +25,6 @@ public class MergeXViewerSorter extends XViewerSorter {
protected final XViewer xViewer;
protected final XMergeLabelProvider labelProvider;
- /**
- * @param xViewer
- */
public MergeXViewerSorter(XViewer xViewer, XMergeLabelProvider labelProvider) {
super(xViewer);
this.xViewer = xViewer;
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xmerge/MergeXWidget.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xmerge/MergeXWidget.java
index 6e3ef551bdf..be38790274c 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xmerge/MergeXWidget.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xmerge/MergeXWidget.java
@@ -701,7 +701,8 @@ public class MergeXWidget extends XWidget implements IAdaptable {
new ListSelectionDialogNoSave(selections.toArray(), Displays.getActiveShell().getShell(),
"Apply Prior Merge Resolution", null,
"Select the destination branch that the previous commit was appplied to", 2, new String[] {
- "Apply", "Cancel"}, 1);
+ "Apply",
+ "Cancel"}, 1);
if (dialog.open() == 0) {
System.out.print("Applying the merge found for Branch " + branchIds.toArray()[dialog.getSelection()]);
applyPreviousMerge(branchIds.get(dialog.getSelection()));
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xnavigate/XNavigateItemBlam.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xnavigate/XNavigateItemBlam.java
index ce987f6d6b4..9372abe2a66 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xnavigate/XNavigateItemBlam.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xnavigate/XNavigateItemBlam.java
@@ -23,10 +23,6 @@ import org.eclipse.osee.framework.ui.skynet.blam.BlamEditor;
public class XNavigateItemBlam extends XNavigateItem {
private final AbstractBlam blamOperation;
- /**
- * @param parent
- * @param name
- */
public XNavigateItemBlam(XNavigateItem parent, AbstractBlam blamOperation) {
super(parent, blamOperation.getName(), FrameworkImage.BLAM);
this.blamOperation = blamOperation;
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xviewer/skynet/SkynetXViewerFactory.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xviewer/skynet/SkynetXViewerFactory.java
index 6944d7de553..818e3876f45 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xviewer/skynet/SkynetXViewerFactory.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xviewer/skynet/SkynetXViewerFactory.java
@@ -41,9 +41,6 @@ import org.eclipse.swt.SWT;
*/
public class SkynetXViewerFactory extends XViewerFactory {
- /**
- * @param namespace
- */
public SkynetXViewerFactory(String namespace) {
super(namespace);
}
@@ -104,7 +101,6 @@ public class SkynetXViewerFactory extends XViewerFactory {
}
/**
- * @param artifacts
* @return columns for attributes valid for at least on of the given artifacts
* @throws OseeCoreException
*/
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xviewer/skynet/column/XViewerArtifactNameColumn.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xviewer/skynet/column/XViewerArtifactNameColumn.java
index 91db9fbf510..66792723011 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xviewer/skynet/column/XViewerArtifactNameColumn.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xviewer/skynet/column/XViewerArtifactNameColumn.java
@@ -41,7 +41,6 @@ public class XViewerArtifactNameColumn extends XViewerValueColumn {
* XViewer uses copies of column definitions so originals that are registered are not corrupted. Classes extending
* XViewerValueColumn MUST extend this constructor so the correct sub-class is created
*
- * @param col
*/
@Override
public XViewerArtifactNameColumn copy() {
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xviewer/skynet/column/XViewerArtifactTypeColumn.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xviewer/skynet/column/XViewerArtifactTypeColumn.java
index 128ab8ea08c..db8ae7598b4 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xviewer/skynet/column/XViewerArtifactTypeColumn.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xviewer/skynet/column/XViewerArtifactTypeColumn.java
@@ -45,7 +45,6 @@ public class XViewerArtifactTypeColumn extends XViewerValueColumn {
* XViewer uses copies of column definitions so originals that are registered are not corrupted. Classes extending
* XViewerValueColumn MUST extend this constructor so the correct sub-class is created
*
- * @param col
*/
@Override
public XViewerArtifactTypeColumn copy() {
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xviewer/skynet/column/XViewerAttributeColumn.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xviewer/skynet/column/XViewerAttributeColumn.java
index a532d41aa67..8bbb13eb411 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xviewer/skynet/column/XViewerAttributeColumn.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xviewer/skynet/column/XViewerAttributeColumn.java
@@ -30,7 +30,6 @@ public class XViewerAttributeColumn extends XViewerValueColumn {
* XViewer uses copies of column definitions so originals that are registered are not corrupted. Classes extending
* XViewerValueColumn need to extend this constructor to copy extra stored fields
*
- * @param col
*/
@Override
public XViewerAttributeColumn copy() {
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xviewer/skynet/column/XViewerGuidColumn.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xviewer/skynet/column/XViewerGuidColumn.java
index 1b8aaac7b99..6116838f05c 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xviewer/skynet/column/XViewerGuidColumn.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xviewer/skynet/column/XViewerGuidColumn.java
@@ -33,7 +33,6 @@ public class XViewerGuidColumn extends XViewerValueColumn {
* XViewer uses copies of column definitions so originals that are registered are not corrupted. Classes extending
* XViewerValueColumn MUST extend this constructor so the correct sub-class is created
*
- * @param col
*/
@Override
public XViewerGuidColumn copy() {
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xviewer/skynet/column/XViewerHridColumn.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xviewer/skynet/column/XViewerHridColumn.java
index ef0584b39ee..4d2397ea317 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xviewer/skynet/column/XViewerHridColumn.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xviewer/skynet/column/XViewerHridColumn.java
@@ -38,7 +38,6 @@ public class XViewerHridColumn extends XViewerValueColumn {
* XViewer uses copies of column definitions so originals that are registered are not corrupted. Classes extending
* XViewerValueColumn MUST extend this constructor so the correct sub-class is created
*
- * @param col
*/
@Override
public XViewerHridColumn copy() {
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xviewer/skynet/column/XViewerLastModifiedByColumn.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xviewer/skynet/column/XViewerLastModifiedByColumn.java
index 19b302c33d8..b55b46530f8 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xviewer/skynet/column/XViewerLastModifiedByColumn.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xviewer/skynet/column/XViewerLastModifiedByColumn.java
@@ -36,7 +36,6 @@ public class XViewerLastModifiedByColumn extends XViewerValueColumn {
* XViewer uses copies of column definitions so originals that are registered are not corrupted. Classes extending
* XViewerValueColumn MUST extend this constructor so the correct sub-class is created
*
- * @param col
*/
@Override
public XViewerLastModifiedByColumn copy() {
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xviewer/skynet/column/XViewerLastModifiedDateColumn.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xviewer/skynet/column/XViewerLastModifiedDateColumn.java
index 5a2a1f53c30..27387c670ab 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xviewer/skynet/column/XViewerLastModifiedDateColumn.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xviewer/skynet/column/XViewerLastModifiedDateColumn.java
@@ -37,7 +37,6 @@ public class XViewerLastModifiedDateColumn extends XViewerValueColumn {
* XViewer uses copies of column definitions so originals that are registered are not corrupted. Classes extending
* XViewerValueColumn MUST extend this constructor so the correct sub-class is created
*
- * @param col
*/
@Override
public XViewerLastModifiedDateColumn copy() {

Back to the top